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

Public Member Functions

 achievement_once_bitten_twice_shy (const char *name, uint8 spawnMode, bool wasVampire)
 
bool OnCheck (Player *source, Unit *target, uint32) override
 
- Public Member Functions inherited from AchievementCriteriaScript
bool IsDatabaseBound () const override
 
virtual bool OnCheck (Player *, Unit *, uint32)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Public Attributes

uint8 _spawnMode
 
bool _wasVampire
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ achievement_once_bitten_twice_shy()

achievement_once_bitten_twice_shy::achievement_once_bitten_twice_shy ( const char *  name,
uint8  spawnMode,
bool  wasVampire 
)
inline
904: AchievementCriteriaScript(name), _spawnMode(spawnMode), _wasVampire(wasVampire) { }
Definition: AchievementCriteriaScript.h:24
bool _wasVampire
Definition: boss_blood_queen_lana_thel.cpp:917
uint8 _spawnMode
Definition: boss_blood_queen_lana_thel.cpp:916

Member Function Documentation

◆ OnCheck()

bool achievement_once_bitten_twice_shy::OnCheck ( Player source,
Unit target,
uint32   
)
inlineoverridevirtual

Reimplemented from AchievementCriteriaScript.

907 {
908 if (!target || !target->FindMap())
909 return false;
910
911 if (LanaThelAI* lanaThelAI = CAST_AI(LanaThelAI, target->GetAI()))
912 return (target->GetMap()->GetSpawnMode() % 2) == _spawnMode && lanaThelAI->WasVampire(source->GetGUID()) == _wasVampire;
913 return false;
914 }
#define CAST_AI(a, b)
Definition: UnitAI.h:26
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Map * GetMap() const
Definition: Object.h:536
Map * FindMap() const
Definition: Object.h:537
UnitAI * GetAI()
Definition: Unit.h:658
uint8 GetSpawnMode() const
Definition: Map.h:418
Definition: boss_blood_queen_lana_thel.cpp:143

References _spawnMode, _wasVampire, CAST_AI, WorldObject::FindMap(), Unit::GetAI(), Object::GetGUID(), WorldObject::GetMap(), and Map::GetSpawnMode().

Member Data Documentation

◆ _spawnMode

uint8 achievement_once_bitten_twice_shy::_spawnMode

Referenced by OnCheck().

◆ _wasVampire

bool achievement_once_bitten_twice_shy::_wasVampire

Referenced by OnCheck().