aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/CMakeLists.txt1
-rw-r--r--src/server/scripts/Northrend/isle_of_conquest.cpp72
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp72
-rwxr-xr-xsrc/server/scripts/World/achievement_scripts.cpp52
4 files changed, 197 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt
index cad76883781..f1c80b14bd1 100644
--- a/src/server/scripts/Northrend/CMakeLists.txt
+++ b/src/server/scripts/Northrend/CMakeLists.txt
@@ -1,5 +1,6 @@
set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
+ Northrend/isle_of_conquest.cpp
Northrend/storm_peaks.cpp
Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp
Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp
new file mode 100644
index 00000000000..b70f8de4b4c
--- /dev/null
+++ b/src/server/scripts/Northrend/isle_of_conquest.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptPCH.h"
+#include "BattlegroundIC.h"
+
+// TO-DO: This should be done with SmartAI, but yet it does not correctly support vehicles's AIs.
+// Even adding ReactState Passive we still have issues using SmartAI.
+
+class npc_four_car_garage : public CreatureScript
+{
+ public:
+ npc_four_car_garage() : CreatureScript("npc_four_car_garage") {}
+
+ struct npc_four_car_garageAI : public NullCreatureAI
+ {
+ npc_four_car_garageAI(Creature* pCreature) : NullCreatureAI(pCreature) { }
+
+ void PassengerBoarded(Unit* who, int8 seatId, bool apply)
+ {
+ if (apply)
+ {
+ uint32 spellId = 0;
+
+ switch(me->GetEntry())
+ {
+ case NPC_DEMOLISHER:
+ spellId = 68365;
+ break;
+ case NPC_GLAIVE_THROWER:
+ spellId = 68363;
+ break;
+ case NPC_SIEGE_ENGINE_H:
+ case NPC_SIEGE_ENGINE_A:
+ spellId = 68364;
+ break;
+ case NPC_CATAPULT:
+ spellId = 68362;
+ break;
+ default:
+ return;
+ }
+
+ me->CastSpell(who,spellId,true);
+ }
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_four_car_garageAI(creature);
+ }
+};
+
+void AddSC_isle_of_conquest()
+{
+ new npc_four_car_garage();
+} \ No newline at end of file
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index a7510b97ff3..3b1a535fcfe 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -635,6 +635,76 @@ public:
}
};
+class spell_gen_gunship_portal : public SpellScriptLoader
+{
+public:
+ spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { }
+
+ class spell_gen_gunship_portalSpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_gunship_portalSpellScript)
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (!caster->ToPlayer())
+ return;
+
+ if (Battleground *bg = caster->ToPlayer()->GetBattleground())
+ {
+ if (bg->GetTypeID(true) == BATTLEGROUND_IC)
+ bg->DoAction(1,caster->GetGUID());
+ }
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_gen_gunship_portalSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_gunship_portalSpellScript();
+ }
+};
+
+enum parachuteIC
+{
+ SPELL_PARACHUTE_IC = 66657
+};
+
+class spell_gen_parachute_ic : public SpellScriptLoader
+{
+ public:
+ spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { }
+
+ class spell_gen_parachute_icAuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_parachute_icAuraScript)
+
+ void HandleTriggerSpell(AuraEffect const * /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+
+ if (!target->ToPlayer())
+ return;
+
+ if (target->ToPlayer()->m_movementInfo.fallTime > 2000)
+ target->CastSpell(target,SPELL_PARACHUTE_IC,true);
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_icAuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript *GetAuraScript() const
+ {
+ return new spell_gen_parachute_icAuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -651,4 +721,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_animal_blood();
new spell_gen_shroud_of_death();
new spell_gen_divine_storm_cd_reset();
+ new spell_gen_parachute_ic();
+ new spell_gen_gunship_portal();
}
diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp
index 4b9f4470450..385e973ee78 100755
--- a/src/server/scripts/World/achievement_scripts.cpp
+++ b/src/server/scripts/World/achievement_scripts.cpp
@@ -18,6 +18,7 @@
#include "ScriptPCH.h"
#include "BattlegroundAB.h"
#include "BattlegroundWS.h"
+#include "BattlegroundIC.h"
class achievement_school_of_hard_knocks : public AchievementCriteriaScript
{
@@ -116,6 +117,54 @@ class achievement_save_the_day : public AchievementCriteriaScript
}
};
+class achievement_bg_ic_resource_glut : public AchievementCriteriaScript
+{
+ public:
+ achievement_bg_ic_resource_glut() : AchievementCriteriaScript("achievement_bg_ic_resource_glut") { }
+
+ bool OnCheck(Player* source, Unit* /*target*/)
+ {
+ if (source->HasAura(SPELL_OIL_REFINERY) && source->HasAura(SPELL_QUARRY))
+ return true;
+
+ return false;
+ }
+};
+
+class achievement_bg_ic_glaive_grave : public AchievementCriteriaScript
+{
+ public:
+ achievement_bg_ic_glaive_grave() : AchievementCriteriaScript("achievement_bg_ic_glaive_grave") { }
+
+ bool OnCheck(Player* source, Unit* target)
+ {
+ if (Creature* vehicle = source->GetVehicleCreatureBase())
+ {
+ if (vehicle->GetEntry() == 35273 || vehicle->GetEntry() == 34802)
+ return true;
+ }
+
+ return false;
+ }
+};
+
+class achievement_bg_ic_mowed_down : public AchievementCriteriaScript
+{
+ public:
+ achievement_bg_ic_mowed_down() : AchievementCriteriaScript("achievement_bg_ic_mowed_down") { }
+
+ bool OnCheck(Player* source, Unit* target)
+ {
+ if (Creature* vehicle = source->GetVehicleCreatureBase())
+ {
+ if (vehicle->GetEntry() == NPC_KEEP_CANNON)
+ return true;
+ }
+
+ return false;
+ }
+};
+
void AddSC_achievement_scripts()
{
new achievement_school_of_hard_knocks();
@@ -123,4 +172,7 @@ void AddSC_achievement_scripts()
new achievement_resilient_victory();
new achievement_bg_control_all_nodes();
new achievement_save_the_day();
+ new achievement_bg_ic_resource_glut();
+ new achievement_bg_ic_glaive_grave();
+ new achievement_bg_ic_mowed_down();
}