public string Spawn(string[] @params, MooNetClient invokerClient) { if (invokerClient == null) { return("You can not invoke this command from console."); } if (invokerClient.InGameClient == null) { return("You can only invoke this command while ingame."); } var player = invokerClient.InGameClient.Player; var name = "Dye_02"; var amount = 1; if (@params == null) { return(this.Fallback()); } name = @params[0]; if (!ItemGenerator.IsValidItem(name)) { return("You need to specify a valid item name!"); } if (@params.Count() == 1 || !Int32.TryParse(@params[1], out amount)) { amount = 1; } if (amount > 100) { amount = 100; } for (int i = 0; i < amount; i++) { var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f, player.Position.Y + (float)RandomHelper.NextDouble() * 20f, player.Position.Z); var item = ItemGenerator.Cook(player, name); item.EnterWorld(position); } return(string.Format("Spawned {0} items with name: {1}", amount, name)); }
public List <Item> AllPotions(Player plr) { List <Item> list = new List <Item> { ItemGenerator.Cook(plr, "HealthPotionMinor"), ItemGenerator.Cook(plr, "HealthPotionLesser"), ItemGenerator.Cook(plr, "HealthPotion"), ItemGenerator.Cook(plr, "HealthPotionGreater"), ItemGenerator.Cook(plr, "HealthPotionMajor"), ItemGenerator.Cook(plr, "HealthPotionSuper"), ItemGenerator.Cook(plr, "HealthPotionHeroic"), ItemGenerator.Cook(plr, "HealthPotionResplendent"), ItemGenerator.Cook(plr, "HealthPotionRunic"), ItemGenerator.Cook(plr, "HealthPotionMythic"), }; return(list); }
public void SpawnHealthPotion(Actor source, Player player) { string Potion = "Potion"; int Percent = RandomHelper.Next(0, 1000); if (player.Toon.Level <= 8) { if (Percent > 950) { Potion = "HealthPotion"; } else if (Percent > 800) { Potion = "HealthPotionLesser"; } else { Potion = "HealthPotionMinor"; } } else if (player.Toon.Level <= 12) { if (Percent > 950) { Potion = "HealthPotionGreater"; } else if (Percent > 800) { Potion = "HealthPotion"; } else if (Percent > 100) { Potion = "HealthPotionLesser"; } else { Potion = "HealthPotionMinor"; } } else if (player.Toon.Level <= 18) { if (Percent > 950) { Potion = "HealthPotionMajor"; } else if (Percent > 800) { Potion = "HealthPotionGreater"; } else if (Percent > 650) { Potion = "HealthPotion"; } else if (Percent > 50) { Potion = "HealthPotionLesser"; } else { Potion = "HealthPotionMinor"; } } else if (player.Toon.Level <= 22) { if (Percent > 950) { Potion = "HealthPotionSuper"; } else if (Percent > 800) { Potion = "HealthPotionMajor"; } else if (Percent > 650) { Potion = "HealthPotionGreater"; } else if (Percent > 350) { Potion = "HealthPotion"; } else if (Percent > 50) { Potion = "HealthPotionLesser"; } else { Potion = "HealthPotionMinor"; } } else if (player.Toon.Level <= 30) { if (Percent > 960) { Potion = "HealthPotionHeroic"; } else if (Percent > 800) { Potion = "HealthPotionSuper"; } else if (Percent > 600) { Potion = "HealthPotionMajor"; } else if (Percent > 450) { Potion = "HealthPotionGreater"; } else if (Percent > 150) { Potion = "HealthPotion"; } else if (Percent > 50) { Potion = "HealthPotionLesser"; } else { Potion = "HealthPotionMinor"; } } else if (player.Toon.Level <= 38) { if (Percent > 960) { Potion = "HealthPotionResplendent"; } else if (Percent > 800) { Potion = "HealthPotionHeroic"; } else if (Percent > 600) { Potion = "HealthPotionSuper"; } else if (Percent > 450) { Potion = "HealthPotionMajor"; } else if (Percent > 150) { Potion = "HealthPotionGreater"; } else if (Percent > 50) { Potion = "HealthPotion"; } else { Potion = "HealthPotionLesser"; } } else if (player.Toon.Level <= 49) { if (Percent > 960) { Potion = "HealthPotionRunic"; } else if (Percent > 800) { Potion = "HealthPotionResplendent"; } else if (Percent > 600) { Potion = "HealthPotionHeroic"; } else if (Percent > 450) { Potion = "HealthPotionSuper"; } else if (Percent > 150) { Potion = "HealthPotionMajor"; } else if (Percent > 50) { Potion = "HealthPotionGreater"; } else { Potion = "HealthPotion"; } } else if (player.Toon.Level <= 55) { if (Percent > 960) { Potion = "HealthPotionMythic"; } else if (Percent > 800) { Potion = "HealthPotionRunic"; } else if (Percent > 600) { Potion = "HealthPotionResplendent"; } else if (Percent > 450) { Potion = "HealthPotionHeroic"; } else if (Percent > 150) { Potion = "HealthPotionSuper"; } else if (Percent > 50) { Potion = "HealthPotionMajor"; } else { Potion = "HealthPotionGreater"; } } else if (player.Toon.Level > 55) { if (Percent > 750) { Potion = "HealthPotionMythic"; } else if (Percent > 550) { Potion = "HealthPotionRunic"; } else if (Percent > 350) { Potion = "HealthPotionResplendent"; } else { Potion = "HealthPotionHeroic"; } } var CookedPotion = ItemGenerator.Cook(player, Potion); // NOTE: The owner field for an item is only set when it is in the owner's inventory. /komiga player.GroundItems[CookedPotion.DynamicID] = CookedPotion; if (RandomHelper.NextDouble() < NullD.Net.GS.Config.Instance.ItemDropRate / 15)// / 1) { DropItem(source, null, CookedPotion); } //HealthPotionMinor - no lvl //HealthPotionLesser - 6 lvl //HealthPotion - 11 lvl //HealthPotionGreater - 16 lvl //HealthPotionMajor - 21 lvl //HealthPotionSuper - 26 lvl //HealthPotionHeroic - 37 lvl //HealthPotionResplendent - 47 lvl //HealthPotionRunic - 53 lvl //HealthPotionMythic - 58 lvl //PowerPotion }