Initial Commit
Initial Commit
This commit is contained in:
20
_module/nss/x4_weapfury.nss
Normal file
20
_module/nss/x4_weapfury.nss
Normal file
@@ -0,0 +1,20 @@
|
||||
#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));
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user