aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2022_01_06_00_world_2020_05_17_03_world.sql50
-rw-r--r--src/server/scripts/Outland/zone_zangarmarsh.cpp122
2 files changed, 50 insertions, 122 deletions
diff --git a/sql/updates/world/master/2022_01_06_00_world_2020_05_17_03_world.sql b/sql/updates/world/master/2022_01_06_00_world_2020_05_17_03_world.sql
new file mode 100644
index 00000000000..0083da35248
--- /dev/null
+++ b/sql/updates/world/master/2022_01_06_00_world_2020_05_17_03_world.sql
@@ -0,0 +1,50 @@
+--
+UPDATE `creature_template` SET `ScriptName` = "" WHERE `entry` IN (17900,17901);
+
+DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (7559,7560);
+INSERT INTO `gossip_menu_option` (`MenuID`,`OptionIndex`,`OptionIcon`,`OptionText`,`OptionBroadcastTextID`,`OptionType`,`OptionNpcFlag`,`VerifiedBuild`) VALUES
+(7559,0,0,"Grant me your mark, wise ancient.",14739,1,1,0),
+(7560,0,0,"Grant me your mark, mighty ancient.",14741,1,1,0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` IN (7559,7560);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,7559,0,0,0,5,0,942,240,0,0,0,0,"","Group 0: Show Gossip Option 0 if player is at least Friendly with Cenarion Expedition"),
+(15,7560,0,0,0,5,0,942,240,0,0,0,0,"","Group 0: Show Gossip Option 0 if player is at least Friendly with Cenarion Expedition");
+
+-- Ashyen SAI
+SET @ID := 17900;
+UPDATE `creature_template` SET `AIName` = "SmartAI" WHERE `entry` = @ID;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
+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
+(@ID,0,0,5,62,0,100,0,7559,0,0,0,0,11,31808,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Ashyen - On Gossip Option 0 Selected - Cast 'Mark of Lore'"),
+(@ID,0,1,5,62,0,100,0,7559,0,0,0,0,11,31810,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Ashyen - On Gossip Option 0 Selected - Cast 'Mark of Lore'"),
+(@ID,0,2,5,62,0,100,0,7559,0,0,0,0,11,31811,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Ashyen - On Gossip Option 0 Selected - Cast 'Mark of Lore'"),
+(@ID,0,3,5,62,0,100,0,7559,0,0,0,0,11,31815,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Ashyen - On Gossip Option 0 Selected - Cast 'Mark of Lore'"),
+(@ID,0,4,5,62,0,100,0,7559,0,0,0,0,33,17900,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Ashyen - On Gossip Option 0 Selected - Quest Credit 'Blessings of the Ancients'"),
+(@ID,0,5,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,"Ashyen - On Link - Close Gossip");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 17900;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(22,1,17900,0,0,5,0,942,16,0,0,0,0,"","Group 0: Execute SAI (Action 0) if player is Friendly with Cenarion Expedition"),
+(22,2,17900,0,0,5,0,942,32,0,0,0,0,"","Group 0: Execute SAI (Action 1) if player is Honored with Cenarion Expedition"),
+(22,3,17900,0,0,5,0,942,64,0,0,0,0,"","Group 0: Execute SAI (Action 2) if player is Revered with Cenarion Expedition"),
+(22,4,17900,0,0,5,0,942,128,0,0,0,0,"","Group 0: Execute SAI (Action 3) if player is Exalted with Cenarion Expedition");
+
+-- Keleth SAI
+SET @ID := 17901;
+UPDATE `creature_template` SET `AIName` = "SmartAI" WHERE `entry` = @ID;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0;
+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
+(@ID,0,0,5,62,0,100,0,7560,0,0,0,0,11,31807,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Keleth - On Gossip Option 0 Selected - Cast 'Mark of War'"),
+(@ID,0,1,5,62,0,100,0,7560,0,0,0,0,11,31812,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Keleth - On Gossip Option 0 Selected - Cast 'Mark of War'"),
+(@ID,0,2,5,62,0,100,0,7560,0,0,0,0,11,31813,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Keleth - On Gossip Option 0 Selected - Cast 'Mark of War'"),
+(@ID,0,3,5,62,0,100,0,7560,0,0,0,0,11,31814,6,0,0,0,0,7,0,0,0,0,0,0,0,0,"Keleth - On Gossip Option 0 Selected - Cast 'Mark of War'"),
+(@ID,0,4,5,62,0,100,0,7560,0,0,0,0,33,17901,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Keleth - On Gossip Option 0 Selected - Quest Credit 'Blessings of the Ancients'"),
+(@ID,0,5,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,"Keleth - On Link - Close Gossip");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 17901;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(22,1,17901,0,0,5,0,942,16,0,0,0,0,"","Group 0: Execute SAI (Action 0) if player is Friendly with Cenarion Expedition"),
+(22,2,17901,0,0,5,0,942,32,0,0,0,0,"","Group 0: Execute SAI (Action 1) if player is Honored with Cenarion Expedition"),
+(22,3,17901,0,0,5,0,942,64,0,0,0,0,"","Group 0: Execute SAI (Action 2) if player is Revered with Cenarion Expedition"),
+(22,4,17901,0,0,5,0,942,128,0,0,0,0,"","Group 0: Execute SAI (Action 3) if player is Exalted with Cenarion Expedition");
diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp
index b3fb6c1254b..a592b8bc63a 100644
--- a/src/server/scripts/Outland/zone_zangarmarsh.cpp
+++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp
@@ -18,12 +18,10 @@
/* ScriptData
SDName: Zangarmarsh
SD%Complete: 100
-SDComment: Quest support: 9752, 9785, Mark Of ... buffs.
SDCategory: Zangarmarsh
EndScriptData */
/* ContentData
-npcs_ashyen_and_keleth
npc_kayra_longmane
EndContentData */
@@ -33,125 +31,6 @@ EndContentData */
#include "ScriptedEscortAI.h"
/*######
-## npcs_ashyen_and_keleth
-######*/
-
-#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient."
-#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient."
-
-enum AshyenAndKeleth
-{
- NPC_ASHYEN = 17900,
- NPC_KELETH = 17901,
-
- SPELL_BLESS_ASH_EXA = 31815,
- SPELL_BLESS_ASH_REV = 31811,
- SPELL_BLESS_ASH_HON = 31810,
- SPELL_BLESS_ASH_FRI = 31808,
-
- SPELL_BLESS_KEL_EXA = 31814,
- SPELL_BLESS_KEL_REV = 31813,
- SPELL_BLESS_KEL_HON = 31812,
- SPELL_BLESS_KEL_FRI = 31807
-};
-
-class npcs_ashyen_and_keleth : public CreatureScript
-{
-public:
- npcs_ashyen_and_keleth() : CreatureScript("npcs_ashyen_and_keleth") { }
-
- struct npcs_ashyen_and_kelethAI : public ScriptedAI
- {
- npcs_ashyen_and_kelethAI(Creature* creature) : ScriptedAI(creature) { }
-
- bool GossipHello(Player* player) override
- {
- if (player->GetReputationRank(942) > REP_NEUTRAL)
- {
- if (me->GetEntry() == NPC_ASHYEN)
- AddGossipItemFor(player, GossipOptionIcon::None, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
-
- if (me->GetEntry() == NPC_KELETH)
- AddGossipItemFor(player, GossipOptionIcon::None, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- }
- SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
-
- return true;
- }
-
- 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)
- {
- me->SetPowerType(POWER_MANA);
- me->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case
- me->SetPower(POWER_MANA, 200);
-
- if (me->GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with
- {
- uint32 spell = 0;
- switch (player->GetReputationRank(942))
- { //mark of lore
- case REP_FRIENDLY:
- spell = SPELL_BLESS_ASH_FRI;
- break;
- case REP_HONORED:
- spell = SPELL_BLESS_ASH_HON;
- break;
- case REP_REVERED:
- spell = SPELL_BLESS_ASH_REV;
- break;
- case REP_EXALTED:
- spell = SPELL_BLESS_ASH_EXA;
- break;
- default:
- break;
- }
-
- if (spell)
- DoCast(player, spell, true);
- }
-
- if (me->GetEntry() == NPC_KELETH)
- {
- uint32 spell = 0;
- switch (player->GetReputationRank(942)) //mark of war
- {
- case REP_FRIENDLY:
- spell = SPELL_BLESS_KEL_FRI;
- break;
- case REP_HONORED:
- spell = SPELL_BLESS_KEL_HON;
- break;
- case REP_REVERED:
- spell = SPELL_BLESS_KEL_REV;
- break;
- case REP_EXALTED:
- spell = SPELL_BLESS_KEL_EXA;
- break;
- default:
- break;
- }
-
- if (spell)
- DoCast(player, spell, true);
- }
- CloseGossipMenuFor(player);
- player->TalkedToCreature(me->GetEntry(), me->GetGUID());
- }
- return true;
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npcs_ashyen_and_kelethAI(creature);
- }
-};
-
-/*######
## npc_kayra_longmane
######*/
@@ -232,6 +111,5 @@ public:
void AddSC_zangarmarsh()
{
- new npcs_ashyen_and_keleth();
new npc_kayra_longmane();
}