mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 19:31:59 +01:00
Scripts/Kezan: Fix quest "Good Help is Hard to Find"
Added Maelstorm to scriptloader Close #10337 Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
13
sql/updates/world/2013_08_06_01_world_defiant_troll_434.sql
Normal file
13
sql/updates/world/2013_08_06_01_world_defiant_troll_434.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- http://www.wowhead.com/quest=14069
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_defiant_troll' WHERE `entry` = 34830;
|
||||
|
||||
DELETE FROM `creature_text` WHERE `entry` = 34830;
|
||||
INSERT INTO `creature_text`(`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
|
||||
(34830, 0, 0, 'Oops, break''s over.', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 1, 'Don''t tase me, mon!', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 2, 'I report you to HR!', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 3, 'Work was bettah in da Undermine!', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 4, 'I''m going. I''m going!', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 5, 'Sorry, mon. It won''t happen again.', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 6, 'What I doin'' wrong? Don''t I get a lunch and two breaks a day, mon?', 14, 0, 100, 0, 0, 0, 'defiant troll says'),
|
||||
(34830, 0, 7, 'Ouch! Dat hurt!', 14, 0, 100, 0, 0, 0, 'defiant troll says');
|
||||
@@ -615,6 +615,9 @@ void AddSC_shattrath_city();
|
||||
void AddSC_terokkar_forest();
|
||||
void AddSC_zangarmarsh();
|
||||
|
||||
// Maelstrom
|
||||
void AddSC_kezan();
|
||||
|
||||
// Events
|
||||
void AddSC_event_childrens_week();
|
||||
|
||||
@@ -644,6 +647,7 @@ void AddScripts()
|
||||
AddKalimdorScripts();
|
||||
AddOutlandScripts();
|
||||
AddNorthrendScripts();
|
||||
AddMaelstromScripts();
|
||||
AddEventScripts();
|
||||
AddBattlegroundScripts();
|
||||
AddOutdoorPvPScripts();
|
||||
@@ -1276,6 +1280,14 @@ void AddNorthrendScripts()
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void AddMaelstromScripts()
|
||||
{
|
||||
#ifdef SCRIPTS
|
||||
AddSC_kezan();
|
||||
#endif
|
||||
}
|
||||
|
||||
void AddEventScripts()
|
||||
{
|
||||
#ifdef SCRIPTS
|
||||
|
||||
@@ -27,6 +27,7 @@ void AddEasternKingdomsScripts();
|
||||
void AddKalimdorScripts();
|
||||
void AddOutlandScripts();
|
||||
void AddNorthrendScripts();
|
||||
void AddMaelstromScripts();
|
||||
void AddEventScripts();
|
||||
void AddBattlegroundScripts();
|
||||
void AddOutdoorPvPScripts();
|
||||
|
||||
@@ -38,6 +38,7 @@ if(SCRIPTS)
|
||||
include(Outland/CMakeLists.txt)
|
||||
include(Northrend/CMakeLists.txt)
|
||||
include(Events/CMakeLists.txt)
|
||||
include(Maelstrom/CMakeLists.txt)
|
||||
endif()
|
||||
|
||||
message(STATUS "SCRIPT PREPARATION COMPLETE")
|
||||
|
||||
@@ -53,7 +53,7 @@ enum ProfessorPhizzlethorpe
|
||||
EVENT_SAY_3 = 1,
|
||||
EVENT_SAY_6 = 2,
|
||||
EVENT_SAY_8 = 3,
|
||||
|
||||
|
||||
// Quests
|
||||
QUEST_SUNKEN_TREASURE = 665,
|
||||
QUEST_GOGGLE_BOGGLE = 26050,
|
||||
|
||||
14
src/server/scripts/Maelstrom/CMakeLists.txt
Normal file
14
src/server/scripts/Maelstrom/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
set(scripts_STAT_SRCS
|
||||
${scripts_STAT_SRCS}
|
||||
Maelstrom/kezan.cpp
|
||||
)
|
||||
|
||||
message(" -> Prepared: The Maelstrom")
|
||||
129
src/server/scripts/Maelstrom/kezan.cpp
Normal file
129
src/server/scripts/Maelstrom/kezan.cpp
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* 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 3 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 "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "Player.h"
|
||||
|
||||
/*####
|
||||
## npc_defiant_troll (http://www.wowhead.com/quest=14069)
|
||||
####*/
|
||||
|
||||
enum DefiantTrollEnum
|
||||
{
|
||||
DEFFIANT_KILL_CREDIT = 34830,
|
||||
SPELL_LIGHTNING_VISUAL = 45870,
|
||||
SPELL_ENRAGE = 45111,
|
||||
QUEST_GOOD_HELP_IS_HARD_TO_FIND = 14069,
|
||||
GO_DEPOSIT = 195489,
|
||||
SAY_WORK = 0
|
||||
};
|
||||
|
||||
class npc_defiant_troll : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_defiant_troll() : CreatureScript("npc_defiant_troll") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_defiant_trollAI(creature);
|
||||
}
|
||||
|
||||
struct npc_defiant_trollAI : public ScriptedAI
|
||||
{
|
||||
npc_defiant_trollAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 rebuffTimer;
|
||||
bool work;
|
||||
|
||||
void Reset () OVERRIDE
|
||||
{
|
||||
rebuffTimer = 0;
|
||||
work = false;
|
||||
me->CastSpell(me, SPELL_ENRAGE, true);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 /*type*/, uint32 id) OVERRIDE
|
||||
{
|
||||
if (id == 1)
|
||||
work = true;
|
||||
}
|
||||
|
||||
bool IsWorking() const { return work; }
|
||||
|
||||
void UpdateAI(const uint32 diff) OVERRIDE
|
||||
{
|
||||
if (IsWorking())
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_MINING);
|
||||
|
||||
if (rebuffTimer <= diff)
|
||||
{
|
||||
Reset();
|
||||
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
case 0:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_EXCLAIM);
|
||||
break;
|
||||
case 1:
|
||||
me->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
break;
|
||||
case 2:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_NONE);
|
||||
break;
|
||||
}
|
||||
rebuffTimer = 120000; // Rebuff again in 2 minutes
|
||||
}
|
||||
else
|
||||
rebuffTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_GOOD_HELP_IS_HARD_TO_FIND) == QUEST_STATUS_INCOMPLETE && !CAST_AI(npc_defiant_troll::npc_defiant_trollAI, creature->AI())->IsWorking())
|
||||
{
|
||||
player->CastSpell(creature, SPELL_LIGHTNING_VISUAL, true);
|
||||
player->KilledMonsterCredit(DEFFIANT_KILL_CREDIT, creature->GetGUID());
|
||||
creature->AI()->Talk(SAY_WORK);
|
||||
creature->RemoveAllAuras();
|
||||
|
||||
if (GameObject* deposit = creature->FindNearestGameObject(GO_DEPOSIT, 20))
|
||||
creature->GetMotionMaster()->MovePoint(1, deposit->GetPositionX() - 1.0f, deposit->GetPositionY(), Deposit->GetPositionZ());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_GOOD_HELP_IS_HARD_TO_FIND) == QUEST_STATUS_COMPLETE)
|
||||
player->RemoveAura(SPELL_LIGHTNING_VISUAL);
|
||||
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_kezan()
|
||||
{
|
||||
new npc_defiant_troll();
|
||||
}
|
||||
Reference in New Issue
Block a user