Jump to content

darkstalker

Members
  • Posts

    717
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by darkstalker

  1. yes it works, i tested this a lot before posting it here maybe the patch could be outdated, but i don't think this part of the code changed
  2. i didnt see any problem with cooldowns, maybe its a problem in your sources
  3. try this: if(_player && _player->m_mover && _player->m_mover->GetGUID() != guid)
  4. updated patch for 9034 with some minor modifications by me: diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2d09f4f..ae8ba39 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3639,11 +3639,12 @@ bool Player::resetTalents(bool no_cost) */ - if(m_canTitanGrip) + if(CanTitanGrip()) { - m_canTitanGrip = false; + SetCanTitanGrip(false); if(sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET)) AutoUnequipOffhandIfNeed(); + RemoveAurasDueToSpellByCancel(49152); } return true; @@ -6400,6 +6401,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) // check some item equip limitations (in result lost CanTitanGrip at talent reset, for example) AutoUnequipOffhandIfNeed(); + if (CanTitanGrip() && IsTwoHandUsedInDualWield() && !HasAura(49152)) + CastSpell(this, 49152, true); // recent client version not send leave/join channel packets for built-in local channels UpdateLocalChannels( newZone ); @@ -10606,6 +10609,14 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) // only for full equip instead adding to stack GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + // titans grip dmg penalty for 2h weapons + if (CanTitanGrip()) + { + ItemPrototype const *pProto = pItem->GetProto(); + if (pProto && pProto->InventoryType == INVTYPE_2HWEAPON && !HasAura(49152)) + CastSpell(this, 49152, true); + } + return pItem; } @@ -10745,6 +10756,14 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update ) pItem->SetSlot( NULL_SLOT ); if( IsInWorld() && update ) pItem->SendCreateUpdateToPlayer( this ); + + // titans grip dmg penalty for 2h weapons removed if player does not have any + if (HasAura(49152)) + { + ItemPrototype const *pProto = pItem->GetProto(); + if (pProto && pProto->InventoryType == INVTYPE_2HWEAPON && !IsTwoHandUsedInDualWield()) + RemoveAurasDueToSpellByCancel(49152); + } } } @@ -19325,7 +19344,7 @@ void Player::AutoUnequipOffhandIfNeed() return; // need unequip offhand for 2h-weapon without TitanGrip (in any from hands) - if (CanTitanGrip() || (offItem->GetProto()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed())) + if (CanTitanGrip() || !((IsTwoHandUsedInDualWield() && offItem->GetProto()->InventoryType != INVTYPE_NON_EQUIP) || offItem->GetProto()->InventoryType == INVTYPE_2HWEAPON)) return; ItemPosCountVec off_dest; diff --git a/src/game/Player.h b/src/game/Player.h index 75e8e31..a57b086 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1269,6 +1269,12 @@ class MANGOS_DLL_SPEC Player : public Unit Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip(); } + bool IsTwoHandUsedInDualWield() const + { + Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); + Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); + return mainItem && mainItem->GetProto()->InventoryType == INVTYPE_2HWEAPON || offItem && offItem->GetProto()->InventoryType == INVTYPE_2HWEAPON; + } void SendNewItem( Item *item, uint32 count, bool received, bool created, bool broadcast = false ); bool BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint8 bag, uint8 slot); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d11576e..3fbe545 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6954,8 +6954,15 @@ void Spell::EffectActivateRune(uint32 eff_idx) void Spell::EffectTitanGrip(uint32 /*eff_idx*/) { - if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER) - ((Player*)unitTarget)->SetCanTitanGrip(true); + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + Player *p_target = (Player*)unitTarget; + p_target->SetCanTitanGrip(true); + + // titans grip dmg penalty for 2h weapons + if (!unitTarget->HasAura(49152) && p_target->IsTwoHandUsedInDualWield()) + unitTarget->CastSpell(unitTarget, 49152, true); } void Spell::EffectRenamePet(uint32 /*eff_idx*/)
  5. that always happened (didnt try the fix yet) edit: this fix worked for this case, awesome. probably this is the cause of getting stuck in combat in battelgrounds too.
  6. client can only display costs indexed in ItemExtendedCost.dbc, they're all fixed values
  7. for that try this: UPDATE spell_proc_event SET Cooldown = 1 WHERE entry IN (30675, 30678, 30679); add 1 sec cooldown to prevent multiple overload proc (potentially triggers at damaging each target)
  8. There is another (maybe related problem) that might be caused by this: get 2 chars of opposite faction, attack one, wait till out of combat and logout victim. The victim char will die on logout.
  9. try: git rebase --interactive HEAD~10 remove the lines of unwanted commits and save
  10. * What bug does the patch fix? What features does the patch add? This patch fixes spell aura 163 (labeled as SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE), incorrectly applied only to melee damage. It should apply to all spells, since it contains spell school mask in EffectMiscValue field. * For which repository revision was the patch created? 9034 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. no * Who has been writing this patch? Please include either forum user names or email addresses. darkstalker diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 3407999..6494988 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -205,7 +205,7 @@ enum AuraType SPELL_AURA_MOD_AOE_AVOIDANCE = 160, SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, SPELL_AURA_POWER_BURN_MANA = 162, - SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE = 163, + SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, SPELL_AURA_164 = 164, SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 3373406..832fbe9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -213,7 +213,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult &Aura::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT implemented in Player::RegenerateAll and Player::RegenerateHealth &Aura::HandleAuraPowerBurn, //162 SPELL_AURA_POWER_BURN_MANA - &Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE implememnted in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus + &Aura::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS implemented in Unit::CalculateMeleeDamage and Unit::SpellCriticalDamageBonus &Aura::HandleUnused, //164 unused (3.0.8a-3.2.2a), only one test spell 10654 &Aura::HandleNoImmediateEffect, //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus &Aura::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 7418057..ef59ffb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1292,10 +1292,9 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da if(damageInfo->attackType == RANGED_ATTACK) mod += damageInfo->target->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE); else - { mod += damageInfo->target->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE); - mod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE); - } + + mod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, SPELL_SCHOOL_MASK_NORMAL); uint32 crTypeMask = damageInfo->target->GetCreatureTypeMask(); @@ -9082,14 +9081,13 @@ uint32 Unit::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damag if(GetWeaponAttackType(spellProto) == RANGED_ATTACK) critPctDamageMod += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE); else - { critPctDamageMod += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE); - critPctDamageMod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE); - } } else critPctDamageMod += pVictim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_DAMAGE,GetSpellSchoolMask(spellProto)); + critPctDamageMod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, GetSpellSchoolMask(spellProto)); + uint32 creatureTypeMask = pVictim->GetCreatureTypeMask(); critPctDamageMod += GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, creatureTypeMask);
  11. what if i need to prevent this? i want mob to stay in place when it dies (and falls down instead)
  12. Spell.dbc is usually the starting point for fixing thigs. Get a DBC reader or dump dbc data to sql and read it. It describes in detail what the spell should do, like the effects and auras it provides.
  13. maybe check if the spell is triggered by the current casting spell?
  14. Mangos Version: 9034 (linux x86_64) SD2 Version: 1513 Database Version: YTDB 524 There is a strange problem with Chain Lightning, sometimes fails to cast in certain positions (you do the cast but no damage or spell animation occurs when you finish casting). From my testing seems that CheckCast and other spell processes return ok, but SetTargetMap gets 0 chain targets. Seems to happen when target is in a different grid position from caster (not 100% sure). To reproduce bug: 1) move the caster with: .go xy 7507.56 -1191.52 571 2) move target with: .go xy 7502.45 -1201.9 571 3) make caster cast chain lightning at target. at this point caster is in cell[46,29]grid[0,6] and target cell[46,29]grid[0,5] moving them to same grid makes the spell work normally.
  15. using m_effindex is not correct, since comes from a different aura, being the same its pure coincidence
  16. the damage increase value is stored in effect 1, so use instead: (*i)->GetSpellProto()->CalculateSimpleValue(1);
  17. to "merge" that patch just use GetModelFormForm for the player case
  18. from what i understood warden uses cryptographic stuff, so you can't send modules to the client withouth the private key that only blizz has
  19. immolate change in 9015 is wrong, now it takes 0 spell bonus, somewhat spellbonus needs to be added w/o other spellmods (things like berserk in wsg makes you oneshot ppl), so i got this: // Calculate tick damage SpellEntry const* spell = aura->GetSpellProto(); int32 sp = m_caster->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) + m_caster->SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_FIRE, unitTarget); SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spell->Id); float coeff = bonus ? bonus->dot_damage : 0; coeff *= m_caster->CalculateLevelPenalty(spell); float damagetick = aura->GetModifier()->m_amount + sp * coeff; // Add talents/glyphs for Immolate if (spell->SpellFamilyFlags & UI64LIT(0x00000004)) { float mult = 1.3; // assume Improved Immolate rank 3 (required talent) if (m_caster->HasAura(18120)) // Aftermath rank 2 mult += 0.06; else if (m_caster->HasAura(18119)) // Aftermath rank 1 mult += 0.03; if (m_caster->HasAura(56228)) // Glyph of Immolate mult += 0.1; damagetick *= mult; } damage += int32(damagetick * 4); maybe add only spellmods with SPELLFAMILY_WARLOCK but don't know how to do that.
  20. better use AddTriggeredSpell(), that way it always procs after the original spell its done
  21. probably the damage part of the spell breaks roots early (race condition)
  22. i dont have an "uptime" table, is it a custom patch? btw, if anyone wants a honor rank, this sql creates it SELECT c.name, c.level, c.race, c.class, (CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', 23), ' ', -1) AS UNSIGNED) >> 16) & 1 AS gender, CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', 1203), ' ', -1) AS UNSIGNED) AS kills, CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', 1252), ' ', -1) AS UNSIGNED) AS honor, g.name AS guild FROM characters AS c LEFT JOIN guild AS g ON g.guildid = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(c.data, ' ', 152), ' ', -1) AS UNSIGNED) ORDER BY kills DESC LIMIT 50; arena rank could be done in a single query too, might work on that later.
  23. maybe something like this: // Gift of the Naaru if (m_spellProto->SpellFamilyFlags2 & 0x80000000) { Unit *caster = GetCaster(); if (!caster) return; SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(m_spellProto->Id); if (bonus) { int32 ap = int32(bonus->ap_bonus * caster->GetTotalAttackPowerValue(BASE_ATTACK)); int32 sp = int32(bonus->dot_bonus * (caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) + caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellProto), m_target))); m_modifier.m_amount += ap > sp ? ap : sp; } }
  24. maybe using a shared library that loads the maps could solve the problem
  25. the problem is that SpellDamageBonus applied all spell mods twice (in this case and conflagrate too)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use