AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BattleExperienceEvent Class Reference
Inheritance diagram for BattleExperienceEvent:
BasicEvent

Public Member Functions

 BattleExperienceEvent (Creature *creature)
 
bool Execute (uint64 timer, uint32) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Static Public Attributes

static uint32 const ExperiencedSpells [5] = { 0, SPELL_EXPERIENCED, SPELL_VETERAN, SPELL_ELITE, SPELL_ADDS_BERSERK }
 
static uint32 const ExperiencedTimes [5] = { 100000, 70000, 60000, 90000, 0 }
 

Private Attributes

Creature_creature
 
int32 _level
 

Detailed Description

Constructor & Destructor Documentation

◆ BattleExperienceEvent()

BattleExperienceEvent::BattleExperienceEvent ( Creature creature)
inline
377: _creature(creature), _level(0) { }
Creature * _creature
Definition: boss_icecrown_gunship_battle.cpp:398
int32 _level
Definition: boss_icecrown_gunship_battle.cpp:399

Member Function Documentation

◆ Execute()

bool BattleExperienceEvent::Execute ( uint64  timer,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

380 {
381 if (!_creature->IsAlive())
382 return true;
383
385 ++_level;
386
388 if (_level < (_creature->GetMap()->IsHeroic() ? 4 : 3))
389 {
391 return false;
392 }
393
394 return true;
395 }
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:103
Map * GetMap() const
Definition: Object.h:536
EventProcessor m_Events
Definition: Object.h:642
bool IsAlive() const
Definition: Unit.h:1654
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
bool IsHeroic() const
Definition: Map.h:450
static uint32 const ExperiencedTimes[5]
Definition: boss_icecrown_gunship_battle.cpp:375
static uint32 const ExperiencedSpells[5]
Definition: boss_icecrown_gunship_battle.cpp:374

References _creature, _level, EventProcessor::AddEvent(), Unit::CastSpell(), ExperiencedSpells, ExperiencedTimes, WorldObject::GetMap(), Unit::IsAlive(), Map::IsHeroic(), WorldObject::m_Events, and Unit::RemoveAurasDueToSpell().

Member Data Documentation

◆ _creature

Creature* BattleExperienceEvent::_creature
private

Referenced by Execute().

◆ _level

int32 BattleExperienceEvent::_level
private

Referenced by Execute().

◆ ExperiencedSpells

uint32 const BattleExperienceEvent::ExperiencedSpells = { 0, SPELL_EXPERIENCED, SPELL_VETERAN, SPELL_ELITE, SPELL_ADDS_BERSERK }
static

Referenced by Execute().

◆ ExperiencedTimes

uint32 const BattleExperienceEvent::ExperiencedTimes = { 100000, 70000, 60000, 90000, 0 }
static