Merge commit 'origin/master' into 310

This commit is contained in:
tomrus88 2009-05-07 02:08:52 +04:00
commit 216b947002
6 changed files with 87 additions and 29 deletions

View file

@ -1485,10 +1485,9 @@ struct TalentEntry
// 14-15 not used // 14-15 not used
uint32 DependsOnRank; // 16 uint32 DependsOnRank; // 16
// 17-18 not used // 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 unk2; // 20, all 0
//uint32 unkFlags1; // 21, related to hunter pet talents //uint64 allowForPet; // 21 its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc
//uint32 unkFlags2; // 22, related to hunter pet talents
}; };
struct TalentTabEntry struct TalentTabEntry

View file

@ -6042,11 +6042,24 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
} }
} }
pvpInfo.inHostileArea = // in PvP, any not controlled zone (except zone->team == 6, default case)
GetTeam() == ALLIANCE && zone->team == AREATEAM_HORDE || // in PvE, only opposition team capital
GetTeam() == HORDE && zone->team == AREATEAM_ALLY || switch(zone->team)
sWorld.IsPvPRealm() && zone->team == AREATEAM_NONE || {
InBattleGround(); // overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this 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 if(pvpInfo.inHostileArea) // in hostile area
{ {

View file

@ -2307,6 +2307,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch(GetId()) switch(GetId())
{ {
case 34246: // Idol of the Emerald Queen case 34246: // Idol of the Emerald Queen
case 60779: // Idol of Lush Moss
{ {
if (m_target->GetTypeId() != TYPEID_PLAYER) if (m_target->GetTypeId() != TYPEID_PLAYER)
return; return;

View file

@ -507,7 +507,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
// Gouge // Gouge
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000000008LL) 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 // Instant Poison
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000002000LL) else if(m_spellInfo->SpellFamilyFlags & 0x0000000000002000LL)
@ -6159,7 +6159,7 @@ void Spell::EffectSummonDeadPet(uint32 /*i*/)
void Spell::EffectDestroyAllTotems(uint32 /*i*/) void Spell::EffectDestroyAllTotems(uint32 /*i*/)
{ {
float mana = 0; int32 mana = 0;
for(int slot = 0; slot < MAX_TOTEM; ++slot) for(int slot = 0; slot < MAX_TOTEM; ++slot)
{ {
if(!m_caster->m_TotemSlot[slot]) if(!m_caster->m_TotemSlot[slot])
@ -6171,13 +6171,16 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/)
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL); uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell_id);
if(spellInfo) if(spellInfo)
mana += spellInfo->manaCost * damage / 100; {
uint32 manacost = m_caster->GetCreateMana() * spellInfo->ManaCostPercentage / 100;
mana += manacost * damage / 100;
}
((Totem*)totem)->UnSummon(); ((Totem*)totem)->UnSummon();
} }
} }
int32 gain = m_caster->ModifyPower(POWER_MANA,int32(mana)); if (mana)
m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA); m_caster->CastCustomSpell(m_caster, 39104, &mana, NULL, NULL, true);
} }
void Spell::EffectDurabilityDamage(uint32 i) void Spell::EffectDurabilityDamage(uint32 i)

View file

@ -1620,6 +1620,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
// Reflect damage spells (not cast any damage spell in aura lookup) // Reflect damage spells (not cast any damage spell in aura lookup)
uint32 reflectSpell = 0; uint32 reflectSpell = 0;
int32 reflectDamage = 0; int32 reflectDamage = 0;
// Death Prevention Aura
SpellEntry const* preventDeathSpell = NULL;
int32 preventDeathAmount = 0;
// Need remove expired auras after // Need remove expired auras after
bool existExpired = false; bool existExpired = false;
// absorb without mana cost // absorb without mana cost
@ -1635,7 +1638,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
// Max Amount can be absorbed by this aura // Max Amount can be absorbed by this aura
int32 currentAbsorb = mod->m_amount; int32 currentAbsorb = mod->m_amount;
// Found empty aura (umpossible but..) // Found empty aura (impossible but..)
if (currentAbsorb <=0) if (currentAbsorb <=0)
{ {
existExpired = true; existExpired = true;
@ -1706,26 +1709,29 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
} }
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Cheat Death // Cheat Death (make less prio with Guardian Spirit case)
if(spellProto->SpellIconID == 2109) 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 preventDeathSpell = (*i)->GetSpellProto();
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;
}
continue; continue;
} }
break; break;
} }
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
{ {
// Guardian Spirit
if (spellProto->SpellIconID == 2873)
{
preventDeathSpell = (*i)->GetSpellProto();
preventDeathAmount = (*i)->GetModifier()->m_amount;
continue;
}
// Reflective Shield // Reflective Shield
if (spellProto->SpellFamilyFlags == 0x1) if (spellProto->SpellFamilyFlags == 0x1)
{ {
@ -1841,6 +1847,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
++i; ++i;
} }
} }
// Cast back reflect damage spell // Cast back reflect damage spell
if (reflectSpell) if (reflectSpell)
pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true); pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true);
@ -1938,6 +1945,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; *absorb = damage - RemainingDamage - *resist;
} }
@ -5924,7 +5966,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->Id == 49005) if (dummySpell->Id == 49005)
{ {
// TODO: need more info (cooldowns/PPM) // TODO: need more info (cooldowns/PPM)
triggered_spell_id = 50424; triggered_spell_id = 61607;
break; break;
} }
// Vendetta // Vendetta

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7785" #define REVISION_NR "7793"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__