FANDOM


This little script I made mimics the way that dying is explained in the D&D Player's Handbook. It states that between -1 and -9, the character is dying. Every round, the PC has a 10% chance of stabilizing. At -10, your charater is dead.

In this script, after you stabilize you also will have a 33% chance of continuing to heal 1 point, up to a total of 1 hit point. When that occurs, the character recovers and can act normally.

This script will also work when the player is at exactly 0 HP. I did this so that a player need not wait and watch the character's unconcious body until friends find the character. This way the PC either slowly bleeds to death, or recovers within about 5 minutes or less. If you want to make recovery faster or slower, feel free to change the numbers around to suit your needs. If you need a major change to this script let me know and I will see what I can do.

The script Edit

You will need two scripts.

OnEnter Edit

 

void main()
{
object oPC = GetEnteringObject();
SetLocalString(oPC, "sBleeding", "True");
}

OnHeartbeat Edit

 
/*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());
           }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.