#include "prc_inc_spells"

void main()
{
object oPC = GetFirstPC();
object oHench1 = GetHenchman(oPC, 1);
object oHench2 = GetHenchman(oPC, 2);
object oSound = GetNearestObjectByTag("Splashdown");
effect eEffect = EffectAppear(1);

int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (DoOnce==TRUE) return;

int nD1 = d4();
int nD2 = d4();
int nD3 = d4();
int nD4 = d4();
int nD5 = d4();
int nDmg = (nD1 + nD2 + nD3 + nD4 + nD5);
if (GetLevelByClass(CLASS_TYPE_MONK, oPC) > 0) nDmg = d6();

if (GetLevelByClass(CLASS_TYPE_MONK, oPC) >= 4) nDmg = 0;
if (GetLevelByClass(CLASS_TYPE_NINJA, oPC) >= 4) nDmg = 0;
if (GetLevelByClass(CLASS_TYPE_SWIFT_WING, oPC) >= 5) nDmg = 0;
if (GetLevelByClass(CLASS_TYPE_DRAGON_DISCIPLE, oPC) >= 9) nDmg = 0;
if (GetLevelByClass(CLASS_TYPE_DRAGON_SHAMAN, oPC) >= 19) nDmg = 0;
if (GetLevelByClass(CLASS_TYPE_FAVOURED_SOUL, oPC) >= 17) nDmg = 0;

if (MyPRCGetRacialType(oPC) == RACIAL_TYPE_SPIRETOPDRAGON) nDmg = 0;
if (MyPRCGetRacialType(oPC) == RACIAL_TYPE_GLOURA) nDmg = 0;

effect eDamage = EffectDamage(nDmg, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 3.0f);
DelayCommand(2.5, SoundObjectPlay(oSound));
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC));

if (!(oHench1 == OBJECT_INVALID))
 {
 nD1 = d4();
 nD2 = d4();
 nD3 = d4();
 nD4 = d4();
 nD5 = d4();
 nDmg = (nD1 + nD2 + nD3 + nD4 + nD5);
 if (GetLevelByClass(CLASS_TYPE_MONK, oHench1) > 0) nDmg = d6();
 effect eDamage = EffectDamage(nDmg, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
 ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oHench1, 3.0f);
 DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oHench1));
 }

if (!(oHench2 == OBJECT_INVALID))
 {
 nD1 = d4();
 nD2 = d4();
 nD3 = d4();
 nD4 = d4();
 nD5 = d4();
 nDmg = (nD1 + nD2 + nD3 + nD4 + nD5);
 if (GetLevelByClass(CLASS_TYPE_MONK, oHench2) > 0) nDmg = d6();
 effect eDamage = EffectDamage(nDmg, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
 ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oHench2, 3.0f);
 DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oHench2));
 }
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
}
