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

Public Member Functions

 AreaTrigger_at_sentry_point ()
 
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_sentry_point()

AreaTrigger_at_sentry_point::AreaTrigger_at_sentry_point ( )
inline
340: AreaTriggerScript("at_sentry_point") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

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

Reimplemented from AreaTriggerScript.

343 {
344 auto quest_status = player->GetQuestStatus(QUEST_MISSING_DIPLO_PT14);
345 if (!player->IsAlive() || quest_status == QUEST_STATUS_NONE || quest_status == QUEST_STATUS_REWARDED)
346 return false;
347
348 if (!player->FindNearestCreature(NPC_TERVOSH, 100.0f))
349 {
350 if(Creature* tervosh = player->SummonCreature(NPC_TERVOSH, -3476.51f, -4105.94f, 17.1f, 5.3816f, TEMPSUMMON_TIMED_DESPAWN, 60000))
351 tervosh->CastSpell(tervosh, SPELL_TELEPORT_VISUAL, true);
352 }
353
354 return true;
355 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ QUEST_STATUS_REWARDED
Definition: QuestDef.h:106
@ QUEST_STATUS_NONE
Definition: QuestDef.h:100
@ NPC_TERVOSH
Definition: areatrigger_scripts.cpp:334
@ QUEST_MISSING_DIPLO_PT14
Definition: areatrigger_scripts.cpp:333
@ SPELL_TELEPORT_VISUAL
Definition: areatrigger_scripts.cpp:332
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

References WorldObject::FindNearestCreature(), Player::GetQuestStatus(), Unit::IsAlive(), NPC_TERVOSH, QUEST_MISSING_DIPLO_PT14, QUEST_STATUS_NONE, QUEST_STATUS_REWARDED, SPELL_TELEPORT_VISUAL, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN.