as the br's in real co call them
lmao
so how do i make moonboxes give out items when you right click them?
LOTF
lmao
so how do i make moonboxes give out items when you right click them?
LOTF
I assume this is coemu2Quote:
as the br's in real co call them
lmao
so how do i make moonboxes give out items when you right click them?
{
Struct.MbPrizes MbList = new Struct.MbPrizes();
int MbPrizeNumber = Nano.MbPrize.Count;
int P = Nano.Rand.Next(1, MbPrizeNumber);
if (Nano.MbPrizeNumber.TryGetValue(P, out RPoint))
{
GiveItem(RPoint.Itemcode, RPoint.Item+, RPoint.ItemSockets, 0, CSocket);///ANYTHING ELSE YOU HAVE LOADING FORM THE DATABASE!! Would basically be everything you would normally use to award an item except this type of script will roll a number between 1 and how many "prizes" you have in your database. It will select that number and then using the give item code do the RPoint.blablabla you can load the other specifics from the database (corresponding to that prize number)
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You have received an item from opening the moon box, how exciting!", Struct.ChatType.Top));
}
break;
}
lol sorry its lotfQuote:
I assume this is coemu2
Under handlers>UseItem set up a case for it. The easiest way would be to add in a databse (yah so it's not "easy", but it saves hard coding all the possible rewards given by the moon box!)
Something along the lines of ummm
case MoonboxIdHere://MoonBox, NOT A COPY PASTE LOL. Would need a database set up
Again, this code WILL NOT work, you would first have to setup a database for it, add a function to load the database into the server (under database.cs, look at lottery script for an example) and a few other things added to source.Code:{ Struct.MbPrizes MbList = new Struct.MbPrizes(); int MbPrizeNumber = Nano.MbPrize.Count; int P = Nano.Rand.Next(1, MbPrizeNumber); if (Nano.MbPrizeNumber.TryGetValue(P, out RPoint)) { GiveItem(RPoint.Itemcode, RPoint.Item+, RPoint.ItemSockets, 0, CSocket);///ANYTHING ELSE YOU HAVE LOADING FORM THE DATABASE!! Would basically be everything you would normally use to award an item except this type of script will roll a number between 1 and how many "prizes" you have in your database. It will select that number and then using the give item code do the RPoint.blablabla you can load the other specifics from the database (corresponding to that prize number) CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You have received an item from opening the moon box, how exciting!", Struct.ChatType.Top)); } break; }
This sytem WILL work though, I have something nearly identical working on my server to setup random scroll points (loads database of scroll points and randomly sends you to one of them whenever you use a random scroll)
The codes are very similar between them, I'm sure you could still use that example to guide you in the right direction.Quote:
lol sorry its lotf
Quote:
else if (ItemParts[0] == "MOONBOXID")
{
CPs += 100000;
MyClient.SendPacket(General.MyPackets.Vital(UID, 30, CPs));
RemoveItem(ItemUID);
}
I don't know scripting in lotf but if you just want it to give a specific thing, or even a random pre-specified thing (you could have it chance based, or a small list of prizes) that's EASY to do. I was thinking you wanted a long list of prizes all with varying chances.Quote:
hmm or maybe i could make moonboxes like the rarest thing in my server
like you right click and get 100k cps
would it work like this?
case 722839://HeroCard (AP)
{
RandomCP = Nano.Rand.Next(1, 10);
CPs(+RandomCP, CSocket);
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You recieved " + RandomCP + " CPs from the HeroCard!!.", Struct.ChatType.Top));
break;
}
case 722839://Change item id to moon box id
{
MoonBoxRandom = Nano.Rand.Next(1, 101);
if MoonBoxRandom == 100
CPs(+10000, CSocket);
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Wow! You received 10000 CPs from the MoonBox. Aren't you lucky!.", Struct.ChatType.Top));
else
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Awwww,you opened the moonbox but didn't find anything", Struct.ChatType.Top));
break;
}
public int MoonBoxRandom = 0;
// Created by Fail
else if (ItemParts[0] == "MoonBoxID" || ItemParts[0] == "MoonBoxID") // 721020 - 721065 , 721080 - 721090
{
MoonBoxRandom = General.Rand.Next(1, 100); // Finds Random #s
if (MoonBoxRandom >= 1 && MoonBoxRandom <= 25) // 25% Win Chance
{
CPs += 1000;
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 silvers!", 2005));
RemoveItem(UID);
}
else
{
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You weren't so lucky this time, Sorry!", 2005));
RemoveItem(UID);
}
}
Damn you and your Lotf farmiliarity!Quote:
Here you go my friend gave me it.
Addin character.cs definitionsCode:public int MoonBoxRandom = 0;
I gave you also a range of MoonBoxIDs they are all of them, You just have to add them, I gave you an example how to add them in the code.Code:// Created by Fail else if (ItemParts[0] == "MoonBoxID" || ItemParts[0] == "MoonBoxID") // 721020 - 721065 , 721080 - 721090 { MoonBoxRandom = General.Rand.Next(1, 100); // Finds Random #s if (MoonBoxRandom >= 1 && MoonBoxRandom <= 25) // 25% Win Chance { CPs += 1000; 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 silvers!", 2005)); RemoveItem(UID); } else { MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You weren't so lucky this time, Sorry!", 2005)); RemoveItem(UID); } }
Press thanks if this helped