*Fix crash.

*Fix Guard Dog and Improved Cower -by pasdVn.
*Fix aura SPELL_AURA_OBS_MOD_ENERGY -by pasdVn.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-08 13:24:05 +01:00
parent abdddf36ff
commit 786fbdec57
7 changed files with 56 additions and 47 deletions

View File

@@ -0,0 +1,7 @@
-- Improved Cower
INSERT INTO `spell_proc_event` VALUES (53180, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
INSERT INTO `spell_proc_event` VALUES (53181, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
-- Guard Dog
INSERT INTO `spell_proc_event` VALUES (53178, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);
INSERT INTO `spell_proc_event` VALUES (53179, 0x00, 9, 0x00000000, 268435456, 0x00000000, 0x00014010, 0x00000000, 0.000000, 0.000000, 0);

View File

@@ -70,4 +70,5 @@ INSTALL(FILES
1727_world_script.sql
1729_world.sql
1730_world.sql
1732_world.sql
DESTINATION share/trinity/sql/updates)

View File

@@ -65,7 +65,7 @@ enum AuraType
SPELL_AURA_MOD_INVISIBILITY = 18,
SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19,
SPELL_AURA_OBS_MOD_HEALTH = 20, //20,21 unofficial
SPELL_AURA_OBS_MOD_MANA = 21,
SPELL_AURA_OBS_MOD_ENERGY = 21,
SPELL_AURA_MOD_RESISTANCE = 22,
SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23,
SPELL_AURA_PERIODIC_ENERGIZE = 24,

View File

@@ -75,7 +75,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY
&Aura::HandleInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION
&Aura::HandleAuraModTotalHealthPercentRegen, // 20 SPELL_AURA_OBS_MOD_HEALTH
&Aura::HandleAuraModTotalManaPercentRegen, // 21 SPELL_AURA_OBS_MOD_MANA
&Aura::HandleAuraModTotalEnergyPercentRegen, // 21 SPELL_AURA_OBS_MOD_ENERGY
&Aura::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE
&Aura::HandlePeriodicTriggerSpell, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
&Aura::HandlePeriodicEnergize, // 24 SPELL_AURA_PERIODIC_ENERGIZE
@@ -4386,7 +4386,7 @@ void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real)
m_isPeriodic = apply;
}
void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real)
void Aura::HandleAuraModTotalEnergyPercentRegen(bool apply, bool Real)
{
if(m_modifier.periodictime == 0)
m_modifier.periodictime = 1000;
@@ -5825,13 +5825,10 @@ void Aura::PeriodicTick()
}
break;
}
case SPELL_AURA_OBS_MOD_ENERGY:
case SPELL_AURA_PERIODIC_ENERGIZE:
{
// ignore non positive values (can be result apply spellmods to aura damage
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS)
break;
@@ -5840,9 +5837,16 @@ void Aura::PeriodicTick()
if(m_target->GetMaxPower(power) == 0)
break;
uint32 amount = m_modifier.m_amount < 0 ? 0 : m_modifier.m_amount;
uint32 pdamage;
// Replenishment (Judgements of the Wise)
if (m_spellProto->SpellIconID == 3184 && m_spellProto->SpellVisual[0] == 12495)
pdamage = 0.25f * m_target->GetMaxPower(POWER_MANA);
else if( m_modifier.m_auraname == SPELL_AURA_OBS_MOD_ENERGY )
pdamage = uint32(m_target->GetMaxPower(power) * amount/100);
else
pdamage = amount;
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
data.append(m_target->GetPackGUID());
@@ -5854,36 +5858,10 @@ void Aura::PeriodicTick()
data << (uint32)pdamage;
m_target->SendMessageToSet(&data,true);
int32 gain = m_target->ModifyPower(power,pdamage);
if(Unit* pCaster = GetCaster())
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());
break;
}
case SPELL_AURA_OBS_MOD_MANA:
{
// ignore non positive values (can be result apply spellmods to aura damage
uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
uint32 pdamage = uint32(m_target->GetMaxPower(POWER_MANA) * amount/100);
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u mana inflicted by %u",
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
if(m_target->GetMaxPower(POWER_MANA) == 0)
break;
WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size
data.append(m_target->GetPackGUID());
data.appendPackGUID(GetCasterGUID());
data << uint32(GetId());
data << uint32(1);
data << uint32(m_modifier.m_auraname);
data << (uint32)0; // ?
data << (uint32)pdamage;
m_target->SendMessageToSet(&data,true);
int32 gain = m_target->ModifyPower(POWER_MANA, pdamage);
int32 gain = m_target->ModifyPower(power,pdamage);
if(Unit* pCaster = GetCaster())
m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto());

