aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-21 21:36:37 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-21 21:36:37 +0200
commit78ea0075e1f10c887c81a2794a74273769067fac (patch)
tree8c020ead01431322a4fd89bbdb7f3c683d913f05 /src
parent1e783cc4468271cb5a2d69889805cf8281fd7049 (diff)
Core/Spells: Allow overriding aura stack amount from CastCustomSpell
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h1
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp8
-rwxr-xr-xsrc/server/game/Spells/Spell.h4
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp23
4 files changed, 12 insertions, 24 deletions
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 20a5120f24b..378505be9f9 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -131,6 +131,7 @@ enum SpellValueMod
SPELLVALUE_BASE_POINT2,
SPELLVALUE_RADIUS_MOD,
SPELLVALUE_MAX_TARGETS,
+ SPELLVALUE_AURA_STACK,
};
typedef std::pair<SpellValueMod, int32> CustomSpellValueMod;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index b35a17ba50f..1e76c2712b6 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1483,6 +1483,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
m_originalCaster, (aurSpellInfo == m_spellInfo)? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem);
if (m_spellAura)
{
+ // Set aura stack amount to desired value
+ m_spellAura->SetStackAmount(m_spellValue->AuraStackAmount);
+
// Now Reduce spell duration using data received at spell hit
int32 duration = m_spellAura->GetMaxDuration();
int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, aurSpellInfo);
@@ -7034,7 +7037,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
void Spell::SetSpellValue(SpellValueMod mod, int32 value)
{
- switch(mod)
+ switch (mod)
{
case SPELLVALUE_BASE_POINT0:
m_spellValue->EffectBasePoints[0] = SpellMgr::CalculateSpellEffectBaseAmount(value, m_spellInfo, 0);
@@ -7051,6 +7054,9 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
case SPELLVALUE_MAX_TARGETS:
m_spellValue->MaxAffectedTargets = (uint32)value;
break;
+ case SPELLVALUE_AURA_STACK:
+ m_spellValue->AuraStackAmount = uint8(value);
+ break;
}
}
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 9b6d48624dd..52c16ba5b0e 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -239,16 +239,18 @@ class SpellCastTargets
struct SpellValue
{
- explicit SpellValue(SpellEntry const *proto)
+ explicit SpellValue(SpellEntry const* proto)
{
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
EffectBasePoints[i] = proto->EffectBasePoints[i];
MaxAffectedTargets = proto->MaxAffectedTargets;
RadiusMod = 1.0f;
+ AuraStackAmount = 1;
}
int32 EffectBasePoints[3];
uint32 MaxAffectedTargets;
float RadiusMod;
+ uint8 AuraStackAmount;
};
enum SpellState
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index af5d50fc11c..0928854ef67 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -257,7 +257,7 @@ class boss_professor_putricide : public CreatureScript
// no possible aura seen in sniff adding the aurastate
summon->SetFlag(UNIT_FIELD_AURASTATE, 1 << (AURA_STATE_UNKNOWN22 - 1));
summon->CastSpell(summon, SPELL_GASEOUS_BLOAT_PROC, true);
- summon->CastSpell(summon, SPELL_GASEOUS_BLOAT, false);
+ summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, summon, false);
summon->SetReactState(REACT_PASSIVE);
return;
case NPC_VOLATILE_OOZE:
@@ -710,22 +710,6 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader
public:
spell_putricide_gaseous_bloat() : SpellScriptLoader("spell_putricide_gaseous_bloat") { }
- class spell_putricide_gaseous_bloat_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_putricide_gaseous_bloat_SpellScript);
-
- void ModAuraStack()
- {
- if (Aura* aur = GetHitAura())
- aur->SetStackAmount(10);
- }
-
- void Register()
- {
- AfterHit += SpellHitFn(spell_putricide_gaseous_bloat_SpellScript::ModAuraStack);
- }
- };
-
class spell_putricide_gaseous_bloat_AuraScript : public AuraScript
{
PrepareAuraScript(spell_putricide_gaseous_bloat_AuraScript);
@@ -745,11 +729,6 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader
}
};
- SpellScript* GetSpellScript() const
- {
- return new spell_putricide_gaseous_bloat_SpellScript();
- }
-
AuraScript* GetAuraScript() const
{
return new spell_putricide_gaseous_bloat_AuraScript();