Amon_PRC8/_module/nss/pws_onunacquire.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

41 lines
1.1 KiB
Plaintext

#include "pws_nodropunique"
#include "x2_inc_switches"
#include "x2_inc_intweapon"
void main()
{
CheckForNoDrop();
// Unacquire DISARM CODE BEGINS HERE
object oItem = GetModuleItemLost();
object oPC = GetModuleItemLostBy();
string sItemGained = GetResRef(oItem);
if (GetLocalInt(oItem, "kitem_error") == TRUE)return;
if(GetIsPC(oPC))
{
if(GetLocalInt(oItem, "recentunequip") == TRUE)
{
object nItem = CopyObject(oItem, GetLocation(oPC), oPC);
DeleteLocalInt(nItem, "recentunequip");
DestroyObject(oItem);
int iGoldB4 = GetLocalInt(oPC, "currentgold");
int iGoldNow = GetGold(oPC);
if(iGoldNow > iGoldB4 && nItem != OBJECT_INVALID)
{
AssignCommand(oPC, TakeGoldFromCreature(iGoldNow - iGoldB4, oPC, TRUE));
}
}
}
if (GetIsPC(oPC))
{
if (GetStringLeft(sItemGained, 9) == "kelobject")
{
DestroyObject(oItem);
}
}
}