mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11198] Implement max stack effect of enchantment applied by spell 2823 and ranks.
Thanks to "maly32167" for additional input.
This commit is contained in:
parent
f9c184b097
commit
35c89b68e7
4 changed files with 49 additions and 1 deletions
|
|
@ -636,6 +636,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
|
|||
( 0, 9,0x0008000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Counterattack', 'Spell::EffectSchoolDMG'),
|
||||
( 0, 5, -1, -1, -1, -1,1179, -1, -1,-1,'Curse of Doom', 'Spell::CheckTargetCreatureType'),
|
||||
( 0, 8,0x0000000000010000,0x00000000, -1, -1, -1, -1, 3,-1,'Deadly poison', 'Spell::EffectSchoolDMG'),
|
||||
( 0, 8,0x0000000000010000,0x00000000, -1, -1, -1, 6, -1,-1,'Deadly Poison', 'Player::CastItemCombatSpell'),
|
||||
( 0,15,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Death Coil', 'Spell::EffectDummy'),
|
||||
( 0,15,0x0000000000000010,0x00000000, -1, -1, -1, 31, -1, 1,'Death Strike', 'Spell::EffectWeaponDmg'),
|
||||
( 0,15,0x0000000000000010,0x00000000, -1, -1, -1, 3, -1, 2,'Death Strike', 'Spell::EffectDummy'),
|
||||
|
|
|
|||
|
|
@ -7528,6 +7528,46 @@ void Player::UpdateEquipSpellsAtFormChange()
|
|||
}
|
||||
}
|
||||
|
||||
/// handles unique effect of Deadly Poison: apply poison of the other weapon when already at max. stack
|
||||
void Player::_HandleDeadlyPoison(Unit* Target, WeaponAttackType attType, SpellEntry const *spellInfo)
|
||||
{
|
||||
SpellAuraHolder const* dPoison = NULL;
|
||||
SpellAuraHolderConstBounds holders = Target->GetSpellAuraHolderBounds(spellInfo->Id);
|
||||
for (SpellAuraHolderMap::const_iterator iter = holders.first; iter != holders.second; ++iter)
|
||||
{
|
||||
if (iter->second->GetCaster() == this)
|
||||
{
|
||||
dPoison = iter->second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dPoison && dPoison->GetStackAmount() == spellInfo->StackAmount)
|
||||
{
|
||||
Item *otherWeapon = GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK );
|
||||
if (!otherWeapon)
|
||||
return;
|
||||
|
||||
// all poison enchantments are temporary
|
||||
uint32 enchant_id = otherWeapon->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT);
|
||||
if (!enchant_id)
|
||||
return;
|
||||
|
||||
SpellItemEnchantmentEntry const* pSecondEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
|
||||
if (!pSecondEnchant)
|
||||
return;
|
||||
|
||||
for (int s = 0; s < 3; ++s)
|
||||
{
|
||||
if (pSecondEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
|
||||
continue;
|
||||
|
||||
SpellEntry const* combatEntry = sSpellStore.LookupEntry(pSecondEnchant->spellid[s]);
|
||||
if (combatEntry && combatEntry->Dispel == DISPEL_POISON)
|
||||
CastSpell(Target, combatEntry, true, otherWeapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
||||
{
|
||||
Item *item = GetWeaponForAttack(attType, true, false);
|
||||
|
|
@ -7614,7 +7654,13 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
|||
if(IsPositiveSpell(pEnchant->spellid[s]))
|
||||
CastSpell(this, pEnchant->spellid[s], true, item);
|
||||
else
|
||||
{
|
||||
// Deadly Poison, unique effect needs to be handled before casting triggered spell
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags & UI64LIT(0x10000))
|
||||
_HandleDeadlyPoison(Target, attType, spellInfo);
|
||||
|
||||
CastSpell(Target, pEnchant->spellid[s], true, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2630,6 +2630,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
Runes *m_runes;
|
||||
EquipmentSets m_EquipmentSets;
|
||||
private:
|
||||
void _HandleDeadlyPoison(Unit* Target, WeaponAttackType attType, SpellEntry const *spellInfo);
|
||||
// internal common parts for CanStore/StoreItem functions
|
||||
uint8 _CanStoreItem_InSpecificSlot( uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool swap, Item *pSrcItem ) const;
|
||||
uint8 _CanStoreItem_InBag( uint8 bag, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot ) const;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11197"
|
||||
#define REVISION_NR "11198"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue