*Allow custom spell to change radius mod.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-29 00:11:15 -05:00
parent 4121087a8e
commit 220dcb65dd
4 changed files with 15 additions and 23 deletions
+6 -21
View File
@@ -923,20 +923,11 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
DoSpellHitOnUnit(m_caster, mask);
}
// Do not take combo points on dodge
if (m_needComboPoints && m_targets.getUnitTargetGUID() == target->targetGUID)
if( missInfo != SPELL_MISS_NONE && missInfo != SPELL_MISS_MISS)
m_needComboPoints = false;
/*else //TODO: This is a hack. need fix
{
uint32 tempMask = 0;
for(uint32 i = 0; i < 3; ++i)
if(m_spellInfo->Effect[i] == SPELL_EFFECT_DUMMY
|| m_spellInfo->Effect[i] == SPELL_EFFECT_TRIGGER_SPELL)
tempMask |= 1<<i;
if(tempMask &= mask)
DoSpellHitOnUnit(unit, tempMask);
}*/
// All calculated do it!
// Do healing and triggers
@@ -1220,15 +1211,6 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
else
unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID());
}
//This is not needed with procflag patch
/*if(m_originalCaster)
{
if(m_customAttr & SPELL_ATTR_CU_EFFECT_HEAL)
m_originalCaster->ProcDamageAndSpell(unit, PROC_FLAG_HEAL, PROC_FLAG_NONE, 0, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
if(m_originalCaster != unit && (m_customAttr & SPELL_ATTR_CU_EFFECT_DAMAGE))
m_originalCaster->ProcDamageAndSpell(unit, PROC_FLAG_HIT_SPELL, PROC_FLAG_STRUCK_SPELL, 0, GetSpellSchoolMask(m_spellInfo), m_spellInfo);
}*/
}
void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
@@ -1515,8 +1497,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
float radius_h, radius_f;
if (m_spellInfo->EffectRadiusIndex[i])
{
radius_h = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
radius_f = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
radius_h = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])) * m_spellValue->RadiusMod;
radius_f = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])) * m_spellValue->RadiusMod;
}
else
{
@@ -5791,6 +5773,9 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
m_spellValue->EffectBasePoints[2] = value - int32(m_spellInfo->EffectBaseDice[2]);
m_currentBasePoints[2] = m_spellValue->EffectBasePoints[2];
break;
case SPELLVALUE_RADIUS_MOD:
m_spellValue->RadiusMod = (float)value / 10000;
break;
case SPELLVALUE_MAX_TARGETS:
m_spellValue->MaxAffectedTargets = (uint32)value;
break;
+3
View File
@@ -213,9 +213,11 @@ struct SpellValue
for(uint32 i = 0; i < 3; ++i)
EffectBasePoints[i] = proto->EffectBasePoints[i];
MaxAffectedTargets = proto->MaxAffectedTargets;
RadiusMod = 1.0f;
}
int32 EffectBasePoints[3];
uint32 MaxAffectedTargets;
float RadiusMod;
};
enum SpellState
@@ -473,6 +475,7 @@ class Spell
void CleanupTargetList();
void SetSpellValue(SpellValueMod mod, int32 value);
//void SetSpellValue(SpellValueMod mod, float value);
protected:
void SendLoot(uint64 guid, LootType loottype);
+5 -2
View File
@@ -2199,10 +2199,13 @@ void AuraEffect::TriggerSpell()
}
// Negative Energy Periodic
case 46284:
{
caster->CastCustomSpell(trigger_spell_id, SPELLVALUE_MAX_TARGETS, m_tickNumber / 10 + 1, NULL, true, NULL, this);
return;
}
// Poison (Grobbulus)
case 28158:
case 54362:
m_target->CastCustomSpell(trigger_spell_id, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000), NULL, true, NULL, this);
return;
}
}
+1
View File
@@ -128,6 +128,7 @@ enum SpellValueMod
SPELLVALUE_BASE_POINT0,
SPELLVALUE_BASE_POINT1,
SPELLVALUE_BASE_POINT2,
SPELLVALUE_RADIUS_MOD,
SPELLVALUE_MAX_TARGETS,
};