*Merge heads

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-26 09:01:39 +01:00
6 changed files with 173 additions and 112 deletions
@@ -467,25 +467,13 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
else { else {
if(LaceratingSlash_Timer < diff) if(LaceratingSlash_Timer < diff)
{ {
if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0)) DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH);
DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH);
else
{
int32 bp0 = 3470;
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_LACERATINGSLASH, &bp0, NULL, NULL, false);
}
LaceratingSlash_Timer = 18000 + rand()%5000; LaceratingSlash_Timer = 18000 + rand()%5000;
}else LaceratingSlash_Timer -= diff; }else LaceratingSlash_Timer -= diff;
if(RendFlesh_Timer < diff) if(RendFlesh_Timer < diff)
{ {
if(!m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0)) DoCast(m_creature->getVictim(), SPELL_RENDFLESH);
DoCast(m_creature->getVictim(), SPELL_RENDFLESH);
else
{
int32 bp1 = 4670;
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_RENDFLESH, NULL, &bp1, NULL, false);
}
RendFlesh_Timer = 5000 + rand()%5000; RendFlesh_Timer = 5000 + rand()%5000;
}else RendFlesh_Timer -= diff; }else RendFlesh_Timer -= diff;
+1 -1
View File
@@ -1165,7 +1165,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
break; break;
case 15438: //fire elemental case 15438: //fire elemental
SetCreateHealth(30 + 40*petlevel); SetCreateHealth(40*petlevel);
SetCreateMana(28 + 10*petlevel); SetCreateMana(28 + 10*petlevel);
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel));
+100 -59
View File
@@ -174,14 +174,8 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster )
*data >> m_targetMask; *data >> m_targetMask;
if(m_targetMask == TARGET_FLAG_SELF) if(m_targetMask == TARGET_FLAG_SELF)
{
//m_destX = caster->GetPositionX();
//m_destY = caster->GetPositionY();
//m_destZ = caster->GetPositionZ();
//m_unitTarget = caster;
//m_unitTargetGUID = caster->GetGUID();
return true; return true;
}
// TARGET_FLAG_UNK2 is used for non-combat pets, maybe other? // TARGET_FLAG_UNK2 is used for non-combat pets, maybe other?
if( m_targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2) ) if( m_targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2) )
if(!readGUID(*data, m_unitTargetGUID)) if(!readGUID(*data, m_unitTargetGUID))
@@ -721,7 +715,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
target.targetGUID = targetGUID; // Store target GUID target.targetGUID = targetGUID; // Store target GUID
target.effectMask = 1<<effIndex; // Store index of effect target.effectMask = 1<<effIndex; // Store index of effect
target.processed = false; // Effects not apply on target target.processed = false; // Effects not apply on target
target.killTarget = false; target.damage = 0;
// Calculate hit result // Calculate hit result
if(m_originalCaster) if(m_originalCaster)
@@ -942,13 +936,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (!unit) if (!unit)
return; return;
if(target->killTarget)
{
// remove spell_magnet aura after first spell redirect and destroy target if its totem
if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem())
unit->Kill(unit);
}
// Get original caster (if exist) and calculate damage/healing from him data // Get original caster (if exist) and calculate damage/healing from him data
Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster;
@@ -963,8 +950,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
unitTarget = unit; unitTarget = unit;
// Reset damage/healing counter // Reset damage/healing counter
m_damage = 0; m_damage = target->damage;
m_healing = 0; m_healing = -target->damage;
// Fill base trigger info // Fill base trigger info
uint32 procAttacker = m_procAttacker; uint32 procAttacker = m_procAttacker;
@@ -991,7 +978,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// All calculated do it! // All calculated do it!
// Do healing and triggers // Do healing and triggers
if (m_healing) if (m_healing > 0)
{ {
bool crit = caster->isSpellCrit(NULL, m_spellInfo, m_spellSchoolMask); bool crit = caster->isSpellCrit(NULL, m_spellInfo, m_spellSchoolMask);
uint32 addhealth = m_healing; uint32 addhealth = m_healing;
@@ -1017,7 +1004,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
bg->UpdatePlayerScore(((Player*)caster), SCORE_HEALING_DONE, gain); bg->UpdatePlayerScore(((Player*)caster), SCORE_HEALING_DONE, gain);
} }
// Do damage and triggers // Do damage and triggers
else if (m_damage) else if (m_damage > 0)
{ {
// Fill base damage struct (unitTarget - is real spell target) // Fill base damage struct (unitTarget - is real spell target)
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask); SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
@@ -1170,8 +1157,9 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
{ {
if (effectMask & (1<<effectNumber)) if (effectMask & (1<<effectNumber))
{ {
HandleEffects(unit,NULL,NULL,effectNumber,m_damageMultipliers[effectNumber]); HandleEffects(unit,NULL,NULL,effectNumber/*,m_damageMultipliers[effectNumber]*/);
if ( m_applyMultiplierMask & (1 << effectNumber) ) //Only damage and heal spells need this
/*if ( m_applyMultiplierMask & (1 << effectNumber) )
{ {
// Get multiplier // Get multiplier
float multiplier = m_spellInfo->DmgMultiplier[effectNumber]; float multiplier = m_spellInfo->DmgMultiplier[effectNumber];
@@ -1180,7 +1168,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if(Player* modOwner = m_originalCaster->GetSpellModOwner()) if(Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier,this); modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier,this);
m_damageMultipliers[effectNumber] *= multiplier; m_damageMultipliers[effectNumber] *= multiplier;
} }*/
} }
} }
@@ -1450,6 +1438,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
else else
radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
//Chain: 2, 6, 22, 25, 45, 77
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i]; uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets; uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
@@ -1462,6 +1451,13 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
} }
} }
if(EffectChainTarget > 1)
{
//otherwise, this multiplier is used for something else
m_damageMultipliers[i] = 1.0f;
m_applyMultiplierMask |= 1 << i;
}
switch(spellmgr.SpellTargetType[cur]) switch(spellmgr.SpellTargetType[cur])
{ {
case TARGET_TYPE_UNIT_CASTER: case TARGET_TYPE_UNIT_CASTER:
@@ -2203,23 +2199,6 @@ void Spell::cast(bool skipCheck)
FillTargetMap(); FillTargetMap();
// who did this hack?
// Conflagrate - consumes immolate
if ((m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) && m_targets.getUnitTarget())
{
// for caster applied auras only
Unit::AuraList const &mPeriodic = m_targets.getUnitTarget()->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4) &&
(*i)->GetCasterGUID()==m_caster->GetGUID() )
{
m_targets.getUnitTarget()->RemoveAura((*i)->GetId(), (*i)->GetEffIndex());
break;
}
}
}
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id)) if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(m_spellInfo->Id))
{ {
for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i) for(std::vector<int32>::const_iterator i = spell_triggered->begin(); i != spell_triggered->end(); ++i)
@@ -2250,13 +2229,10 @@ void Spell::cast(bool skipCheck)
return; return;
} }
SendCastResult(castResult); SendCastResult(castResult);
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()... SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
for(int i = 0; i < 3; ++i) CalculateDamageDoneForAllTargets();
m_currentBasePoints[i] = CalculateDamage(i, NULL);
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells // Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo)) if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo))
@@ -2398,17 +2374,6 @@ void Spell::_handle_immediate_phase()
// Don't do spell log, if is school damage spell // Don't do spell log, if is school damage spell
if(m_spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE || m_spellInfo->Effect[j] == 0) if(m_spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE || m_spellInfo->Effect[j] == 0)
m_needSpellLog = false; m_needSpellLog = false;
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[j];
if(m_originalCaster)
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, EffectChainTarget, this);
// initialize multipliers
m_damageMultipliers[j] = 1.0f;
if( (m_spellInfo->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE || m_spellInfo->EffectImplicitTargetA[j] == TARGET_CHAIN_HEAL) &&
(EffectChainTarget > 1) )
m_applyMultiplierMask |= 1 << j;
} }
// initialize Diminishing Returns Data // initialize Diminishing Returns Data
@@ -3287,7 +3252,7 @@ void Spell::HandleThreatSpells(uint32 spellId)
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat); DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat);
} }
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier) void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float /*DamageMultiplier*/)
{ {
unitTarget = pUnitTarget; unitTarget = pUnitTarget;
itemTarget = pItemTarget; itemTarget = pItemTarget;
@@ -3296,14 +3261,15 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
uint8 eff = m_spellInfo->Effect[i]; uint8 eff = m_spellInfo->Effect[i];
uint32 mechanic = m_spellInfo->EffectMechanic[i]; uint32 mechanic = m_spellInfo->EffectMechanic[i];
damage = int32(m_currentBasePoints[i] * DamageMultiplier);
sLog.outDebug( "Spell: Effect : %u", eff); sLog.outDebug( "Spell: Effect : %u", eff);
//Simply return. Do not display "immune" in red text on client //Simply return. Do not display "immune" in red text on client
if(unitTarget && unitTarget->IsImmunedToSpellEffect(eff, mechanic)) if(unitTarget && unitTarget->IsImmunedToSpellEffect(eff, mechanic))
return; return;
//we do not need DamageMultiplier here.
damage = CalculateDamage(i, NULL);
if(eff<TOTAL_SPELL_EFFECTS) if(eff<TOTAL_SPELL_EFFECTS)
{ {
//sLog.outDebug( "WORLD: Spell FX %d < TOTAL_SPELL_EFFECTS ", eff); //sLog.outDebug( "WORLD: Spell FX %d < TOTAL_SPELL_EFFECTS ", eff);
@@ -3924,7 +3890,8 @@ uint8 Spell::CanCast(bool strict)
SkillValue = 0; SkillValue = 0;
// add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value) // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value)
SkillValue += m_currentBasePoints[i]/*+1*/; // TODO: is this a hack?
SkillValue += m_currentBasePoints[i]+1;
// get the required lock value // get the required lock value
int32 ReqValue=0; int32 ReqValue=0;
@@ -5152,7 +5119,7 @@ Unit* Spell::SelectMagnetTarget()
{ {
if (targetGUID == ihit->targetGUID) // Found in list if (targetGUID == ihit->targetGUID) // Found in list
{ {
(*ihit).killTarget = true; (*ihit).damage = target->GetHealth();
break; break;
} }
} }
@@ -5330,4 +5297,78 @@ bool Spell::IsValidSingleTargetSpell(Unit const* target) const
// return false; // return false;
} }
return true; return true;
}
void Spell::CalculateDamageDoneForAllTargets()
{
float multiplier[3];
for(int i = 0; i < 3; ++i)
{
if ( m_applyMultiplierMask & (1 << i) )
{
// Get multiplier
multiplier[i] = m_spellInfo->DmgMultiplier[i];
// Apply multiplier mods
if(m_originalCaster)
if(Player* modOwner = m_originalCaster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_EFFECT_PAST_FIRST, multiplier[i], this);
}
}
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
TargetInfo target = *ihit;
uint32 mask = target.effectMask;
if(!mask)
continue;
Unit* unit = m_caster->GetGUID()==target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID);
if (!unit)
continue;
if (target.missCondition==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
target.damage += CalculateDamageDone(unit, mask, multiplier);
else if (target.missCondition == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
{
if (target.reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
target.damage += CalculateDamageDone(m_caster, mask, multiplier);
}
}
}
int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *multiplier)
{
m_damage = 0;
unitTarget = unit;
for(uint32 i = 0; i < 3; ++i)
{
if (effectMask & (1<<i))
{
if(m_applyMultiplierMask & (1 << i))
{
damage = CalculateDamage(i, NULL) * m_damageMultipliers[i];
m_damageMultipliers[i] *= multiplier[i];
}
else
damage = CalculateDamage(i, NULL);
switch(m_spellInfo->Effect[i])
{
case SPELL_EFFECT_SCHOOL_DAMAGE:
SpellDamageSchoolDmg(i);
break;
case SPELL_EFFECT_WEAPON_DAMAGE:
case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
case SPELL_EFFECT_NORMALIZED_WEAPON_DMG:
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
SpellDamageWeaponDmg(i);
break;
case SPELL_EFFECT_HEAL:
SpellDamageHeal(i);
break;
}
}
}
return m_damage;
} }
+6 -1
View File
@@ -505,7 +505,7 @@ class Spell
SpellMissInfo reflectResult:8; SpellMissInfo reflectResult:8;
uint8 effectMask:8; uint8 effectMask:8;
bool processed:1; bool processed:1;
bool killTarget:1; int32 damage;
}; };
std::list<TargetInfo> m_UniqueTargetInfo; std::list<TargetInfo> m_UniqueTargetInfo;
uint8 m_needAliveTargetMask; // Mask req. alive targets uint8 m_needAliveTargetMask; // Mask req. alive targets
@@ -542,6 +542,11 @@ class Spell
void SearchChainTarget(std::list<Unit*> &data, Unit* pUnitTarget, float max_range, uint32 unMaxTargets); void SearchChainTarget(std::list<Unit*> &data, Unit* pUnitTarget, float max_range, uint32 unMaxTargets);
bool IsValidSingleTargetEffect(Unit const* target, Targets type) const; bool IsValidSingleTargetEffect(Unit const* target, Targets type) const;
bool IsValidSingleTargetSpell(Unit const* target) const; bool IsValidSingleTargetSpell(Unit const* target) const;
void CalculateDamageDoneForAllTargets();
int32 CalculateDamageDone(Unit *unit, const uint32 effectMask, float *multiplier);
void SpellDamageSchoolDmg(uint32 i);
void SpellDamageWeaponDmg(uint32 i);
void SpellDamageHeal(uint32 i);
// ------------------------------------------- // -------------------------------------------
//List For Triggered Spells //List For Triggered Spells
+62 -37
View File
@@ -301,6 +301,10 @@ void Spell::EffectEnvirinmentalDMG(uint32 i)
} }
void Spell::EffectSchoolDMG(uint32 effect_idx) void Spell::EffectSchoolDMG(uint32 effect_idx)
{
}
void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
{ {
if( unitTarget && unitTarget->isAlive()) if( unitTarget && unitTarget->isAlive())
{ {
@@ -395,6 +399,22 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE)) if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE))
damage += int32(damage*0.25); damage += int32(damage*0.25);
} }
// Conflagrate - consumes immolate
if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
{
// for caster applied auras only
Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4) &&
(*i)->GetCasterGUID()==m_caster->GetGUID() )
{
unitTarget->RemoveAurasDueToCasterSpell((*i)->GetId(), m_caster->GetGUID());
break;
}
}
}
break; break;
} }
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
@@ -532,6 +552,23 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
{ {
int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE)); int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE));
damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f); damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f);
bool found = false;
// check dazed affect
Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
for(Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
{
if((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0)
{
found = true;
break;
}
}
//TODO: should this be put on taken but not done?
if(found)
m_damage += m_spellInfo->EffectBasePoints[1];
} }
//Explosive Trap Effect //Explosive Trap Effect
else if(m_spellInfo->SpellFamilyFlags & 0x00000004) else if(m_spellInfo->SpellFamilyFlags & 0x00000004)
@@ -1258,7 +1295,7 @@ void Spell::EffectDummy(uint32 i)
//Life Tap (only it have this with dummy effect) //Life Tap (only it have this with dummy effect)
if (m_spellInfo->SpellFamilyFlags == 0x40000) if (m_spellInfo->SpellFamilyFlags == 0x40000)
{ {
float cost = m_currentBasePoints[0];//+1; float cost = damage;
if(Player* modOwner = m_caster->GetSpellModOwner()) if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, cost,this); modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, cost,this);
@@ -1378,29 +1415,6 @@ void Spell::EffectDummy(uint32 i)
} }
break; break;
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
// Steady Shot
if(m_spellInfo->SpellFamilyFlags & 0x100000000LL)
{
if( !unitTarget || !unitTarget->isAlive())
return;
bool found = false;
// check dazed affect
Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
for(Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
{
if((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0)
{
found = true;
break;
}
}
if(found)
m_damage+= damage;
return;
}
// Kill command // Kill command
if(m_spellInfo->SpellFamilyFlags & 0x00080000000000LL) if(m_spellInfo->SpellFamilyFlags & 0x00080000000000LL)
{ {
@@ -2077,7 +2091,7 @@ void Spell::EffectApplyAura(uint32 i)
sLog.outDebug("Spell: Aura is: %u", m_spellInfo->EffectApplyAuraName[i]); sLog.outDebug("Spell: Aura is: %u", m_spellInfo->EffectApplyAuraName[i]);
Aura* Aur = CreateAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, caster, m_CastItem); Aura* Aur = CreateAura(m_spellInfo, i, &damage, unitTarget, caster, m_CastItem);
// Now Reduce spell duration using data received at spell hit // Now Reduce spell duration using data received at spell hit
int32 duration = Aur->GetAuraMaxDuration(); int32 duration = Aur->GetAuraMaxDuration();
@@ -2127,7 +2141,7 @@ void Spell::EffectApplyAura(uint32 i)
if (AdditionalSpellInfo) if (AdditionalSpellInfo)
{ {
// applied at target by target // applied at target by target
Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, 0, &m_currentBasePoints[0], unitTarget,unitTarget, 0); Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, 0, NULL, unitTarget,unitTarget, 0);
unitTarget->AddAura(AdditionalAura); unitTarget->AddAura(AdditionalAura);
sLog.outDebug("Spell: Additional Aura is: %u", AdditionalSpellInfo->EffectApplyAuraName[0]); sLog.outDebug("Spell: Additional Aura is: %u", AdditionalSpellInfo->EffectApplyAuraName[0]);
} }
@@ -2294,10 +2308,16 @@ void Spell::EffectPowerBurn(uint32 i)
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier); modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
new_damage = int32(new_damage*multiplier); new_damage = int32(new_damage*multiplier);
m_damage+=new_damage; //m_damage+=new_damage; should not apply spell bonus
//TODO: no log
unitTarget->ModifyHealth(-new_damage);
} }
void Spell::EffectHeal( uint32 /*i*/ ) void Spell::EffectHeal( uint32 /*i*/ )
{
}
void Spell::SpellDamageHeal(uint32 /*i*/)
{ {
if( unitTarget && unitTarget->isAlive() && damage >= 0) if( unitTarget && unitTarget->isAlive() && damage >= 0)
{ {
@@ -2369,7 +2389,7 @@ void Spell::EffectHeal( uint32 /*i*/ )
else else
addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget); addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget);
m_healing+=addhealth; m_damage -= addhealth;
} }
} }
@@ -2470,7 +2490,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
// TODO: maybe all this can be replaced by using correct calculated `damage` value // TODO: maybe all this can be replaced by using correct calculated `damage` value
if(pProto->Class != ITEM_CLASS_CONSUMABLE || m_spellInfo->SpellFamilyName != SPELLFAMILY_MAGE) if(pProto->Class != ITEM_CLASS_CONSUMABLE || m_spellInfo->SpellFamilyName != SPELLFAMILY_MAGE)
{ {
num_to_add = m_currentBasePoints[i]; num_to_add = damage;
/*int32 basePoints = m_currentBasePoints[i]; /*int32 basePoints = m_currentBasePoints[i];
int32 randomPoints = m_spellInfo->EffectDieSides[i]; int32 randomPoints = m_spellInfo->EffectDieSides[i];
if (randomPoints) if (randomPoints)
@@ -2482,7 +2502,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
num_to_add = 1; num_to_add = 1;
else if(player->getLevel() >= m_spellInfo->spellLevel) else if(player->getLevel() >= m_spellInfo->spellLevel)
{ {
num_to_add = m_currentBasePoints[i]; num_to_add = damage;
/*int32 basePoints = m_currentBasePoints[i]; /*int32 basePoints = m_currentBasePoints[i];
float pointPerLevel = m_spellInfo->EffectRealPointsPerLevel[i]; float pointPerLevel = m_spellInfo->EffectRealPointsPerLevel[i];
num_to_add = basePoints + 1 + uint32((player->getLevel() - m_spellInfo->spellLevel)*pointPerLevel);*/ num_to_add = basePoints + 1 + uint32((player->getLevel() - m_spellInfo->spellLevel)*pointPerLevel);*/
@@ -2896,7 +2916,7 @@ void Spell::EffectOpenLock(uint32 /*i*/)
SkillId = SKILL_LOCKPICKING; SkillId = SKILL_LOCKPICKING;
// skill bonus provided by casting spell (mostly item spells) // skill bonus provided by casting spell (mostly item spells)
uint32 spellSkillBonus = uint32(m_currentBasePoints[0]/*+1*/); uint32 spellSkillBonus = uint32(damage/*m_currentBasePoints[0]+1*/);
uint32 reqSkillValue = lockInfo->requiredminingskill; uint32 reqSkillValue = lockInfo->requiredminingskill;
@@ -3076,7 +3096,7 @@ void Spell::EffectApplyAreaAura(uint32 i)
if(!unitTarget->isAlive()) if(!unitTarget->isAlive())
return; return;
AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster, m_CastItem); AreaAura* Aur = new AreaAura(m_spellInfo, i, &damage, unitTarget, m_caster, m_CastItem);
unitTarget->AddAura(Aur); unitTarget->AddAura(Aur);
} }
@@ -4178,6 +4198,10 @@ void Spell::EffectTaunt(uint32 /*i*/)
} }
void Spell::EffectWeaponDmg(uint32 i) void Spell::EffectWeaponDmg(uint32 i)
{
}
void Spell::SpellDamageWeaponDmg(uint32 i)
{ {
if(!unitTarget) if(!unitTarget)
return; return;
@@ -4464,9 +4488,10 @@ void Spell::EffectHealMaxHealth(uint32 /*i*/)
if(!unitTarget->isAlive()) if(!unitTarget->isAlive())
return; return;
uint32 heal = m_caster->GetMaxHealth(); uint32 addhealth = unitTarget->GetMaxHealth() - unitTarget->GetHealth();
unitTarget->SetHealth(unitTarget->GetMaxHealth());
m_healing+=heal; if(m_originalCaster)
m_originalCaster->SendHealSpellLog(unitTarget, m_spellInfo->Id, addhealth, false);
} }
void Spell::EffectInterruptCast(uint32 i) void Spell::EffectInterruptCast(uint32 i)
@@ -5306,7 +5331,7 @@ void Spell::EffectEnchantHeldItem(uint32 i)
uint32 enchant_id = m_spellInfo->EffectMiscValue[i]; uint32 enchant_id = m_spellInfo->EffectMiscValue[i];
int32 duration = GetSpellDuration(m_spellInfo); //Try duration index first .. int32 duration = GetSpellDuration(m_spellInfo); //Try duration index first ..
if(!duration) if(!duration)
duration = m_currentBasePoints[i];//+1; //Base points after .. duration = damage;//+1; //Base points after ..
if(!duration) if(!duration)
duration = 10; //10 seconds for enchants which don't have listed duration duration = 10; //10 seconds for enchants which don't have listed duration
@@ -5612,7 +5637,7 @@ void Spell::EffectReputation(uint32 i)
Player *_player = (Player*)unitTarget; Player *_player = (Player*)unitTarget;
int32 rep_change = m_currentBasePoints[i];//+1; // field store reputation change -1 int32 rep_change = damage;//+1; // field store reputation change -1
uint32 faction_id = m_spellInfo->EffectMiscValue[i]; uint32 faction_id = m_spellInfo->EffectMiscValue[i];
+2
View File
@@ -8606,8 +8606,10 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
TakenTotalMod *= (mod+100.0f)/100.0f; TakenTotalMod *= (mod+100.0f)/100.0f;
} }
break; break;
//This is changed in WLK, using aura 255
//Mangle //Mangle
case 2312: case 2312:
case 44955:
for(int j=0;j<3;j++) for(int j=0;j<3;j++)
{ {
if(GetEffectMechanic(spellProto, j)==MECHANIC_BLEED) if(GetEffectMechanic(spellProto, j)==MECHANIC_BLEED)