aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_06_26_00_world_conditions.sql4
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp43
2 files changed, 19 insertions, 28 deletions
diff --git a/sql/updates/world/2013_06_26_00_world_conditions.sql b/sql/updates/world/2013_06_26_00_world_conditions.sql
new file mode 100644
index 00000000000..bb1467d7bfe
--- /dev/null
+++ b/sql/updates/world/2013_06_26_00_world_conditions.sql
@@ -0,0 +1,4 @@
+-- Add Gossip Menu conditions for Agnetta Tyrsdottar
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (9874);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,9874,0,0,28,12969,0,0,1,0,'','Agnetta Tyrsdottar - Show gossip option only if quest is not complete');
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index aa6c53c188b..83262ee6964 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -27,16 +27,15 @@
#include "WorldSession.h"
/*######
-## npc_agnetta_tyrsdottar
+## npc_agnetta_tyrsdottar for QUEST_ITS_THAT_YOUR_GOBLIN 12969
######*/
-#define GOSSIP_AGNETTA "Skip the warmup, sister... or are you too scared to face soemeone your own size?"
-
enum eAgnetta
{
- QUEST_ITS_THAT_YOUR_GOBLIN = 12969,
FACTION_HOSTILE_AT1 = 45,
- SAY_AGGRO = 0
+ SAY_AGGRO = 0,
+ GOSSIP_ID = 9874,
+ GOSSIP_OPTION_ID = 0
};
class npc_agnetta_tyrsdottar : public CreatureScript
@@ -52,35 +51,23 @@ public:
{
me->RestoreFaction();
}
+
+ void sGossipSelect(Player* player, uint32 sender, uint32 action)
+ {
+ if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID)
+ {
+ player->CLOSE_GOSSIP_MENU();
+ me->setFaction(FACTION_HOSTILE_AT1);
+ Talk(SAY_AGGRO);
+ AttackStart(player);
+ }
+ }
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_agnetta_tyrsdottarAI(creature);
}
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_ITS_THAT_YOUR_GOBLIN) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AGNETTA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
-
- player->SEND_GOSSIP_MENU(13691, creature->GetGUID());
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF+1)
- {
- creature->AI()->Talk(SAY_AGGRO);
- player->CLOSE_GOSSIP_MENU();
- creature->setFaction(FACTION_HOSTILE_AT1);
- creature->AI()->AttackStart(player);
- }
-
- return true;
- }
};
/*######