AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AreaTrigger_at_nats_landing Class Reference
Inheritance diagram for AreaTrigger_at_nats_landing:
AreaTriggerScript ScriptObject

Public Member Functions

 AreaTrigger_at_nats_landing ()
 
bool OnTrigger (Player *player, AreaTrigger const *) override
 
- Public Member Functions inherited from AreaTriggerScript
bool IsDatabaseBound () const override
 
virtual bool OnTrigger (Player *, AreaTrigger const *)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Additional Inherited Members

- Protected Member Functions inherited from AreaTriggerScript
 AreaTriggerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ AreaTrigger_at_nats_landing()

AreaTrigger_at_nats_landing::AreaTrigger_at_nats_landing ( )
inline
260: AreaTriggerScript("at_nats_landing") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

bool AreaTrigger_at_nats_landing::OnTrigger ( Player player,
AreaTrigger const *   
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

263 {
264 if (!player->IsAlive() || !player->HasAura(SPELL_FISH_PASTE))
265 return false;
266
268 {
269 if (!player->FindNearestCreature(NPC_LURKING_SHARK, 20.0f))
270 {
271 if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000))
272 shark->AI()->AttackStart(player);
273
274 return false;
275 }
276 }
277 return true;
278 }
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:48
@ SPELL_FISH_PASTE
Definition: areatrigger_scripts.cpp:253
@ QUEST_NATS_BARGAIN
Definition: areatrigger_scripts.cpp:252
@ NPC_LURKING_SHARK
Definition: areatrigger_scripts.cpp:254
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1424
bool IsAlive() const
Definition: Unit.h:1204
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669

References WorldObject::FindNearestCreature(), Player::GetQuestStatus(), Unit::HasAura(), Unit::IsAlive(), NPC_LURKING_SHARK, QUEST_NATS_BARGAIN, QUEST_STATUS_INCOMPLETE, SPELL_FISH_PASTE, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT.