mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[6815] Allowed switching INVTYPE_HOLDABLE items during combat, used correct spells for triggering global cooldown at weapon switch. Original patch provided by mobel/simak
This commit is contained in:
parent
a44ada6d6b
commit
8e54a3c1cf
5 changed files with 23 additions and 9 deletions
|
|
@ -552,6 +552,7 @@ struct ItemPrototype
|
||||||
{
|
{
|
||||||
case INVTYPE_RELIC:
|
case INVTYPE_RELIC:
|
||||||
case INVTYPE_SHIELD:
|
case INVTYPE_SHIELD:
|
||||||
|
case INVTYPE_HOLDABLE:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9942,9 +9942,26 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
||||||
|
|
||||||
if(pProto && isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer == 0)
|
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)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -677,12 +677,6 @@ struct ItemPosCount
|
||||||
};
|
};
|
||||||
typedef std::vector<ItemPosCount> ItemPosCountVec;
|
typedef std::vector<ItemPosCount> ItemPosCountVec;
|
||||||
|
|
||||||
enum SwitchWeapon
|
|
||||||
{
|
|
||||||
DEFAULT_SWITCH_WEAPON = 1500, //cooldown in ms
|
|
||||||
ROGUE_SWITCH_WEAPON = 1000
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TradeSlots
|
enum TradeSlots
|
||||||
{
|
{
|
||||||
TRADE_SLOT_COUNT = 7,
|
TRADE_SLOT_COUNT = 7,
|
||||||
|
|
|
||||||
|
|
@ -1834,6 +1834,8 @@ enum CorpseDynFlags
|
||||||
#define SPELL_ID_GENERIC_LEARN 483
|
#define SPELL_ID_GENERIC_LEARN 483
|
||||||
#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457
|
#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457
|
||||||
#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007
|
#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007
|
||||||
|
#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119
|
||||||
|
#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123
|
||||||
|
|
||||||
enum WeatherType
|
enum WeatherType
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6814"
|
#define REVISION_NR "6815"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue