aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-05-27 22:14:58 +0200
committerKudlaty <none@none>2009-05-27 22:14:58 +0200
commitdc1c900048966279e87db0e3623bf2a6b46df69e (patch)
tree0c928df9ff9ade59366ba3ac17fec9ee2394024c
parent4ce92ed6fa6c73de41169669f7df0f35611d072e (diff)
Add fix for quest 12680
--HG-- branch : trunk
-rw-r--r--sql/updates/3601_world.sql8
-rw-r--r--sql/world_scripts_full.sql1
-rw-r--r--sql/world_spell_full.sql8
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp37
4 files changed, 54 insertions, 0 deletions
diff --git a/sql/updates/3601_world.sql b/sql/updates/3601_world.sql
new file mode 100644
index 00000000000..0230669b1c5
--- /dev/null
+++ b/sql/updates/3601_world.sql
@@ -0,0 +1,8 @@
+UPDATE creature_template SET `VehicleId`=200 WHERE `entry` IN (28605,28606,28607);
+UPDATE creature_template SET `ScriptName`='npc_salanar_the_horseman' WHERE `entry`=28653;
+
+DELETE FROM npc_spellclick_spells WHERE `npc_entry` IN (28605,28606,28607);
+INSERT INTO npc_spellclick_spells (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES
+(28605, 52263, 12680, 3, 1),
+(28606, 52263, 12680, 3, 1),
+(28607, 52263, 12680, 3, 1);
diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql
index 97e4d15ca49..8bc58973f2c 100644
--- a/sql/world_scripts_full.sql
+++ b/sql/world_scripts_full.sql
@@ -103,6 +103,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate_anchor' WHERE
UPDATE `creature_template` SET `ScriptName`='npc_kingdom_of_dalaran_quests' WHERE `entry` IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162);
UPDATE `creature_template` SET `ScriptName`='npc_taxi' WHERE `entry` IN (17435, 23413, 18725, 19401, 19409, 20235, 25059, 25236, 20903, 20162, 29154, 23415, 27575, 26443, 26949, 23816);
UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406;
+UPDATE `creature_template` SET `ScriptName`='npc_salanar_the_horseman' WHERE `entry`=28653;
/* */
/* ZONE */
diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql
index 08a95ff1b39..bb50e70e3d7 100644
--- a/sql/world_spell_full.sql
+++ b/sql/world_spell_full.sql
@@ -172,6 +172,12 @@ INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_id`, `quest
('29488', '54568', '12670', '1', '3'),
('29501', '54575', '12670', '1', '3');
+DELETE FROM npc_spellclick_spells WHERE `npc_entry` IN (28605,28606,28607);
+INSERT INTO npc_spellclick_spells (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES
+(28605, 52263, 12680, 3, 1),
+(28606, 52263, 12680, 3, 1),
+(28607, 52263, 12680, 3, 1);
+
-- --------
-- TARGET
-- --------
@@ -1548,6 +1554,8 @@ spell4 = VALUES(spell4);
-- Three-seat mammoth
UPDATE creature_template SET VehicleId = 312 WHERE entry IN (31857,31858,31861,31862,32212,32213,32633,32640);
+-- Horses for quest 12680 / not sure if its offilike
+UPDATE creature_template SET `VehicleId`=200 WHERE `entry` IN (28605,28606,28607);
-- --------
-- Death Knight
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
index 4821269e2a1..b241be0f7d7 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
@@ -461,6 +461,38 @@ bool GossipSelect_npc_death_knight_initiate(Player *player, Creature *_Creature,
return true;
}
+/*######
+## npc_salanar_the_horseman
+######*/
+
+struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI
+{
+ npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {Reset();}
+
+ void Reset() { }
+
+ void MoveInLineOfSight(Unit *who)
+ {
+ if( (who->GetTypeId() == TYPEID_UNIT) && ((Creature*)who)->isVehicle() && m_creature->IsWithinDistInMap(who, 25.0f) )
+ {
+ if( Unit *charmer = who->GetCharmer() )
+ {
+ if( charmer->GetTypeId() == TYPEID_PLAYER && ((Player*)charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE )
+ {
+ ((Player*)charmer)->KilledMonster(28767,m_creature->GetGUID());
+ ((Player*)charmer)->ExitVehicle();
+ // TODO: dismiss Vehicle; Now we cant do it from script.
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_salanar_the_horseman(Creature *_Creature)
+{
+ return new npc_salanar_the_horsemanAI(_Creature);
+}
+
void AddSC_the_scarlet_enclave()
{
Script *newscript;
@@ -486,4 +518,9 @@ void AddSC_the_scarlet_enclave()
newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate;
newscript->GetAI = &GetAI_npc_death_knight_initiate;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_salanar_the_horseman";
+ newscript->GetAI = &GetAI_npc_salanar_the_horseman;
+ newscript->RegisterSelf();
} \ No newline at end of file