Skip to content

Commit

Permalink
Core/Scripts: zone_terokkar_forest cleanup
Browse files Browse the repository at this point in the history
- moved spell, quest and gossip IDs into enum
- replaced hardcoded text with DB gossip IDs
- restored correct gossip option order for Skull Pile

Replaces the crashed PR attempt in #16668
  • Loading branch information
tkrokli committed Feb 24, 2016
1 parent dab661c commit 043ed71
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 64 deletions.
5 changes: 5 additions & 0 deletions sql/updates/world/2016_02_29_29_world.sql
@@ -0,0 +1,5 @@
-- Create gossip_menu_option 7731,7732 for NPC 18588 Floon in Terokkar Forest
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7731,7732) AND `id` = 0;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES
(7731,0,0,'He wants his "golds." Pay up or die... again...',15564,1,1,0,0,0,0,'',0),
(7732,0,0,"I have been sent by Sal'salabim to collect a debt that you owe. Pay up or I'm going to have to hurt you.",15560,1,1,0,0,0,0,'',0);
160 changes: 96 additions & 64 deletions src/server/scripts/Outland/zone_terokkar_forest.cpp
Expand Up @@ -46,13 +46,13 @@ EndContentData */

enum UnkorTheRuthless
{
SAY_SUBMIT = 0,

FACTION_HOSTILE = 45,
FACTION_FRIENDLY = 35,
QUEST_DONTKILLTHEFATONE = 9889,

SPELL_PULVERIZE = 2676
SAY_SUBMIT = 0,
REQUIRED_KILL_COUNT = 10,
FACTION_FRIENDLY = 35,
FACTION_HOSTILE = 45,
SPELL_PULVERIZE = 2676,
QUEST_DONTKILLTHEFATONE = 9889,
NPC_BOULDERFIST_INVADER = 18260
};

class npc_unkor_the_ruthless : public CreatureScript
Expand Down Expand Up @@ -116,7 +116,7 @@ class npc_unkor_the_ruthless : public CreatureScript
Player* groupie = itr->GetSource();
if (groupie &&
groupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, NPC_BOULDERFIST_INVADER) == REQUIRED_KILL_COUNT)
{
groupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
if (!CanDoQuest)
Expand All @@ -125,7 +125,7 @@ class npc_unkor_the_ruthless : public CreatureScript
}
}
else if (player->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, NPC_BOULDERFIST_INVADER) == REQUIRED_KILL_COUNT)
{
player->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
CanDoQuest = true;
Expand Down Expand Up @@ -170,6 +170,11 @@ class npc_unkor_the_ruthless : public CreatureScript
## npc_infested_root_walker
######*/

enum InfestedRootWalker
{
SPELL_SUMMON_WOOD_MITES = 39130
};

class npc_infested_root_walker : public CreatureScript
{
public:
Expand All @@ -193,14 +198,20 @@ class npc_infested_root_walker : public CreatureScript
if (me->GetHealth() <= damage)
if (rand32() % 100 < 75)
//Summon Wood Mites
DoCast(me, 39130, true);
DoCast(me, SPELL_SUMMON_WOOD_MITES, true);
}
};
};

/*######
## npc_skywing
######*/

enum Skywing
{
QUEST_SKYWING = 10898
};

class npc_skywing : public CreatureScript
{
public:
Expand All @@ -225,7 +236,7 @@ class npc_skywing : public CreatureScript
switch (waypointId)
{
case 8:
player->AreaExploredOrEventHappens(10898);
player->AreaExploredOrEventHappens(QUEST_SKYWING);
break;
}
}
Expand All @@ -239,7 +250,7 @@ class npc_skywing : public CreatureScript
return;

Player* player = who->ToPlayer();
if (player && player->GetQuestStatus(10898) == QUEST_STATUS_INCOMPLETE)
if (player && player->GetQuestStatus(QUEST_SKYWING) == QUEST_STATUS_INCOMPLETE)
if (me->IsWithinDistInMap(who, 10.0f))
Start(false, false, who->GetGUID());
}
Expand All @@ -257,6 +268,11 @@ class npc_skywing : public CreatureScript
## npc_rotting_forest_rager
######*/

enum RottingForestRager
{
SPELL_SUMMON_LOTS_OF_WOOD_MITES = 39134
};

