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
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ AreaTrigger_at_nats_landing()

AreaTrigger_at_nats_landing::AreaTrigger_at_nats_landing ( )
inline
305: 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.

308 {
309 if (!player->IsAlive() || !player->HasAura(SPELL_FISH_PASTE))
310 return false;
311
313 {
314 if (!player->FindNearestCreature(NPC_LURKING_SHARK, 20.0f))
315 {
316 if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000))
317 shark->AI()->AttackStart(player);
318
319 return false;
320 }
321 }
322 return true;
323 }
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ SPELL_FISH_PASTE
Definition: areatrigger_scripts.cpp:298
@ QUEST_NATS_BARGAIN
Definition: areatrigger_scripts.cpp:297
@ NPC_LURKING_SHARK
Definition: areatrigger_scripts.cpp:299
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:2343
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1416
bool IsAlive() const
Definition: Unit.h:1822
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636

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.