PWE_PRC8/_module/nss/ls_kehaarattack.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

23 lines
664 B
Plaintext

//Script written by Lilac Soul, aka Carsten Hjorthoj
//To go OnPhysicalAttacked of placeable. If someone attacks
//it, they will suffer d20+d20 damage. It then makes the
//attacker stop attacking.
void main()
{
object oPC=GetLastAttacker();
if (!GetIsPC(oPC) && GetMaster(oPC)==OBJECT_INVALID) return;
int nDamage=d20()+d20();
ClearAllActions();
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SONIC), OBJECT_SELF));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_ENERGY), oPC));
DelayCommand(0.5, AssignCommand(oPC, ClearAllActions(TRUE)));
}