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

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) && getClassName(%bot) $= "AIplayer")
{
%drop = new item()
{
datablock = %item;
};
%drop.position = getPosition(%bot);
}
}

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

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?
FIX IT, I REALLY WANT THIS SCRIPT


I could use it as is, but you should really fix that one problem.

OK, I made it. Let me test it.
EDIT: http://dl.dropbox.com/u/551734/add-ons/Event_PrizeDrops.zip
Use Bot -> addPrizeDrop [Item] [Percent Chance] to add a prize drop, prize drops are automatically dropped when the bot or player dies.
Use Bot -> dropPrizeDrops to drop all of the player's prize drops.
« Last Edit: May 19, 2011, 10:56:41 PM by Destiny/Zack0Wack0 »

Find out how the minigame checks if the item is in the minigame.

OK, I made it. Let me test it.
EDIT: http://dl.dropbox.com/u/551734/add-ons/Event_PrizeDrops.zip
Use Bot -> addPrizeDrop [Item] [Percent Chance] to add a prize drop, prize drops are automatically dropped when the bot or player dies.
Use Bot -> dropPrizeDrops to drop all of the player's prize drops.

Aww, you beat me.

Wait, bots have clients?  I never thought that %player.client would work for a bot.

Find out how the minigame checks if the item is in the minigame.
Yes please, it always says the item is not part of the minigame.

Destiny, maybe see what you can do so that either:

The item's minigame is set to the person that killed the bot
or
The item's minigame is set to the person that tries to pick it up first.

I do not think bots can have a minigame.

Event_Bots/inputs.cs, line 77
Code: [Select]
%obj.client = new AIconnection()
{
bot = %obj;
minigame = %client.minigame;
brickGroup = %client.brickGroup; //So the client can still ride horses and whatnot
};

Your version works great.
Its just that the items still cannot be picked up in a minigame making it mostly useless.

Other than that, this is perfect! Thank you.

Your version works great.
Its just that the items still cannot be picked up in a minigame making it mostly useless.

Other than that, this is perfect! Thank you.

The bots cant die by anyone but the brick owner unless you're all in a minigame... in which there is no point seeing as the items can't be acquired.  This needs that change before it becomes usable.

Got an idea for you.

OnBotKilled > Droprandomitem (name all the items to be dropped) - percentage for each

Got an idea for you.

OnBotKilled > Droprandomitem (name all the items to be dropped) - percentage for each

Thats an okay idea. Except for the fact that I cant see this working without you having to type out all the names of the items you want to drop. And I DETEST that. I really don't want to have to look up each name of each item.

Its fine the way it is, just the fact that the items cant be picked up in a minigame needs to be fixed.

Got an idea for you.

OnBotKilled > Droprandomitem (name all the items to be dropped) - percentage for each

There actually already is an option to make it random.  You can add a random item to the enemy.

Got an idea for you.

OnBotKilled > Droprandomitem (name all the items to be dropped) - percentage for each
even better, now i can make a survival with enemy soldiers :D (so they randomly drop grenades, weapons, or ammo in T+T)