You would need to alter your modules "OnUnAcquireItem" script. This is what the default "x2_mod_def_unaqu" script would look like with the needed changes:
//::///////////////////////////////////////////////
//:: Example XP2 OnItemUnAcquireScript
//:: x2_mod_def_unaqu
//:: © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnItemUnAcquire Event
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_itemprop"
void main()
{
object oItem = GetModuleItemLost();
///////////////////////////////////////////////////////////////////////////
//::Added to place disarmed weapons back into a player inventory.
///////////////////////////////////////////////////////////////////////////
object oPC = GetModuleItemLostBy();
int iLoopStop = GetLocalInt(oItem, "LOOP_STOP");
if (GetIsPC(oPC) && GetIsInCombat(oPC))
{
if (IPGetIsMeleeWeapon(oItem))
{
if (iLoopStop != TRUE)
{
SetLocalInt(oItem, "LOOP_STOP", TRUE);
object oCopy = CopyItem(oItem, oPC, TRUE);
DelayCommand(2.0, DeleteLocalInt(oCopy, "LOOP_STOP"));
DestroyObject(oItem, 0.0);
}
}
}
///////////////////////////////////////////////////////////////////////////
// * Generic Item Script Execution Code
// * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,
// * it will execute a script that has the same name as the item's tag
// * inside this script you can manage scripts for all events by checking against
// * GetUserDefinedItemEventNumber(). See x2_it_example.nss
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNACQUIRE);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
}
This does not include anything for delaying the ability to equipp the weapon again. I suppose you could just add another variable to the weapon and then add a delay to delete the variable. Then go to your "OnPlayerEquipItem" script and do a check for the variable. If found then unequip the weapon?
Hope this helps. good luck.
P.S. This also takes into consideration the fact that the players inventory might be full. In which case the item will still have to go onto the ground.
Modifié par GhostOfGod, 25 novembre 2010 - 12:09 .