Core/Spells: Implemented additional conditions for spells that start cooldown after an event instead of after cast
This commit is contained in:
1 parent
daf5a4b5c3
commit
b81bf7d025
17 files changed
+79
-51
No files matched your search
@@ -4838,7 +4838,7 @@ void Unit::AddGameObject(GameObject* gameObj)
|
||||
{
|
||||
SpellInfo const* createBySpell = sSpellMgr->GetSpellInfo(gameObj->GetSpellId());
|
||||
// Need disable spell use for owner
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
if (createBySpell && createBySpell->IsCooldownStartedOnEvent())
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true);
|
||||
}
|
||||
@@ -4869,7 +4869,7 @@ void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||
{
|
||||
SpellInfo const* createBySpell = sSpellMgr->GetSpellInfo(spellid);
|
||||
// Need activate spell use for owner
|
||||
if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)
|
||||
if (createBySpell && createBySpell->IsCooldownStartedOnEvent())
|
||||
// note: item based cooldowns and cooldown spell mods with charges ignored (unknown existing cases)
|
||||
ToPlayer()->SendCooldownEvent(createBySpell);
|
||||
}
|
||||
@@ -9382,7 +9382,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
// Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
|
||||
if (spellInfo && (spellInfo->IsCooldownStartedOnEvent()))
|
||||
ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true);
|
||||
}
|
||||
}
|
||||
@@ -9424,7 +9424,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL));
|
||||
// Remove infinity cooldown
|
||||
if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE))
|
||||
if (spellInfo && (spellInfo->IsCooldownStartedOnEvent()))
|
||||
ToPlayer()->SendCooldownEvent(spellInfo);
|
||||
}
|
||||
|
||||
@@ -10546,7 +10546,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
|
||||
break;
|
||||
}
|
||||
// Exorcism
|
||||
else if (spellProto->Category == 19)
|
||||
else if (spellProto->GetCategory() == 19)
|
||||
{
|
||||
if (victim->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD)
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user