Source Type : LOTF.
Usage Info : Gives you 1000 Conquer Points [ Based on a 25% Chance ]
Lets first define our variables.
In Character.cs
Now for the Item Usage code.
Right after
You add..
As you see i put MoonBoxID instead of the real IDs, but on the side I gave you the ID ranges. So that's your "homework", Finish it and you have a perfectly working moonbox usage code for ever moonbox.
Usage Info : Gives you 1000 Conquer Points [ Based on a 25% Chance ]
Lets first define our variables.
In Character.cs
Code:
public int MoonBoxRandom = 0;
Right after
Code:
if (ItemParts[0] == "720027")
{
if (ItemsInInventory <= 30)
{
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
RemoveItem(ItemUID);
}
}
Code:
else if (ItemParts[0] == "MoonBoxID" || ItemParts[0] == "MoonBoxID") // 721020 - 721065 , 721080 - 721090
{
MoonBoxRandom = General.Rand.Next(1, 100); // Finds Random #s
if (MoonBoxRandom < 26) // 25% Win Chance
{
CPs += 1000; // Grants CPs
MyClient.SendPacket(General.MyPackets.Vital((long)UID, 30, CPs));
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You opened a MoonBox and got 1000 Conquer Points!", 2005));
RemoveItem(UID);
}
else
{
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You weren't so lucky this time, Sorry!", 2005));
RemoveItem(UID);
}
}