Ancordia_PRC8/_module/nss/x4_weapfury.nss
Jaysyn904 102ba7dab6 Initial Commit
Initial Commit
2023-09-21 19:51:32 -04:00

21 lines
776 B
Plaintext

#include "x4_inc_functions"
void main()
{
object oPC = OBJECT_SELF;
//Don't do anything if the PC is still under the effect of Weapon Fury
if (GetLocalInt(oPC, "wm_weapfury") == 1) return;
int nLevel = GetLevelByClass(CLASS_TYPE_WEAPON_MASTER, oPC);
int nDuration = nLevel / 2; //1 round per 2 caster levels
SetLocalInt(oPC, "wm_weapfury", 1);
ApplyWeaponFury(oPC);
DelayCommand(RoundsToSeconds(nDuration), SetLocalInt(oPC, "wm_weapfury", 0));
//At the end of the fury, deal the PC damage equal to 1/3 of max HP
int nDrawback = GetMaxHitPoints(oPC) / 3;
effect eDrawback = EffectDamage(nDrawback, DAMAGE_TYPE_POSITIVE);
DelayCommand(RoundsToSeconds(nDuration), ApplyEffectToObject(DURATION_TYPE_INSTANT, eDrawback, oPC));
}