Initial upload
Initial upload
This commit is contained in:
60
_module/nss/ac_guilesdmblade.nss
Normal file
60
_module/nss/ac_guilesdmblade.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
//This is the default header for most items converted to the new
|
||||
//tagbased system.
|
||||
//Remember to create 2 scripts, one using the template, and name this
|
||||
//script ac_"tagnameofitemgoeshere" (without the "")
|
||||
#include "nw_i0_spells"
|
||||
#include "x2_inc_switches"
|
||||
void main()
|
||||
{
|
||||
// Check if we have the correct event firing the script
|
||||
if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
|
||||
|
||||
//Define Variables
|
||||
|
||||
//On-Hit Flaming Hide Script
|
||||
|
||||
|
||||
|
||||
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();
|
||||
int nLevel = GetCasterLevel(OBJECT_SELF);
|
||||
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (GetIsObjectValid(oSpellTarget))
|
||||
{
|
||||
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oSpellTarget);
|
||||
if (!GetIsObjectValid(oWeapon))
|
||||
{
|
||||
oWeapon = GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oSpellTarget);
|
||||
}
|
||||
if (!GetWeaponRanged(oWeapon) || !GetIsObjectValid(oWeapon))
|
||||
{
|
||||
SignalEvent(oSpellTarget,EventSpellCastAt(OBJECT_SELF,GetSpellId()));
|
||||
int nDamage = d10(10)+ nLevel;
|
||||
effect eDamage = EffectDamage(nDamage,DAMAGE_TYPE_FIRE);
|
||||
effect eVis;
|
||||
if (nDamage<15)
|
||||
{
|
||||
eVis =EffectVisualEffect(VFX_IMP_FLAME_S);
|
||||
}
|
||||
else
|
||||
{
|
||||
eVis =EffectVisualEffect(VFX_IMP_FLAME_M);
|
||||
}
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oSpellTarget);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oSpellTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Error: Spell was not cast by an item
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user