mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user