Core/GameObject: Implement GameObject::Use case for GAMEOBJECT_TYPE_NEW_FLAG

Port From (https://github.com/TrinityCore/TrinityCore/commit/2a9940e17d4e943aa5d9b95f8f5b54783e14d7b2)
This commit is contained in:
hondacrx
2021-11-23 20:48:36 -05:00
parent c8a395b918
commit 6110585521
2 changed files with 17 additions and 0 deletions
@@ -2005,6 +2005,18 @@ namespace Game.Entities
player.SetStandState((UnitStandStateType.SitLowChair + (byte)info.BarberChair.chairheight), info.BarberChair.SitAnimKit);
return;
}
case GameObjectTypes.NewFlag:
{
GameObjectTemplate info = GetGoInfo();
if (info == null)
return;
if (!user.IsPlayer())
return;
spellId = info.NewFlag.pickupSpell;
break;
}
case GameObjectTypes.ItemForge:
{
GameObjectTemplate info = GetGoInfo();
+5
View File
@@ -1343,6 +1343,11 @@ namespace Game.Spells
return;
}
}
else if (goInfo.type == GameObjectTypes.NewFlag)
{
gameObjTarget.Use(player);
return;
}
else if (m_spellInfo.Id == 1842 && gameObjTarget.GetGoInfo().type == GameObjectTypes.Trap && gameObjTarget.GetOwner() != null)
{
gameObjTarget.SetLootState(LootState.JustDeactivated);