34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
// vamp_act_stun
|
|
// modified 06/16/2004 Jremy Greene
|
|
#include "vampire_header"
|
|
void main()
|
|
{
|
|
object oPC=GetPCSpeaker();
|
|
if (!GetIsObjectValid(oPC)) oPC=OBJECT_SELF;
|
|
object oT=GetLocalObject(oPC,"oTarget");
|
|
int nXP=GetLocalInt(oPC,"nVampireXP");
|
|
int nLevel=1+(nXP/5000);
|
|
int nStun;
|
|
int nCounter;
|
|
effect eDazed=EffectVisualEffect(VFX_IMP_DAZED_S);
|
|
effect eStun=EffectStunned();
|
|
effect eDmg=EffectDamage(0);
|
|
if (nLevel>5) nLevel=5;
|
|
nStun=d20()+(nLevel*2);
|
|
nCounter=d20()+GetWillSavingThrow(oT);
|
|
if (GetCurrentHitPoints(oT)<(GetMaxHitPoints(oT)/2)) nStun=nStun+2;
|
|
SendMessageToPC(oPC,"You rolled a "+IntToString(nStun)+" against a DC of "+IntToString(nCounter)+".");
|
|
AssignCommand(oPC,ClearAllActions());
|
|
AssignCommand(oPC,ActionMoveToObject(oT,TRUE,1.0));
|
|
//AssignCommand(oPC,ActionAttack(oT,TRUE));
|
|
AssignCommand(oPC,ActionDoCommand(SetIsTemporaryEnemy(oPC,oT)));
|
|
if (nStun>=nCounter)
|
|
{ // stun them
|
|
fnGiveVampXP(oPC,5);
|
|
AssignCommand(oPC,ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDazed,oT,12.0)));
|
|
AssignCommand(oPC,ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStun,oT,12.0)));
|
|
} // stun them
|
|
else
|
|
SendMessageToPC(oPC,"You fail to stun "+GetName(oT)+".");
|
|
}
|