aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <none@none>2010-08-25 21:23:28 +0300
committerShocker <none@none>2010-08-25 21:23:28 +0300
commit91ebad0016d102ee9a10c5804ace08b41e6ac4e2 (patch)
tree6bcfaafed4e2b66efa76a9f928b4955b25a47486
parente8a7a53bfa26c3809d3540cfeae81efd04a3ae5d (diff)
* Add support for quest 1393 (Galen's Escape), original code by przemratajczak, port by McBitter, closes issue 3463
* Fix typo in AuctionHouseHandler, thanks GriffonHeart, fixes issue 3609 * Forgotten thanks --HG-- branch : trunk
-rw-r--r--THANKS2
-rw-r--r--sql/scripts/world_script_texts.sql7
-rw-r--r--sql/scripts/world_script_waypoints.sql26
-rw-r--r--sql/scripts/world_scripts_full.sql1
-rw-r--r--sql/updates/9591_world_script_texts.sql10
-rw-r--r--sql/updates/9591_world_script_waypoint.sql25
-rw-r--r--sql/updates/9591_world_scriptname.sql2
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp2
-rw-r--r--src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp155
10 files changed, 230 insertions, 2 deletions
diff --git a/THANKS b/THANKS
index 2820050deae..3bf9e1023a2 100644
--- a/THANKS
+++ b/THANKS
@@ -65,4 +65,4 @@ Malcrom, Vladmimír Lipták, retriman, hyriuu, Smakapotatis, PainKiller,
bkhorizon, n0n4m3, Chesterfield, Frankir, Wowka321, Morpheux, p0wer,
Ouden, toshik, laise, yavi, Splinter, Syntec, Arthas, denyde, unholy,
Vaughner, blackmanos, edrinn, Liberate, Shauren, dr.tenma, click, silverice,
-SupaBad, Xanadu, Socolin, Shocker, Silinoron, 0xFuture, xK1
+SupaBad, Xanadu, Socolin, Shocker, Silinoron, 0xFuture, xK1, svetilo12
diff --git a/sql/scripts/world_script_texts.sql b/sql/scripts/world_script_texts.sql
index fab6a21b7bf..cc678861318 100644
--- a/sql/scripts/world_script_texts.sql
+++ b/sql/scripts/world_script_texts.sql
@@ -426,6 +426,13 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(17375, -1000474, '[Fulborg] The Stillpine furbolgs will not soon forget your bravery!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 0, 0, 0, 0,'Stillpine Capitive free say text 1'),
(17375, -1000475, '[Fulborg] Thank you, $N',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 0, 0, 0, 0, 'Stillpine Capitive free say text 2'),
(17375, -1000476, '[Fulborg] Those remaining at Stillpine Hold will welcome you as a hero!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 0, 0, 0, 0, 'Stillpine Capitive free say text 3'),
+ (5391, -1000500, 'Help! Please, You must help me!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Galen - periodic say'),
+ (5391, -1000501, 'Let us leave this place.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Galen - quest accepted'),
+ (5391, -1000502, 'Look out! The $c attacks!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Galen - aggro 1'),
+ (5391, -1000503, 'Help! I\'m under attack!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Galen - aggro 2'),
+ (5391, -1000504, 'Thank you $N. I will remember you always. You can find my strongbox in my camp, north of Stonard.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Galen - quest complete'),
+ (5391, -1000505, '%s whispers to $N the secret to opening his strongbox.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,2,0,0,'Galen - emote whisper'),
+ (5391, -1000506, '%s disappears into the swamp.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,2,0,0,'Galen - emote disappear'),
(26588,-1800001, 'Um... I think one of those wolves is back...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),
(26588,-1800002, 'He''s going for Mr. Floppy! ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),
(26588,-1800003, 'Oh, no! Look, it''s another wolf, and it''s a biiiiiig one!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),
diff --git a/sql/scripts/world_script_waypoints.sql b/sql/scripts/world_script_waypoints.sql
index 3a5734d6d0e..473acfa0e88 100644
--- a/sql/scripts/world_script_waypoints.sql
+++ b/sql/scripts/world_script_waypoints.sql
@@ -2267,3 +2267,29 @@ INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `
(33370, 4, 206.092, -34.7447, 409.801, 0, '0'),
(33370, 5, 240.208, 1.10346, 409.802, 0, '0'),
(33370, 6, 337.199, 11.7051, 409.802, 0, '0');
+
+-- Waypoints for Galen Goodward
+DELETE FROM `script_waypoint` WHERE `entry`=5391;
+INSERT INTO `script_waypoint` VALUES
+(5391, 0, -9901.12, -3727.29, 22.11, 3000, ''),
+(5391, 1, -9909.27, -3727.81, 23.25, 0, ''),
+(5391, 2, -9935.25, -3729.02, 22.11, 0, ''),
+(5391, 3, -9945.83, -3719.34, 21.68, 0, ''),
+(5391, 4, -9963.41, -3710.18, 21.71, 0, ''),
+(5391, 5, -9972.75, -3690.13, 21.68, 0, ''),
+(5391, 6, -9989.70, -3669.67, 21.67, 0, ''),
+(5391, 7, -9989.21, -3647.76, 23.00, 0, ''),
+(5391, 8, -9992.27, -3633.74, 21.67, 0, ''),
+(5391, 9,-10002.32, -3611.67, 22.26, 0, ''),
+(5391,10, -9999.25, -3586.33, 21.85, 0, ''),
+(5391,11,-10006.53, -3571.99, 21.67, 0, ''),
+(5391,12,-10014.30, -3545.24, 21.67, 0, ''),
+(5391,13,-10018.91, -3525.03, 21.68, 0, ''),
+(5391,14,-10030.22, -3514.77, 21.67, 0, ''),
+(5391,15,-10045.11, -3501.49, 21.67, 0, ''),
+(5391,16,-10052.91, -3479.13, 21.67, 0, ''),
+(5391,17,-10060.68, -3460.31, 21.67, 0, ''),
+(5391,18,-10074.68, -3436.85, 20.97, 0, ''),
+(5391,19,-10074.68, -3436.85, 20.97, 0, ''),
+(5391,20,-10072.86, -3408.92, 20.43, 15000, ''),
+(5391,21,-10108.01, -3406.05, 22.06, 0, '');
diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql
index f4dfddc6152..08303c24cbf 100644
--- a/sql/scripts/world_scripts_full.sql
+++ b/sql/scripts/world_scripts_full.sql
@@ -1273,6 +1273,7 @@ UPDATE `gameobject_template` SET `ScriptName`='kalecgos_teleporter' WHERE `entry
UPDATE `creature_template` SET `ScriptName`='npc_blackhole' WHERE `entry`=25855;
/* SWAMP OF SORROWS */
+UPDATE `creature_template` SET `ScriptName`='npc_galen_goodward' WHERE `entry`=5391;
/* TANARIS */
UPDATE `creature_template` SET `ScriptName`='mob_aquementas' WHERE `entry`=9453;
diff --git a/sql/updates/9591_world_script_texts.sql b/sql/updates/9591_world_script_texts.sql
new file mode 100644
index 00000000000..3cc94032437
--- /dev/null
+++ b/sql/updates/9591_world_script_texts.sql
@@ -0,0 +1,10 @@
+DELETE FROM script_texts WHERE entry BETWEEN -1000506 AND -1000500;
+INSERT INTO script_texts (npc_entry,entry,content_default,sound,type,language,emote,comment) VALUES
+(5391, -1000500,'Help! Please, You must help me!',0,0,0,0,'Galen - periodic say'),
+(5391, -1000501,'Let us leave this place.',0,0,0,0,'Galen - quest accepted'),
+(5391, -1000502,'Look out! The $c attacks!',0,0,0,0,'Galen - aggro 1'),
+(5391, -1000503,'Help! I\'m under attack!',0,0,0,0,'Galen - aggro 2'),
+(5391, -1000504,'Thank you $N. I will remember you always. You can find my strongbox in my camp, north of Stonard.',0,0,0,0,'Galen - quest complete'),
+(5391, -1000505,'%s whispers to $N the secret to opening his strongbox.',0,2,0,0,'Galen - emote whisper'),
+(5391, -1000506,'%s disappears into the swamp.',0,2,0,0,'Galen - emote disapper');
+
diff --git a/sql/updates/9591_world_script_waypoint.sql b/sql/updates/9591_world_script_waypoint.sql
new file mode 100644
index 00000000000..31f69b62961
--- /dev/null
+++ b/sql/updates/9591_world_script_waypoint.sql
@@ -0,0 +1,25 @@
+DELETE FROM script_waypoint WHERE entry=5391;
+INSERT INTO script_waypoint VALUES
+(5391, 0, -9901.12, -3727.29, 22.11, 3000, ''),
+(5391, 1, -9909.27, -3727.81, 23.25, 0, ''),
+(5391, 2, -9935.25, -3729.02, 22.11, 0, ''),
+(5391, 3, -9945.83, -3719.34, 21.68, 0, ''),
+(5391, 4, -9963.41, -3710.18, 21.71, 0, ''),
+(5391, 5, -9972.75, -3690.13, 21.68, 0, ''),
+(5391, 6, -9989.70, -3669.67, 21.67, 0, ''),
+(5391, 7, -9989.21, -3647.76, 23.00, 0, ''),
+(5391, 8, -9992.27, -3633.74, 21.67, 0, ''),
+(5391, 9,-10002.32, -3611.67, 22.26, 0, ''),
+(5391,10, -9999.25, -3586.33, 21.85, 0, ''),
+(5391,11,-10006.53, -3571.99, 21.67, 0, ''),
+(5391,12,-10014.30, -3545.24, 21.67, 0, ''),
+(5391,13,-10018.91, -3525.03, 21.68, 0, ''),
+(5391,14,-10030.22, -3514.77, 21.67, 0, ''),
+(5391,15,-10045.11, -3501.49, 21.67, 0, ''),
+(5391,16,-10052.91, -3479.13, 21.67, 0, ''),
+(5391,17,-10060.68, -3460.31, 21.67, 0, ''),
+(5391,18,-10074.68, -3436.85, 20.97, 0, ''),
+(5391,19,-10074.68, -3436.85, 20.97, 0, ''),
+(5391,20,-10072.86, -3408.92, 20.43, 15000, ''),
+(5391,21,-10108.01, -3406.05, 22.06, 0, '');
+
diff --git a/sql/updates/9591_world_scriptname.sql b/sql/updates/9591_world_scriptname.sql
new file mode 100644
index 00000000000..e103b512376
--- /dev/null
+++ b/sql/updates/9591_world_scriptname.sql
@@ -0,0 +1,2 @@
+UPDATE creature_template SET ScriptName='npc_galen_goodward' WHERE entry=5391;
+
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 2a4a313a8ab..362f9f7e986 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -215,6 +215,7 @@ void AddSC_silvermoon_city();
void AddSC_silverpine_forest();
void AddSC_stormwind_city();
void AddSC_stranglethorn_vale();
+void AddSC_swamp_of_sorrows();
void AddSC_tirisfal_glades();
void AddSC_undercity();
void AddSC_western_plaguelands();
@@ -793,6 +794,7 @@ void AddEasternKingdomsScripts()
AddSC_silverpine_forest();
AddSC_stormwind_city();
AddSC_stranglethorn_vale();
+ AddSC_swamp_of_sorrows();
AddSC_tirisfal_glades();
AddSC_undercity();
AddSC_western_plaguelands();
diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
index 4d8b544b850..9c3c395cfd2 100644
--- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
@@ -305,7 +305,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
return;
}
- if (pl->HasEnoughMoney(price))
+ if (!pl->HasEnoughMoney(price))
{
//you don't have enought money!, client tests!
//SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???);
diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
new file mode 100644
index 00000000000..f957bec940f
--- /dev/null
+++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ *
+ * 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 "ScriptedEscortAI.h"
+
+/*######
+## npc_galen_goodward
+######*/
+
+enum Galen
+{
+ QUEST_GALENS_ESCAPE = 1393,
+
+ GO_GALENS_CAGE = 37118,
+
+ SAY_PERIODIC = -1000500,
+ SAY_QUEST_ACCEPTED = -1000501,
+ SAY_ATTACKED_1 = -1000502,
+ SAY_ATTACKED_2 = -1000503,
+ SAY_QUEST_COMPLETE = -1000504,
+ EMOTE_WHISPER = -1000505,
+ EMOTE_DISAPPEAR = -1000506
+};
+
+class npc_galen_goodward : public CreatureScript
+{
+public:
+
+ npc_galen_goodward() : CreatureScript("npc_galen_goodward") { }
+
+ bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const *quest)
+ {
+ if (quest->GetQuestId() == QUEST_GALENS_ESCAPE)
+ {
+ CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, pCreature->AI())->Start(false, false, pPlayer->GetGUID());
+ pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE);
+ DoScriptText(SAY_QUEST_ACCEPTED, pCreature);
+ }
+ return true;
+ }
+
+ CreatureAI* GetAI(Creature* pCreature) const
+ {
+ return new npc_galen_goodwardAI(pCreature);
+ }
+
+ struct npc_galen_goodwardAI : public npc_escortAI
+ {
+ npc_galen_goodwardAI(Creature* pCreature) : npc_escortAI(pCreature)
+ {
+ m_uiGalensCageGUID = 0;
+ Reset();
+ }
+
+ uint64 m_uiGalensCageGUID;
+ uint32 m_uiPeriodicSay;
+
+ void Reset()
+ {
+ m_uiPeriodicSay = 6000;
+ }
+
+ void EnterCombat(Unit* pWho)
+ {
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ DoScriptText(RAND(SAY_ATTACKED_1, SAY_ATTACKED_2), me, pWho);
+ }
+
+ void WaypointStart(uint32 uiPointId)
+ {
+ switch (uiPointId)
+ {
+ case 0:
+ {
+ GameObject* pCage = NULL;
+ if (m_uiGalensCageGUID)
+ pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID);
+ else
+ pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE);
+ if (pCage)
+ {
+ pCage->UseDoorOrButton();
+ m_uiGalensCageGUID = pCage->GetGUID();
+ }
+ break;
+ }
+ case 21:
+ DoScriptText(EMOTE_DISAPPEAR, me);
+ break;
+ }
+ }
+
+ void WaypointReached(uint32 uiPointId)
+ {
+ switch (uiPointId)
+ {
+ case 0:
+ if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID))
+ pCage->ResetDoorOrButton();
+ break;
+ case 20:
+ if (Player* pPlayer = GetPlayerForEscort())
+ {
+ me->SetFacingToObject(pPlayer);
+ DoScriptText(SAY_QUEST_COMPLETE, me, pPlayer);
+ DoScriptText(EMOTE_WHISPER, me, pPlayer);
+ pPlayer->GroupEventHappens(QUEST_GALENS_ESCAPE, me);
+ }
+ SetRun(true);
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (HasEscortState(STATE_ESCORT_NONE))
+ return;
+
+ if (m_uiPeriodicSay < uiDiff)
+ {
+ if (!HasEscortState(STATE_ESCORT_ESCORTING))
+ DoScriptText(SAY_PERIODIC, me);
+ m_uiPeriodicSay = 15000;
+ }
+ else
+ m_uiPeriodicSay -= uiDiff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+};
+
+void AddSC_swamp_of_sorrows()
+{
+ new npc_galen_goodward();
+}