From bfa9e7516177af9e13391a09d4e1356c74a4c2ba Mon Sep 17 00:00:00 2001 From: visagalis Date: Fri, 14 Nov 2008 17:03:03 -0600 Subject: [svn] *** Source: MaNGOS *** * Implement localization of creature/gameobject name that say/yell. Author: evilstar (rewrited by: Vladimir) * Fix auth login queue. Author: Derex * Allowed switching INVTYPE_HOLDABLE items during combat, used correct spells for triggering global cooldown at weapon switch. Author: mobel/simak * Fixed some format arg type/value pairs. Other warnings. Author: Vladimir * [238_world.sql] Allow have team dependent graveyards at entrance map for instances. Author: Vladimir NOTE: Entrance map graveyards selected by same way as local (by distance from entrance) Until DB support will work in old way base at current DB data. --HG-- branch : trunk --- src/game/Player.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/game/Player.cpp') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8ec5b2fb52b..0d7c035711c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -10256,9 +10256,26 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) if(pProto && isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer == 0) { - m_weaponChangeTimer = DEFAULT_SWITCH_WEAPON; + uint32 cooldownSpell = SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s; + if (getClass() == CLASS_ROGUE) - m_weaponChangeTimer = ROGUE_SWITCH_WEAPON; + cooldownSpell = SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s; + + SpellEntry const* spellProto = sSpellStore.LookupEntry(cooldownSpell); + + if (!spellProto) + sLog.outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell); + else + { + m_weaponChangeTimer = spellProto->StartRecoveryTime; + + WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); + data << uint64(GetGUID()); + data << uint8(1); + data << uint32(cooldownSpell); + data << uint32(0); + GetSession()->SendPacket(&data); + } } } -- cgit v1.2.3