diff options
| author | visagalis <none@none> | 2008-11-14 17:03:03 -0600 |
|---|---|---|
| committer | visagalis <none@none> | 2008-11-14 17:03:03 -0600 |
| commit | bfa9e7516177af9e13391a09d4e1356c74a4c2ba (patch) | |
| tree | b4b4c98fac8e547db4a165e5e8cc0fb03c21c005 /src/game/Player.cpp | |
| parent | d1e759479b3f31cccc270e40d3e6af13204eb627 (diff) | |
[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
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
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); + } } } |
