diff options
| author | Andrew Letson <velinath@users.noreply.github.com> | 2017-10-21 06:16:54 -0400 |
|---|---|---|
| committer | Aokromes <Aokromes@users.noreply.github.com> | 2017-10-21 12:16:54 +0200 |
| commit | 7db70bf40b1595f58a08536a36f74f18e8405758 (patch) | |
| tree | 057bcf38c848a9bf18a0c64e5021f289a68da952 | |
| parent | 23329790d21de649ef5fc5b9e60bf089b879f1b9 (diff) | |
DB/Scripts: Migrate Raliq the Drunk and Sal'salabim to SAI
| -rw-r--r-- | sql/updates/world/3.3.5/2017_10_21_03_world.sql | 38 | ||||
| -rw-r--r-- | src/server/scripts/Outland/zone_shattrath_city.cpp | 196 |
2 files changed, 39 insertions, 195 deletions
diff --git a/sql/updates/world/3.3.5/2017_10_21_03_world.sql b/sql/updates/world/3.3.5/2017_10_21_03_world.sql new file mode 100644 index 00000000000..34176d34678 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_10_21_03_world.sql @@ -0,0 +1,38 @@ +-- Raliq the Drunk +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18585; + +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 18585); +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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18585, 0, 0, 0, 0, 0, 100, 0, 5000, 5000, 15000, 15000, 11, 10966, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - In Combat - Cast \'Uppercut\''), +(18585, 0, 1, 2, 62, 0, 100, 0, 7729, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - On Gossip Option 0 Selected - Close Gossip'), +(18585, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 2, 45, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - On Gossip Option 0 Selected - Set Faction Ogre'), +(18585, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - On Gossip Option 0 Selected - Say Line 0'), +(18585, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - On Gossip Option 0 Selected - Start Attacking'), +(18585, 0, 5, 0, 25, 0, 100, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Raliq the Drunk - On Reset - Set Default Faction'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` = 7729; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 7729, 9440, 0, 0, 9, 0, 10009, 0, 0, 0, 0, 0, '', 'Show gossip menu 7729 text id 9440 if quest Crackin\' Some Skulls has been taken.'), +(15, 7729, 0, 0, 0, 9, 0, 10009, 0, 0, 0, 0, 0, '', 'Show gossip menu 7729 option id 0 if quest Crackin\' Some Skulls has been taken.'); + +-- Sal\'salabim +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18584; + +-- Table smart_scripts +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 18584); +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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18584, 0, 0, 0, 0, 0, 100, 0, 15000, 15000, 15000, 15000, 11, 31705, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - In Combat - Cast \'Magnetic Pull\''), +(18584, 0, 1, 2, 62, 0, 100, 0, 7725, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Gossip Option 0 Selected - Close Gossip'), +(18584, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 2, 90, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Gossip Option 0 Selected - Set Faction Demon'), +(18584, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Gossip Option 0 Selected - Say Line 0'), +(18584, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Gossip Option 0 Selected - Start Attacking'), +(18584, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 42, 0, 19, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Gossip Option 0 Selected - Set Invincibility Hp 19%'), +(18584, 0, 6, 7, 2, 0, 100, 1, 0, 20, 0, 0, 15, 10004, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Health Below 20% - Quest Credit \'Patience and Understanding\''), +(18584, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Health Below 20% - Evade'), +(18584, 0, 8, 0, 25, 0, 100, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Sal\'salabim - On Reset - Set Default Faction'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` = 7725; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceGroup` = 6 AND `SourceEntry` = 18584; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 7725, 9435, 0, 0, 9, 0, 10004, 0, 0, 0, 0, 0, '', 'Show gossip menu 7725 text id 9440 if quest Patience and Understanding has been taken.'), +(15, 7725, 0, 0, 0, 9, 0, 10004, 0, 0, 0, 0, 0, '', 'Show gossip menu 7725 option id 0 if quest Patience and Understanding has been taken.'); diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index d5f95c74c59..073897b5689 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -19,213 +19,21 @@ /* ScriptData SDName: Shattrath_City SD%Complete: 100 -SDComment: Quest support: 10004, 10009, 10211. +SDComment: Quest support: 10211. SDCategory: Shattrath City EndScriptData */ /* ContentData -npc_raliq_the_drunk -npc_salsalabim npc_kservant EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "Player.h" #include "WorldSession.h" /*###### -## npc_raliq_the_drunk -######*/ - -enum RaliqTheDrunk -{ - SAY_RALIQ_ATTACK = 0, - OPTION_ID_COLLECT_A_DEBT = 0, - MENU_ID_COLLECT_A_DEBT = 7729, - NPC_TEXT_WUT_YOU_WANT = 9440, - CRACKIN_SOME_SKULLS = 10009, - SPELL_UPPERCUT = 10966 -}; - -class npc_raliq_the_drunk : public CreatureScript -{ -public: - npc_raliq_the_drunk() : CreatureScript("npc_raliq_the_drunk") { } - - struct npc_raliq_the_drunkAI : public ScriptedAI - { - npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - Uppercut_Timer = 5000; - } - - uint32 Uppercut_Timer; - - void Reset() override - { - Initialize(); - me->RestoreFaction(); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (Uppercut_Timer <= diff) - { - DoCastVictim(SPELL_UPPERCUT); - Uppercut_Timer = 15000; - } else Uppercut_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override - { - uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId); - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - CloseGossipMenuFor(player); - me->SetFaction(FACTION_OGRE); - Talk(SAY_RALIQ_ATTACK, player); - AttackStart(player); - } - return true; - } - - bool GossipHello(Player* player) override - { - if (player->GetQuestStatus(CRACKIN_SOME_SKULLS) == QUEST_STATUS_INCOMPLETE) - { - AddGossipItemFor(player, MENU_ID_COLLECT_A_DEBT, OPTION_ID_COLLECT_A_DEBT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - SendGossipMenuFor(player, NPC_TEXT_WUT_YOU_WANT, me->GetGUID()); - } - else - { - ClearGossipMenuFor(player); - SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID()); - } - return true; - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_raliq_the_drunkAI(creature); - } -}; - -/*###### -# npc_salsalabim -######*/ - -enum Salsalabim -{ - SAY_DEMONIC_AGGRO = 0, - OPTION_ID_ALTRUIS_SENT_ME = 0, - MENU_ID_ALTRUIS_SENT_ME = 7725, - NPC_TEXT_SAL_GROWLS_AT_YOU = 9435, - PATIENCE_AND_UNDERSTANDING = 10004, - SPELL_MAGNETIC_PULL = 31705 -}; - -class npc_salsalabim : public CreatureScript -{ -public: - npc_salsalabim() : CreatureScript("npc_salsalabim") { } - - struct npc_salsalabimAI : public ScriptedAI - { - npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - MagneticPull_Timer = 15000; - } - - uint32 MagneticPull_Timer; - - void Reset() override - { - Initialize(); - me->RestoreFaction(); - } - - void DamageTaken(Unit* done_by, uint32 &damage) override - { - if (done_by->GetTypeId() == TYPEID_PLAYER && me->HealthBelowPctDamaged(20, damage)) - { - done_by->ToPlayer()->GroupEventHappens(PATIENCE_AND_UNDERSTANDING, me); - damage = 0; - EnterEvadeMode(); - } - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (MagneticPull_Timer <= diff) - { - DoCastVictim(SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000; - } else MagneticPull_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override - { - uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId); - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - CloseGossipMenuFor(player); - me->SetFaction(FACTION_DEMON); - Talk(SAY_DEMONIC_AGGRO, player); - AttackStart(player); - } - return true; - } - - bool GossipHello(Player* player) override - { - if (player->GetQuestStatus(PATIENCE_AND_UNDERSTANDING) == QUEST_STATUS_INCOMPLETE) - { - AddGossipItemFor(player, MENU_ID_ALTRUIS_SENT_ME, OPTION_ID_ALTRUIS_SENT_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - SendGossipMenuFor(player, NPC_TEXT_SAL_GROWLS_AT_YOU, me->GetGUID()); - } - else - { - if (me->IsQuestGiver()) - player->PrepareQuestMenu(me->GetGUID()); - SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID()); - } - return true; - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_salsalabimAI(creature); - } -}; - -/*###### # npc_kservant ######*/ @@ -372,7 +180,5 @@ public: void AddSC_shattrath_city() { - new npc_raliq_the_drunk(); - new npc_salsalabim(); new npc_kservant(); } |
