public override void Drink(Mobile from) { TeiravonMobile m_Player = (TeiravonMobile)from; if (m_Player.CanDrink(PEffect) && (m_Player.Body == 0x190 || m_Player.Body == 0x191)) { m_Player.SendMessage("You feel a little strange..."); if (m_Player.Body == 0x190) { m_Player.BodyMod = 0x191; } else { m_Player.BodyMod = 0x190; } } else { m_Player.SendMessage("It has no effect."); m_Player.RevealingAction(); m_Player.PlaySound(0x2D6); m_Player.AddToBackpack(new Bottle()); this.Consume(); return; } base.Drink(from); }
protected override void OnTick() { m_Mobile.Frozen = false; if (m_Mobile.Alive) { m_ballista.Delete(); wpn.Delete(); if (m_Mobile is TeiravonMobile) { TeiravonMobile player = (TeiravonMobile)m_Mobile; if (player.Backpack != null) { player.AddToBackpack(new BallistaEastAddonDeed()); } } } }
public override void OnResponse(Server.Network.NetState sender, RelayInfo info) { Container pack = m_Player.Backpack; if (pack == null) { m_Player.SendMessage("You don't have a backpack."); return; } bool mandrakeroot = false; bool sulfurousash = false; bool blackpearl = false; bool fertiledirt = false; bool bottle = false; bool daemonblood = false; bool success = false; bool nightshade = false; int m_Bottle; int m_MandrakeRoot; int m_SulfurousAsh; int m_BlackPearl; int m_FertileDirt; int m_DaemonBlood; int m_NightShade; switch (info.ButtonID) { default: break; case (int)Buttons.CGolog: if (playerlevel(m_Player, 3)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 3) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 3) { sulfurousash = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } if (blackpearl && sulfurousash && bottle) { pack.ConsumeTotal(typeof(BlackPearl), 3); pack.ConsumeTotal(typeof(SulfurousAsh), 3); pack.ConsumeTotal(typeof(Bottle), 1); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.95) { chance = 0.95; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new GologsYelp()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CGolog)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; case (int)Buttons.CShara: if (playerlevel(m_Player, 6)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 5) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 5) { sulfurousash = true; } m_FertileDirt = pack.GetAmount(typeof(FertileDirt)); if (m_FertileDirt >= 5) { fertiledirt = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } if (blackpearl && sulfurousash && fertiledirt && bottle) { pack.ConsumeTotal(typeof(BlackPearl), 5); pack.ConsumeTotal(typeof(SulfurousAsh), 5); pack.ConsumeTotal(typeof(FertileDirt), 5); pack.ConsumeTotal(typeof(Bottle), 1); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.85) { chance = 0.85; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new SharasFart()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CShara)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!fertiledirt) { m_Player.SendMessage("You need more fertile dirt."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; case (int)Buttons.CGazat: if (playerlevel(m_Player, 9)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 7) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 7) { sulfurousash = true; } m_FertileDirt = pack.GetAmount(typeof(FertileDirt)); if (m_FertileDirt >= 7) { fertiledirt = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } if (blackpearl && sulfurousash && fertiledirt && bottle) { pack.ConsumeTotal(typeof(BlackPearl), 7); pack.ConsumeTotal(typeof(SulfurousAsh), 7); pack.ConsumeTotal(typeof(FertileDirt), 7); pack.ConsumeTotal(typeof(Bottle), 1); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.75) { chance = 0.75; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new GazatsRoar()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CGazat)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!fertiledirt) { m_Player.SendMessage("You need more fertile dirt."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; case (int)Buttons.CStone: if (playerlevel(m_Player, 12)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 10) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 10) { sulfurousash = true; } m_FertileDirt = pack.GetAmount(typeof(FertileDirt)); if (m_FertileDirt >= 10) { fertiledirt = true; } m_MandrakeRoot = pack.GetAmount(typeof(MandrakeRoot)); if (m_MandrakeRoot >= 10) { mandrakeroot = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } if (blackpearl && sulfurousash && fertiledirt && mandrakeroot && bottle) { pack.ConsumeTotal(typeof(BlackPearl), 10); pack.ConsumeTotal(typeof(SulfurousAsh), 10); pack.ConsumeTotal(typeof(FertileDirt), 10); pack.ConsumeTotal(typeof(MandrakeRoot), 10); pack.ConsumeTotal(typeof(Bottle), 1); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.65) { chance = 0.65; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new StoneSmasher()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CStone)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!fertiledirt) { m_Player.SendMessage("You need more fertile dirt."); } if (!mandrakeroot) { m_Player.SendMessage("You need more mandrake root."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; case (int)Buttons.CMountain: if (playerlevel(m_Player, 15)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 15) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 15) { sulfurousash = true; } m_FertileDirt = pack.GetAmount(typeof(FertileDirt)); if (m_FertileDirt >= 15) { fertiledirt = true; } m_MandrakeRoot = pack.GetAmount(typeof(MandrakeRoot)); if (m_MandrakeRoot >= 15) { mandrakeroot = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } if (blackpearl && sulfurousash && fertiledirt && mandrakeroot && bottle) { pack.ConsumeTotal(typeof(BlackPearl), 15); pack.ConsumeTotal(typeof(SulfurousAsh), 15); pack.ConsumeTotal(typeof(FertileDirt), 15); pack.ConsumeTotal(typeof(MandrakeRoot), 15); pack.ConsumeTotal(typeof(Bottle), 1); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.55) { chance = 0.55; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new MountainCrusher()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CMountain)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!fertiledirt) { m_Player.SendMessage("You need more fertile dirt."); } if (!mandrakeroot) { m_Player.SendMessage("You need more mandrake root."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; case (int)Buttons.CMight: if (playerlevel(m_Player, 18)) { break; } m_BlackPearl = pack.GetAmount(typeof(BlackPearl)); if (m_BlackPearl >= 20) { blackpearl = true; } m_SulfurousAsh = pack.GetAmount(typeof(SulfurousAsh)); if (m_SulfurousAsh >= 20) { sulfurousash = true; } m_FertileDirt = pack.GetAmount(typeof(FertileDirt)); if (m_FertileDirt >= 20) { fertiledirt = true; } m_DaemonBlood = pack.GetAmount(typeof(DaemonBlood)); if (m_DaemonBlood >= 20) { daemonblood = true; } m_Bottle = pack.GetAmount(typeof(Bottle)); if (m_Bottle >= 1) { bottle = true; } m_NightShade = pack.GetAmount(typeof(Nightshade)); if (m_NightShade >= 3) { nightshade = true; } if (blackpearl && sulfurousash && fertiledirt && daemonblood && bottle && nightshade) { pack.ConsumeTotal(typeof(BlackPearl), 20); pack.ConsumeTotal(typeof(SulfurousAsh), 20); pack.ConsumeTotal(typeof(FertileDirt), 20); pack.ConsumeTotal(typeof(DaemonBlood), 20); pack.ConsumeTotal(typeof(Bottle), 1); pack.ConsumeTotal(typeof(Nightshade), 3); double chance = (m_Player.Skills[MainSkill(m_Player)].Value / 100.0) + 0.1 + ((double)Utility.Random(20) / 100.0); if (chance > 0.45) { chance = 0.45; } if (Utility.RandomDouble() <= chance) { success = true; } if (success) { m_Player.AddToBackpack(new MightOfTheUruk()); m_Player.SendMessage("You bottle the explosive liquid and place it in your pack."); } else { m_Player.SendMessage("You fail to create the explosive and lose your ingredients."); } m_Player.SendGump(new BuumBuumGump(m_Player, (int)Buttons.CMight)); break; } if (!blackpearl) { m_Player.SendMessage("You need more black pearls."); } if (!sulfurousash) { m_Player.SendMessage("You need more sulfurous ash."); } if (!fertiledirt) { m_Player.SendMessage("You need more fertile dirt."); } if (!daemonblood) { m_Player.SendMessage("You need more daemon blood."); } if (!nightshade) { m_Player.SendMessage("You need more nightshade."); } if (!bottle) { m_Player.SendMessage("You need a bottle."); } break; } }
public override void OnResponse(NetState sender, RelayInfo info) { switch (info.ButtonID) { case 0: { break; } case (int)Buttons.Iron: { m_step[m_itemnum] = new IronIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.DullCopper: { m_step[m_itemnum] = new DullCopperIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.ShadowIron: { m_step[m_itemnum] = new ShadowIronIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Copper: { m_step[m_itemnum] = new CopperIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Bronze: { m_step[m_itemnum] = new BronzeIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Gold: { m_step[m_itemnum] = new GoldIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Agapite: { m_step[m_itemnum] = new AgapiteIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Verite: { m_step[m_itemnum] = new VeriteIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Valorite: { m_step[m_itemnum] = new ValoriteIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Oak: { m_step[m_itemnum] = new Log(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Pine: { m_step[m_itemnum] = new PineLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Redwood: { m_step[m_itemnum] = new RedwoodLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.WhitePine: { m_step[m_itemnum] = new WhitePineLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Ashwood: { m_step[m_itemnum] = new AshwoodLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.SilverBirch: { m_step[m_itemnum] = new SilverBirchLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Silver: { m_step[m_itemnum] = new SilverIngot(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Yew: { m_step[m_itemnum] = new YewLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.BlackOak: { m_step[m_itemnum] = new BlackOakLog(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.SulfurousAsh: { m_step[m_itemnum] = new SulfurousAsh(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.ZoogiFungus: { m_step[m_itemnum] = new ZoogiFungus(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.FertileDirt: { m_step[m_itemnum] = new FertileDirt(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.PigIron: { m_step[m_itemnum] = new PigIron(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.NoxCrystal: { m_step[m_itemnum] = new NoxCrystal(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Diamond: { m_step[m_itemnum] = new Diamond(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Wool: { m_step[m_itemnum] = new Wool(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Bone: { m_step[m_itemnum] = new Bone(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Citrine: { m_step[m_itemnum] = new Citrine(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.BlackPearl: { m_step[m_itemnum] = new BlackPearl(); m_itemnum += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Decrease: { if (m_amt > 1) { m_amt -= 1; } m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Increase: { m_amt += 1; m_player.SendGump(new AlloyGump(m_player, m_amt, m_itemnum, m_step[1], m_step[2], m_step[3], m_step[4], m_step[5], m_step[6])); break; } case (int)Buttons.Cancel: { m_player.SendGump(new AlloyGump(m_player, 1, 1, null, null, null, null, null, null)); break; } case (int)Buttons.OK: { //check for and consume ingredients here Container pack = m_player.Backpack; if (m_step[6] == null) { m_player.SendMessage("You must pick 6 steps"); m_player.SendGump(new AlloyGump(m_player, 1, 1, null, null, null, null, null, null)); break; } bool allres = true; for (int i = 1; i < 7; i++) { Item itm = (Item)m_step[i]; int packamt = m_player.Backpack.GetAmount(itm.GetType()); if (packamt < m_amt) { m_player.SendMessage("You do not have enough {0} to attempt this", itm.GetType().Name); allres = false; } } if (allres) { for (int i = 1; i < 7; i++) { Item itm = (Item)m_step[i]; m_player.Backpack.ConsumeTotal(m_step[i].GetType(), m_amt); m_player.SendMessage("Step {0} consumes {1} {2}", i.ToString(), m_amt.ToString(), itm.GetType().Name); } } else { m_player.SendMessage("Please try again when you have all of the needed resources"); return; } if (m_step[1] is AgapiteIngot && m_step[2] is BlackOakLog && m_step[3] is AgapiteIngot && m_step[4] is ShadowIronIngot && m_step[5] is Bone && m_step[6] is AgapiteIngot) { if (m_player.Backpack != null) { m_player.AddToBackpack(new BloodrockIngot(m_amt)); } break; } if (m_step[1] is ValoriteIngot && m_step[2] is WhitePineLog && m_step[3] is ValoriteIngot && m_step[4] is CopperIngot && m_step[5] is FertileDirt && m_step[6] is SilverBirchLog) { if (m_player.Backpack != null) { m_player.AddToBackpack(new SteelIngot(m_amt)); } break; } if (m_step[1] is ShadowIronIngot && m_step[2] is AshwoodLog && m_step[3] is VeriteIngot && m_step[4] is ShadowIronIngot && m_step[5] is NoxCrystal && m_step[6] is ShadowIronIngot) { if (m_player.Backpack != null) { m_player.AddToBackpack(new AdamantiteIngot(m_amt)); } break; } if (m_step[1] is IronIngot && m_step[2] is SilverBirchLog && m_step[3] is ValoriteIngot && m_step[4] is IronIngot && m_step[5] is Citrine && m_step[6] is SilverBirchLog) { if (m_player.Backpack != null) { m_player.AddToBackpack(new IthilmarIngot(m_amt)); } break; } if (m_step[1] is SilverIngot && m_step[2] is GoldIngot && m_step[3] is Diamond && m_step[4] is SilverIngot && m_step[5] is GoldIngot && m_step[6] is SilverIngot) { if (m_player.Backpack != null) { m_player.AddToBackpack(new ElectrumIngot(m_amt)); } break; } if (m_step[1] is PigIron && m_player.IsGoblin()) { if (m_player.Backpack != null) { m_player.AddToBackpack(new SkazzIngot(m_amt)); } break; } m_player.SendMessage("You fail to create a new alloy and your materials are lost"); m_player.SendGump(new AlloyGump(m_player, 1, 1, null, null, null, null, null, null)); break; } } }
public override void OnResponse(NetState sender, RelayInfo info) { switch (info.ButtonID) { case 0: { break; } case (int)Buttons.IronButton: { m_player.AddToBackpack(new Granite()); m_box.IronAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.DCButton: { m_player.AddToBackpack(new DullCopperGranite()); m_box.DullAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.ShadowButton: { m_player.AddToBackpack(new ShadowIronGranite()); m_box.ShadowAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.CopperButton: { m_player.AddToBackpack(new CopperGranite()); m_box.CopperAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.BronzeButton: { m_player.AddToBackpack(new BronzeGranite()); m_box.BronzeAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.GoldButton: { m_player.AddToBackpack(new GoldGranite()); m_box.GoldAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.AgapiteButton: { m_player.AddToBackpack(new AgapiteGranite()); m_box.AgapiteAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.VeriteButton: { m_player.AddToBackpack(new VeriteGranite()); m_box.VeriteAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.ValoriteButton: { m_player.AddToBackpack(new ValoriteGranite()); m_box.ValoriteAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } case (int)Buttons.MithrilButton: { m_player.AddToBackpack(new MithrilGranite()); m_box.MithrilAmt -= 1; m_player.SendGump(new GraniteGump(m_player, m_box, m_box.IronAmt, m_box.DullAmt, m_box.ShadowAmt, m_box.CopperAmt, m_box.BronzeAmt, m_box.GoldAmt, m_box.AgapiteAmt, m_box.VeriteAmt, m_box.ValoriteAmt, m_box.MithrilAmt)); break; } } }
protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; if (p == null || map == null || m_Deed.Deleted) { return; } if (m_Deed.IsChildOf(from.Backpack)) { BaseAddon addon = m_Deed.Addon; Server.Spells.SpellHelper.GetSurfaceTop(ref p); ArrayList houses = null; AddonFitResult res = addon.CouldFit(p, map, from, ref houses); if (res == AddonFitResult.Valid) { addon.MoveToWorld(new Point3D(p), map); if (from is TeiravonMobile) { TeiravonMobile player = (TeiravonMobile)from; if (addon is BallistaEastAddon) { BallistaEastAddon m_ballista = (BallistaEastAddon)addon; if (player.Backpack != null) { DwarvenBallista wep = new DwarvenBallista(); wep.Ballista = addon; player.AddToBackpack(wep); m_ballista.Controller = wep; } } if (addon is OrcCombatBridgeAddon) { OrcCombatBridgeAddon bridge = (OrcCombatBridgeAddon)addon; bridge.Z = player.Z; } } } else if (res == AddonFitResult.Blocked) { from.SendLocalizedMessage(500269); // You cannot build that there. } else if (res == AddonFitResult.NotInHouse) { from.SendLocalizedMessage(500274); // You can only place this in a house that you own! } else if (res == AddonFitResult.DoorsNotClosed) { from.SendMessage("You must close all house doors before placing this."); } else if (res == AddonFitResult.DoorTooClose) { from.SendLocalizedMessage(500271); // You cannot build near the door. } else if (res == AddonFitResult.NoWall) { from.SendLocalizedMessage(500268); // This object needs to be mounted on something. } if (res == AddonFitResult.Valid) { m_Deed.Delete(); if (houses != null) { foreach (Server.Multis.BaseHouse h in houses) { h.Addons.Add(addon); } } } else { addon.Delete(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }