aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql5
-rw-r--r--sql/updates/10910_world_spell_script_names.sql6
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h1
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp23
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp4
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp8
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp2
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp22
10 files changed, 47 insertions, 28 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index d1ec9c60687..dae6a244462 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -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'),
diff --git a/sql/updates/10910_world_spell_script_names.sql b/sql/updates/10910_world_spell_script_names.sql
new file mode 100644
index 00000000000..46e1ff570e0
--- /dev/null
+++ b/sql/updates/10910_world_spell_script_names.sql
@@ -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');
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 3c9de3197ce..0fb06acc4fa 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -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);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 3afd452044b..275a7d38ab8 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -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:
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index ce60df4fdc0..c84f0ae1021 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -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;
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 5b73b399106..6fbd4493661 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -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)
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index 4dd334ed32a..1fcca917b7d 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -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;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index b2c08301332..e5a6705b0e4 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -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);
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index 4e14a2208fa..80e168b3de9 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -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;
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 0f664c3d829..1d35ebf59d4 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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()