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
@@ -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]