fix(Scripts/Netherstorm): Remove hardcode from zone_netherstorm. (#15805)

* fix(Scripts/Core): Remove hardcode from zone_netherstorm.

* gcc

* double insert -.-
This commit is contained in:
avarishd
2023-04-12 11:45:09 +03:00
committed by GitHub
parent fd6941de7c
commit ea82506a25
2 changed files with 25 additions and 69 deletions

View File

@@ -0,0 +1,17 @@
-- ID 20985 (Captain Saeed)
DELETE FROM `gossip_menu_option` WHERE `MenuID` = 8228;
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES
(8228, 0, 0, 'I am that fleshling, Saeed. Let\'s go!', 18639, 0, 1, 0, 0, 0, 0, '', 0, 0),
(8228, 1, 0, 'I am ready. Let\'s make history!', 18641, 0, 1, 0, 0, 0, 0, '', 0, 0);
-- ID 20907 (Professor Dabiri)
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20907;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 20907);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(20907, 0, 0, 1, 62, 0, 100, 0, 8207, 0, 0, 0, 0, 85, 35780, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Professor Dabiri - On Gossip Option 0 Selected - Invoker Cast \'Summon Phase Disruptor\''),
(20907, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Professor Dabiri - On Gossip Option 0 Selected - Close Gossip');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8207;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 8207, 0, 0, 0, 2, 0, 29778, 1, 0, 1, 0, 0, '', '(AND) Professor Dabiri - Show gossip option 0 if item 29778 is NOT in inventory.'),
(15, 8207, 0, 0, 0, 47, 0, 10438, 10, 0, 0, 0, 0, '', '(AND) Professor Dabiri - Show gossip option 0 if quest 10438 is complete or incomplete.');

View File

@@ -15,20 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Netherstorm
SD%Complete: 80
SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10198, 10191
SDCategory: Netherstorm
EndScriptData */
/* ContentData
npc_commander_dawnforge
npc_bessy
npc_maxx_a_million
go_captain_tyralius_prison
EndContentData */
#include "GameObjectAI.h"
#include "Player.h"
#include "ScriptMgr.h"
@@ -59,7 +45,11 @@ enum saeed
QUEST_DIMENSIUS_DEVOURING = 10439,
SPELL_DIMENSIUS_TRANSFORM = 35939
SPELL_DIMENSIUS_TRANSFORM = 35939,
GOSSIP_MENU_SAEED = 8228,
TEXT_NPC_SAEED_DEFAULT = 10229,
TEXT_NPC_SAEED_START_FIGHT = 10232,
};
class npc_captain_saeed : public CreatureScript
@@ -280,12 +270,12 @@ public:
if (player->GetQuestStatus(QUEST_DIMENSIUS_DEVOURING) == QUEST_STATUS_INCOMPLETE)
{
if (!creature->AI()->GetData(1))
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Let's move out.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, GOSSIP_MENU_SAEED, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
else
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Let's start the battle.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
AddGossipItemFor(player, GOSSIP_MENU_SAEED, 1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
}
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
SendGossipMenuFor(player, creature->AI()->GetData(1) ? TEXT_NPC_SAEED_START_FIGHT : TEXT_NPC_SAEED_DEFAULT, creature->GetGUID());
return true;
}
@@ -587,56 +577,6 @@ public:
}
};
/*######
## npc_professor_dabiri
######*/
enum ProfessorDabiriData
{
SPELL_PHASE_DISTRUPTOR = 35780,
//WHISPER_DABIRI = 0, not existing in database
QUEST_DIMENSIUS = 10439,
QUEST_ON_NETHERY_WINGS = 10438,
};
#define GOSSIP_ITEM "I need a new phase distruptor, Professor"
class npc_professor_dabiri : public CreatureScript
{
public:
npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { }
//OnQuestAccept:
//if (quest->GetQuestId() == QUEST_DIMENSIUS)
//creature->AI()->Talk(WHISPER_DABIRI, player);
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false);
CloseGossipMenuFor(player);
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778))
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
## npc_phase_hunter
######*/
@@ -979,7 +919,6 @@ void AddSC_netherstorm()
// Theirs
new npc_commander_dawnforge();
new at_commander_dawnforge();
new npc_professor_dabiri();
new npc_phase_hunter();
new npc_bessy();
new npc_maxx_a_million_escort();