From 727268a4e8533de705d14d1ab6491734ceea9c40 Mon Sep 17 00:00:00 2001 From: Elron Date: Wed, 6 May 2009 09:45:16 +0400 Subject: [PATCH 1/8] [7786] Proper hostile zones marking for PvE servers. Signed-off-by: VladimirMangos --- src/game/Player.cpp | 23 ++++++++++++++++++----- src/shared/revision_nr.h | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f123e4b1d..b365c917a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6053,11 +6053,24 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } } - pvpInfo.inHostileArea = - GetTeam() == ALLIANCE && zone->team == AREATEAM_HORDE || - GetTeam() == HORDE && zone->team == AREATEAM_ALLY || - sWorld.IsPvPRealm() && zone->team == AREATEAM_NONE || - InBattleGround(); // overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this + // in PvP, any not controlled zone (except zone->team == 6, default case) + // in PvE, only opposition team capital + switch(zone->team) + { + case AREATEAM_ALLY: + pvpInfo.inHostileArea = GetTeam() != ALLIANCE && (sWorld.IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + break; + case AREATEAM_HORDE: + pvpInfo.inHostileArea = GetTeam() != HORDE && (sWorld.IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + break; + case AREATEAM_NONE: + // overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this + pvpInfo.inHostileArea = sWorld.IsPvPRealm() || InBattleGround(); + break; + default: // 6 in fact + pvpInfo.inHostileArea = false; + break; + } if(pvpInfo.inHostileArea) // in hostile area { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c5e56799c..91e7e9bd7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7785" + #define REVISION_NR "7786" #endif // __REVISION_NR_H__ From ac239e6178e15c846ee03467c373b47dfa0eda46 Mon Sep 17 00:00:00 2001 From: Maxxie Date: Wed, 6 May 2009 13:55:38 +0400 Subject: [PATCH 2/8] [7787] Apply death preventing buffs after absorbing damage Signed-off-by: VladimirMangos --- src/game/Unit.cpp | 70 ++++++++++++++++++++++++++++++++-------- src/shared/revision_nr.h | 2 +- 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6220e5e18..07d098180 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1613,6 +1613,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe // Reflect damage spells (not cast any damage spell in aura lookup) uint32 reflectSpell = 0; int32 reflectDamage = 0; + // Death Prevention Aura + SpellEntry const* preventDeathSpell = NULL; + int32 preventDeathAmount = 0; // Need remove expired auras after bool existExpired = false; // absorb without mana cost @@ -1628,7 +1631,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe // Max Amount can be absorbed by this aura int32 currentAbsorb = mod->m_amount; - // Found empty aura (umpossible but..) + // Found empty aura (impossible but..) if (currentAbsorb <=0) { existExpired = true; @@ -1699,26 +1702,29 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe } case SPELLFAMILY_ROGUE: { - // Cheat Death - if(spellProto->SpellIconID == 2109) + // Cheat Death (make less prio with Guardian Spirit case) + if (!preventDeathSpell && spellProto->SpellIconID == 2109 && + pVictim->GetTypeId()==TYPEID_PLAYER && // Only players + !((Player*)pVictim)->HasSpellCooldown(31231) && + // Only if no cooldown + roll_chance_i((*i)->GetModifier()->m_amount)) + // Only if roll { - if (pVictim->GetTypeId()==TYPEID_PLAYER && // Only players - pVictim->GetHealth() <= RemainingDamage && // Only if damage kill - !((Player*)pVictim)->HasSpellCooldown(31231) && // Only if no cooldown - roll_chance_i(currentAbsorb)) // Only if roll - { - pVictim->CastSpell(pVictim,31231,true); - ((Player*)pVictim)->AddSpellCooldown(31231,0,time(NULL)+60); - // with health > 10% lost health until health==10%, in other case no losses - uint32 health10 = pVictim->GetMaxHealth()/10; - RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0; - } + preventDeathSpell = (*i)->GetSpellProto(); continue; } break; } case SPELLFAMILY_PRIEST: { + // Guardian Spirit + if (spellProto->SpellIconID == 2873) + { + preventDeathSpell = (*i)->GetSpellProto(); + preventDeathAmount = (*i)->GetModifier()->m_amount; + continue; + } + // Reflective Shield if (spellProto->SpellFamilyFlags == 0x1) { @@ -1834,6 +1840,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe ++i; } } + // Cast back reflect damage spell if (reflectSpell) pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true); @@ -1931,6 +1938,41 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe } } + // Apply death prevention spells effects + if (preventDeathSpell && RemainingDamage >= pVictim->GetHealth()) + { + switch(preventDeathSpell->SpellFamilyName) + { + // Cheat Death + case SPELLFAMILY_ROGUE: + { + // Cheat Death + if (preventDeathSpell->SpellIconID == 2109) + { + pVictim->CastSpell(pVictim,31231,true); + ((Player*)pVictim)->AddSpellCooldown(31231,0,time(NULL)+60); + // with health > 10% lost health until health==10%, in other case no losses + uint32 health10 = pVictim->GetMaxHealth()/10; + RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0; + } + break; + } + // Guardian Spirit + case SPELLFAMILY_PRIEST: + { + // Guardian Spirit + if (preventDeathSpell->SpellIconID == 2873) + { + int32 healAmount = pVictim->GetMaxHealth() * preventDeathAmount / 100; + pVictim->CastCustomSpell(pVictim, 48153, &healAmount, NULL, NULL, true); + pVictim->RemoveAurasDueToSpell(preventDeathSpell->Id); + RemainingDamage = 0; + } + break; + } + } + } + *absorb = damage - RemainingDamage - *resist; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 91e7e9bd7..6e6f26f29 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7786" + #define REVISION_NR "7787" #endif // __REVISION_NR_H__ From 54f29f713831ef4c5d2a958669e9a043c92ddab7 Mon Sep 17 00:00:00 2001 From: DEN_North Date: Wed, 6 May 2009 14:46:50 +0400 Subject: [PATCH 3/8] [7788] Implement item 40711 effect. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 1 + src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index bf82ff5e6..888a81462 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2301,6 +2301,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) switch(GetId()) { case 34246: // Idol of the Emerald Queen + case 60779: // Idol of Lush Moss { if (m_target->GetTypeId() != TYPEID_PLAYER) return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6e6f26f29..0673b312a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7787" + #define REVISION_NR "7788" #endif // __REVISION_NR_H__ From 4c29782d660055b68664bba38f23f1fe9e3331c6 Mon Sep 17 00:00:00 2001 From: Maxxie Date: Wed, 6 May 2009 13:18:44 +0200 Subject: [PATCH 4/8] [7789] Fixed mana gain from spell effect EffectDestroyAllTotems. Signed-off-by: ApoC --- src/game/SpellEffects.cpp | 11 +++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d73e6faef..2663d3630 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6155,7 +6155,7 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/) void Spell::EffectDestroyAllTotems(uint32 /*i*/) { - float mana = 0; + uint32 mana = 0; for(int slot = 0; slot < MAX_TOTEM; ++slot) { if(!m_caster->m_TotemSlot[slot]) @@ -6167,13 +6167,16 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/) uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id); if(spellInfo) - mana += spellInfo->manaCost * damage / 100; + { + uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100; + mana += manacost * damage / 100; + } ((Totem*)totem)->UnSummon(); } } - int32 gain = m_caster->ModifyPower(POWER_MANA,int32(mana)); - m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA); + if (mana) + m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true); } void Spell::EffectDurabilityDamage(uint32 i) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0673b312a..8583c7ad6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7788" + #define REVISION_NR "7789" #endif // __REVISION_NR_H__ From e0f5561caef8aaa201f762c94bd4bd6939f2efb9 Mon Sep 17 00:00:00 2001 From: Opterman Date: Wed, 6 May 2009 13:58:11 +0200 Subject: [PATCH 5/8] [7790] Fixed proc spell for talent 49005 Signed-off-by: ApoC --- src/game/Unit.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 07d098180..01ad54e5b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5959,7 +5959,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if (dummySpell->Id == 49005) { // TODO: need more info (cooldowns/PPM) - triggered_spell_id = 50424; + triggered_spell_id = 61607; break; } // Vendetta diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8583c7ad6..8d607ddff 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7789" + #define REVISION_NR "7790" #endif // __REVISION_NR_H__ From ab170653fc2a0ddc524061dce084caa5c687c544 Mon Sep 17 00:00:00 2001 From: ApoC Date: Wed, 6 May 2009 14:26:59 +0200 Subject: [PATCH 6/8] [7791] Compile fix of [7789]. Signed-off-by: ApoC --- src/game/SpellEffects.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2663d3630..b51ab8204 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6155,7 +6155,7 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/) void Spell::EffectDestroyAllTotems(uint32 /*i*/) { - uint32 mana = 0; + int32 mana = 0; for(int slot = 0; slot < MAX_TOTEM; ++slot) { if(!m_caster->m_TotemSlot[slot]) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8d607ddff..ed4992734 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7790" + #define REVISION_NR "7791" #endif // __REVISION_NR_H__ From f2c514e81081b1c4aa3cfd5d8564f96aa09ddbe0 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 6 May 2009 19:16:07 +0400 Subject: [PATCH 7/8] [7792] Fix one rogue spell AP bonus Signed-off-by: DiSlord --- src/game/SpellEffects.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index b51ab8204..2701678bf 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -504,7 +504,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) // Gouge else if(m_spellInfo->SpellFamilyFlags & 0x0000000000000008LL) { - damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.02f); + damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.21f); } // Instant Poison else if(m_spellInfo->SpellFamilyFlags & 0x0000000000002000LL) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ed4992734..1197c10d0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7791" + #define REVISION_NR "7792" #endif // __REVISION_NR_H__ From b2d9faa1cfce9da0bc4c2d7a1c1b35745cb26d97 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Wed, 6 May 2009 22:00:02 +0400 Subject: [PATCH 8/8] [7793] Add some comments to fields in Talent.dbc Signed-off-by: DiSlord --- src/game/DBCStructure.h | 5 ++--- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 942dadaa2..e33e2f58a 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1480,10 +1480,9 @@ struct TalentEntry // 14-15 not used uint32 DependsOnRank; // 16 // 17-18 not used - //uint32 unk1; // 19, 0 or 1 + //uint32 needAddInSpellBook; // 19 also need disable higest ranks on reset talent tree //uint32 unk2; // 20, all 0 - //uint32 unkFlags1; // 21, related to hunter pet talents - //uint32 unkFlags2; // 22, related to hunter pet talents + //uint64 allowForPet; // 21 its a 64 bit mask for pet 1<