51 lines
1.7 KiB
Plaintext
51 lines
1.7 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Example XP2 OnActivate Script Script
|
||
|
//:: x2_mod_def_act
|
||
|
//:: (c) 2003 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Put into: OnItemActivate Event
|
||
|
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Georg Zoeller
|
||
|
//:: Created On: 2003-07-16
|
||
|
//:://////////////////////////////////////////////
|
||
|
|
||
|
#include "x2_inc_switches"
|
||
|
void main()
|
||
|
{
|
||
|
object oItem = GetItemActivated();
|
||
|
/*object oTarget = GetItemActivatedTarget();
|
||
|
location lLocal = GetItemActivatedTargetLocation();
|
||
|
|
||
|
if (GetStringLeft(GetTag(oItem), 5) == "dmfi_" ||
|
||
|
GetStringLeft(GetTag(oItem), 8) == "hlslang_" ||
|
||
|
GetTag(oItem) == "persistinfo")
|
||
|
{
|
||
|
SetLocalObject(OBJECT_SELF, "dmfi_item", oItem);
|
||
|
SetLocalObject(OBJECT_SELF, "dmfi_target", oTarget);
|
||
|
SetLocalLocation(OBJECT_SELF, "dmfi_location", lLocal);
|
||
|
ExecuteScript("dmfi_activate", OBJECT_SELF);
|
||
|
return;
|
||
|
}*/
|
||
|
|
||
|
|
||
|
// * 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_ACTIVATE);
|
||
|
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
|
||
|
if (nRet == X2_EXECUTE_SCRIPT_END)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|