View File

@@ -111,7 +111,7 @@ class TRINITY_DLL_SPEC Aura
void HandleInvisibility(bool Apply, bool Real);
void HandleInvisibilityDetect(bool Apply, bool Real);
void HandleAuraModTotalHealthPercentRegen(bool Apply, bool Real);
void HandleAuraModTotalManaPercentRegen(bool Apply, bool Real);
void HandleAuraModTotalEnergyPercentRegen(bool Apply, bool Real);
void HandleAuraModResistance(bool Apply, bool Real);
void HandleAuraModRoot(bool Apply, bool Real);
void HandleAuraModSilence(bool Apply, bool Real);

View File

@@ -1321,6 +1321,9 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
// generic spells
if(!spellInfo_1->SpellFamilyName)
{
// hack for Incanter's Absorption
if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413)
return false;
if(!spellInfo_1->SpellIconID
|| spellInfo_1->SpellIconID == 1
|| spellInfo_1->SpellIconID != spellInfo_2->SpellIconID)

View File

@@ -2223,8 +2223,6 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
auraAbsorbMod = (*i)->GetModifier()->m_amount;
}
RemainingDamage += auraAbsorbMod * TotalAbsorb / 100;
// Ignore absorb - add reduced amount again to damage
RemainingDamage += auraAbsorbMod * TotalAbsorb / 100;
@@ -2232,6 +2230,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
if (*absorb)
{
bool found = false;
int32 spell_dmg=0;
// Incanter's Absorption
AuraList const& DummmyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = DummmyAuras.begin(); i != DummmyAuras.end(); ++i)
@@ -2240,22 +2240,22 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
if (spellmgr.GetFirstSpellInChain(spellInfo->Id) == 44394)
{
int32 total_dmg=0;
AuraList const& ignore = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
for(AuraList::const_iterator j = ignore.begin(); i != ignore.end(); ++i)
// Get total bonus from auras
spellEffectPair spair = spellEffectPair(44413, 0);
for(AuraMap::const_iterator itr = pVictim->GetAuras().lower_bound(spair); itr != pVictim->GetAuras().upper_bound(spair); ++itr)
{
if ((*j)->GetId()!=44413)
continue;
total_dmg += (*j)->GetModifier()->m_miscvalue;
total_dmg += itr->second->GetModifier()->m_miscvalue;
}
int32 spell_dmg = int32(*absorb * (*i)->GetModifier()->m_amount / 100);
spell_dmg = int32(*absorb * (*i)->GetModifier()->m_amount / 100);
// Do not apply more auras if more than 5% hp
if(total_dmg+spell_dmg > int32(GetMaxHealth() * 5 / 100))
break;
pVictim->CastCustomSpell(pVictim, 44413, &spell_dmg, NULL, NULL, false);
found=true;
break;
}
}
if (found)
pVictim->CastCustomSpell(pVictim, 44413, &spell_dmg, NULL, NULL, false);
}
}
@@ -3766,7 +3766,7 @@ bool Unit::AddAura(Aura *Aur)
case SPELL_AURA_OBS_MOD_HEALTH:
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_OBS_MOD_MANA:
case SPELL_AURA_OBS_MOD_ENERGY:
case SPELL_AURA_POWER_BURN_MANA:
break;
default: // not allow
@@ -6487,6 +6487,26 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true;
}
}
break;
}
case SPELLFAMILY_PET:
{
// improved cower
if (dummySpell->SpellIconID == 958 && procSpell->SpellIconID == 958)
{
triggered_spell_id = dummySpell->Id == 53180 ? 54200 : 54201;
target = this;
break;
}
// guard dog
if (dummySpell->SpellIconID == 201 && procSpell->SpellIconID == 201)
{
triggered_spell_id = 54445;
target = this;
pVictim->AddThreat(this,procSpell->EffectBasePoints[0]*triggerAmount/100);
break;
}
break;
}
default:
break;