generated from Jaysyn/ModuleTemplate
96 lines
4.1 KiB
Plaintext
96 lines
4.1 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 "habd_include"
|
|
#include "omw_plns"
|
|
#include "x2_inc_switches"
|
|
#include "NW_I0_Plot"
|
|
void main()
|
|
{
|
|
object oItem = GetItemActivated();
|
|
if (PLNSToggleLootNotificationOnActivateItem(GetItemActivator(), GetItemActivated())) 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;
|
|
}
|
|
if (HABDOnActivateItem(GetItemActivator(), GetItemActivatedTarget(), GetItemActivated())) return;
|
|
|
|
|
|
}
|
|
{
|
|
if ( GetTag( GetItemActivated() ) == "SleepActivatorToy")
|
|
{
|
|
if (GetLocalInt(GetModule(),"RestAllow") == 1)
|
|
{
|
|
SetLocalInt(GetModule(),"RestAllow",0);
|
|
SpeakString("Resting Disabled",TALKVOLUME_SHOUT);
|
|
return;
|
|
}
|
|
if (GetLocalInt(GetModule(),"RestAllow") == 0)
|
|
{
|
|
SetLocalInt(GetModule(),"RestAllow",1);
|
|
SpeakString("Resting Enabled",TALKVOLUME_SHOUT);
|
|
return;
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// //
|
|
// 1> create a custom potion. name it "Potion of the Wolf" - suggested stack size: 1 //
|
|
// 2> for properties choose "Unique Power" make sure tag says "PotionoftheWolf"- sug. retail: 1234 gold min) //
|
|
// 3> cut & paste this entire text to module properties/events/OnActivateItem (replacing all else) //
|
|
// 4> paste werewolfonrest in module properties "OnPlayerRest" //
|
|
// 5> place potion //
|
|
// 6> curse can ONLY be dispelled by dispelpolycurse script which MUST be called from conversation //
|
|
// 6> you're done! //
|
|
// 7> ps: this is Stone of Recall compliant for your convenience. //
|
|
// 8> note that without werewolfonrest script, this effect is temporary.It wears off after a nap //
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
IsRecall(); ///stone of recall stuff
|
|
object oActiveObject = GetItemActivated();
|
|
if (oActiveObject == GetObjectByTag ("PotionoftheWolf")) //// <-did they drink it yet?
|
|
{
|
|
object oTarget = GetItemActivator();
|
|
SetLocalInt(oTarget,"WolfCurse",TRUE);
|
|
SetLocalInt(oTarget,"Cursetype",POLYMORPH_TYPE_WEREWOLF);
|
|
effect ePolymorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
|
|
|
effect eRandomVisual = EffectVisualEffect(20);//random visual
|
|
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eRandomVisual, oTarget,3.2);
|
|
|
|
DelayCommand(0.5,ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePolymorph, oTarget)); ///apply polymorph here
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_INTELLIGENCE,10),oTarget);
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectAbilityDecrease(ABILITY_WISDOM,10),oTarget);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|