Bot Event: Loot Drops

Author Topic: Bot Event: Loot Drops  (Read 7352 times)

An event that regulates the percent chance a bot can drop an item when killed.
OnBotKilled > DropItem (Select Item) - [% Chance of of dropping]
Or something along those lines.

Now, I tried to do this with variables and Bot Events till I was blue in the face, but I could not manage to find a way to have a chance drop. Each time, somewhere along the line, it would lose the killer giving the item to the owner of the brick.

Extremely useful for RPGs.
/support



This is a really good idea, it would make dedicated RPG's a lot more fun to play! "have you got the... shadow sword?lolol, yet?" "nah man I want it so bad!" I mean come on people could trade other players and stuff like that, this is a really useful event.

/SUPPORT!

somebody, MAKE THIS ADD-ON, i can use it for a survival i plan on making


I'll do it.

OK, post it here when its done so we can test, than add it to Add-Ons.

Wow, what a turnout. I hope this is actually made.

I believe this can be done with the ifrandomdice event in VCE.

I believe this can be done with the ifrandomdice event in VCE.

This may be true, but I don't know because I don't use the new VCE. I would much rather it be an add to the Bot Events.

/Support one hundred percent. I love this idea. I would probably use this a lot too.


I think this is a great idea.

I haven't tested this yet, but I think this should do the trick


Code: [Select]
RegisterOutputEvent("FxDTSbrick", "BotDropItem", "DataBlock ItemData", false);
RegisterOutputEvent("Player", "BotDropItem", "DataBlock ItemData", false);

function FxDTSbrick::BotDropItem(%brick, %item)
{
if(isObject(%bot = %brick.vehicle) && %bot.getClassName) $= "AIplayer")
{
%drop = new item()
{
datablock = %item;
canPickup = true;
rotate = true;
};
%drop.position = %bot.getPosition);
}
}

function Player::BotDropItem(%bot, %item)
{
if(isObject(%bot) && %bot.getClassName() $= "AIplayer")
{
%drop = new item()
{
datablock = %item;
canPickup = true;
rotate = true;
};
%drop.position = %bot.getPosition();
}
}

edit: What the heck, it says getClassName() isn't a function!   I'm going to try to do %bot.getClassName() instead.
double edit:  Ok, it works now, but if you pick up the item while you are in a minigame, it will say "item is not in minigame."

Is this acceptable or should I fix this?

Latest edit: added rotate.  Will add random thing in just a bit.
« Last Edit: May 19, 2011, 06:57:24 PM by Nexus »