HoS_PRC8/_mod/_module/nss/cai_lanternarcho.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

42 lines
1.8 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// cai_lanternarcho = rays 2 rays 1d6 +2 touch ranged attack
// By Deva Bryson Winblood. 03/06/2005
////////////////////////////////////////////////////////////////////////////////
#include "nw_i0_generic"
void main()
{
object oMe=OBJECT_SELF;
object oEnemy1=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oMe,1,CREATURE_TYPE_PERCEPTION,PERCEPTION_SEEN,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY);
object oEnemy2=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oMe,2,CREATURE_TYPE_PERCEPTION,PERCEPTION_SEEN,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY);
object oTarget;
effect eVFXHIT=EffectBeam(VFX_BEAM_HOLY,oMe,BODY_NODE_HAND,FALSE);
effect eVFXMISS=EffectBeam(VFX_BEAM_HOLY,oMe,BODY_NODE_HAND,TRUE);
effect eDmg;
int nN;
if (GetDistanceBetween(oEnemy1,oMe)<=30.0)
{ // in range
nN=TouchAttackRanged(oEnemy1);
if (nN==0) ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFXMISS,oEnemy1,2.0);
else
{ // hit
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFXMISS,oEnemy1,2.0);
eDmg=EffectDamage(d6(),DAMAGE_TYPE_FIRE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oEnemy1,1.0);
} // hit
oTarget=oEnemy1;
if (GetIsDead(oTarget)) oTarget=oEnemy2;
if (GetDistanceBetween(oMe,oTarget)<=30.0)
{ // in range
nN=TouchAttackRanged(oTarget);
if (nN==0) DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFXMISS,oTarget,2.0));
else
{ // hit
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFXHIT,oTarget,2.0));
eDmg=EffectDamage(d6(),DAMAGE_TYPE_FIRE);
DelayCommand(3.01,ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oTarget,1.0));
} // hit
} // in range
} // in range
}