Scripts/Spells: quest "That's Abominable"

Port From (https://github.com/TrinityCore/TrinityCore/commit/6d7288356a5de88df1636916d5f2d4f1c37aff4b)
This commit is contained in:
hondacrx
2021-06-23 12:13:15 -04:00
parent 1cebd025fe
commit dd4d434d72
2 changed files with 83 additions and 0 deletions
+78
View File
@@ -125,6 +125,11 @@ namespace Scripts.Spells.Quest
public const uint CreateBearFlank = 56566;
public const uint BearFlankFail = 56569;
//ThatsAbominable
public const uint IcyGhoulCredit = 59591; // Credit for Icy Ghoul
public const uint ViciousGeistsCredit = 60042; // Credit for Vicious Geists
public const uint RisenAllianceSoldiersCredit = 60040; // Credit for Risen Alliance Soldiers
//Burstattheseams
public const uint BurstAtTheSeams = 52510; // Burst At The Seams
public const uint BurstAtTheSeamsDmg = 52508; // Damage Spell
@@ -241,6 +246,12 @@ namespace Scripts.Spells.Quest
public const uint Skytalon = 31583;
public const uint Decoy = 31578;
//ThatsAbominable
public const uint IcyGhoul = 31142;
public const uint RisenAllianceSoldiers = 31205;
public const uint ViciousGeist = 31147;
public const uint RenimatedAbomination = 31692;
//Burstattheseams
public const uint DrakkariChieftaink = 29099;
@@ -274,6 +285,9 @@ namespace Scripts.Spells.Quest
//Quest12372
public const uint WhisperOnHitByForceWhisper = 1;
//ThatsAbominable
public const uint QuestThatsAbominable = 13264;
//BurstAtTheSeams
public const uint QuestIdBurstAtTheSeams = 12690;
}
@@ -1453,6 +1467,70 @@ namespace Scripts.Spells.Quest
}
}
[Script]
class spell_q13264_thats_abominable : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.IcyGhoulCredit, SpellIds.ViciousGeistsCredit, SpellIds.RisenAllianceSoldiersCredit);
}
void HandleKnockBack(uint effIndex)
{
PreventHitDefaultEffect(effIndex);
Creature creature = GetHitCreature();
if (creature != null)
{
Unit charmer = GetCaster().GetCharmerOrOwner();
if (charmer != null)
{
Player player = charmer.ToPlayer();
if (player != null)
if (player.GetQuestStatus(Misc.QuestThatsAbominable) == QuestStatus.Incomplete)
if (GiveCreditIfValid(player, creature))
creature.KillSelf();
}
}
}
bool GiveCreditIfValid(Player player, Creature creature)
{
uint entry = creature.GetEntry();
switch (entry)
{
case CreatureIds.IcyGhoul:
player.CastSpell(player, SpellIds.IcyGhoulCredit, true);
return true;
case CreatureIds.ViciousGeist:
player.CastSpell(player, SpellIds.ViciousGeistsCredit, true);
return true;
case CreatureIds.RisenAllianceSoldiers:
player.CastSpell(player, SpellIds.RisenAllianceSoldiersCredit, true);
return true;
}
return false;
}
void HandleScript(uint effIndex)
{
Creature creature = GetCaster().ToCreature();
if (creature != null)
{
creature.KillSelf();
creature.DespawnOrUnsummon();
}
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleKnockBack, 1, SpellEffectName.KnockBack));
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script]
class spell_q12690_burst_at_the_seams : SpellScript
{
@@ -0,0 +1,5 @@
-- Reanimated Abomination Abilities
UPDATE `creature_template` SET `spell1` = 59564, `spell2` = 59576 WHERE `entry` = 31692;
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_q13264_thats_abominable';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(59576, 'spell_q13264_thats_abominable');