Scripts/Trial of the Crusader:

1) Fix Leeching Swarm damage and create spell difficulty links to code. Closes  issue #4909 .
2) Fix Valkyr's Touch. Closes  issue #4553 .
3) Fix Permafrost aura difficulty check.
4) Reduce Slime Pool damage range.
5) Avoid Shaman Champion Heroism spam using 5 minutes (CD) as timer.
6) Fix many spell target selection to only select players (no more totens or pets).
7) Fix Anub'arak Spike being able to receibe the permafrost aura in order to cast spike fail, hopefully.
This commit is contained in:
John Holiver authored and leak committed 2010-12-31 06:01:01 +01:00
1 parent d747b8063b
commit 3a053c6cd3
10 files changed
+47 -28

No files matched your search

+5
View File
@@ -26878,6 +26878,11 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 71900, 'spell_blood_queen_bloodbolt'),
( 71901, 'spell_blood_queen_bloodbolt'),
( 71902, 'spell_blood_queen_bloodbolt'),
-- Trial of Crusader
( 66118, 'spell_gen_leeching_swarm'),
( 67630, 'spell_gen_leeching_swarm'),
( 68646, 'spell_gen_leeching_swarm'),
( 68647, 'spell_gen_leeching_swarm'),
-- Ulduar
( 62717, 'spell_ignis_slag_pot'),
( 63477, 'spell_ignis_slag_pot'),
@@ -0,0 +1,6 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN ( 66118, 67630, 68646, 68647 );
INSERT INTO `spell_script_names` VALUES
(66118, 'spell_gen_leeching_swarm'),
(67630, 'spell_gen_leeching_swarm'),
(68646, 'spell_gen_leeching_swarm'),
(68647, 'spell_gen_leeching_swarm');
+1
View File
@@ -1255,6 +1255,7 @@ class Unit : public WorldObject
inline bool HealthAbovePct(int32 pct) const { return GetHealth() * (uint64)100 > GetMaxHealth() * (uint64)pct; }
inline float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
inline uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); }
inline uint32 CountPctFromCurHealth(int32 pct) const { return CalculatePctN(GetHealth(), pct); }
void SetHealth(uint32 val);
void SetMaxHealth(uint32 val);
@@ -2362,16 +2362,23 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
case 65920:
case 65922:
case 65923:
if (caster->HasAura(66193))
{
if (Unit *permafrostCaster = caster->GetAura(66193)->GetCaster())
Unit *permafrostCaster = NULL;
if (caster->HasAura(66193)) permafrostCaster = caster->GetAura(66193)->GetCaster();
if (caster->HasAura(67855)) permafrostCaster = caster->GetAura(67855)->GetCaster();
if (caster->HasAura(67856)) permafrostCaster = caster->GetAura(67856)->GetCaster();
if (caster->HasAura(67857)) permafrostCaster = caster->GetAura(67857)->GetCaster();
if (permafrostCaster)
{
if (Creature *permafrostCasterAsCreature = permafrostCaster->ToCreature())
permafrostCasterAsCreature->ForcedDespawn(3000);
caster->CastSpell(caster, 66181, false);
caster->RemoveAllAuras();
if (Creature *casterAsCreature = caster->ToCreature())
casterAsCreature->DisappearAndDie();
caster->CastSpell(caster, 66181, false);
caster->RemoveAllAuras();
if (Creature *casterAsCreature = caster->ToCreature())
casterAsCreature->DisappearAndDie();
}
}
break;
// Mana Tide
@@ -2387,7 +2394,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
case 54362:
// Slime Pool (Dreadscale & Acidmaw)
case 66882:
target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000), NULL, true, NULL, this);
target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), NULL, true, NULL, this);
return;
// Beacon of Light
case 53563:
@@ -222,7 +222,7 @@ public:
void JustSummoned(Creature* pSummoned)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true);
switch (pSummoned->GetEntry())
{
case NPC_BURROW:
@@ -658,7 +658,7 @@ public:
void Reset()
{
// For an unknown reason this npc isn't recognize the Aura of Permafrost with this flags =/
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_uiTargetGUID = 0;
}
@@ -601,7 +601,7 @@ public:
else
if (!me->HasAura(AURA_SATED))
DoCastAOE(SPELL_BLOODLUST);
m_uiHeroismOrBloodlustTimer = urand(30*IN_MILLISECONDS, 60*IN_MILLISECONDS);
m_uiHeroismOrBloodlustTimer = 300*IN_MILLISECONDS;
} else m_uiHeroismOrBloodlustTimer -= uiDiff;
if (m_uiHexTimer <= uiDiff)
@@ -209,7 +209,7 @@ public:
if (m_uiIncinerateFleshTimer <= uiDiff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{
DoScriptText(EMOTE_INCINERATE, me, pTarget);
DoScriptText(SAY_INCINERATE, me);
@@ -226,7 +226,7 @@ public:
if (m_uiLegionFlameTimer <= uiDiff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
{
DoScriptText(EMOTE_LEGION_FLAME, me, pTarget);
DoCast(pTarget, SPELL_LEGION_FLAME);
@@ -534,14 +534,14 @@ public:
if (m_uiSpinningStrikeTimer <= uiDiff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
DoCast(pTarget, SPELL_SPINNING_STRIKE);
m_uiSpinningStrikeTimer = 30*IN_MILLISECONDS;
} else m_uiSpinningStrikeTimer -= uiDiff;
if (IsHeroic() && m_uiMistressKissTimer <= uiDiff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
DoCast(pTarget, SPELL_MISTRESS_KISS);
m_uiMistressKissTimer = 30*IN_MILLISECONDS;
} else m_uiMistressKissTimer -= uiDiff;
@@ -843,7 +843,7 @@ public:
m_uiStage = 2;
break;
case 2:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
{
m_uiTrampleTargetGUID = pTarget->GetGUID();
me->SetUInt64Value(UNIT_FIELD_TARGET, m_uiTrampleTargetGUID);
@@ -389,7 +389,7 @@ struct boss_twin_baseAI : public ScriptedAI
if (IsHeroic() && m_uiTouchTimer <= uiDiff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true, m_uiOtherEssenceSpellId))
DoCast(pTarget, m_uiTouchSpellId);
me->CastCustomSpell(m_uiTouchSpellId, SPELLVALUE_MAX_TARGETS, 1, pTarget, false);
m_uiTouchTimer = urand(10, 15)*IN_MILLISECONDS;
} m_uiTouchTimer -= uiDiff;
+11 -11
View File
@@ -281,17 +281,17 @@ public:
void HandleEffectPeriodic(AuraEffect const * aurEff)
{
Unit* pTarget = GetTarget();
if (Unit* pCaster = GetCaster())
{
int32 lifeLeeched = pTarget->CountPctFromMaxHealth(aurEff->GetAmount());
if (lifeLeeched < 250)
lifeLeeched = 250;
// Damage
pCaster->CastCustomSpell(pTarget, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
// Heal
pCaster->CastCustomSpell(pCaster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false);
}
if (Unit* pTarget = GetTarget())
if (Unit* pCaster = GetCaster())
{
int32 lifeLeeched = pTarget->CountPctFromCurHealth(aurEff->GetAmount());
if (lifeLeeched < 250)
lifeLeeched = 250;
// Damage
pCaster->CastCustomSpell(pTarget, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false);
// Heal
pCaster->CastCustomSpell(pCaster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false);
}
}
void Register()