[Release] Moonbox Usage

07/09/2009 09:16 f0am#1
Source Type : LOTF.


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;
Now for the Item Usage code.

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);
                }
            }
You add..

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);
                }

            }
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.

07/09/2009 19:58 raidenx123#2
Nice well I made a new item, this is for itemtype:
Code:
729913 CPBox 0 0 0 0 0 0 0 0 8 0 1000000 7403530 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Giftbox Right~click~on~it~for~a~chance~to~win~1000~CPs.
07/09/2009 21:21 f0am#3
These are for moonbox but nice i guess.. :D
07/09/2009 21:25 danielachraf#4
totally wrong .. but good anyway
07/09/2009 21:38 f0am#5
Quote:
Originally Posted by danielachraf View Post
totally wrong .. but good anyway

Whats wrong about it?


(If your answer to the question is one of the following ... please continue)

Drops All Items (or a certain type) : Learn to edit your self

Wrong Random : 25% Chance is pretty fair, I won't go for 50%


Anything else please post =]
07/10/2009 00:40 taylor2846#6
lol
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);
                }
            }
why not
Code:
            if (ItemParts[0] == "720027")
            {
                if (ItemsInInventory <= 30)
                {
                     for (int i = 0; i < 10; i++)
                        {
                         AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(346623472));
                        }
                    RemoveItem(ItemUID);
                }
            }
07/10/2009 00:44 raidenx123#7
because no one wanted too
07/10/2009 11:58 f0am#8
#BUMP

The only 4 letter word that allows me to bump something up a day without getting the moderators to yell at me. Isn't it spectacular?


I've took a look at the votes and I already started on the Meteor and DragonBall Bank.