fix(core): DK ToT off-hand strikes and Titan Grip for classless
- Item: 2H weapon subclass/inventory masks for strike spells (ToT / dual 2H). - Player: allow SPELL_EFFECT_TITAN_GRIP through skill validation; clear TG on talent/spec reset only for warriors. - PlayerStorage: sync m_canTitanGrip from spellbook before inventory load. - Spell: treat Thassarian off-hand strike spells as OFF_ATTACK when DBC omits SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON.
This commit is contained in:
@@ -3088,6 +3088,12 @@ bool Player::CheckSkillLearnedBySpell(uint32 spellId)
|
||||
if (!sWorld->getBoolConfig(CONFIG_VALIDATE_SKILL_LEARNED_BY_SPELLS))
|
||||
return true;
|
||||
|
||||
// Titan Grip (e.g. talent 46917) ties to warrior-only skill lines in DBC. Classless / cross-class
|
||||
// characters must keep the spell; otherwise it is deleted on every login and 2H off-hand unequips.
|
||||
if (SpellInfo const* si = sSpellMgr->GetSpellInfo(spellId))
|
||||
if (si->HasEffect(SPELL_EFFECT_TITAN_GRIP))
|
||||
return true;
|
||||
|
||||
SkillLineAbilityMapBounds skill_bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
|
||||
uint32 errorSkill = 0;
|
||||
for (SkillLineAbilityMap::const_iterator sla = skill_bounds.first; sla != skill_bounds.second; ++sla)
|
||||
@@ -3773,8 +3779,8 @@ bool Player::resetTalents(bool noResetCost)
|
||||
_removeTalent(itr, GetActiveSpecMask());
|
||||
}
|
||||
|
||||
// xinef: remove titan grip if player had it set
|
||||
if (m_canTitanGrip)
|
||||
// xinef: remove titan grip on warrior talent reset (other classes may use custom Titan Grip)
|
||||
if (IsClass(CLASS_WARRIOR, CLASS_CONTEXT_ABILITY) && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
// xinef: remove dual wield if player does not have dual wield spell (shamans)
|
||||
if (!HasSpell(674) && CanDualWield())
|
||||
@@ -15409,8 +15415,8 @@ void Player::ActivateSpec(uint8 spec)
|
||||
SetPower(POWER_MANA, 0); // Mana must be 0 even if it isn't the active power type.
|
||||
SetPower(pw, 0);
|
||||
|
||||
// xinef: remove titan grip if player had it set and does not have appropriate talent
|
||||
if (!HasTalent(46917, GetActiveSpec()) && m_canTitanGrip)
|
||||
// xinef: remove titan grip if warrior had it set and does not have appropriate talent (other classes may use Titan Grip from custom spells)
|
||||
if (IsClass(CLASS_WARRIOR, CLASS_CONTEXT_ABILITY) && !HasTalent(46917, GetActiveSpec()) && m_canTitanGrip)
|
||||
SetCanTitanGrip(false);
|
||||
// xinef: remove dual wield if player does not have dual wield spell (shamans)
|
||||
if (!HasSpell(674) && CanDualWield())
|
||||
|
||||
@@ -5525,6 +5525,21 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
||||
// xinef: load mails before inventory, so problematic items can be added to already loaded mails
|
||||
_LoadMail(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MAILS), holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MAIL_ITEMS));
|
||||
|
||||
// m_canTitanGrip is normally set when SPELL_EFFECT_TITAN_GRIP runs. After spellbook load, ensure the
|
||||
// flag matches any known TG spell so 2H off-hand items validate before _LoadInventory (classless DK, etc.).
|
||||
for (auto const& spellItr : m_spells)
|
||||
{
|
||||
if (!spellItr.second->Active || spellItr.second->State == PLAYERSPELL_REMOVED)
|
||||
continue;
|
||||
if (SpellInfo const* si = sSpellMgr->GetSpellInfo(spellItr.first))
|
||||
if (si->HasEffect(SPELL_EFFECT_TITAN_GRIP))
|
||||
{
|
||||
SetCanTitanGrip(true);
|
||||
UpdateTitansGrip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_LoadInventory(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_INVENTORY), time_diff);
|
||||
|
||||
// update items with duration and realtime
|
||||
|
||||
Reference in New Issue
Block a user