fix(Core/Creature): Fire Elemental Invasion changes (#9372)
* fix(DB): Blazing elemental invasion event - Fixed Elemental Invader's SmartAI; - Re-arranged Elemental Rifts SmartAI for controlled spawning of Invaders. * SmartAI: SetCounter to be able to subtract * Target unit or summoner changed for worldobjects * extra checks and last sql file * Codestyle * codestyle * adding Baron to elemental invasions * changed owner or summoner target (SmartAI) * codestyle
This commit is contained in:
parent
cb7e355291
commit
5d45c52c3e
6 changed files with 61 additions and 19 deletions
|
|
@ -143,18 +143,28 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void StoreCounter(uint32 id, uint32 value, uint32 reset)
|
||||
void StoreCounter(uint32 id, uint32 value, uint32 reset, uint32 subtract)
|
||||
{
|
||||
CounterMap::iterator itr = mCounterList.find(id);
|
||||
if (itr != mCounterList.end())
|
||||
{
|
||||
if (reset == 0)
|
||||
if (!reset && !subtract)
|
||||
{
|
||||
itr->second += value;
|
||||
}
|
||||
else if (subtract)
|
||||
{
|
||||
itr->second -= value;
|
||||
}
|
||||
else
|
||||
{
|
||||
itr->second = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mCounterList.insert(std::make_pair(id, value));
|
||||
}
|
||||
|
||||
ProcessEventsFor(SMART_EVENT_COUNTER_SET, nullptr, id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue