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
+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);
}
}