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

AreaTrigger_at_sentry_point::AreaTrigger_at_sentry_point ( )
inline
295: 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.

298 {
299 auto quest_status = player->GetQuestStatus(QUEST_MISSING_DIPLO_PT14);
300 if (!player->IsAlive() || quest_status == QUEST_STATUS_NONE || quest_status == QUEST_STATUS_REWARDED)
301 return false;
302
303 if (!player->FindNearestCreature(NPC_TERVOSH, 100.0f))
304 {
305 if (Creature* tervosh = player->SummonCreature(NPC_TERVOSH, -3476.51f, -4105.94f, 17.1f, 5.3816f, TEMPSUMMON_TIMED_DESPAWN, 60000))
306 tervosh->CastSpell(tervosh, SPELL_TELEPORT_VISUAL, true);
307 }
308
309 return true;
310 }
@ NPC_TERVOSH
Definition: areatrigger_scripts.cpp:289
@ QUEST_MISSING_DIPLO_PT14
Definition: areatrigger_scripts.cpp:288
@ SPELL_TELEPORT_VISUAL
Definition: areatrigger_scripts.cpp:287
@ QUEST_STATUS_REWARDED
Definition: QuestDef.h:106
@ QUEST_STATUS_NONE
Definition: QuestDef.h:100
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
Definition: Creature.h:43
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:2366
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
bool IsAlive() const
Definition: Unit.h:1654

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.