mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[10248] Implement applying proper penalty spell when making use of talent 46917.
This commit is contained in:
parent
5efb7410f2
commit
33e7d46519
4 changed files with 32 additions and 5 deletions
|
|
@ -3577,12 +3577,14 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_canTitanGrip)
|
if (CanTitanGrip())
|
||||||
{
|
{
|
||||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id);
|
||||||
if (IsSpellHaveEffect(spellInfo, SPELL_EFFECT_TITAN_GRIP))
|
if (IsSpellHaveEffect(spellInfo, SPELL_EFFECT_TITAN_GRIP))
|
||||||
{
|
{
|
||||||
m_canTitanGrip = false;
|
SetCanTitanGrip(false);
|
||||||
|
// Remove Titan's Grip damage penalty now
|
||||||
|
RemoveAurasDueToSpell(49152);
|
||||||
if(sWorld.getConfig(CONFIG_BOOL_OFFHAND_CHECK_AT_TALENTS_RESET))
|
if(sWorld.getConfig(CONFIG_BOOL_OFFHAND_CHECK_AT_TALENTS_RESET))
|
||||||
AutoUnequipOffhandIfNeed();
|
AutoUnequipOffhandIfNeed();
|
||||||
}
|
}
|
||||||
|
|
@ -11047,6 +11049,9 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
||||||
|
|
||||||
return pItem2;
|
return pItem2;
|
||||||
}
|
}
|
||||||
|
// Apply Titan's Grip damage penalty if necessary
|
||||||
|
if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && HasTwoHandWeaponInOneHand() && !HasAura(49152))
|
||||||
|
CastSpell(this, 49152, true);
|
||||||
|
|
||||||
// only for full equip instead adding to stack
|
// only for full equip instead adding to stack
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
||||||
|
|
@ -11070,6 +11075,9 @@ void Player::QuickEquipItem( uint16 pos, Item *pItem)
|
||||||
pItem->AddToWorld();
|
pItem->AddToWorld();
|
||||||
pItem->SendCreateUpdateToPlayer( this );
|
pItem->SendCreateUpdateToPlayer( this );
|
||||||
}
|
}
|
||||||
|
// Apply Titan's Grip damage penalty if necessary
|
||||||
|
if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && HasTwoHandWeaponInOneHand() && !HasAura(49152))
|
||||||
|
CastSpell(this, 49152, true);
|
||||||
|
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, slot+1);
|
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, slot+1);
|
||||||
|
|
@ -11179,7 +11187,12 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
|
||||||
SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0);
|
SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), 0);
|
||||||
|
|
||||||
if ( slot < EQUIPMENT_SLOT_END )
|
if ( slot < EQUIPMENT_SLOT_END )
|
||||||
|
{
|
||||||
SetVisibleItemSlot(slot, NULL);
|
SetVisibleItemSlot(slot, NULL);
|
||||||
|
// Remove Titan's Grip damage penalty if necessary
|
||||||
|
if ((slot == EQUIPMENT_SLOT_MAINHAND || slot == EQUIPMENT_SLOT_OFFHAND) && CanTitanGrip() && !HasTwoHandWeaponInOneHand())
|
||||||
|
RemoveAurasDueToSpell(49152);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1329,6 +1329,12 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||||
return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
|
return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
|
||||||
}
|
}
|
||||||
|
bool HasTwoHandWeaponInOneHand() const
|
||||||
|
{
|
||||||
|
Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||||
|
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
|
||||||
|
return offItem && ((mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON) || offItem->GetProto()->InventoryType == INVTYPE_2HWEAPON);
|
||||||
|
}
|
||||||
void SendNewItem( Item *item, uint32 count, bool received, bool created, bool broadcast = false );
|
void SendNewItem( Item *item, uint32 count, bool received, bool created, bool broadcast = false );
|
||||||
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7825,10 +7825,18 @@ void Spell::EffectActivateRune(SpellEffectIndex eff_idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectTitanGrip(SpellEffectIndex /*eff_idx*/)
|
void Spell::EffectTitanGrip(SpellEffectIndex eff_idx)
|
||||||
{
|
{
|
||||||
|
// Make sure "Titan's Grip" (49152) penalty spell does not silently change
|
||||||
|
if (m_spellInfo->EffectMiscValue[eff_idx] != 49152)
|
||||||
|
sLog.outError("Spell::EffectTitanGrip: Spell %u has unexpected EffectMiscValue '%u'", m_spellInfo->Id, m_spellInfo->EffectMiscValue[eff_idx]);
|
||||||
if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
|
if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||||
((Player*)unitTarget)->SetCanTitanGrip(true);
|
{
|
||||||
|
Player *plr = (Player*)m_caster;
|
||||||
|
plr->SetCanTitanGrip(true);
|
||||||
|
if (plr->HasTwoHandWeaponInOneHand() && !plr->HasAura(49152))
|
||||||
|
plr->CastSpell(plr, 49152, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::EffectRenamePet(SpellEffectIndex /*eff_idx*/)
|
void Spell::EffectRenamePet(SpellEffectIndex /*eff_idx*/)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10247"
|
#define REVISION_NR "10248"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue