public override void OnDamage(int amount, Mobile from, bool willKill) { PlayerMobile pm = null; int amountmodified = amount; if (IsQuest) { if (Damagers != null) { if (from is PlayerMobile) { pm = from as PlayerMobile; } else if (from is BaseCreature && ((BaseCreature)from).GetMaster() is PlayerMobile) { pm = ((BaseCreature)from).GetMaster() as PlayerMobile; } if (pm != null && Damagers.ContainsKey(pm)) { Damagers[pm] += amountmodified; } else if (pm != null) { Damagers.Add(pm, amountmodified); } } } base.OnDamage(amount, from, willKill); }
public override void OnDamage(int amount, Mobile from, bool willKill) { ZombieAvatar avatar = null; int amountmodified = amount; if (Damagers != null) { if (from is ZombieAvatar) { avatar = from as ZombieAvatar; } else if (from is BaseCreature && ((BaseCreature)from).GetMaster() is ZombieAvatar) { avatar = ((BaseCreature)from).GetMaster() as ZombieAvatar; } if (avatar != null && Damagers.ContainsKey(avatar)) { Damagers[avatar] += amountmodified; } else if (avatar != null) { Damagers.Add(avatar, amountmodified); } } base.OnDamage(amount, from, willKill); }
public void AwardPoints() { if (Damagers != null) { foreach (ZombieAvatar avatar in Damagers.Keys) { if (avatar.Owner != null) { PlayerZombieProfile profile = ZombieEvent.EnsureProfile(avatar.Owner); if (Damagers.ContainsKey(avatar)) { profile.DragonBossDamage += Damagers[avatar]; } } } } }