Initial Upload
Initial Upload
This commit is contained in:
51
_module/nss/deathonheartbeat.nss
Normal file
51
_module/nss/deathonheartbeat.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
/*Created by Fadedshadow 8/28/02. Feel free to modify,pirate,or whatever to suit your needs. */
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastPlayerDying();
|
||||
int nHitPoints = GetCurrentHitPoints(oPC);
|
||||
effect eHeal = EffectHeal(1);
|
||||
effect eDamage = EffectDamage(1,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_PLUS_FIVE);
|
||||
string sDying = "Help ! I'm dying !";
|
||||
string sStable = "I've stablized.";
|
||||
string sRecover = "I have recovered.";
|
||||
/* You can make this 0 so the pc will stay unconcious until healed by someone else. */
|
||||
if (nHitPoints < 1)
|
||||
{
|
||||
if (nHitPoints > -10)
|
||||
{
|
||||
int nRoll = (Random(100));
|
||||
if (GetLocalString(oPC,"sBleeding") == "True" && nRoll <=10)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC);
|
||||
AssignCommand(oPC,SpeakString(sStable));
|
||||
SetLocalString(oPC, "sBleeding","False");
|
||||
if (GetCurrentHitPoints(oPC) >= 1)
|
||||
{
|
||||
SetLocalString(oPC, "sBleeding","True");
|
||||
}
|
||||
}
|
||||
if (GetLocalString(oPC,"sBleeding") == "True" && nRoll > 10)
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);
|
||||
AssignCommand(oPC,SpeakString(sDying));
|
||||
}
|
||||
if (nRoll <=33 && GetLocalString(oPC,"sBleeding") =="False")
|
||||
{
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oPC);
|
||||
}
|
||||
if (GetCurrentHitPoints(oPC) >= 1)
|
||||
{
|
||||
SetLocalString(oPC, "sBleeding","True");
|
||||
AssignCommand(oPC,SpeakString(sRecover));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(GetCurrentHitPoints(oPC) <= -10)
|
||||
{
|
||||
effect eDeath = EffectDeath(FALSE, FALSE);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user