Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura

Port From (https://github.com/TrinityCore/TrinityCore/commit/9d865f7536ae6feda6fba77785e4548f95ca5d03)
This commit is contained in:
hondacrx
2021-12-16 12:56:20 -05:00
parent 40f6c9a9fd
commit 736892998f
6 changed files with 57 additions and 2 deletions
@@ -352,7 +352,37 @@ namespace Game.Entities
}
}
// despawn at uses amount
/// <summary>
/// Cannot be used/activated/looted by players under immunity effects (example: Divine Shield)
/// </summary>
/// <returns></returns>
public uint GetNoDamageImmune()
{
switch (type)
{
case GameObjectTypes.Door:
return Door.noDamageImmune;
case GameObjectTypes.Button:
return Button.noDamageImmune;
case GameObjectTypes.QuestGiver:
return QuestGiver.noDamageImmune;
case GameObjectTypes.Chest:
return 1;
case GameObjectTypes.Goober:
return Goober.noDamageImmune;
case GameObjectTypes.FlagStand:
return FlagStand.noDamageImmune;
case GameObjectTypes.FlagDrop:
return FlagDrop.noDamageImmune;
default:
return 0;
}
}
/// <summary>
/// despawn at uses amount
/// </summary>
/// <returns></returns>
public uint GetCharges()
{
switch (type)