mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
Scripts/Ogri'La: Add support for quest "Bomb Them Again" and all related
* Sniffed spell support for Knockdown Fel Cannon: Choose Loc, Knockdown Fel Cannon: The Aggro Check, Knockdown Fel Cannon: The Aggro Burst, Knockdown Fel Cannon: The Aggro Check Aura, Trhow Bomb and Fel Flak Fire * Sniffed spawns support, but only for quest related creatures and gos, no area patrols/spawns involved * Achievement support for Blade's Edge Bomberman and Fa-la-la-la-Ogri'la * Full DB support based on sniffs, all that can be done in SAI and not in *cpp is converted Credits: The SAI script is based on Warpen work, thanks to Subv for proposing fix for Fel Flak Fire /and helping/ and DDuarte for helping with conditions Closes: Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GridNotifiers.h"
|
||||
|
||||
class spell_generic_quest_update_entry_SpellScript : public SpellScript
|
||||
{
|
||||
@@ -1314,6 +1315,180 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad
|
||||
}
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/quest=11010 "Bombing Run", http://www.wowhead.com/quest=11102 "Bombing Run" /druid/ and http://www.wowhead.com/quest=11023 "Bomb Them Again!"
|
||||
enum Quest11010_11102_11023Data
|
||||
{
|
||||
// Spell
|
||||
SPELL_FLAK_CANNON_TRIGGER = 40110,
|
||||
SPELL_CHOOSE_LOC = 40056,
|
||||
SPELL_AGGRO_CHECK = 40112,
|
||||
// NPCs
|
||||
NPC_FEL_CANNON2 = 23082
|
||||
};
|
||||
|
||||
// 40113 Knockdown Fel Cannon: The Aggro Check Aura
|
||||
class spell_q11010_q11102_q11023_aggro_check_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q11010_q11102_q11023_aggro_check_aura() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check_aura") { }
|
||||
|
||||
class spell_q11010_q11102_q11023_aggro_check_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript);
|
||||
|
||||
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
// On trigger proccing
|
||||
target->CastSpell(target, SPELL_AGGRO_CHECK);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_aggro_check_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 40112 Knockdown Fel Cannon: The Aggro Check
|
||||
class spell_q11010_q11102_q11023_aggro_check : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q11010_q11102_q11023_aggro_check() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check") { }
|
||||
|
||||
class spell_q11010_q11102_q11023_aggro_check_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q11010_q11102_q11023_aggro_check_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* playerTarget = GetHitPlayer())
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
{
|
||||
playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q11010_q11102_q11023_aggro_check_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_aggro_check_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 40119 Knockdown Fel Cannon: The Aggro Burst
|
||||
class spell_q11010_q11102_q11023_aggro_burst : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q11010_q11102_q11023_aggro_burst() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_burst") { }
|
||||
|
||||
class spell_q11010_q11102_q11023_aggro_burst_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q11010_q11102_q11023_aggro_burst_AuraScript);
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
// On each tick cast Choose Loc to trigger summon
|
||||
target->CastSpell(target, SPELL_CHOOSE_LOC);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_burst_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_aggro_burst_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 40056 Knockdown Fel Cannon: Choose Loc
|
||||
class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q11010_q11102_q11023_choose_loc() : SpellScriptLoader("spell_q11010_q11102_q11023_choose_loc") { }
|
||||
|
||||
class spell_q11010_q11102_q11023_choose_loc_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q11010_q11102_q11023_choose_loc_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
// Check for player that is in 65 y range
|
||||
std::list<Player*> PlayerList;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f);
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, PlayerList, checker);
|
||||
caster->VisitNearbyWorldObject(65.0f, searcher);
|
||||
for (std::list<Player*>::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
{
|
||||
// Summom Fel Cannon (bunny version) at found player
|
||||
caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_q11010_q11102_q11023_choose_loc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_choose_loc_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q11010_q11102_q11023_throw_bomb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q11010_q11102_q11023_throw_bomb() : SpellScriptLoader("spell_q11010_q11102_q11023_throw_bomb") { }
|
||||
|
||||
class spell_q11010_q11102_q11023_throw_bomb_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q11010_q11102_q11023_throw_bomb_SpellScript);
|
||||
|
||||
SpellCastResult CheckRequirement()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
// This spell will be casted only if caster has one of these auras
|
||||
if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_q11010_q11102_q11023_throw_bomb_SpellScript::CheckRequirement);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q11010_q11102_q11023_throw_bomb_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q55_sacred_cleansing();
|
||||
@@ -1345,4 +1520,9 @@ void AddSC_quest_spell_scripts()
|
||||
new spell_q12735_song_of_cleansing();
|
||||
new spell_q12372_cast_from_gossip_trigger();
|
||||
new spell_q12372_destabilize_azure_dragonshrine_dummy();
|
||||
}
|
||||
new spell_q11010_q11102_q11023_aggro_check_aura();
|
||||
new spell_q11010_q11102_q11023_aggro_check();
|
||||
new spell_q11010_q11102_q11023_aggro_burst();
|
||||
new spell_q11010_q11102_q11023_choose_loc();
|
||||
new spell_q11010_q11102_q11023_throw_bomb();
|
||||
}
|
||||
Reference in New Issue
Block a user