class npc_rotting_forest_rager : public CreatureScript
{
public:
Expand All @@ -279,8 +295,8 @@ class npc_rotting_forest_rager : public CreatureScript
if (done_by->GetTypeId() == TYPEID_PLAYER)
if (me->GetHealth() <= damage)
if (rand32() % 100 < 75)
//Summon Lots of Wood Mights
DoCast(me, 39134, true);
//Summon Lots of Wood Mites
DoCast(me, SPELL_SUMMON_LOTS_OF_WOOD_MITES, true);
}
};
};
Expand All @@ -289,19 +305,22 @@ class npc_rotting_forest_rager : public CreatureScript
## npc_floon
######*/

#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
#define GOSSIP_FLOON2 "Hand over the money or die...again!"

enum Floon
{
SAY_FLOON_ATTACK = 0,

SPELL_SILENCE = 6726,
SPELL_FROSTBOLT = 9672,
SPELL_FROST_NOVA = 11831,

FACTION_HOSTILE_FL = 1738,
QUEST_CRACK_SKULLS = 10009
SAY_FLOON_ATTACK = 0,
OPTION_ID_PAY_UP_OR_DIE = 0,
OPTION_ID_COLLECT_A_DEBT = 0,
FACTION_HOSTILE_FLOON = 1738,
MENU_ID_PAY_UP_OR_DIE = 7731,
MENU_ID_COLLECT_A_DEBT = 7732,
GOSSIP_FLOON_STRANGE_SOUNDS = 9442,
GOSSIP_HE_ALREADY_KILLED_ME = 9443,

SPELL_SILENCE = 6726,
SPELL_FROSTBOLT = 9672,
SPELL_FROST_NOVA = 11831,

QUEST_CRACKIN_SOME_SKULLS = 10009
};

class npc_floon : public CreatureScript
Expand All @@ -314,13 +333,13 @@ class npc_floon : public CreatureScript
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9443, creature->GetGUID());
player->ADD_GOSSIP_ITEM_DB(MENU_ID_PAY_UP_OR_DIE, OPTION_ID_PAY_UP_OR_DIE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(GOSSIP_HE_ALREADY_KILLED_ME, creature->GetGUID());
}
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
creature->setFaction(FACTION_HOSTILE_FL);
creature->setFaction(FACTION_HOSTILE_FLOON);
creature->AI()->Talk(SAY_FLOON_ATTACK, player);
creature->AI()->AttackStart(player);
}
Expand All @@ -329,10 +348,10 @@ class npc_floon : public CreatureScript

bool OnGossipHello(Player* player, Creature* creature) override
{
if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
if (player->GetQuestStatus(QUEST_CRACKIN_SOME_SKULLS) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM_DB(MENU_ID_COLLECT_A_DEBT, OPTION_ID_COLLECT_A_DEBT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);

player->SEND_GOSSIP_MENU(9442, creature->GetGUID());
player->SEND_GOSSIP_MENU(GOSSIP_FLOON_STRANGE_SOUNDS, creature->GetGUID());
return true;
}

Expand Down Expand Up @@ -403,15 +422,16 @@ class npc_floon : public CreatureScript
######*/
enum IslaStarmaneData
{
SAY_PROGRESS_1 = 0,
SAY_PROGRESS_2 = 1,
SAY_PROGRESS_3 = 2,
SAY_PROGRESS_4 = 3,

QUEST_EFTW_H = 10052,
QUEST_EFTW_A = 10051,
GO_CAGE = 182794,
SPELL_CAT = 32447,
SAY_PROGRESS_1 = 0,
SAY_PROGRESS_2 = 1,
SAY_PROGRESS_3 = 2,
SAY_PROGRESS_4 = 3,
GO_DISTANCE = 10,
FACTION_ESCORTEE = 113,
ESCAPE_FROM_FIREWING_POINT_A = 10051,
ESCAPE_FROM_FIREWING_POINT_H = 10052,
SPELL_TRAVEL_FORM_CAT = 32447,
GO_CAGE = 182794
};

class npc_isla_starmane : public CreatureScript
Expand All @@ -432,7 +452,7 @@ class npc_isla_starmane : public CreatureScript
switch (waypointId)
{
case 0:
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, GO_DISTANCE))
Cage->SetGoState(GO_STATE_ACTIVE);
break;
case 2:
Expand All @@ -447,16 +467,16 @@ class npc_isla_starmane : public CreatureScript
case 29:
Talk(SAY_PROGRESS_4, player);
if (player->GetTeam() == ALLIANCE)
player->GroupEventHappens(QUEST_EFTW_A, me);
player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_A, me);
else if (player->GetTeam() == HORDE)
player->GroupEventHappens(QUEST_EFTW_H, me);
player->GroupEventHappens(ESCAPE_FROM_FIREWING_POINT_H, me);
me->SetInFront(player);
break;
case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break;
case 31:
DoCast(me, SPELL_CAT);
DoCast(me, SPELL_TRAVEL_FORM_CAT);
me->SetWalk(false);
break;
}
Expand All @@ -472,19 +492,19 @@ class npc_isla_starmane : public CreatureScript
if (Player* player = GetPlayerForEscort())
{
if (player->GetTeam() == ALLIANCE)
player->FailQuest(QUEST_EFTW_A);
player->FailQuest(ESCAPE_FROM_FIREWING_POINT_A);
else if (player->GetTeam() == HORDE)
player->FailQuest(QUEST_EFTW_H);
player->FailQuest(ESCAPE_FROM_FIREWING_POINT_H);
}
}
};

bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
if (quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_H || quest->GetQuestId() == ESCAPE_FROM_FIREWING_POINT_A)
{
ENSURE_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
creature->setFaction(113);
creature->setFaction(FACTION_ESCORTEE);
}
return true;
}
Expand All @@ -498,10 +518,20 @@ class npc_isla_starmane : public CreatureScript
/*######
## go_skull_pile
######*/
#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai"
#define GOSSIP_S_KARROG "Summon Karrog"
#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress"
#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager"

enum SkullPile
{
OPTION_ID_GEZZARAK_THE_HUNTRESS = 0,
OPTION_ID_DARKSCREECHER_AKKARAI = 1,
OPTION_ID_KARROG = 2,
OPTION_ID_VAKKIZ_THE_WINDRAGER = 3,
GOSSIP_MENU_ID_SKULL_PILE = 8660,
ADVERSARIAL_BLOOD = 11885,
SUMMON_GEZZARAK_THE_HUNTRESS = 40632,
SUMMON_KARROG = 40640,
SUMMON_DARKSCREECHER_AKKARAI = 40642,
SUMMON_VAKKIZ_THE_WINDRAGER = 40644
};

class go_skull_pile : public GameObjectScript
{
Expand All @@ -520,12 +550,12 @@ class go_skull_pile : public GameObjectScript

bool OnGossipHello(Player* player, GameObject* go) override
{
if ((player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(11885))
if ((player->GetQuestStatus(ADVERSARIAL_BLOOD) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(ADVERSARIAL_BLOOD))
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM_DB(GOSSIP_MENU_ID_SKULL_PILE, OPTION_ID_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
}

player->SEND_GOSSIP_MENU(go->GetGOInfo()->questgiver.gossipID, go->GetGUID());
Expand All @@ -537,16 +567,16 @@ class go_skull_pile : public GameObjectScript
switch (action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
player->CastSpell(player, 40642, false);
player->CastSpell(player, SUMMON_GEZZARAK_THE_HUNTRESS, false);
break;
case GOSSIP_ACTION_INFO_DEF + 2:
player->CastSpell(player, 40640, false);
player->CastSpell(player, SUMMON_DARKSCREECHER_AKKARAI, false);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
player->CastSpell(player, 40632, false);
player->CastSpell(player, SUMMON_KARROG, false);
break;
case GOSSIP_ACTION_INFO_DEF + 4:
player->CastSpell(player, 40644, false);
player->CastSpell(player, SUMMON_VAKKIZ_THE_WINDRAGER, false);
break;
}
}
Expand All @@ -558,7 +588,9 @@ class go_skull_pile : public GameObjectScript

enum Slim
{
FACTION_CONSORTIUM = 933
FACTION_CONSORTIUM = 933,
NPC_TEXT_NEITHER_SLIM_NOR_SHADY = 9895,
NPC_TEXT_I_SEE_YOU_ARE_A_FRIEND = 9896
};

class npc_slim : public CreatureScript
Expand All @@ -580,10 +612,10 @@ class npc_slim : public CreatureScript
if (creature->IsVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
player->SEND_GOSSIP_MENU(9896, creature->GetGUID());
player->SEND_GOSSIP_MENU(NPC_TEXT_I_SEE_YOU_ARE_A_FRIEND, creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(9895, creature->GetGUID());
player->SEND_GOSSIP_MENU(NPC_TEXT_NEITHER_SLIM_NOR_SHADY, creature->GetGUID());

return true;
}
Expand Down

0 comments on commit 043ed71

Please sign in to comment.