42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
|
// shadfiendclaw
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
object oItem=GetItemActivated();
|
||
|
object oFiend=GetItemActivator();
|
||
|
object oTarget=GetItemActivatedTarget();
|
||
|
string sRes=GetLocalString(oFiend,"sShadow");
|
||
|
int nN;
|
||
|
int nSTR;
|
||
|
int nR=d3();
|
||
|
effect eEffect=EffectAbilityDecrease(ABILITY_STRENGTH,nR);
|
||
|
if (GetStringLength(sRes)<1) sRes="nw_shadow1";
|
||
|
if (GetIsObjectValid(oTarget))
|
||
|
{ // on hit against target
|
||
|
SendMessageToPC(oTarget,"Hit by SHADOW FIEND special claw attack [DC12 Fortitude].");
|
||
|
nSTR=GetAbilityScore(oTarget,ABILITY_STRENGTH,FALSE);
|
||
|
if (FortitudeSave(oTarget,12,SAVING_THROW_TYPE_NEGATIVE,oFiend)==0)
|
||
|
{ // failed saving throw
|
||
|
nN=nSTR-3;
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eEffect,oTarget,HoursToSeconds(24));
|
||
|
if (nN>0)
|
||
|
{ // need to add to counter
|
||
|
nSTR=GetLocalInt(oTarget,"nFiendDrain");
|
||
|
nSTR=nSTR+nN;
|
||
|
SetLocalInt(oTarget,"nFiendDrain",nSTR);
|
||
|
if (nSTR>2)
|
||
|
{ // kill
|
||
|
eEffect=EffectCutsceneGhost();
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eEffect,oTarget,10.0);
|
||
|
oItem=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oTarget));
|
||
|
eEffect=EffectDamage(GetMaxHitPoints(oTarget)+20);
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oTarget);
|
||
|
eEffect=EffectDeath();
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oTarget);
|
||
|
SendMessageToPC(oTarget,"YOUR STRENGTH WAS DRAINED BELOW 1 RESULTING IN DEATH.");
|
||
|
} // kill
|
||
|
} // need to add to counter
|
||
|
} // failed saving throw
|
||
|
} // on hit against target
|
||
|
}
|