Core/GameObjects: Implement more gameobject gameevent uses

Port From (https://github.com/TrinityCore/TrinityCore/commit/597485f1d4ccadaccf800a2663f3d74342aa5c4d)
This commit is contained in:
hondacrx
2022-05-31 19:44:57 -04:00
parent da944ab528
commit 623c3198c0
2 changed files with 10 additions and 0 deletions
@@ -1800,6 +1800,8 @@ namespace Game.Entities
ChairListSlots[nearest_slot] = player.GetGUID(); //this slot in now used by player
player.TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), (TeleportToOptions.NotLeaveTransport | TeleportToOptions.NotLeaveCombat | TeleportToOptions.NotUnSummonPet));
player.SetStandState(UnitStandStateType.SitLowChair + (byte)info.Chair.chairheight);
if (info.Chair.triggeredEvent != 0)
GameEvents.Trigger(info.Chair.triggeredEvent, player, this);
return;
}
}
@@ -2217,6 +2219,9 @@ namespace Game.Entities
bg.EventPlayerClickedOnFlag(player, this);
break;
}
if (info.FlagDrop.eventID != 0)
GameEvents.Trigger(info.FlagDrop.eventID, player, this);
}
//this cause to call return, all flags must be deleted here!!
spellId = 0;
@@ -2591,6 +2596,9 @@ namespace Game.Entities
player.SendPacket(packet);
}
if (change < 0 && GetGoInfo().DestructibleBuilding.DamageEvent != 0)
GameEvents.Trigger(GetGoInfo().DestructibleBuilding.DamageEvent, attackerOrHealer, this);
GameObjectDestructibleState newState = GetDestructibleState();
if (m_goValue.Building.Health == 0)