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

Public Member Functions

 at_scarshield_infiltrator ()
 
bool OnTrigger (Player *player, const AreaTrigger *) 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

◆ at_scarshield_infiltrator()

at_scarshield_infiltrator::at_scarshield_infiltrator ( )
inline
830: AreaTriggerScript("at_scarshield_infiltrator") { }
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

bool at_scarshield_infiltrator::OnTrigger ( Player player,
const AreaTrigger  
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

833 {
834 if (player && player->IsAlive())
835 {
836 if (Creature* creature = player->FindNearestCreature(NPC_SCARSHIELD_INFILTRATOR, 100.0f, true))
837 {
838 if (player->GetLevel() >= 57 && player->HasItemCount(ITEM_UNADORNED_SEAL))
839 {
840 creature->AI()->SetData(0, 1); // Start transform into Vaelan
841 return true;
842 }
843 }
844 }
845 return false;
846 }
@ NPC_SCARSHIELD_INFILTRATOR
Definition: blackrock_spire.h:84
@ ITEM_UNADORNED_SEAL
Definition: blackrock_spire.h:106
Definition: Creature.h:46
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:661
bool IsAlive() const
Definition: Unit.h:1204
uint8 GetLevel() const
Definition: Unit.h:855

References WorldObject::FindNearestCreature(), Unit::GetLevel(), Player::HasItemCount(), Unit::IsAlive(), ITEM_UNADORNED_SEAL, and NPC_SCARSHIELD_INFILTRATOR.