Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for food killing player #4093

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/ACE.Server/WorldObjects/Creature_Death.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public DeathMessage GetDeathMessage(DamageHistoryInfo lastDamagerInfo, DamageTyp
{
var lastDamager = lastDamagerInfo?.TryGetAttacker();

if (lastDamagerInfo == null || lastDamagerInfo.Guid == Guid || lastDamager is Hotspot)
if (lastDamagerInfo == null || lastDamagerInfo.Guid == Guid || lastDamager is Hotspot || lastDamager is Food) // !(lastDamager is Creature)?
return Strings.General[1];

var deathMessage = Strings.GetDeathMessage(damageType, criticalHit);
Expand Down
6 changes: 6 additions & 0 deletions Source/ACE.Server/WorldObjects/Food.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public void BoostVital(Player player)
var verb = BoostValue >= 0 ? "restores" : "takes";

player.Session.Network.EnqueueSend(new GameMessageSystemChat($"The {Name} {verb} {vitalChange} points of your {BoosterEnum}.", ChatMessageType.Broadcast));

if (player.IsDead)
{
player.OnDeath(player.DamageHistory.LastDamager, DamageType.Health, false);
player.Die();
}
}

public void CastSpell(Player player)
Expand Down