Changed folder name.
Changed folder name.
This commit is contained in:
85
_module/nss/onaquireditem.nss
Normal file
85
_module/nss/onaquireditem.nss
Normal file
@@ -0,0 +1,85 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Example XP2 OnItemAcquireScript
|
||||
//:: x2_mod_def_aqu
|
||||
//:: (c) 2003 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Put into: OnItemAcquire Event
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Georg Zoeller
|
||||
//:: Created On: 2003-07-16
|
||||
//:: Modified by Genisys / Guile 5/20/08
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_onaquire", OBJECT_SELF);
|
||||
|
||||
//IMPORTANT THIS MUST BE IN YOUR OnAcquireItem Module Event Script
|
||||
//This is a fix for the Inventory Organizing System!
|
||||
object oPC = GetModuleItemAcquiredBy();
|
||||
|
||||
if (!GetIsPC(oPC)) { return; }
|
||||
if (GetIsDM(oPC) || GetIsDMPossessed(oPC))
|
||||
{ return; }
|
||||
|
||||
if(GetLocalInt(oPC, "ORGANIZING")==1)
|
||||
{ return; }
|
||||
|
||||
|
||||
object oRobbed = GetModuleItemLostBy();
|
||||
object oItem = GetModuleItemAcquired();
|
||||
object oTaken = GetModuleItemLost();
|
||||
string sTaken = GetName(oTaken);
|
||||
string sRecieved = GetName(oItem);
|
||||
string sRob = GetName(oRobbed);
|
||||
string sPC = GetName(oPC);
|
||||
|
||||
string sCDKey = GetPCPublicCDKey(oPC, FALSE);
|
||||
|
||||
int nCheck = GetLocalInt(oPC, "CHECKING_ROGUE");
|
||||
|
||||
//Do this only if the player has not been checked recently!
|
||||
if(nCheck !=1)
|
||||
{
|
||||
//Watch the rogues..
|
||||
if(GetIsPC(oPC) && GetHasSkill(SKILL_PICK_POCKET, oPC) && !GetIsDM(oPC))
|
||||
{
|
||||
|
||||
SetLocalInt(oPC, "CHECKING_ROGUE", 1);
|
||||
//Prevent Rapid Fire!
|
||||
DelayCommand(3.0, SetLocalInt(oPC, "CHECKING_ROGUE", 0));
|
||||
|
||||
if((GetIsPC(oRobbed)) && (!GetIsDM(oRobbed)) && (!GetIsDMPossessed(oRobbed)))
|
||||
{
|
||||
if(sRob == sPC)
|
||||
{
|
||||
if(sTaken == sRecieved)
|
||||
{
|
||||
SendMessageToAllDMs("Player " + GetName(oPC) + " may have performed a pick pocket on " + GetName(oRobbed));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// * 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_ACQUIRE);
|
||||
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
|
||||
if (nRet == X2_EXECUTE_SCRIPT_END)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user