private void ResetPlayers() { foreach (KeyValuePair <PlayerMobile, TourneyEntry> item in m_Participants) { PlayerMobile m = item.Key; Refresh(m); m.Frozen = true; //Undress List <Item> dress = new List <Item>(m.Items); foreach (Item item2 in dress) { if (item2 == m.Backpack) { continue; } DeathMoveResult res = m.GetParentMoveResultFor(item2); if (res == DeathMoveResult.MoveToBackpack || res == DeathMoveResult.MoveToCorpse) { m.Backpack.AddItem(item2); } } //Clear backapck if (m_StolenBackpack.ContainsKey(m)) { m.Backpack.Delete(); } else { m.BankBox.DropItem(m.Backpack); } //New backpack Backpack pack = new Backpack(); pack.Movable = false; m.AddItem(pack); //Supply items AddItems(pack); //Robe m.EquipItem(new DeathRobe()); //Team colour m.SolidHueOverride = item.Value.Team; //Move to base TeamBase bas = bases[item.Value.Team]; if (bas != null) { m.MoveToWorld(bas.Location, bas.Map); } } }
public override DeathMoveResult OnInventoryDeath(Mobile parent) { DeathMoveResult result = base.OnParentDeath(parent); if (result == DeathMoveResult.MoveToCorpse && m_EthicState != null && Ethic.IsEthicsDeath(parent)) { return(DeathMoveResult.MoveToBackpack); } else { return(result); } }
public override DeathMoveResult OnInventoryDeath(Mobile parent) { DeathMoveResult result = base.OnParentDeath(parent); Ethic parentState = Ethic.Find(parent); if (parentState != null && result == DeathMoveResult.MoveToCorpse && m_EthicState != null && parentState == m_EthicState.Ethic) { return(DeathMoveResult.MoveToBackpack); } else { return(result); } }
public static Container CreatePlayerCorpse(Mobile mob) { if (mob == null) { return(null); } var content = new List <Item>(); var equip = new List <Item>(); var moveToPack = new List <Item>(); var itemsCopy = new List <Item>(mob.Items); Container pack = mob.Backpack; foreach (Item item in itemsCopy) { if (item == pack) { continue; } DeathMoveResult res = mob.GetParentMoveResultFor(item); switch (res) { case DeathMoveResult.MoveToCorpse: { content.Add(item); equip.Add(item); break; } case DeathMoveResult.MoveToBackpack: { moveToPack.Add(item); break; } } } if (pack != null) { var packCopy = new List <Item>(); if (pack.Items != null && pack.Items.Count > 0) { packCopy.AddRange(pack.Items); foreach (Item item in packCopy) { DeathMoveResult res = mob.GetInventoryMoveResultFor(item); if (res == DeathMoveResult.MoveToCorpse) { content.Add(item); //RunUO SVN 610 - Core change instead. var subItems = new List <Item>(); List <Item> lookup = item.LookupItems(); if (lookup != null && lookup.Count > 0) { subItems.AddRange(lookup); } moveToPack.AddRange( subItems.Where( subItem => !subItem.Deleted && (subItem.LootType == LootType.Blessed || subItem.Insured))); } else { moveToPack.Add(item); } } } foreach (Item item in moveToPack.Where(item => !mob.RetainPackLocsOnDeath || item.Parent != pack)) { pack.DropItem(item); } } HairInfo hair = null; if (mob.HairItemID != 0) { hair = new HairInfo(mob.HairItemID, mob.HairHue); } FacialHairInfo facialhair = null; if (mob.FacialHairItemID != 0) { facialhair = new FacialHairInfo(mob.FacialHairItemID, mob.FacialHairHue); } return(Mobile.CreateCorpseHandler != null ? Mobile.CreateCorpseHandler(mob, hair, facialhair, content, equip) : null); }