Files
Anphillia_PRC8/_removed/x2_s3_onhitcast.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

75 lines
2.6 KiB
Plaintext

//::///////////////////////////////////////////////
//:: User Defined OnHitCastSpell code
//:: x2_s3_onhitcast
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
This file can hold your module specific
OnHitCastSpell definitions
How to use:
- Add the Item Property OnHitCastSpell: UniquePower (OnHit)
- Add code to this spellscript (see below)
WARNING!
This item property can be a major performance hog when used
extensively in a multi player module. Especially in higher
levels, with each player having multiple attacks, having numerous
of OnHitCastSpell items in your module this can be a problem.
It is always a good idea to keep any code in this script as
optimized as possible.
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-22
//:://////////////////////////////////////////////
#include "x2_inc_switches"
void main()
{
object oItem; // The item casting triggering this spellscript
object oSpellTarget; // On a weapon: The one being hit. On an armor: The one hitting the armor
object oSpellOrigin; // On a weapon: The one wielding the weapon. On an armor: The one wearing an armor
// fill the variables
oSpellOrigin = OBJECT_SELF;
oSpellTarget = GetSpellTargetObject();
oItem = GetSpellCastItem();
if (GetIsObjectValid(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) == TRUE)
{
SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ONHITCAST);
int nRet = ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);
if (nRet == X2_EXECUTE_SCRIPT_END)
{
return;
}
}
string sItemTag = GetTag(oItem);
if (sItemTag == "ee_sq_webber_wpn")
{
// Paralyze the target for 6 seconds
effect eEffect = EffectCutsceneParalyze();
effect eVFX_1 = EffectVisualEffect(VFX_DUR_STONEHOLD);
effect eVFX_2 = EffectVisualEffect(VFX_DUR_ICESKIN);
effect eLink = EffectLinkEffects(eEffect, eVFX_1);
eLink = EffectLinkEffects(eLink, eVFX_2);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oSpellTarget, 6.0f);
}
}
}