During that, for my random drop event I decided to write a little command/void to handle dropping items. This can be used however you wish. Maybe you want a gm command to drop x number of db's in twin city, a random event or anything else you want really.
NOTE: Coded for CoFuture 1.0 server, SUPER easy to convert to CoEmu and I'm sure a lotf version would be very easy to make.
Enjoy
For my version I created a new class file under handlers but you could obviously pack this in somewhere else (although there is no reason to)
Right click handles>Add>Class and name it w/e you want, mine is ItemDrop1.cs but it makes no real diff
replace the entire new file with this
Notice I just stole the existing item drop code from monsters and modified it to use a new void. As the drop code already seems to work perfectly fine I felt no need to change it.
Now for implimentation of it
under Commands.cs place
Code:
if (Splitter[0] == "/itemdrop")
{
try
{
Handler.ItemDrop(Client.Char.ID, Convert.ToInt32(Splitter[1]), Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]), Convert.ToUInt16(Splitter[4]), Convert.ToUInt16(Splitter[5]));
}
catch
{
Console.WriteLine("Error! Failed to drop item!");
}
return 2;
}
The way this works is very simple.
The item permission (who can grab item) is set to the person using the command (this way the gm could grab if he made a mistake but ppl in server have to wait a while to grab them!)
Everything else is set through the command.
Eg:
/itemdrop 1088001 10 1002 515 422 would drop 10 meteors at 515 422 twin city
And that's all there is to it. You can invoke the command anywhere in the source for any use where you want multiple (or even single) items dropping at a specific place.
All you have to do for that is
Handler.ItemDrop(Client.Char.ID, itemId#, Amount, Map, x, y);
Please let me know if I made any mistakes as I haven't really tested this much (Note! This would need to be changed if you wanted to deal with item quality/+/gem/etc! This is for mets/db mainly, or + stones if using a higher patched source.)
Enjoy,
P4N
Ooh: and a screenshot just so you have an example
Edit: bahh I realized when posting this that it only will drop 9 items due to the limitations of the system I used... I have no reason to fix it right now but feel free if you want to post the correction and obviously all credit will go to you.






