Core/Battleground: Implemented blizzlike script for Isle of Conquest, written by gyullo and me, based on Socolin's and Josh's patch -BIG THANKS TO THEM-

Anyway the map is not yet playable, there are issues not related with the script.

I also want to thanks to QAston, linencloth, Shauren and Machiavelli to be so patient with my questions.
This commit is contained in:
Manuel
2011-01-09 00:00:08 -03:00
parent 57173df80f
commit 5cf76896eb
19 changed files with 2139 additions and 48 deletions

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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();
}