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
375: _creature(creature), _level(0) { }
Creature * _creature
Definition: boss_icecrown_gunship_battle.cpp:396
int32 _level
Definition: boss_icecrown_gunship_battle.cpp:397

Member Function Documentation

◆ Execute()

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

Reimplemented from BasicEvent.

378 {
379 if (!_creature->IsAlive())
380 return true;
381
383 ++_level;
384
386 if (_level < (_creature->GetMap()->IsHeroic() ? 4 : 3))
387 {
389 return false;
390 }
391
392 return true;
393 }
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:103
Map * GetMap() const
Definition: Object.h:531
bool IsAlive() const
Definition: Unit.h:1204
EventProcessor m_Events
Definition: Unit.h:1792
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:1168
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
bool IsHeroic() const
Definition: Map.h:452
static uint32 const ExperiencedTimes[5]
Definition: boss_icecrown_gunship_battle.cpp:373
static uint32 const ExperiencedSpells[5]
Definition: boss_icecrown_gunship_battle.cpp:372

References _creature, _level, EventProcessor::AddEvent(), Unit::CastSpell(), ExperiencedSpells, ExperiencedTimes, WorldObject::GetMap(), Unit::IsAlive(), Map::IsHeroic(), Unit::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