public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems) { bool shouldFillCorpse = true; //if ( owner is BaseCreature ) // shouldFillCorpse = !((BaseCreature)owner).IsBonded; Corpse c; c = new Corpse(owner, hair, facialhair, shouldFillCorpse ? equipItems : new List <Item>()); owner.Corpse = c; if (shouldFillCorpse) { for (int i = 0; i < initialContent.Count; ++i) { Item item = initialContent[i]; if (Core.AOS && owner.Player && item.Parent == owner.Backpack) { c.AddItem(item); } else { c.DropItem(item); } if (owner.Player && Core.AOS) { c.SetRestoreInfo(item, item.Location); } } if (!owner.Player) { c.AssignInstancedLoot(); } } else { c.Carved = true; // TODO: Is it needed? } Point3D loc = owner.Location; Map map = owner.Map; if (map == null || map == Map.Internal) { loc = owner.LogoutLocation; map = owner.LogoutMap; } c.MoveToWorld(loc, map); return(c); }
public static Container Mobile_CreateCorpseHandler( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems) { var c = new Corpse(owner, hair, facialhair, equipItems); owner.Corpse = c; for (int i = 0; i < initialContent.Count; ++i) { Item item = initialContent[i]; if (owner.Player && item.Parent == owner.Backpack) { c.AddItem(item); } else { c.DropItem(item); } if (owner.Player) { c.SetRestoreInfo(item, item.Location); } } if (!owner.Player) { c.AssignInstancedLoot(); c.HasAssignedInstancedLoot = true; } else { PlayerMobile pm = owner as PlayerMobile; if (pm != null) { c.RestoreEquip = pm.EquipSnapshot; } } Point3D loc = owner.Location; Map map = owner.Map; if (map == null || map == Map.Internal) { loc = owner.LogoutLocation; map = owner.LogoutMap; } c.MoveToWorld(loc, map); return(c); }
public static Container Mobile_CreateCorpseHandler(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> initialContent, List <Item> equipItems) { Corpse c = new Corpse(owner, hair, facialhair, equipItems); owner.Corpse = c; for (int i = 0; i < initialContent.Count; ++i) { Item item = (Item)initialContent[i]; if (owner.IsPlayer && item.Parent == owner.Backpack) { c.AddItem(item); } else { c.DropItem(item); } if (owner.IsPlayer) { c.SetRestoreInfo(item, item.Location); } } Point3D loc = owner.Location; Map map = owner.Map; if (map == null || map == Map.Internal) { loc = owner.LogoutLocation; map = owner.LogoutMap; } c.MoveToWorld(loc, map); return(c); }
public static Container Mobile_CreateCorpseHandler( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> initialContent, List<Item> equipItems ) { bool shouldFillCorpse = true; //if ( owner is BaseCreature ) // shouldFillCorpse = !((BaseCreature)owner).IsBonded; Corpse c = new Corpse( owner, hair, facialhair, shouldFillCorpse ? equipItems : new List<Item>() ); owner.Corpse = c; if ( shouldFillCorpse ) { for ( int i = 0; i < initialContent.Count; ++i ) { Item item = initialContent[i]; if ( Core.AOS && owner.Player && item.Parent == owner.Backpack ) c.AddItem( item ); else c.DropItem( item ); if ( owner.Player && Core.AOS ) c.SetRestoreInfo( item, item.Location ); } } else { c.Carved = true; // TODO: Is it needed? } Point3D loc = owner.Location; Map map = owner.Map; if ( map == null || map == Map.Internal ) { loc = owner.LogoutLocation; map = owner.LogoutMap; } c.MoveToWorld( loc, map ); return c; }
protected override void OnTarget(Mobile from, object target) { if (target is Corpse) { Corpse c = (Corpse)target; if (c.Owner is BaseCreature) { if (c.Carved == false && ((BaseCreature)c.Owner).Hides != 0) { Map map = from.Map; if (map == null) { return; } BaseCreature spawned = null; if (((BaseCreature)c.Owner).HideType == HideType.Regular) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(4)) { case 0: spawned = new Elementals(102); break; case 1: spawned = new Elementals(103); break; case 2: spawned = new Elementals(104); break; case 3: spawned = new Elementals(105); break; } } switch (Utility.Random(4)) { case 0: c.AddItem(new SpinedHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new HornedHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Spined) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(5)) { case 0: spawned = new Elementals(103); break; case 1: spawned = new Elementals(104); break; case 2: spawned = new Elementals(105); break; case 3: spawned = new Elementals(106); break; case 4: spawned = new Elementals(107); break; } } switch (Utility.Random(5)) { case 0: c.AddItem(new HornedHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break; case 4: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Horned) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(6)) { case 0: spawned = new Elementals(104); break; case 1: spawned = new Elementals(105); break; case 2: spawned = new Elementals(106); break; case 3: spawned = new Elementals(107); break; case 4: spawned = new Elementals(108); break; case 5: spawned = new Elementals(109); break; } } switch (Utility.Random(6)) { case 0: c.AddItem(new BarbedHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break; case 4: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break; case 5: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Barbed) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(7)) { case 0: spawned = new Elementals(105); break; case 1: spawned = new Elementals(106); break; case 2: spawned = new Elementals(107); break; case 3: spawned = new Elementals(108); break; case 4: spawned = new Elementals(109); break; case 5: spawned = new Elementals(110); break; case 6: spawned = new Elementals(111); break; } } switch (Utility.Random(7)) { case 0: c.AddItem(new PolarHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break; case 4: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; case 5: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 6: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Polar) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(6)) { case 0: spawned = new Elementals(106); break; case 1: spawned = new Elementals(107); break; case 2: spawned = new Elementals(108); break; case 3: spawned = new Elementals(109); break; case 4: spawned = new Elementals(110); break; case 5: spawned = new Elementals(111); break; } } switch (Utility.Random(6)) { case 0: c.AddItem(new SyntheticHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; case 4: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 5: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Synthetic) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(5)) { case 0: spawned = new Elementals(107); break; case 1: spawned = new Elementals(108); break; case 2: spawned = new Elementals(109); break; case 3: spawned = new Elementals(110); break; case 4: spawned = new Elementals(111); break; } } switch (Utility.Random(5)) { case 0: c.AddItem(new BlazeHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 4: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.BlazeL) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(4)) { case 0: spawned = new Elementals(108); break; case 1: spawned = new Elementals(109); break; case 2: spawned = new Elementals(110); break; case 3: spawned = new Elementals(111); break; } } switch (Utility.Random(4)) { case 0: c.AddItem(new DaemonicHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 3: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Daemonic) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: spawned = new Elementals(109); break; case 1: spawned = new Elementals(110); break; case 2: spawned = new Elementals(111); break; } } switch (Utility.Random(3)) { case 0: c.AddItem(new ShadowHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 2: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType == HideType.Shadow) { if (0.1 > Utility.RandomDouble()) { switch (Utility.Random(2)) { case 0: spawned = new Elementals(110); break; case 1: spawned = new Elementals(111); break; } } switch (Utility.Random(2)) { case 0: c.AddItem(new FrostHides(((BaseCreature)c.Owner).Hides)); break; case 1: c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); break; } } else if (((BaseCreature)c.Owner).HideType >= HideType.Frost) { if (0.1 > Utility.RandomDouble()) { spawned = new Elementals(111); } c.AddItem(new EtherealHides(((BaseCreature)c.Owner).Hides)); } else { from.SendMessage("You can't use gargoyles knife on that."); from.PlaySound(1066); //play giggle sound return; } c.Carved = true; if (m_Knife != null) { if (m_Knife.UsesRemaining > 1) { m_Knife.UsesRemaining--; } else { m_Knife.Delete(); from.SendMessage("You used up your gargoyles knife"); } } if (spawned != null) { from.SendMessage("When you used your gargoyles knife on the corpse a leather elemental came to defend it."); from.PlaySound(1098); //play m_yell int offset = Utility.Random(8) * 2; for (int i = 0; i < m_Offsets.Length; i += 2) { int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length]; int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length]; if (map.CanSpawnMobile(x, y, from.Z)) { spawned.MoveToWorld(new Point3D(x, y, from.Z), map); spawned.Combatant = from; return; } else { int z = map.GetAverageZ(x, y); if (map.CanSpawnMobile(x, y, z)) { spawned.MoveToWorld(new Point3D(x, y, z), map); spawned.Combatant = from; return; } } } try { spawned.MoveToWorld(from.Location, from.Map); spawned.Combatant = from; } catch { } } else { from.SendMessage("Nothing happened when you used your gargoyles knife on the corpse."); if (from.BodyValue == 401) { from.PlaySound(787); // play f_cry } else if (from.BodyValue == 400) { from.PlaySound(1058); //play m_cry } } } else { from.SendMessage("You see nothing useful to carve from the corpse."); } } } }
public static Container Mobile_CreateCorpseHandler( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List<Item> initialContent, List<Item> equipItems ) { Corpse c = new Corpse( owner, hair, facialhair, equipItems ); owner.Corpse = c; for ( int i = 0; i < initialContent.Count; ++i ) { Item item = (Item) initialContent[i]; if ( owner.IsPlayer && item.Parent == owner.Backpack ) c.AddItem( item ); else c.DropItem( item ); if ( owner.IsPlayer ) c.SetRestoreInfo( item, item.Location ); } Point3D loc = owner.Location; Map map = owner.Map; if ( map == null || map == Map.Internal ) { loc = owner.LogoutLocation; map = owner.LogoutMap; } c.MoveToWorld( loc, map ); return c; }
public override void OnCarve( Mobile from, Corpse corpse, Item with ) { base.OnCarve( from, corpse, with ); if ( corpse == null ) return; for ( int i = 0; i < 6; i++ ) { corpse.AddItem( new Server.Engines.Plants.Seed() ); corpse.AddItem( new GreenThorns( Utility.RandomMinMax( 2, 5 ) ) ); } from.SendMessage( "As you cut into her body you notice she is more plant-like than elven." ); }