Updated to PRC8. Further function integration. Fixed NPC onDeath script. Full compile. Updated release archive.
63 lines
2.1 KiB
Plaintext
63 lines
2.1 KiB
Plaintext
//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"
|
|
#include "prc_inc_spells"
|
|
|
|
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 = PRCGetSpellTargetObject();
|
|
oItem = PRCGetSpellCastItem();
|
|
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,PRCGetSpellId()));
|
|
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
|
|
}
|
|
}
|