Core/Scripts: unified scripted gossip/quest api

Port From (https://github.com/TrinityCore/TrinityCore/commit/6604849716bc73d82a4cdbf8c66bb188086ceae4)
This commit is contained in:
hondacrx
2020-05-22 13:28:20 -04:00
parent 87b63b0975
commit c2aee387a8
30 changed files with 1642 additions and 1367 deletions
@@ -692,7 +692,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
{
public npc_grandmother(Creature creature) : base(creature) { }
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
if (menuId == RedRidingHood.OptionWhatPhatLewtsYouHave && gossipListId == 0)
{
@@ -704,6 +704,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
me.DespawnOrUnsummon();
}
return false;
}
}
@@ -1574,6 +1575,67 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
}
}
public override bool GossipHello(Player player)
{
// Check for death of Moroes and if opera event is not done already
if (instance.GetBossState(DataTypes.Moroes) == EncounterState.Done && instance.GetBossState(DataTypes.OperaPerformance) != EncounterState.Done)
{
AddGossipItemFor(player, GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (player.IsGameMaster())
{
AddGossipItemFor(player, GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
AddGossipItemFor(player, GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
AddGossipItemFor(player, GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
}
if (!RaidWiped)
SendGossipMenuFor(player, 8970, me.GetGUID());
else
SendGossipMenuFor(player, 8975, me.GetGUID());
return true;
}
SendGossipMenuFor(player, 8978, me.GetGUID());
return true;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
ClearGossipMenuFor(player);
switch (action)
{
case eTradeskill.GossipActionInfoDef + 1:
AddGossipItemFor(player, GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
SendGossipMenuFor(player, 8971, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
player.CLOSE_GOSSIP_MENU();
StartEvent();
break;
case eTradeskill.GossipActionInfoDef + 3:
CloseGossipMenuFor(player);
m_uiEventId = OperaEvents.Oz;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_OZ", player.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 4:
CloseGossipMenuFor(player);
m_uiEventId = OperaEvents.Hood;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_HOOD", player.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 5:
CloseGossipMenuFor(player);
m_uiEventId = OperaEvents.RAJ;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_RAJ", player.GetGUID());
break;
}
return true;
}
InstanceScript instance;
ObjectGuid m_uiSpotlightGUID;
@@ -1587,75 +1649,6 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent
public bool RaidWiped;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
npc_barnesAI pBarnesAI = (npc_barnesAI)creature.GetAI();
switch (action)
{
case eTradeskill.GossipActionInfoDef + 1:
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.SEND_GOSSIP_MENU(8971, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
player.CLOSE_GOSSIP_MENU();
pBarnesAI.StartEvent();
break;
case eTradeskill.GossipActionInfoDef + 3:
player.CLOSE_GOSSIP_MENU();
pBarnesAI.m_uiEventId = OperaEvents.Oz;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_OZ", player.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 4:
player.CLOSE_GOSSIP_MENU();
pBarnesAI.m_uiEventId = OperaEvents.Hood;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_HOOD", player.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 5:
player.CLOSE_GOSSIP_MENU();
pBarnesAI.m_uiEventId = OperaEvents.RAJ;
Log.outInfo(LogFilter.Scripts, "player (GUID {0}) manually set Opera event to EVENT_RAJ", player.GetGUID());
break;
}
return true;
}
public override bool OnGossipHello(Player player, Creature creature)
{
InstanceScript instance = creature.GetInstanceScript();
if (instance != null)
{
// Check for death of Moroes and if opera event is not done already
if (instance.GetBossState(DataTypes.Moroes) == EncounterState.Done && instance.GetBossState(DataTypes.OperaPerformance) != EncounterState.Done)
{
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, karazhanConst.OZ_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (player.IsGameMaster())
{
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Dot, karazhanConst.OZ_GM_GOSSIP3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
}
npc_barnesAI pBarnesAI = (npc_barnesAI)creature.GetAI();
if (pBarnesAI != null)
{
if (!pBarnesAI.RaidWiped)
player.SEND_GOSSIP_MENU(8970, creature.GetGUID());
else
player.SEND_GOSSIP_MENU(8975, creature.GetGUID());
return true;
}
}
}
player.SEND_GOSSIP_MENU(8978, creature.GetGUID());
return true;
}
public override CreatureAI GetAI(Creature creature)
{
return GetInstanceAI<npc_barnesAI>(creature);
@@ -349,21 +349,31 @@ namespace Scripts.EasternKingdoms
{
public go_acherus_soul_prison() : base("go_acherus_soul_prison") { }
public override bool OnGossipHello(Player player, GameObject go)
class go_acherus_soul_prisonAI : GameObjectAI
{
Creature anchor = go.FindNearestCreature(29521, 15);
if (anchor)
{
ObjectGuid prisonerGUID = anchor.GetAI().GetGUID();
if (!prisonerGUID.IsEmpty())
{
Creature prisoner = ObjectAccessor.GetCreature(player, prisonerGUID);
if (prisoner)
((npc_unworthy_initiate)prisoner.GetAI()).EventStart(anchor, player);
}
}
public go_acherus_soul_prisonAI(GameObject go) : base(go) { }
return false;
public override bool GossipHello(Player player, bool reportUse)
{
Creature anchor = me.FindNearestCreature(29521, 15);
if (anchor)
{
ObjectGuid prisonerGUID = anchor.GetAI().GetGUID();
if (!prisonerGUID.IsEmpty())
{
Creature prisoner = ObjectAccessor.GetCreature(player, prisonerGUID);
if (prisoner)
((npc_unworthy_initiate)prisoner.GetAI()).EventStart(anchor, player);
}
}
return false;
}
}
public override GameObjectAI GetAI(GameObject go)
{
return new go_acherus_soul_prisonAI(go);
}
}
@@ -545,54 +555,51 @@ namespace Scripts.EasternKingdoms
base.UpdateAI(uiDiff);
}
public override bool GossipHello(Player player)
{
if (player.GetQuestStatus(MiscConst.QuestDeathChallenge) == QuestStatus.Incomplete && me.IsFullHealth())
{
if (player.HealthBelowPct(10))
return true;
if (player.IsInCombat() || me.IsInCombat())
return true;
AddGossipItemFor(player, Player.GetDefaultGossipMenuForSource(me), 0, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
SendGossipMenuFor(player, player.GetGossipTextId(me), me.GetGUID());
}
return true;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
ClearGossipMenuFor(player);
if (action == eTradeskill.GossipActionInfoDef)
{
CloseGossipMenuFor(player);
if (player.IsInCombat() || me.IsInCombat())
return true;
if (m_bIsDuelInProgress)
return true;
me.RemoveUnitFlag(UnitFlags.ImmuneToPc);
me.RemoveUnitFlag(UnitFlags.Unk15);
player.CastSpell(me, SpellIds.Duel, false);
player.CastSpell(player, SpellIds.DuelFlag, true);
}
return true;
}
bool lose;
ObjectGuid m_uiDuelerGUID;
uint m_uiDuelTimer;
public bool m_bIsDuelInProgress;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
ClearGossipMenuFor(player);
if (action == eTradeskill.GossipActionInfoDef)
{
CloseGossipMenuFor(player);
if (player.IsInCombat() || creature.IsInCombat())
return true;
npc_death_knight_initiateAI pInitiateAI = creature.GetAI<npc_death_knight_initiateAI>();
if (pInitiateAI != null)
{
if (pInitiateAI.m_bIsDuelInProgress)
return true;
}
creature.RemoveUnitFlag(UnitFlags.ImmuneToPc);
creature.RemoveUnitFlag(UnitFlags.Unk15);
player.CastSpell(creature, SpellIds.Duel, false);
player.CastSpell(player, SpellIds.DuelFlag, true);
}
return true;
}
public override bool OnGossipHello(Player player, Creature creature)
{
if (player.GetQuestStatus(MiscConst.QuestDeathChallenge) == QuestStatus.Incomplete && creature.IsFullHealth())
{
if (player.HealthBelowPct(10))
return true;
if (player.IsInCombat() || creature.IsInCombat())
return true;
AddGossipItemFor(player, Player.GetDefaultGossipMenuForSource(creature), 0, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
SendGossipMenuFor(player, player.GetGossipTextId(creature), creature.GetGUID());
}
return true;
}
public override CreatureAI GetAI(Creature creature)
{
return new npc_death_knight_initiateAI(creature);
@@ -681,13 +688,14 @@ namespace Scripts.EasternKingdoms
{
public npc_salanar_the_horseman(Creature creature) : base(creature) { }
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
if (menuId == MiscConst.GossipSalanarMenu && gossipListId == MiscConst.GossipSalanarOption)
{
player.CastSpell(player, SpellIds.RealmOfShadows, true);
player.PlayerTalkClass.SendCloseGossip();
}
return false;
}
public override void SpellHit(Unit caster, SpellInfo spell)
+20 -10
View File
@@ -319,22 +319,32 @@ namespace Scripts.Kalimdor.ZoneAshenvale
{
public go_naga_brazier() : base("go_naga_brazier") { }
public override bool OnGossipHello(Player player, GameObject go)
class go_naga_brazierAI : GameObjectAI
{
Creature creature = ScriptedAI.GetClosestCreatureWithEntry(go, CreatureIds.Muglash, SharedConst.InteractionDistance * 2);
if (creature)
public go_naga_brazierAI(GameObject go) : base(go) { }
public override bool GossipHello(Player player, bool reportUse)
{
npc_muglash pEscortAI = creature.GetAI<npc_muglash>();
if (pEscortAI != null)
Creature creature = ScriptedAI.GetClosestCreatureWithEntry(me, CreatureIds.Muglash, SharedConst.InteractionDistance * 2);
if (creature)
{
creature.GetAI().Talk(TextIds.SayMugBrazierWait);
npc_muglash pEscortAI = creature.GetAI<npc_muglash>();
if (pEscortAI != null)
{
creature.GetAI().Talk(TextIds.SayMugBrazierWait);
pEscortAI._isBrazierExtinguished = true;
return false;
pEscortAI._isBrazierExtinguished = true;
return false;
}
}
}
return true;
return true;
}
}
public override GameObjectAI GetAI(GameObject go)
{
return new go_naga_brazierAI(go);
}
}
@@ -364,33 +364,44 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet.PrinceTaldaram
{
public go_prince_taldaram_sphere() : base("go_prince_taldaram_sphere") { }
public override bool OnGossipHello(Player player, GameObject go)
class go_prince_taldaram_sphereAI : GameObjectAI
{
InstanceScript instance = go.GetInstanceScript();
if (instance == null)
return false;
Creature PrinceTaldaram = ObjectAccessor.GetCreature(go, instance.GetGuidData(DataTypes.PrinceTaldaram));
if (PrinceTaldaram && PrinceTaldaram.IsAlive())
public go_prince_taldaram_sphereAI(GameObject go) : base(go)
{
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
switch (go.GetEntry())
{
case GameObjectIds.Sphere1:
instance.SetData(DataTypes.Sphere1, (uint)EncounterState.InProgress);
PrinceTaldaram.GetAI().Talk(TextIds.Say1);
break;
case GameObjectIds.Sphere2:
instance.SetData(DataTypes.Sphere2, (uint)EncounterState.InProgress);
PrinceTaldaram.GetAI().Talk(TextIds.Say1);
break;
}
PrinceTaldaram.GetAI<boss_prince_taldaram>().CheckSpheres();
instance = go.GetInstanceScript();
}
return true;
public override bool GossipHello(Player player, bool reportUse)
{
Creature PrinceTaldaram = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.PrinceTaldaram));
if (PrinceTaldaram && PrinceTaldaram.IsAlive())
{
me.AddFlag(GameObjectFlags.NotSelectable);
me.SetGoState(GameObjectState.Active);
switch (me.GetEntry())
{
case GameObjectIds.Sphere1:
instance.SetData(DataTypes.Sphere1, (uint)EncounterState.InProgress);
PrinceTaldaram.GetAI().Talk(TextIds.Say1);
break;
case GameObjectIds.Sphere2:
instance.SetData(DataTypes.Sphere2, (uint)EncounterState.InProgress);
PrinceTaldaram.GetAI().Talk(TextIds.Say1);
break;
}
PrinceTaldaram.GetAI<boss_prince_taldaram>().CheckSpheres();
}
return true;
}
InstanceScript instance;
}
public override GameObjectAI GetAI(GameObject go)
{
return GetInstanceAI<go_prince_taldaram_sphereAI>(go);
}
}
@@ -518,6 +518,40 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
}
}
public override bool GossipHello(Player player)
{
if (((instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.Done &&
instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.Done &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_E) == (uint)EncounterState.Done) ||
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_P) == (uint)EncounterState.Done))
return false;
if (instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_E) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_P) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.NotStarted)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, TrialOfTheChampionConst.GOSSIP_START_EVENT1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
else if (instance != null)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, TrialOfTheChampionConst.GOSSIP_START_EVENT2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
SendGossipMenuFor(player, player.GetGossipTextId(me), me.GetGUID());
return true;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
ClearGossipMenuFor(player);
if (action == eTradeskill.GossipActionInfoDef + 1)
{
CloseGossipMenuFor(player);
StartEncounter();
}
return true;
}
InstanceScript instance;
byte uiSummonTimes;
@@ -543,43 +577,6 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
Position SpawnPosition = new Position(746.261f, 657.401f, 411.681f, 4.65f);
}
public override bool OnGossipHello(Player player, Creature creature)
{
InstanceScript instance = creature.GetInstanceScript();
if (instance != null &&
((instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.Done &&
instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.Done &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_E) == (uint)EncounterState.Done) ||
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_P) == (uint)EncounterState.Done))
return false;
if (instance != null &&
instance.GetData((uint)Data.BOSS_GRAND_CHAMPIONS) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_E) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_ARGENT_CHALLENGE_P) == (uint)EncounterState.NotStarted &&
instance.GetData((uint)Data.BOSS_BLACK_KNIGHT) == (uint)EncounterState.NotStarted)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, TrialOfTheChampionConst.GOSSIP_START_EVENT1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
else if (instance != null)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, TrialOfTheChampionConst.GOSSIP_START_EVENT2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(player.GetGossipTextId(creature), creature.GetGUID());
return true;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
if (action == eTradeskill.GossipActionInfoDef + 1)
{
player.CLOSE_GOSSIP_MENU();
((npc_announcer_toc5AI)creature.GetAI()).StartEncounter();
}
return true;
}
public override CreatureAI GetAI(Creature creature)
{
return GetInstanceAI<npc_announcer_toc5AI>(creature);
@@ -22,6 +22,7 @@ using Game.AI;
using Game.Entities;
using Game.Maps;
using Game.Scripting;
using System.Linq;
namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
{
@@ -779,7 +780,10 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
class npc_announcer_toc10AI : ScriptedAI
{
public npc_announcer_toc10AI(Creature creature) : base(creature) { }
public npc_announcer_toc10AI(Creature creature) : base(creature)
{
instance = creature.GetInstanceScript();
}
public override void Reset()
{
@@ -794,101 +798,86 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader
}
public override void AttackStart(Unit who) { }
}
public override bool OnGossipHello(Player player, Creature creature)
{
InstanceScript instance = creature.GetInstanceScript();
if (instance == null)
return true;
string _message = "We are ready!";
if (player.IsInCombat() || instance.IsEncounterInProgress() || instance.GetData(DataTypes.Event) != 0)
return true;
byte i = 0;
for (; i < MiscData._GossipMessage.Length; ++i)
public override bool GossipHello(Player player)
{
if ((!MiscData._GossipMessage[i].state && instance.GetBossState(MiscData._GossipMessage[i].encounter) != EncounterState.Done)
|| (MiscData._GossipMessage[i].state && instance.GetBossState(MiscData._GossipMessage[i].encounter) == EncounterState.Done))
string _message = "We are ready!";
if (player.IsInCombat() || instance.IsEncounterInProgress() || instance.GetData(DataTypes.Event) != 0)
return true;
byte i = 0;
for (; i < MiscData._GossipMessage.Length; ++i)
{
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, _message, eTradeskill.GossipSenderMain, MiscData._GossipMessage[i].id);
break;
if ((!MiscData._GossipMessage[i].state && instance.GetBossState(MiscData._GossipMessage[i].encounter) != EncounterState.Done)
|| (MiscData._GossipMessage[i].state && instance.GetBossState(MiscData._GossipMessage[i].encounter) == EncounterState.Done))
{
AddGossipItemFor(player, GossipOptionIcon.Chat, _message, eTradeskill.GossipSenderMain, MiscData._GossipMessage[i].id);
break;
}
}
}
if (i >= MiscData._GossipMessage.Length)
return false;
if (i >= MiscData._GossipMessage.Length)
return false;
player.SEND_GOSSIP_MENU((uint)MiscData._GossipMessage[i].msgnum, creature.GetGUID());
return true;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
player.CLOSE_GOSSIP_MENU();
InstanceScript instance = creature.GetInstanceScript();
if (instance == null)
SendGossipMenuFor(player, (uint)MiscData._GossipMessage[i].msgnum, me.GetGUID());
return true;
if (instance.GetBossState(DataTypes.BossBeasts) != EncounterState.Done)
{
instance.SetData(DataTypes.Event, 110);
instance.SetData(DataTypes.NorthrendBeasts, (uint)EncounterState.NotStarted);
instance.SetBossState(DataTypes.BossBeasts, EncounterState.NotStarted);
}
else if (instance.GetBossState(DataTypes.BossJaraxxus) != EncounterState.Done)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
// if Jaraxxus is spawned, but the raid wiped
Creature jaraxxus = ObjectAccessor.GetCreature(player, instance.GetGuidData(CreatureIds.Jaraxxus));
if (jaraxxus)
ClearGossipMenuFor(player);
CloseGossipMenuFor(player);
if (instance.GetBossState(DataTypes.BossBeasts) != EncounterState.Done)
{
jaraxxus.RemoveAurasDueToSpell(Spells.JaraxxusChains);
jaraxxus.RemoveUnitFlag(UnitFlags.NonAttackable);
jaraxxus.SetReactState(ReactStates.Defensive);
jaraxxus.SetInCombatWithZone();
instance.SetData(DataTypes.Event, 110);
instance.SetData(DataTypes.NorthrendBeasts, (uint)EncounterState.NotStarted);
instance.SetBossState(DataTypes.BossBeasts, EncounterState.NotStarted);
}
else
else if (instance.GetBossState(DataTypes.BossJaraxxus) != EncounterState.Done)
{
instance.SetData(DataTypes.Event, 1010);
instance.SetBossState(DataTypes.BossJaraxxus, EncounterState.NotStarted);
// if Jaraxxus is spawned, but the raid wiped
Creature jaraxxus = ObjectAccessor.GetCreature(player, instance.GetGuidData(CreatureIds.Jaraxxus));
if (jaraxxus)
{
jaraxxus.RemoveAurasDueToSpell(Spells.JaraxxusChains);
jaraxxus.RemoveUnitFlag(UnitFlags.NonAttackable);
jaraxxus.SetReactState(ReactStates.Defensive);
jaraxxus.SetInCombatWithZone();
}
else
{
instance.SetData(DataTypes.Event, 1010);
instance.SetBossState(DataTypes.BossJaraxxus, EncounterState.NotStarted);
}
}
else if (instance.GetBossState(DataTypes.BossCrusaders) != EncounterState.Done)
{
if (player.GetTeam() == Team.Alliance)
instance.SetData(DataTypes.Event, 3000);
else
instance.SetData(DataTypes.Event, 3001);
instance.SetBossState(DataTypes.BossCrusaders, EncounterState.NotStarted);
}
else if (instance.GetBossState(DataTypes.BossValkiries) != EncounterState.Done)
{
instance.SetData(DataTypes.Event, 4000);
instance.SetBossState(DataTypes.BossValkiries, EncounterState.NotStarted);
}
else if (instance.GetBossState(DataTypes.BossLichKing) != EncounterState.Done)
{
if (me.GetMap().GetPlayers().First().GetTeam() == Team.Alliance)
instance.SetData(DataTypes.Event, 4020);
else
instance.SetData(DataTypes.Event, 4030);
instance.SetBossState(DataTypes.BossLichKing, EncounterState.NotStarted);
}
me.RemoveNpcFlag(NPCFlags.Gossip);
return true;
}
else if (instance.GetBossState(DataTypes.BossCrusaders) != EncounterState.Done)
{
if (player.GetTeam() == Team.Alliance)
instance.SetData(DataTypes.Event, 3000);
else
instance.SetData(DataTypes.Event, 3001);
instance.SetBossState(DataTypes.BossCrusaders, EncounterState.NotStarted);
}
else if (instance.GetBossState(DataTypes.BossValkiries) != EncounterState.Done)
{
instance.SetData(DataTypes.Event, 4000);
instance.SetBossState(DataTypes.BossValkiries, EncounterState.NotStarted);
}
else if (instance.GetBossState(DataTypes.BossLichKing) != EncounterState.Done)
{
GameObject floor = ObjectAccessor.GetGameObject(player, instance.GetGuidData(GameObjectIds.ArgentColiseumFloor));
if (floor)
floor.SetDestructibleState(GameObjectDestructibleState.Damaged);
creature.CastSpell(creature, Spells.CorpseTeleport, false);
creature.CastSpell(creature, Spells.DestroyFloorKnockup, false);
Creature anubArak = ObjectAccessor.GetCreature(creature, instance.GetGuidData(CreatureIds.Anubarak));
if (!anubArak || !anubArak.IsAlive())
anubArak = creature.SummonCreature(CreatureIds.Anubarak, MiscData.AnubarakLoc[0].GetPositionX(), MiscData.AnubarakLoc[0].GetPositionY(), MiscData.AnubarakLoc[0].GetPositionZ(), 3, TempSummonType.CorpseTimedDespawn, MiscData.DespawnTime);
instance.SetBossState(DataTypes.BossAnubarak, EncounterState.NotStarted);
if (creature.IsVisible())
creature.SetVisible(false);
}
creature.RemoveNpcFlag(NPCFlags.Gossip);
return true;
InstanceScript instance;
}
public override CreatureAI GetAI(Creature creature)
@@ -220,7 +220,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
Initialize();
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
if (menuId == Misc.MenuIdSylvanas && gossipListId == Misc.GossipOptionId)
{
@@ -231,6 +231,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
_events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000);
}
return false;
}
public override void UpdateAI(uint diff)
@@ -304,7 +305,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
Initialize();
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
if (menuId == Misc.MenuIdJaina && gossipListId == Misc.GossipOptionId)
{
@@ -314,6 +315,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls
_events.Reset();
_events.ScheduleEvent(EventIds.Intro1, 1000);
}
return false;
}
public override void UpdateAI(uint diff)
@@ -17,6 +17,7 @@
using Framework.Constants;
using Framework.IO;
using Game.AI;
using Game.Entities;
using Game.Maps;
using Game.Scripting;
@@ -421,19 +422,28 @@ namespace Scripts.Northrend.Gundrak
{
public go_gundrak_altar() : base("go_gundrak_altar") { }
public override bool OnGossipHello(Player player, GameObject go)
class go_gundrak_altarAI : GameObjectAI
{
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
InstanceScript instance = go.GetInstanceScript();
if (instance != null)
public go_gundrak_altarAI(GameObject go) : base(go)
{
instance.SetData(GDDataTypes.StatueActivate, go.GetEntry());
instance = go.GetInstanceScript();
}
public override bool GossipHello(Player player, bool reportUse)
{
me.AddFlag(GameObjectFlags.NotSelectable);
me.SetGoState(GameObjectState.Active);
instance.SetData(GDDataTypes.StatueActivate, me.GetEntry());
return true;
}
return false;
InstanceScript instance;
}
public override GameObjectAI GetAI(GameObject go)
{
return GetInstanceAI<go_gundrak_altarAI>(go);
}
}
}
@@ -955,7 +955,7 @@ namespace Scripts.Northrend.IcecrownCitadel
}
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true);
@@ -965,6 +965,7 @@ namespace Scripts.Northrend.IcecrownCitadel
_events.ScheduleEvent(GunshipEvents.IntroSummonSkybreaker, 24600, 0, GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroH3, 29600, 0, GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroH4, 39200, 0, GunshipMiscData.PhaseIntro);
return false;
}
public override void DamageTaken(Unit u, ref uint damage)
@@ -1200,7 +1201,7 @@ namespace Scripts.Northrend.IcecrownCitadel
}
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
me.RemoveNpcFlag(NPCFlags.Gossip);
me.GetTransport().EnableMovement(true);
@@ -1211,6 +1212,7 @@ namespace Scripts.Northrend.IcecrownCitadel
_events.ScheduleEvent(GunshipEvents.IntroA3, 33000, 0, GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroA4, 39000, 0, GunshipMiscData.PhaseIntro);
_events.ScheduleEvent(GunshipEvents.IntroA5, 45000, 0, GunshipMiscData.PhaseIntro);
return false;
}
public override void DamageTaken(Unit u, ref uint damage)
@@ -1358,10 +1360,11 @@ namespace Scripts.Northrend.IcecrownCitadel
me.SetReactState(ReactStates.Passive);
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
player.AddItem(GunshipMiscData.ItemGoblinRocketPack, 1);
player.PlayerTalkClass.SendCloseGossip();
return false;
}
public override void UpdateAI(uint diff)
@@ -441,12 +441,22 @@ namespace Scripts.Northrend.IcecrownCitadel
{
public npc_alchemist_adrianna() : base("npc_alchemist_adrianna") { }
public override bool OnGossipHello(Player player, Creature creature)
class npc_alchemist_adriannaAI : ScriptedAI
{
if (!creature.FindCurrentSpellBySpellId(InstanceSpells.HarvestBlightSpecimen) && !creature.FindCurrentSpellBySpellId(InstanceSpells.HarvestBlightSpecimen25))
if (player.HasAura(InstanceSpells.OrangeBlightResidue) && player.HasAura(InstanceSpells.GreenBlightResidue))
creature.CastSpell(creature, InstanceSpells.HarvestBlightSpecimen, false);
return false;
public npc_alchemist_adriannaAI(Creature creature) : base(creature) { }
public override bool GossipHello(Player player)
{
if (!me.FindCurrentSpellBySpellId(InstanceSpells.HarvestBlightSpecimen) && !me.FindCurrentSpellBySpellId(InstanceSpells.HarvestBlightSpecimen25))
if (player.HasAura(InstanceSpells.OrangeBlightResidue) && player.HasAura(InstanceSpells.GreenBlightResidue))
DoCastSelf(InstanceSpells.HarvestBlightSpecimen, false);
return false;
}
}
public override CreatureAI GetAI(Creature creature)
{
return new npc_alchemist_adriannaAI(creature);
}
}
@@ -194,22 +194,34 @@ namespace Scripts.Northrend.Nexus.Nexus
{
public containment_sphere() : base("containment_sphere") { }
public override bool OnGossipHello(Player player, GameObject go)
class containment_sphereAI : GameObjectAI
{
InstanceScript instance = go.GetInstanceScript();
Creature pKeristrasza = ObjectAccessor.GetCreature(go, instance.GetGuidData(DataTypes.Keristrasza));
if (pKeristrasza && pKeristrasza.IsAlive())
public containment_sphereAI(GameObject go) : base(go)
{
// maybe these are hacks :(
go.AddFlag(GameObjectFlags.NotSelectable);
go.SetGoState(GameObjectState.Active);
((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
instance = go.GetInstanceScript();
}
return true;
public override bool GossipHello(Player player, bool reportUse)
{
Creature pKeristrasza = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Keristrasza));
if (pKeristrasza && pKeristrasza.IsAlive())
{
// maybe these are hacks :(
me.AddFlag(GameObjectFlags.NotSelectable);
me.SetGoState(GameObjectState.Active);
((boss_keristrasza)pKeristrasza.GetAI()).CheckContainmentSpheres(true);
}
return true;
}
InstanceScript instance;
}
public override GameObjectAI GetAI(GameObject go)
{
return GetInstanceAI<containment_sphereAI>(go);
}
}
[Script]
@@ -1034,7 +1034,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
}
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
if (menuId == GossipIds.MenuLoreKeeper && gossipListId == GossipIds.OptionLoreKeeper)
{
@@ -1062,6 +1062,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
}
}
}
return false;
}
InstanceScript _instance;
@@ -1072,31 +1073,42 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan
{
public go_ulduar_tower() : base("go_ulduar_tower") { }
public override void OnDestroyed(GameObject go, Player player)
class go_ulduar_towerAI : GameObjectAI
{
InstanceScript instance = go.GetInstanceScript();
if (instance == null)
return;
switch (go.GetEntry())
public go_ulduar_towerAI(GameObject go) : base(go)
{
case Towers.ofStorms:
instance.ProcessEvent(go, InstanceEventIds.TowerOfStormDestroyed);
break;
case Towers.ofFlames:
instance.ProcessEvent(go, InstanceEventIds.TowerOfFlamesDestroyed);
break;
case Towers.ofFrost:
instance.ProcessEvent(go, InstanceEventIds.TowerOfFrostDestroyed);
break;
case Towers.ofLife:
instance.ProcessEvent(go, InstanceEventIds.TowerOfLifeDestroyed);
break;
instance = go.GetInstanceScript();
}
Creature trigger = go.FindNearestCreature(CreatureIds.UlduarGauntletGenerator, 15.0f, true);
if (trigger)
trigger.DisappearAndDie();
public override void Destroyed(Player player, uint eventId)
{
switch (me.GetEntry())
{
case Towers.ofStorms:
instance.ProcessEvent(me, InstanceEventIds.TowerOfStormDestroyed);
break;
case Towers.ofFlames:
instance.ProcessEvent(me, InstanceEventIds.TowerOfFlamesDestroyed);
break;
case Towers.ofFrost:
instance.ProcessEvent(me, InstanceEventIds.TowerOfFrostDestroyed);
break;
case Towers.ofLife:
instance.ProcessEvent(me, InstanceEventIds.TowerOfLifeDestroyed);
break;
}
Creature trigger = me.FindNearestCreature(CreatureIds.UlduarGauntletGenerator, 15.0f, true);
if (trigger)
trigger.DisappearAndDie();
}
InstanceScript instance;
}
public override GameObjectAI GetAI(GameObject go)
{
return GetInstanceAI<go_ulduar_towerAI>(go);
}
}
+23 -11
View File
@@ -24,6 +24,7 @@ using Game.Scripting;
using Game.Spells;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
namespace Scripts.Northrend.Ulduar
@@ -1594,21 +1595,32 @@ namespace Scripts.Northrend.Ulduar
{
public go_mimiron_hardmode_button() : base("go_mimiron_hardmode_button") { }
public override bool OnGossipHello(Player player, GameObject go)
class go_mimiron_hardmode_buttonAI : GameObjectAI
{
if (go.HasFlag(GameObjectFlags.NotSelectable))
go_mimiron_hardmode_buttonAI(GameObject go) : base(go)
{
instance = go.GetInstanceScript();
}
public override bool GossipHello(Player player, bool reportUse)
{
if (me.HasFlag(GameObjectFlags.NotSelectable))
return true;
Creature computer = ObjectAccessor.GetCreature(me, instance.GetGuidData(InstanceData.Computer));
if (computer)
computer.GetAI().DoAction(Actions.ActivateComputer);
me.SetGoState(GameObjectState.Active);
me.AddFlag(GameObjectFlags.NotSelectable);
return true;
}
InstanceScript instance = go.GetInstanceScript();
if (instance == null)
return false;
InstanceScript instance;
}
Creature computer = ObjectAccessor.GetCreature(go, instance.GetGuidData(InstanceData.Computer));
if (computer)
computer.GetAI().DoAction(Actions.ActivateComputer);
go.SetGoState(GameObjectState.Active);
go.AddFlag(GameObjectFlags.NotSelectable);
return true;
public override GameObjectAI GetAI(GameObject go)
{
return GetInstanceAI<go_mimiron_hardmode_buttonAI>(go);
}
}
+184 -166
View File
@@ -29,108 +29,119 @@ namespace Scripts.Outlands
{
public npcs_ashyen_and_keleth() : base("npcs_ashyen_and_keleth") { }
public override bool OnGossipHello(Player player, Creature creature)
class npcs_ashyen_and_kelethAI : ScriptedAI
{
if (player.GetReputationRank(942) > ReputationRank.Neutral)
public npcs_ashyen_and_kelethAI(Creature creature) : base(creature) { }
public override bool GossipHello(Player player)
{
if (creature.GetEntry() == NPC_ASHYEN)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_BLESS_ASH, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (player.GetReputationRank(942) > ReputationRank.Neutral)
{
if (me.GetEntry() == NPC_ASHYEN)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_BLESS_ASH, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (creature.GetEntry() == NPC_KELETH)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_BLESS_KEL, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (me.GetEntry() == NPC_KELETH)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_BLESS_KEL, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
}
player.SEND_GOSSIP_MENU(player.GetGossipTextId(me), me.GetGUID());
return true;
}
player.SEND_GOSSIP_MENU(player.GetGossipTextId(creature), creature.GetGUID());
return true;
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
if (action == eTradeskill.GossipActionInfoDef + 1)
{
me.SetPowerType(PowerType.Mana);
me.SetMaxPower(PowerType.Mana, 200); //set a "fake" mana value, we can't depend on database doing it in this case
me.SetPower(PowerType.Mana, 200);
if (me.GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with
{
uint spell = 0;
switch (player.GetReputationRank(942))
{ //mark of lore
case ReputationRank.Friendly:
spell = SPELL_BLESS_ASH_FRI;
break;
case ReputationRank.Honored:
spell = SPELL_BLESS_ASH_HON;
break;
case ReputationRank.Revered:
spell = SPELL_BLESS_ASH_REV;
break;
case ReputationRank.Exalted:
spell = SPELL_BLESS_ASH_EXA;
break;
default:
break;
}
if (spell != 0)
{
DoCast(player, spell, true);
me.GetAI().Talk(GOSSIP_REWARD_BLESS);
}
}
if (me.GetEntry() == NPC_KELETH)
{
uint spell = 0;
switch (player.GetReputationRank(942)) //mark of war
{
case ReputationRank.Friendly:
spell = SPELL_BLESS_KEL_FRI;
break;
case ReputationRank.Honored:
spell = SPELL_BLESS_KEL_HON;
break;
case ReputationRank.Revered:
spell = SPELL_BLESS_KEL_REV;
break;
case ReputationRank.Exalted:
spell = SPELL_BLESS_KEL_EXA;
break;
default:
break;
}
if (spell != 0)
{
DoCast(player, spell, true);
me.GetAI().Talk(GOSSIP_REWARD_BLESS);
}
}
player.CLOSE_GOSSIP_MENU();
player.TalkedToCreature(me.GetEntry(), me.GetGUID());
}
return true;
}
const uint GOSSIP_REWARD_BLESS = 0;
const uint NPC_ASHYEN = 17900;
const uint NPC_KELETH = 17901;
const uint SPELL_BLESS_ASH_EXA = 31815;
const uint SPELL_BLESS_ASH_REV = 31811;
const uint SPELL_BLESS_ASH_HON = 31810;
const uint SPELL_BLESS_ASH_FRI = 31808;
const uint SPELL_BLESS_KEL_EXA = 31814;
const uint SPELL_BLESS_KEL_REV = 31813;
const uint SPELL_BLESS_KEL_HON = 31812;
const uint SPELL_BLESS_KEL_FRI = 31807;
const string GOSSIP_ITEM_BLESS_ASH = "Grant me your mark, wise ancient.";
const string GOSSIP_ITEM_BLESS_KEL = "Grant me your mark, mighty ancient.";
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
public override CreatureAI GetAI(Creature creature)
{
player.PlayerTalkClass.ClearMenus();
if (action == eTradeskill.GossipActionInfoDef + 1)
{
creature.SetPowerType(PowerType.Mana);
creature.SetMaxPower(PowerType.Mana, 200); //set a "fake" mana value, we can't depend on database doing it in this case
creature.SetPower(PowerType.Mana, 200);
if (creature.GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with
{
uint spell = 0;
switch (player.GetReputationRank(942))
{ //mark of lore
case ReputationRank.Friendly:
spell = SPELL_BLESS_ASH_FRI;
break;
case ReputationRank.Honored:
spell = SPELL_BLESS_ASH_HON;
break;
case ReputationRank.Revered:
spell = SPELL_BLESS_ASH_REV;
break;
case ReputationRank.Exalted:
spell = SPELL_BLESS_ASH_EXA;
break;
default:
break;
}
if (spell != 0)
{
creature.CastSpell(player, spell, true);
creature.GetAI().Talk(GOSSIP_REWARD_BLESS);
}
}
if (creature.GetEntry() == NPC_KELETH)
{
uint spell = 0;
switch (player.GetReputationRank(942)) //mark of war
{
case ReputationRank.Friendly:
spell = SPELL_BLESS_KEL_FRI;
break;
case ReputationRank.Honored:
spell = SPELL_BLESS_KEL_HON;
break;
case ReputationRank.Revered:
spell = SPELL_BLESS_KEL_REV;
break;
case ReputationRank.Exalted:
spell = SPELL_BLESS_KEL_EXA;
break;
default:
break;
}
if (spell != 0)
{
creature.CastSpell(player, spell, true);
creature.GetAI().Talk(GOSSIP_REWARD_BLESS);
}
}
player.CLOSE_GOSSIP_MENU();
player.TalkedToCreature(creature.GetEntry(), creature.GetGUID());
}
return true;
return new npcs_ashyen_and_kelethAI(creature);
}
const uint GOSSIP_REWARD_BLESS = 0;
const uint NPC_ASHYEN = 17900;
const uint NPC_KELETH = 17901;
const uint SPELL_BLESS_ASH_EXA = 31815;
const uint SPELL_BLESS_ASH_REV = 31811;
const uint SPELL_BLESS_ASH_HON = 31810;
const uint SPELL_BLESS_ASH_FRI = 31808;
const uint SPELL_BLESS_KEL_EXA = 31814;
const uint SPELL_BLESS_KEL_REV = 31813;
const uint SPELL_BLESS_KEL_HON = 31812;
const uint SPELL_BLESS_KEL_FRI = 31807;
const string GOSSIP_ITEM_BLESS_ASH = "Grant me your mark, wise ancient.";
const string GOSSIP_ITEM_BLESS_KEL = "Grant me your mark, mighty ancient.";
}
[Script]
@@ -171,6 +182,28 @@ namespace Scripts.Outlands
DoMeleeAttackIfReady();
}
public override bool GossipHello(Player player)
{
if (player.GetQuestStatus(QUEST_CRACK_SKULLS) == QuestStatus.Incomplete)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_COOSH, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(9441, me.GetGUID());
return true;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
if (action == eTradeskill.GossipActionInfoDef)
{
player.CLOSE_GOSSIP_MENU();
me.SetFaction(FACTION_HOSTILE_CO);
me.GetAI().AttackStart(player);
}
return true;
}
}
public override CreatureAI GetAI(Creature creature)
@@ -178,27 +211,6 @@ namespace Scripts.Outlands
return new npc_cooshcooshAI(creature);
}
public override bool OnGossipHello(Player player, Creature creature)
{
if (player.GetQuestStatus(QUEST_CRACK_SKULLS) == QuestStatus.Incomplete)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_COOSH, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(9441, creature.GetGUID());
return true;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
if (action == eTradeskill.GossipActionInfoDef)
{
player.CLOSE_GOSSIP_MENU();
creature.SetFaction(FACTION_HOSTILE_CO);
creature.GetAI().AttackStart(player);
}
return true;
}
const uint SPELL_LIGHTNING_BOLT = 9532;
const uint QUEST_CRACK_SKULLS = 10009;
const uint FACTION_HOSTILE_CO = 45;
@@ -212,54 +224,64 @@ namespace Scripts.Outlands
{
public npc_elder_kuruti() : base("npc_elder_kuruti") { }
public override bool OnGossipHello(Player player, Creature creature)
class npc_elder_kurutiAI : ScriptedAI
{
if (player.GetQuestStatus(9803) == QuestStatus.Incomplete)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
public npc_elder_kurutiAI(Creature creature) : base(creature) { }
player.SEND_GOSSIP_MENU(9226, creature.GetGUID());
return true;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
switch (action)
public override bool GossipHello(Player player)
{
case eTradeskill.GossipActionInfoDef:
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(9227, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 1:
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.SEND_GOSSIP_MENU(9229, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
{
if (!player.HasItemCount(24573))
{
List<ItemPosCount> dest = new List<ItemPosCount>();
uint itemId = 24573;
uint temp;
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, itemId, 1, out temp);
if (msg == InventoryResult.Ok)
{
player.StoreNewItem(dest, itemId, true);
}
else
player.SendEquipError(msg, null, null, itemId);
}
player.SEND_GOSSIP_MENU(9231, creature.GetGUID());
break;
}
if (player.GetQuestStatus(9803) == QuestStatus.Incomplete)
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(9226, me.GetGUID());
return true;
}
return true;
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
switch (action)
{
case eTradeskill.GossipActionInfoDef:
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(9227, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 1:
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GOSSIP_ITEM_KUR3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.SEND_GOSSIP_MENU(9229, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
{
if (!player.HasItemCount(24573))
{
List<ItemPosCount> dest = new List<ItemPosCount>();
uint itemId = 24573;
uint temp;
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, itemId, 1, out temp);
if (msg == InventoryResult.Ok)
{
player.StoreNewItem(dest, itemId, true);
}
else
player.SendEquipError(msg, null, null, itemId);
}
player.SEND_GOSSIP_MENU(9231, me.GetGUID());
break;
}
}
return true;
}
const string GOSSIP_ITEM_KUR1 = "Greetings, elder. It is time for your people to end their hostility towards the draenei and their allies.";
const string GOSSIP_ITEM_KUR2 = "I did not mean to deceive you, elder. The draenei of Telredor thought to approach you in a way that would seem familiar to you.";
const string GOSSIP_ITEM_KUR3 = "I will tell them. Farewell, elder.";
}
const string GOSSIP_ITEM_KUR1 = "Greetings, elder. It is time for your people to end their hostility towards the draenei and their allies.";
const string GOSSIP_ITEM_KUR2 = "I did not mean to deceive you, elder. The draenei of Telredor thought to approach you in a way that would seem familiar to you.";
const string GOSSIP_ITEM_KUR3 = "I will tell them. Farewell, elder.";
public override CreatureAI GetAI(Creature creature)
{
return new npc_elder_kurutiAI(creature);
}
}
[Script]
@@ -304,19 +326,15 @@ namespace Scripts.Outlands
break;
}
}
}
public override bool OnQuestAccept(Player player, Creature creature, Quest quest)
{
if (quest.Id == QUEST_ESCAPE_FROM)
public override void QuestAccept(Player player, Quest quest)
{
creature.GetAI().Talk(SAY_START, player);
NpcEscortAI pEscortAI = (npc_kayra_longmaneAI)creature.GetAI();
if (pEscortAI != null)
pEscortAI.Start(false, false, player.GetGUID());
if (quest.Id == QUEST_ESCAPE_FROM)
{
Talk(SAY_START, player);
Start(false, false, player.GetGUID());
}
}
return true;
}
public override CreatureAI GetAI(Creature creature)
File diff suppressed because it is too large Load Diff
+220 -206
View File
@@ -629,22 +629,18 @@ namespace Scripts.World.NpcSpecial
break;
}
}
}
public override bool OnQuestAccept(Player player, Creature creature, Quest quest)
{
if (quest.Id == QuestConst.Cluck)
((npc_chicken_cluckAI)creature.GetAI()).Reset();
public override void QuestAccept(Player player, Quest quest)
{
if (quest.Id == QuestConst.Cluck)
Reset();
}
return true;
}
public override bool OnQuestReward(Player player, Creature creature, Quest quest, uint opt)
{
if (quest.Id == QuestConst.Cluck)
((npc_chicken_cluckAI)creature.GetAI()).Reset();
return true;
public override void QuestReward(Player player, Quest quest, uint opt)
{
if (quest.Id == QuestConst.Cluck)
Reset();
}
}
public override CreatureAI GetAI(Creature creature)
@@ -1022,6 +1018,12 @@ namespace Scripts.World.NpcSpecial
public override void EnterCombat(Unit who) { }
public override void QuestAccept(Player player, Quest quest)
{
if ((quest.Id == 6624) || (quest.Id == 6622))
BeginEvent(player);
}
ObjectGuid PlayerGUID;
uint SummonPatientTimer;
@@ -1035,14 +1037,6 @@ namespace Scripts.World.NpcSpecial
List<Position> Coordinates = new List<Position>();
}
public override bool OnQuestAccept(Player player, Creature creature, Quest quest)
{
if ((quest.Id == 6624) || (quest.Id == 6622))
((npc_doctorAI)creature.GetAI()).BeginEvent(player);
return true;
}
public override CreatureAI GetAI(Creature creature)
{
return new npc_doctorAI(creature);
@@ -1332,117 +1326,129 @@ namespace Scripts.World.NpcSpecial
{
public npc_sayge() : base("npc_sayge") { }
public override bool OnGossipHello(Player player, Creature creature)
class npc_saygeAI : ScriptedAI
{
if (creature.IsQuestGiver())
player.PrepareQuestMenu(creature.GetGUID());
public npc_saygeAI(Creature creature) : base(creature) { }
if (player.GetSpellHistory().HasCooldown(Spells.Strength) ||
player.GetSpellHistory().HasCooldown(Spells.Agility) ||
player.GetSpellHistory().HasCooldown(Spells.Stamina) ||
player.GetSpellHistory().HasCooldown(Spells.Spirit) ||
player.GetSpellHistory().HasCooldown(Spells.Intellect) ||
player.GetSpellHistory().HasCooldown(Spells.Armor) ||
player.GetSpellHistory().HasCooldown(Spells.Damage) ||
player.GetSpellHistory().HasCooldown(Spells.Resistance))
player.SEND_GOSSIP_MENU(GossipMenus.CantGiveYouYour, creature.GetGUID());
else
public override bool GossipHello(Player player)
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.IAmReadyToDiscover, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(GossipMenus.IHaveLongKnown, creature.GetGUID());
if (me.IsQuestGiver())
player.PrepareQuestMenu(me.GetGUID());
if (player.GetSpellHistory().HasCooldown(Spells.Strength) ||
player.GetSpellHistory().HasCooldown(Spells.Agility) ||
player.GetSpellHistory().HasCooldown(Spells.Stamina) ||
player.GetSpellHistory().HasCooldown(Spells.Spirit) ||
player.GetSpellHistory().HasCooldown(Spells.Intellect) ||
player.GetSpellHistory().HasCooldown(Spells.Armor) ||
player.GetSpellHistory().HasCooldown(Spells.Damage) ||
player.GetSpellHistory().HasCooldown(Spells.Resistance))
player.SEND_GOSSIP_MENU(GossipMenus.CantGiveYouYour, me.GetGUID());
else
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.IAmReadyToDiscover, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(GossipMenus.IHaveLongKnown, me.GetGUID());
}
return true;
}
return true;
}
void SendAction(Player player, Creature creature, uint action)
{
switch (action)
void SendAction(Player player, uint action)
{
case eTradeskill.GossipActionInfoDef + 1:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer4, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
player.SEND_GOSSIP_MENU(GossipMenus.YouHaveBeenTasked, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 1, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 2, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 3, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.SwornExecutioner, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 3:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 4, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 5, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 2, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.DiplomaticMission, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 4:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 6, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 7, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 8, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.YourBrotherSeeks, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 5:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 5, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 4, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 3, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.ATerribleBeast, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge6, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 6);
player.SEND_GOSSIP_MENU(GossipMenus.YourFortuneIsCast, creature.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 6:
creature.CastSpell(player, Spells.Fortune, false);
player.SEND_GOSSIP_MENU(GossipMenus.HereIsYourFortune, creature.GetGUID());
break;
switch (action)
{
case eTradeskill.GossipActionInfoDef + 1:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge, GossipMenus.OptionIdAnswer4, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
player.SEND_GOSSIP_MENU(GossipMenus.YouHaveBeenTasked, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 2:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 1, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 2, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge2, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 3, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.SwornExecutioner, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 3:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 4, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 5, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge3, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 2, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.DiplomaticMission, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 4:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 6, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 7, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge4, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 8, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.YourBrotherSeeks, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 5:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain + 5, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer2, eTradeskill.GossipSenderMain + 4, eTradeskill.GossipActionInfoDef);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge5, GossipMenus.OptionIdAnswer3, eTradeskill.GossipSenderMain + 3, eTradeskill.GossipActionInfoDef);
player.SEND_GOSSIP_MENU(GossipMenus.ATerribleBeast, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef:
player.ADD_GOSSIP_ITEM_DB(GossipMenus.OptionSayge6, GossipMenus.OptionIdAnswer1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 6);
player.SEND_GOSSIP_MENU(GossipMenus.YourFortuneIsCast, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 6:
DoCast(player, Spells.Fortune, false);
player.SEND_GOSSIP_MENU(GossipMenus.HereIsYourFortune, me.GetGUID());
break;
}
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint sender = player.PlayerTalkClass.GetGossipOptionSender(gossipListId);
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
uint spellId = 0;
switch (sender)
{
case eTradeskill.GossipSenderMain:
SendAction(player, action);
break;
case eTradeskill.GossipSenderMain + 1:
spellId = Spells.Damage;
break;
case eTradeskill.GossipSenderMain + 2:
spellId = Spells.Resistance;
break;
case eTradeskill.GossipSenderMain + 3:
spellId = Spells.Armor;
break;
case eTradeskill.GossipSenderMain + 4:
spellId = Spells.Spirit;
break;
case eTradeskill.GossipSenderMain + 5:
spellId = Spells.Intellect;
break;
case eTradeskill.GossipSenderMain + 6:
spellId = Spells.Stamina;
break;
case eTradeskill.GossipSenderMain + 7:
spellId = Spells.Strength;
break;
case eTradeskill.GossipSenderMain + 8:
spellId = Spells.Agility;
break;
}
if (spellId != 0)
{
DoCast(player, spellId, false);
player.GetSpellHistory().AddCooldown(spellId, 0, TimeSpan.FromHours(2));
SendAction(player, action);
}
return true;
}
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
public override CreatureAI GetAI(Creature creature)
{
player.PlayerTalkClass.ClearMenus();
uint spellId = 0;
switch (sender)
{
case eTradeskill.GossipSenderMain:
SendAction(player, creature, action);
break;
case eTradeskill.GossipSenderMain + 1:
spellId = Spells.Damage;
break;
case eTradeskill.GossipSenderMain + 2:
spellId = Spells.Resistance;
break;
case eTradeskill.GossipSenderMain + 3:
spellId = Spells.Armor;
break;
case eTradeskill.GossipSenderMain + 4:
spellId = Spells.Spirit;
break;
case eTradeskill.GossipSenderMain + 5:
spellId = Spells.Intellect;
break;
case eTradeskill.GossipSenderMain + 6:
spellId = Spells.Stamina;
break;
case eTradeskill.GossipSenderMain + 7:
spellId = Spells.Strength;
break;
case eTradeskill.GossipSenderMain + 8:
spellId = Spells.Agility;
break;
}
if (spellId != 0)
{
creature.CastSpell(player, spellId, false);
player.GetSpellHistory().AddCooldown(spellId, 0, TimeSpan.FromHours(2));
SendAction(player, creature, action);
}
return true;
return new npc_saygeAI(creature);
}
}
@@ -1627,71 +1633,67 @@ namespace Scripts.World.NpcSpecial
Initialize();
}
public override uint GetData(uint type)
public override bool GossipHello(Player player)
{
return (type == NpcSpecialConst.DataShowUnderground && _showUnderground) ? 1 : 0u;
if (me.IsSummon())
{
if (player == me.ToTempSummon().GetSummoner())
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole4, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
if (_showUnderground)
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole6, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 6);
player.SEND_GOSSIP_MENU(Texts.Wormhole, me.GetGUID());
}
}
return true;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
switch (action)
{
case eTradeskill.GossipActionInfoDef + 1: // Borean Tundra
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.BoreanTundra, false);
break;
case eTradeskill.GossipActionInfoDef + 2: // Howling Fjord
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.HowlingFjord, false);
break;
case eTradeskill.GossipActionInfoDef + 3: // Sholazar Basin
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.SholazarBasin, false);
break;
case eTradeskill.GossipActionInfoDef + 4: // Icecrown
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.Icecrown, false);
break;
case eTradeskill.GossipActionInfoDef + 5: // Storm peaks
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.StormPeaks, false);
break;
case eTradeskill.GossipActionInfoDef + 6: // Underground
player.CLOSE_GOSSIP_MENU();
DoCast(player, Spells.Underground, false);
break;
}
return true;
}
bool _showUnderground;
}
public override bool OnGossipHello(Player player, Creature creature)
{
if (creature.IsSummon())
{
if (player == creature.ToTempSummon().GetSummoner())
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole3, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 3);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole4, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 4);
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 5);
if (creature.GetAI().GetData(NpcSpecialConst.DataShowUnderground) != 0)
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdWormhole, GossipMenus.OptionIdWormhole6, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 6);
player.SEND_GOSSIP_MENU(Texts.Wormhole, creature.GetGUID());
}
}
return true;
}
public override bool OnGossipSelect(Player player, Creature creature, uint sender, uint action)
{
player.PlayerTalkClass.ClearMenus();
switch (action)
{
case eTradeskill.GossipActionInfoDef + 1: // Borean Tundra
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.BoreanTundra, false);
break;
case eTradeskill.GossipActionInfoDef + 2: // Howling Fjord
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.HowlingFjord, false);
break;
case eTradeskill.GossipActionInfoDef + 3: // Sholazar Basin
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.SholazarBasin, false);
break;
case eTradeskill.GossipActionInfoDef + 4: // Icecrown
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.Icecrown, false);
break;
case eTradeskill.GossipActionInfoDef + 5: // Storm peaks
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.StormPeaks, false);
break;
case eTradeskill.GossipActionInfoDef + 6: // Underground
player.CLOSE_GOSSIP_MENU();
creature.CastSpell(player, Spells.Underground, false);
break;
}
return true;
}
public override CreatureAI GetAI(Creature creature)
{
return new npc_wormholeAI(creature);
@@ -1703,37 +1705,48 @@ namespace Scripts.World.NpcSpecial
{
public npc_experience() : base("npc_experience") { }
public override bool OnGossipHello(Player player, Creature creature)
class npc_experienceAI : ScriptedAI
{
if (player.HasPlayerFlag(PlayerFlags.NoXPGain)) // not gaining XP
public npc_experienceAI(Creature creature) : base(creature) { }
public override bool GossipHello(Player player)
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(Texts.XpOnOff, creature.GetGUID());
if (player.HasPlayerFlag(PlayerFlags.NoXPGain)) // not gaining XP
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.SEND_GOSSIP_MENU(Texts.XpOnOff, me.GetGUID());
}
else // currently gaining XP
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOff, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.SEND_GOSSIP_MENU(Texts.XpOnOff, me.GetGUID());
}
return true;
}
else // currently gaining XP
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
player.ADD_GOSSIP_ITEM_DB(GossipMenus.MenuIdXpOnOff, GossipMenus.OptionIdXpOff, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
player.SEND_GOSSIP_MENU(Texts.XpOnOff, creature.GetGUID());
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.PlayerTalkClass.ClearMenus();
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.AddPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
break;
}
player.PlayerTalkClass.SendCloseGossip();
return true;
}
return true;
}
public override bool OnGossipSelect(Player player, Creature Creature, uint sender, uint action)
public override CreatureAI GetAI(Creature creature)
{
player.PlayerTalkClass.ClearMenus();
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.AddPlayerFlag(PlayerFlags.NoXPGain); // turn off XP gain
break;
}
player.PlayerTalkClass.SendCloseGossip();
return true;
return new npc_experienceAI(creature);
}
}
@@ -2221,7 +2234,7 @@ namespace Scripts.World.NpcSpecial
});
}
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
switch (gossipListId)
{
@@ -2272,6 +2285,7 @@ namespace Scripts.World.NpcSpecial
break;
}
player.PlayerTalkClass.SendCloseGossip();
return false;
}
public override void UpdateAI(uint diff)