UW2_PRC8/_module/nss/onunaquireitem.nss
Jaysyn904 f69e979e53 Updated event system
Added caller scripts to the PC events.  Full compile.  Updated release.
2023-11-13 13:16:17 -05:00

115 lines
2.7 KiB
Plaintext

//Script Name: onunaquireitem
//////////////////////////////////////////
//Created By: Genisys (Guile)
//Created On: 3/05/08 (Update 9/16/08)
/////////////////////////////////////////
/*
This script goes in the OnUnAquireItem
Module Event in the Module Properties
This script accurately nails a player
for pick pocketing another player.
It doesn't fire if they are pick
pocketing anything but a player.
The Tag Standard Bioware Tag-Based
Scripting will still fire reguardless.
*/
////////////////////////////////////////
//Required Include
#include "x2_inc_switches"
void main()
{
//IMPORTANT THIS MUST BE IN YOUR OnUnAcquireItem Module Event Script
//This is a fix for the Inventory Organizing System!
object oPC = GetModuleItemLostBy();
if(!GetIsPC(oPC))
return;
if(GetLocalInt(oPC, "ORGANIZING")==1)
{ return; }
object oItem = GetModuleItemLost();
SetPlotFlag(oItem, FALSE);
object oRobbed;
oRobbed = GetModuleItemLostBy();
object oThief;
oThief = GetModuleItemAcquiredBy();
object oLost;
oLost = GetModuleItemLost();
object oFound;
oFound = GetModuleItemAcquired();
string sMsg;
//This script destroys all items dropped if not in combat (disarmed)
//or if the item is put into a container in the module.
//Simply place // before Execute to turn off.
//ExecuteScript("trashem",OBJECT_SELF);
////////////////////////////////////////////////////////////////////////
////Pick Pocket Watch///// Testing...
/*
//We do not run this script AT ALL for DMs!
if(!GetIsDM(oRobbed))
{
if(!GetIsDMPossessed(oRobbed))
{
if(GetObjectType(oRobbed)==OBJECT_TYPE_CREATURE)
{
//Let's make sure the thief is a PC
if (GetIsPC(oThief))
{
//Lets see if they have Pick Pocket Skills
if(GetSkillRank(SKILL_PICK_POCKET, oThief, TRUE)>0)
{
//Lets make sure they took it from a PC and not an NPC or Monster.
if(GetIsPC(oRobbed))
{
//Let's make sure the thief isn't crafting.
if(oRobbed != oThief)
{
sMsg = GetName(oThief) + " Has pickpocketed - " + GetName(oRobbed);
SendMessageToAllDMs(sMsg);
WriteTimestampedLogEntry(sMsg);
}
}
}
}
}
}
}
*/
///////////////////////////////////////////////////////////////////////////
//Your Code Goes here...
///////////////////////////////////////////////////////////////////////////
///////////STANDARD XP2 TAG BASED SCRIPTING CODE///////////////////////////
//Tag Based Scripting Check
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;
}
}
//Main Script End
}