mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[10526] Implement server side global cooldown check.
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also pet/controlled unit global cooldown code replaced by new placed in charmInfo structure. Thanks to nos4r2zod for testing and gcd range check implement.
This commit is contained in:
parent
cb03e5a376
commit
3a8ad26a5e
12 changed files with 142 additions and 26 deletions
|
|
@ -170,9 +170,6 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||
case ACT_ENABLED: // 0xC1 spell
|
||||
{
|
||||
Unit* unit_target = NULL;
|
||||
if (((Creature*)pet)->GetGlobalCooldown() > 0)
|
||||
return;
|
||||
|
||||
if(guid2)
|
||||
unit_target = _player->GetMap()->GetUnit(guid2);
|
||||
|
||||
|
|
@ -184,6 +181,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||
return;
|
||||
}
|
||||
|
||||
if (pet->GetCharmInfo() && pet->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo))
|
||||
return;
|
||||
|
||||
for(int i = 0; i < MAX_EFFECT_INDEX;++i)
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA || spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA_INSTANT || spellInfo->EffectImplicitTargetA[i] == TARGET_ALL_ENEMY_IN_AREA_CHANNELED)
|
||||
|
|
@ -615,9 +615,6 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
|
|||
return;
|
||||
}
|
||||
|
||||
if (pet->GetGlobalCooldown() > 0)
|
||||
return;
|
||||
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid);
|
||||
if (!spellInfo)
|
||||
{
|
||||
|
|
@ -625,6 +622,10 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
|
|||
return;
|
||||
}
|
||||
|
||||
if (pet->GetCharmInfo() && pet->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo))
|
||||
return;
|
||||
|
||||
|
||||
// do not cast not learned spells
|
||||
if (!pet->HasSpell(spellid) || IsPassiveSpell(spellInfo))
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue