aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2011_10_24_02_world_core_script_support.sql22
-rw-r--r--src/server/scripts/World/go_scripts.cpp78
2 files changed, 93 insertions, 7 deletions
diff --git a/sql/updates/world/2011_10_24_02_world_core_script_support.sql b/sql/updates/world/2011_10_24_02_world_core_script_support.sql
new file mode 100644
index 00000000000..c27d788c3f0
--- /dev/null
+++ b/sql/updates/world/2011_10_24_02_world_core_script_support.sql
@@ -0,0 +1,22 @@
+-- [Q] Of Keys and Cages
+UPDATE `gameobject_template` SET `ScriptName`='go_gjalerbron_cage' WHERE `name`='Gjalerbron Cage';
+UPDATE `gameobject_template` SET `ScriptName`='go_large_gjalerbron_cage' WHERE `entry`=186490;
+DELETE FROM `creature_text` WHERE `entry`=24035;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(24035,0,0, "Avenge my friends who have already been sacrificed",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,1, "I don't want to be sacrificed",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,2, "I don't want to be taken down into the catacombs",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,3, "I think I saw a key on one of those Gjalerbron vrykul up top.",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,4, "I think I saw a key on one of those vrykul.",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,5, "Is there no hero to rescue me?",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,6, "My thanks to you, hero",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,7, "Oh, thank you, thank you",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,8, "Please, let me out of here",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,9, "Thank goodness for you",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,10, "Thank you. I will not forget this",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,11, "The key... you have to find the key",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,12, "The vrykul are evil and must be destroyed",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,13, "They're performing unholy rites down in the catacombs, and I'm about to be the sacrifice",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,14, "This is the end.",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,15, "You have to put a stop to this madness before it's too late",12,0,100,0,0,0,"Gjalerbron Prisoner"),
+(24035,0,16, "You saved my life",12,0,100,0,0,0,"Gjalerbron Prisoner");
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index cdeac03d76e..866b6c38d5c 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -1176,14 +1176,76 @@ public:
class go_massive_seaforium_charge : public GameObjectScript
{
-public:
- go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
+ public:
+ go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
- bool OnGossipHello(Player* /*player*/, GameObject* go)
- {
- go->SetLootState(GO_JUST_DEACTIVATED);
- return true;
- }
+ bool OnGossipHello(Player* /*player*/, GameObject* go)
+ {
+ go->SetLootState(GO_JUST_DEACTIVATED);
+ return true;
+ }
+};
+
+/*######
+## go_gjalerbron_cage
+######*/
+
+enum OfKeysAndCages
+{
+ QUEST_OF_KEYS_AND_CAGES = 11231,
+ NPC_GJALERBRON_PRISONER = 24035,
+ SAY_FREE = 0,
+};
+
+class go_gjalerbron_cage : public GameObjectScript
+{
+ public:
+ go_gjalerbron_cage() : GameObjectScript("go_gjalerbron_cage") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f))
+ {
+ go->UseDoorOrButton();
+
+ if (player)
+ player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0);
+
+ prisoner->AI()->Talk(SAY_FREE);
+ prisoner->ForcedDespawn(6000);
+ }
+ }
+ return true;
+ }
+};
+
+/*########
+## go_large_gjalerbron_cage
+#####*/
+
+class go_large_gjalerbron_cage : public GameObjectScript
+{
+ public:
+ go_large_gjalerbron_cage() : GameObjectScript("go_large_gjalerbron_cage") { }
+
+ bool OnGossipHello(Player* player, GameObject* go)
+ {
+ if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)
+ {
+ std::list<Creature*> prisonerList;
+ GetCreatureListWithEntryInGrid(prisonerList, go, NPC_GJALERBRON_PRISONER, INTERACTION_DISTANCE);
+ for (std::list<Creature*>::const_iterator itr = prisonerList.begin(); itr != prisonerList.end(); ++itr)
+ {
+ go->UseDoorOrButton();
+ player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID());
+ (*itr)->ForcedDespawn(6000);
+ (*itr)->AI()->Talk(SAY_FREE);
+ }
+ }
+ return false;
+ }
};
void AddSC_go_scripts()
@@ -1224,4 +1286,6 @@ void AddSC_go_scripts()
new go_amberpine_outhouse;
new go_hive_pod;
new go_massive_seaforium_charge;
+ new go_gjalerbron_cage;
+ new go_large_gjalerbron_cage;
}