Scripts/AreaTrigger: Added CanCaptureFlag and CaptureFlag hooks
Port From (https://github.com/TrinityCore/TrinityCore/commit/30f57de184fb96dfb6c548201e7717fa293682e1)
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using System.Collections.Generic;
|
||||
using Game.AI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.World.Areatriggers
|
||||
{
|
||||
@@ -433,4 +434,21 @@ namespace Scripts.World.Areatriggers
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class areatrigger_action_capture_flag : AreaTriggerAI
|
||||
{
|
||||
public areatrigger_action_capture_flag(AreaTrigger areatrigger) : base(areatrigger) { }
|
||||
|
||||
public override void OnUnitEnter(Unit unit)
|
||||
{
|
||||
if (!unit.IsPlayer())
|
||||
return;
|
||||
|
||||
Player player = unit.ToPlayer();
|
||||
ZoneScript zoneScript = at.GetZoneScript();
|
||||
if (zoneScript != null && zoneScript.CanCaptureFlag(at, player))
|
||||
zoneScript.OnCaptureFlag(at, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user