That's Abominable for the 3 other quests, and knockbacks for all. (#22127)

This commit is contained in:
PolarCookie
2019-01-05 01:43:53 +01:00
committed by Aokromes
parent be561bef0f
commit fb19f7be1f
2 changed files with 254 additions and 150 deletions

View File

@@ -0,0 +1,27 @@
UPDATE `spell_script_names` SET `ScriptName`='spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576' WHERE `spell_id` = 59576;
UPDATE `spell_script_names` SET `ScriptName`='spell_q12690_burst_at_the_seams_52510' WHERE `spell_id` = 52510;
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death', 'spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579', 'spell_q13264_q13276_q13288_q13289_area_restrict_abom', 'spell_q13264_q13276_q13288_q13289_assign_credit_to_master');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(52593, 'spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death'),
(59579, 'spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579'),
(76245, 'spell_q13264_q13276_q13288_q13289_area_restrict_abom'),
(59590, 'spell_q13264_q13276_q13288_q13289_assign_credit_to_master'),
(60039, 'spell_q13264_q13276_q13288_q13289_assign_credit_to_master'),
(60041, 'spell_q13264_q13276_q13288_q13289_assign_credit_to_master');
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (31692);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (31692) AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(31692,0,0,0, 54,0,100,0,0,0,0,0, 11,76244,2,0,0,0,0, 1,0,0,0,0,0,0,0, 'Reanimated Abomination - On Summoned - Cast "Reanimated Abomination Script"');
DELETE FROM `conditions` WHERE `SourceEntry` IN (59576,59579) AND `SourceTypeOrReferenceId` = 13;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 2, 59576, 0, 0, 31, 0, 3, 31142, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Icy Ghoul'),
(13, 2, 59576, 0, 1, 31, 0, 3, 31147, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Vicious Geist'),
(13, 2, 59576, 0, 2, 31, 0, 3, 31205, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Risen Alliance Soldier'),
(13, 2, 59576, 0, 3, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Players'),
(13, 1, 59579, 0, 0, 31, 0, 3, 31142, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Icy Ghoul'),
(13, 1, 59579, 0, 1, 31, 0, 3, 31147, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Vicious Geist'),
(13, 1, 59579, 0, 2, 31, 0, 3, 31205, 0, 0, 0, 0, '', 'Spell "Burst at the Seams" targets Risen Alliance Soldier');

View File

@@ -1958,178 +1958,251 @@ class spell_q13086_cannons_target : public SpellScriptLoader
}
};
enum ThatsAbominable
{
QUEST_THATS_ABOMINABLE = 13264,
NPC_ICY_GHOUL = 31142,
NPC_RISEN_ALLIANCE_SOLDIERS = 31205,
NPC_VICIOUS_GEIST = 31147,
NPC_RENIMATED_ABOMINATION = 31692,
SPELL_ICY_GHOUL_CREDIT = 59591, // Credit for Icy Ghoul
SPELL_VICIOUS_GEISTS_CREDIT = 60042, // Credit for Vicious Geists
SPELL_RISEN_ALLIANCE_SOLDIERS_CREDIT = 60040, // Credit for Risen Alliance Soldiers
};
class spell_q13264_thats_abominable : public SpellScriptLoader
{
public:
spell_q13264_thats_abominable() : SpellScriptLoader("spell_q13264_thats_abominable") { }
class spell_q13264_thats_abominable_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q13264_thats_abominable_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_ICY_GHOUL_CREDIT,
SPELL_VICIOUS_GEISTS_CREDIT,
SPELL_RISEN_ALLIANCE_SOLDIERS_CREDIT,
});
}
void HandleKnockBack(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Creature* creature = GetHitCreature())
if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
if (Player* player = charmer->ToPlayer())
if (player->GetQuestStatus(QUEST_THATS_ABOMINABLE) == QUEST_STATUS_INCOMPLETE)
if (GiveCreditIfValid(player, creature))
creature->KillSelf();
}
bool GiveCreditIfValid(Player* player, Creature* creature)
{
uint32 entry = creature->GetEntry();
switch(entry)
{
case NPC_ICY_GHOUL:
player->CastSpell(player, SPELL_ICY_GHOUL_CREDIT, true);
return true;
case NPC_VICIOUS_GEIST:
player->CastSpell(player, SPELL_VICIOUS_GEISTS_CREDIT, true);
return true;
case NPC_RISEN_ALLIANCE_SOLDIERS:
player->CastSpell(player, SPELL_RISEN_ALLIANCE_SOLDIERS_CREDIT, true);
return true;
}
return false;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* creature = GetCaster()->ToCreature()) {
creature->KillSelf();
creature->DespawnOrUnsummon();
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q13264_thats_abominable_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
OnEffectHitTarget += SpellEffectFn(spell_q13264_thats_abominable_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q13264_thats_abominable_SpellScript();
}
};
enum BurstAtTheSeams
{
NPC_DRAKKARI_CHIEFTAINK = 29099,
AREA_THE_BROKEN_FRONT = 4507,
AREA_MORD_RETHAR_THE_DEATH_GATE = 4508,
NPC_DRAKKARI_CHIEFTAINK = 29099,
NPC_ICY_GHOUL = 31142,
NPC_VICIOUS_GEIST = 31147,
NPC_RISEN_ALLIANCE_SOLDIERS = 31205,
NPC_RENIMATED_ABOMINATION = 31692,
QUEST_BURST_AT_THE_SEAMS = 12690,
QUEST_FUEL_FOR_THE_FIRE = 12690,
SPELL_BURST_AT_THE_SEAMS = 52510, // Burst at the Seams
SPELL_BURST_AT_THE_SEAMS_DMG = 52508, // Damage spell
SPELL_BURST_AT_THE_SEAMS_DMG_2 = 59580, // Abomination self damage spell
SPELL_BURST_AT_THE_SEAMS_BONE = 52516, // Burst at the Seams:Bone
SPELL_BURST_AT_THE_SEAMS_MEAT = 52520, // Explode Abomination:Meat
SPELL_BURST_AT_THE_SEAMS_BMEAT = 52523, // Explode Abomination:Bloody Meat
SPELL_DRAKKARI_SKULLCRUSHER_CREDIT = 52590, // Credit for Drakkari Skullcrusher
SPELL_SUMMON_DRAKKARI_CHIEFTAIN = 52616, // Summon Drakkari Chieftain
SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT = 52620 // Drakkari Chieftain Kill Credit
SPELL_BLOATED_ABOMINATION_FEIGN_DEATH = 52593,
SPELL_BURST_AT_THE_SEAMS_BONE = 52516,
SPELL_EXPLODE_ABOMINATION_MEAT = 52520,
SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT = 52523,
SPELL_TROLL_EXPLOSION = 52565,
SPELL_EXPLODE_TROLL_MEAT = 52578,
SPELL_EXPLODE_TROLL_BLOODY_MEAT = 52580,
SPELL_BURST_AT_THE_SEAMS_59576 = 59576, //script/knockback, That's Abominable
SPELL_BURST_AT_THE_SEAMS_59579 = 59579, //dummy
SPELL_BURST_AT_THE_SEAMS_52510 = 52510, //script/knockback, Fuel for the Fire
SPELL_BURST_AT_THE_SEAMS_52508 = 52508, //damage 20000
SPELL_BURST_AT_THE_SEAMS_59580 = 59580, //damage 50000
SPELL_ASSIGN_GHOUL_KILL_CREDIT_TO_MASTER = 59590,
SPELL_ASSIGN_GEIST_KILL_CREDIT_TO_MASTER = 60041,
SPELL_ASSIGN_SKELETON_KILL_CREDIT_TO_MASTER = 60039,
SPELL_DRAKKARI_SKULLCRUSHER_CREDIT = 52590,
SPELL_SUMMON_DRAKKARI_CHIEFTAIN = 52616,
SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT = 52620
};
class spell_q12690_burst_at_the_seams : public SpellScriptLoader
class spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576 : public SpellScript
{
public:
spell_q12690_burst_at_the_seams() : SpellScriptLoader("spell_q12690_burst_at_the_seams") { }
PrepareSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576);
class spell_q12690_burst_at_the_seams_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
PrepareSpellScript(spell_q12690_burst_at_the_seams_SpellScript);
SPELL_BURST_AT_THE_SEAMS_59576,
SPELL_BLOATED_ABOMINATION_FEIGN_DEATH,
SPELL_BURST_AT_THE_SEAMS_59579,
SPELL_BURST_AT_THE_SEAMS_BONE,
SPELL_EXPLODE_ABOMINATION_MEAT,
SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT
});
}
bool Validate(SpellInfo const* /*spellInfo*/) override
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* creature = GetCaster()->ToCreature())
{
creature->CastSpell(creature, SPELL_BLOATED_ABOMINATION_FEIGN_DEATH, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59579, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579 : public AuraScript
{
PrepareAuraScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579);
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_TROLL_EXPLOSION, true);
target->CastSpell(target, SPELL_EXPLODE_ABOMINATION_MEAT, true);
target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
target->CastSpell(target, SPELL_EXPLODE_TROLL_BLOODY_MEAT, true);
target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_BONE, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (Unit* caster = GetCaster())
{
switch (target->GetEntry())
{
return ValidateSpellInfo(
{
SPELL_BURST_AT_THE_SEAMS,
SPELL_BURST_AT_THE_SEAMS_DMG,
SPELL_BURST_AT_THE_SEAMS_DMG_2,
SPELL_BURST_AT_THE_SEAMS_BONE,
SPELL_BURST_AT_THE_SEAMS_MEAT,
SPELL_BURST_AT_THE_SEAMS_BMEAT
});
case NPC_ICY_GHOUL:
target->CastSpell(caster, SPELL_ASSIGN_GHOUL_KILL_CREDIT_TO_MASTER, true);
break;
case NPC_VICIOUS_GEIST:
target->CastSpell(caster, SPELL_ASSIGN_GEIST_KILL_CREDIT_TO_MASTER, true);
break;
case NPC_RISEN_ALLIANCE_SOLDIERS:
target->CastSpell(caster, SPELL_ASSIGN_SKELETON_KILL_CREDIT_TO_MASTER, true);
break;
}
}
target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_59580, true);
}
bool Load() override
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectApplyFn(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death : public AuraScript
{
PrepareAuraScript(spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death);
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
if (Creature* creature = target->ToCreature())
creature->SetReactState(REACT_PASSIVE);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (Creature* creature = target->ToCreature())
creature->DespawnOrUnsummon();
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectApplyFn(spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_q13264_q13276_q13288_q13289_area_restrict_abom : public SpellScript
{
PrepareSpellScript(spell_q13264_q13276_q13288_q13289_area_restrict_abom);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* creature = GetHitCreature()) {
uint32 area = creature->GetAreaId();
if (area != AREA_THE_BROKEN_FRONT && area != AREA_MORD_RETHAR_THE_DEATH_GATE)
creature->DespawnOrUnsummon();
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q13264_q13276_q13288_q13289_area_restrict_abom::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_q13264_q13276_q13288_q13289_assign_credit_to_master : public SpellScript
{
PrepareSpellScript(spell_q13264_q13276_q13288_q13289_assign_credit_to_master);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
{
if (Unit* owner = target->GetOwner())
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
owner->CastSpell(owner, GetEffectValue(), true);
}
}
}
void HandleKnockBack(SpellEffIndex /*effIndex*/)
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q13264_q13276_q13288_q13289_assign_credit_to_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_q12690_burst_at_the_seams_52510 : public SpellScript
{
PrepareSpellScript(spell_q12690_burst_at_the_seams_52510);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_BURST_AT_THE_SEAMS_52510,
SPELL_BURST_AT_THE_SEAMS_52508,
SPELL_BURST_AT_THE_SEAMS_59580,
SPELL_BURST_AT_THE_SEAMS_BONE,
SPELL_EXPLODE_ABOMINATION_MEAT,
SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT
});
}
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void HandleKnockBack(SpellEffIndex /*effIndex*/)
{
if (Unit* creature = GetHitCreature())
{
if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
{
if (Unit* creature = GetHitCreature())
if (Player* player = charmer->ToPlayer())
{
if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
if (player->GetQuestStatus(QUEST_FUEL_FOR_THE_FIRE) == QUEST_STATUS_INCOMPLETE)
{
if (Player* player = charmer->ToPlayer())
{
if (player->GetQuestStatus(QUEST_BURST_AT_THE_SEAMS) == QUEST_STATUS_INCOMPLETE)
{
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_MEAT, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BMEAT, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG_2, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_52508, true);
creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59580, true);
player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_BURST_AT_THE_SEAMS, NPC_DRAKKARI_CHIEFTAINK);
if ((count % 20) == 0)
player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
}
}
player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_FUEL_FOR_THE_FIRE, NPC_DRAKKARI_CHIEFTAINK);
if ((count % 20) == 0)
player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
}
}
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q12690_burst_at_the_seams_SpellScript();
}
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_52510::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_52510::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
enum EscapeFromSilverbrook
@@ -2837,8 +2910,12 @@ void AddSC_quest_spell_scripts()
new spell_q12847_summon_soul_moveto_bunny();
new spell_q13011_bear_flank_master();
new spell_q13086_cannons_target();
new spell_q13264_thats_abominable();
new spell_q12690_burst_at_the_seams();
RegisterSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576);
RegisterAuraScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579);
RegisterAuraScript(spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death);
RegisterSpellScript(spell_q13264_q13276_q13288_q13289_area_restrict_abom);
RegisterSpellScript(spell_q13264_q13276_q13288_q13289_assign_credit_to_master);
RegisterSpellScript(spell_q12690_burst_at_the_seams_52510);
new spell_q12308_escape_from_silverbrook_summon_worgen();
new spell_q12308_escape_from_silverbrook();
new spell_q12641_death_comes_from_on_high();