Core/GameObject: Implemented OnFlagTaken/OnFlagDropped hooks for GAMEOBJECT_TYPE_FLAGSTAND
Port From (https://github.com/TrinityCore/TrinityCore/commit/0535a61cb7c9da97f05e5867ce181d91e3dd92eb)
This commit is contained in:
@@ -2632,8 +2632,22 @@ namespace Game.Entities
|
||||
SpellCastResult castResult = CastSpell(user, spellId);
|
||||
if (castResult == SpellCastResult.Success)
|
||||
{
|
||||
if (GetGoType() == GameObjectTypes.NewFlag)
|
||||
HandleCustomTypeCommand(new GameObjectType.SetNewFlagState(FlagState.Taken, user.ToPlayer()));
|
||||
switch (GetGoType())
|
||||
{
|
||||
case GameObjectTypes.NewFlag:
|
||||
HandleCustomTypeCommand(new GameObjectType.SetNewFlagState(FlagState.Taken, user.ToPlayer()));
|
||||
break;
|
||||
case GameObjectTypes.FlagStand:
|
||||
SetFlag(GameObjectFlags.InUse);
|
||||
ZoneScript zonescript = GetZoneScript();
|
||||
if (zonescript != null)
|
||||
zonescript.OnFlagTaken(this, user?.ToPlayer());
|
||||
|
||||
Delete();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user