public override void RightClick(Player player) { int roll = Main.rand.Next(4); ModItem item = null; if (roll == 1) { item = mod.GetItem("SunstoneAccessory"); } else if (roll == 2) { item = mod.GetItem("SunstoneMelee"); } else if (roll == 3) { item = mod.GetItem("SunstoneRanged"); } else { item = mod.GetItem("SunstoneArcane"); } int prefix = item.ChoosePrefix(Main.rand); Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, item.item.type, 1, false, prefix, false, false); }
public override void RightClick(Player player) { ModItem item = null; if (Main.rand.Next(2) == 1) { item = mod.GetItem("MoonstoneWeapon"); } else { item = mod.GetItem("MoonstoneAccessory"); } int prefix = item.ChoosePrefix(Main.rand); int number = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, item.item.type, 1, false, prefix, true, false); if (Main.netMode == 1) { NetMessage.SendData(21, -1, -1, null, number, 1f, 0f, 0f, 0, 0, 0); } }
public override void RightClick(Player player) { /* * So I wanted to add a weapon moonstone for each damage pool type * * Accessory for Accessories * Melee for Melee damage * Ranged for Ranged and Thrown damage * Arcane for Magic and Summoning damage * * This would allow you to make the mod compatible with mods that add new damage types */ int roll = Main.rand.Next(4); ModItem item = null; if (roll == 1) { item = mod.GetItem("MoonstoneAccessory"); } else if (roll == 2) { item = mod.GetItem("MoonstoneMelee"); } else if (roll == 3) { item = mod.GetItem("MoonstoneRanged"); } else { item = mod.GetItem("MoonstoneArcane"); } int prefix = item.ChoosePrefix(Main.rand); int number = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, item.item.type, 1, false, prefix, false, false); if (Main.netMode == 1) { NetMessage.SendData(21, -1, -1, null, number, 1f, 0f, 0f, 0, 0, 0); } }