public override void OnDeath(Container c) { List <DamageStore> rights = GetLootingRights(); HashSet <Mobile> set = new HashSet <Mobile>(); for (var index = 0; index < rights.Count; index++) { var x = rights[index]; Mobile m = x.m_Mobile; if (set.Add(m) && m is PlayerMobile pm && pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent) { Item item = new OrcishSchematics(); if (pm.Backpack == null || !pm.Backpack.TryDropItem(pm, item, false)) { pm.BankBox.DropItem(item); } pm.SendLocalizedMessage(1154489); // You received a Quest Item! } } if (Instances != null && Instances.Contains(this)) { Instances.Remove(this); } base.OnDeath(c); }
public override void OnDeath(Container c) { List <DamageStore> rights = GetLootingRights(); foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct()) { if (m is PlayerMobile) { PlayerMobile pm = m as PlayerMobile; if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent) { Item item = new OrcishSchematics(); if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false)) { m.BankBox.DropItem(item); } m.SendLocalizedMessage(1154489); // You received a Quest Item! } } } base.OnDeath(c); }
public override bool OnBeforeDeath() { Mobile killer = DemonKnight.FindRandomPlayer(this); if (killer != null) { Item item = new OrcishSchematics(); Container pack = killer.Backpack; if (pack == null || !pack.TryDropItem(killer, item, false)) { killer.BankBox.DropItem(item); } killer.SendLocalizedMessage(1154489); // You received a Quest Item! } return(base.OnBeforeDeath()); }