Core/Gossip: Drop OptionType for gossip_menu_option and rename OptionIcon to OptionNpc as it also determines functionality on client side
Port From (https://github.com/TrinityCore/TrinityCore/commit/69e0249807f5a8f351e6be6f7350ebace3d2997a)
This commit is contained in:
@@ -471,7 +471,7 @@ namespace Scripts.World.GameObjects
|
||||
QuestStatus status = player.GetQuestStatus(QuestIds.DoingYourDuty);
|
||||
if (status == QuestStatus.Incomplete || status == QuestStatus.Complete || status == QuestStatus.Rewarded)
|
||||
{
|
||||
player.AddGossipItem(GossipOptionIcon.None, GossipConst.GossipUseOuthouse, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.AddGossipItem(GossipOptionNpc.None, GossipConst.GossipUseOuthouse, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.SendGossipMenu(GossipConst.GossipOuthouseVacant, me.GetGUID());
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1475,45 +1475,6 @@ namespace Scripts.World.NpcSpecial
|
||||
bool _showUnderground;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_experience : ScriptedAI
|
||||
{
|
||||
public npc_experience(Creature creature) : base(creature) { }
|
||||
|
||||
public override bool OnGossipHello(Player player)
|
||||
{
|
||||
if (player.HasPlayerFlag(PlayerFlags.NoXPGain)) // not gaining XP
|
||||
{
|
||||
player.AddGossipItem(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.SendGossipMenu(TextIds.XpOnOff, me.GetGUID());
|
||||
}
|
||||
else // currently gaining XP
|
||||
{
|
||||
player.AddGossipItem(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOff, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
|
||||
player.SendGossipMenu(TextIds.XpOnOff, me.GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
{
|
||||
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case eTradeskill.GossipActionInfoDef + 1:// XP ON selected
|
||||
player.RemovePlayerFlag(PlayerFlags.NoXPGain); // turn on XP gain
|
||||
break;
|
||||
case eTradeskill.GossipActionInfoDef + 2:// XP OFF selected
|
||||
player.SetPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
|
||||
break;
|
||||
}
|
||||
|
||||
player.PlayerTalkClass.SendCloseGossip();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_spring_rabbit : ScriptedAI
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user