public void OnEventPlayerDeath(Arena.EventPlayer eventPlayer, HitInfo info, Arena.ArenaData.EventConfig config) { if (eventPlayer == null || eventPlayer.player == null) { return; } AddScore(eventPlayer.player.userID, ScoreType.Death, config.eventType, config.eventName); List <ulong> contributors = eventPlayer.GetDamageContributors(); ulong killerId = 0U; if (contributors.Count > 1) { killerId = contributors.Last(); for (int i = 0; i < contributors.Count - 1; i++) { AddScore(contributors[i], ScoreType.Assist, config.eventType, config.eventName); } } else if (contributors.Count == 1) { killerId = contributors[0]; } if (killerId != 0U) { AddScore(killerId, ScoreType.Kill, config.eventType, config.eventName); if (info != null && info.damageTypes.IsMeleeType()) { AddScore(killerId, ScoreType.Melee, config.eventType, config.eventName); } Arena.IssueReward(killerId, Arena.RewardType.Kill, config); } }
public void OnNPCPlayerDeath(Arena.EventPlayer eventPlayer, HitInfo info, Arena.ArenaData.EventConfig config) { if (eventPlayer == null || eventPlayer.player == null) { return; } ulong killerId = eventPlayer.player.userID; AddScore(killerId, ScoreType.Kill, config.eventType, config.eventName); if (info != null && info.damageTypes.IsMeleeType()) { AddScore(killerId, ScoreType.Melee, config.eventType, config.eventName); } if (info.isHeadshot) { AddScore(killerId, ScoreType.Headshot, config.eventType, config.eventName); } Arena.IssueReward(killerId, Arena.RewardType.Kill, config); }