112 lines
3.1 KiB
Plaintext
112 lines
3.1 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Custom User Defined Event
|
||
|
//:: FileName
|
||
|
//:: Copyright (c) 2001 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By:
|
||
|
//:: Created On:
|
||
|
//:://////////////////////////////////////////////
|
||
|
#include "nw_i0_spells"
|
||
|
|
||
|
void dobuffs()
|
||
|
{
|
||
|
|
||
|
//Declare major variables
|
||
|
int nAmount = 20;
|
||
|
int nDuration = nAmount;
|
||
|
object oTarget = OBJECT_SELF;
|
||
|
int nDamage = nAmount * 10;
|
||
|
|
||
|
//Fire cast spell at event for the specified target
|
||
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_GREATER_STONESKIN, FALSE));
|
||
|
|
||
|
effect eVis2 = EffectVisualEffect(VFX_IMP_POLYMORPH);
|
||
|
effect eStone = EffectDamageReduction(20, DAMAGE_POWER_PLUS_FIVE, nDamage);
|
||
|
effect eVis = EffectVisualEffect(VFX_DUR_PROT_STONESKIN);
|
||
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||
|
|
||
|
//Link the texture replacement and the damage reduction effect
|
||
|
effect eLink = EffectLinkEffects(eVis, eStone);
|
||
|
eLink = EffectLinkEffects(eLink, eDur);
|
||
|
|
||
|
//Remove effects from target if they have Greater Stoneskin cast on them already.
|
||
|
RemoveEffectsFromSpell(oTarget, SPELL_GREATER_STONESKIN);
|
||
|
|
||
|
//Apply the linked effect
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget);
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration));
|
||
|
effect eSpell = EffectSpellLevelAbsorption(4, 0);
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpell, oTarget, HoursToSeconds(nDuration));
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
int nUser = GetUserDefinedEventNumber();
|
||
|
|
||
|
if(nUser == 1001) //HEARTBEAT
|
||
|
{
|
||
|
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1002) // PERCEIVE
|
||
|
{
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1003) // END OF COMBAT
|
||
|
{
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1004) // ON DIALOGUE
|
||
|
{
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1005) // ATTACKED
|
||
|
{
|
||
|
if (GetLocalInt(OBJECT_SELF,"nDone")!=1)
|
||
|
{
|
||
|
dobuffs();
|
||
|
SetLocalInt(OBJECT_SELF,"nDone",1);
|
||
|
}
|
||
|
}
|
||
|
else if(nUser == 1006) // DAMAGED
|
||
|
{
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1007) // DEATH
|
||
|
{
|
||
|
object oPC=GetLastDamager();
|
||
|
vector vPosition=GetPosition(oPC);
|
||
|
SetFacingPoint(vPosition);
|
||
|
effect eArrow = EffectVisualEffect(245);
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eArrow, oPC);
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_ACID_S),OBJECT_SELF);
|
||
|
float fDist = GetDistanceToObject(oPC);
|
||
|
float fDelay = (fDist/25.0);//(3.0 * log(fDist) + 2.0);
|
||
|
//ActionCastFakeSpellAtObject(SPELL_MELFS_ACID_ARROW,oPC,PROJECTILE_PATH_TYPE_HIGH_BALLISTIC);
|
||
|
|
||
|
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBlindness(),oPC,20.0));
|
||
|
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BLIND),oPC,20.0));
|
||
|
|
||
|
|
||
|
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectPoison(POISON_GARGANTUAN_SPIDER_VENOM),oPC,400.0));
|
||
|
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_IMP_POISON_S),oPC,20.0));
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
else if(nUser == 1008) // DISTURBED
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|