Files
HeroesStone_PRC8/_module/nss/x2_mod_def_unequ.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

65 lines
2.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Example XP2 OnItemEquipped
//:: x2_mod_def_unequ
//:: (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Put into: OnUnEquip Event
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-16
//:://////////////////////////////////////////////
#include "x2_inc_switches"
#include "x2_inc_intweapon"
void main()
{
ExecuteScript("vcs_onunequip", OBJECT_SELF);
object oItem = GetPCItemLastUnequipped();
object oPC = GetPCItemLastUnequippedBy();
// -------------------------------------------------------------------------
// Intelligent Weapon System
// -------------------------------------------------------------------------
if (IPGetIsIntelligentWeapon(oItem))
{
IWSetIntelligentWeaponEquipped(oPC,OBJECT_INVALID);
IWPlayRandomUnequipComment(oPC,oItem);
}
// -------------------------------------------------------------------------
// 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) == FALSE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_UNEQUIP);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
//::///////////////////////////////////////////////
//:: torch_OnUnEquip Rev. 2
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/* See "loc_inc_torches" for usage details
and author's info */
{
object oItem = GetPCItemLastUnequipped();
if (GetTag(oItem) == "NW_IT_TORCH001") // check if a torch was just unequipped
{
SetLocalInt(oItem, "TorchInHands", 0);
}
}
}
}