Scripts/Instances: Replace manual criteria timer starts in instances with new GameEvents api
Port From (https://github.com/TrinityCore/TrinityCore/commit/1c62b0b90f879e5df6c6785c12e9a5bddd65cb48)
This commit is contained in:
@@ -320,6 +320,22 @@ namespace Game.Maps
|
|||||||
minionInfo.bossInfo.minion.Remove(minion.GetGUID());
|
minionInfo.bossInfo.minion.Remove(minion.GetGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Triggers a GameEvent
|
||||||
|
// * If source is null then event is triggered for each player in the instance as "source"
|
||||||
|
public override void TriggerGameEvent(uint gameEventId, WorldObject source = null, WorldObject target = null)
|
||||||
|
{
|
||||||
|
if (source != null)
|
||||||
|
{
|
||||||
|
base.TriggerGameEvent(gameEventId, source, target);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessEvent(target, gameEventId, source);
|
||||||
|
instance.DoOnPlayers(player => GameEvents.TriggerForPlayer(gameEventId, player));
|
||||||
|
|
||||||
|
GameEvents.TriggerForMap(gameEventId, instance);
|
||||||
|
}
|
||||||
|
|
||||||
public Creature GetCreature(uint type)
|
public Creature GetCreature(uint type)
|
||||||
{
|
{
|
||||||
return instance.GetCreature(GetObjectGuid(type));
|
return instance.GetCreature(GetObjectGuid(type));
|
||||||
@@ -600,12 +616,6 @@ namespace Game.Maps
|
|||||||
instance.DoOnPlayers(player => player.UpdateCriteria(type, miscValue1, miscValue2, 0, unit));
|
instance.DoOnPlayers(player => player.UpdateCriteria(type, miscValue1, miscValue2, 0, unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start timed achievement for all players in instance
|
|
||||||
public void DoStartCriteriaTimer(CriteriaStartEvent startEvent, uint entry)
|
|
||||||
{
|
|
||||||
instance.DoOnPlayers(player => player.StartCriteriaTimer(startEvent, entry));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove Auras due to Spell on all players in instance
|
// Remove Auras due to Spell on all players in instance
|
||||||
public void DoRemoveAurasDueToSpellOnPlayers(uint spell, bool includePets = false, bool includeControlled = false)
|
public void DoRemoveAurasDueToSpellOnPlayers(uint spell, bool includePets = false, bool includeControlled = false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,14 @@ namespace Game.Maps
|
|||||||
{
|
{
|
||||||
public class ZoneScript
|
public class ZoneScript
|
||||||
{
|
{
|
||||||
|
public virtual void TriggerGameEvent(uint gameEventId, WorldObject source = null, WorldObject target = null)
|
||||||
|
{
|
||||||
|
if (source != null)
|
||||||
|
GameEvents.Trigger(gameEventId, source, target);
|
||||||
|
else
|
||||||
|
ProcessEvent(null, gameEventId, null);
|
||||||
|
}
|
||||||
|
|
||||||
public virtual uint GetCreatureEntry(ulong guidlow, CreatureData data) { return data.Id; }
|
public virtual uint GetCreatureEntry(ulong guidlow, CreatureData data) { return data.Id; }
|
||||||
public virtual uint GetGameObjectEntry(ulong spawnId, uint entry) { return entry; }
|
public virtual uint GetGameObjectEntry(ulong spawnId, uint entry) { return entry; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user