Bleeding to death 3rd Edition Rules Script:
ok it works good if you have more than one person bleeding to death there
may be a skip in who loses hitpoints first in the next round..not sure how
it will work with more than one person dying..probably going to modify it
using get first get next pc functions in the future so i handle all pcs in
the same round.
put this in your heartbeat event for your module...
NWScript: void main()
{
object oPC = GetLastPlayerDying ();
string sName = GetName (oPC);
if ( GetIsObjectValid (oPC) == TRUE)
{
if ((GetCurrentHitPoints (oPC) > GetLocalInt ( oPC, "iCurrhp"))
&& (GetLocalInt (oPC, "iDying") == 1))
{
SetLocalInt( oPC, "iDying", 0) ;
string sCurrhp = IntToString ( GetCurrentHitPoints(oPC));
FloatingTextStringOnCreature( sName + " Has Stabilized By Healing at " + sCurrhp + " HPs", oPC, TRUE) ;
if (( GetCurrentHitPoints( oPC) <= 0) && ( GetLocalInt (oPC, "iDying") == 0 ))
{
DelayCommand(2.5, PopUpDeathGUIPanel( oPC, TRUE, TRUE, 0, "You Stabilized By Healing, If You Respawn You Will Lose Some Experience!"));
}
}
if ( GetLocalInt( oPC, "iDying") == 1)
{
int oDieroll = d100 (1) ;
string sDieroll = IntToString ( oDieroll);
FloatingTextStringOnCreature( sName + " Stabilize Roll: " + sDieroll, oPC, TRUE) ;
if (oDieroll > 1 && oDieroll <=10 && GetLocalInt(oPC, "iDying") == 1 )
{
SetLocalInt(oPC, "iDying", 0) ;
string sCurrhp = IntToString( GetCurrentHitPoints( oPC));
FloatingTextStringOnCreature(sName + " Has Stabilized at " + sCurrhp + " HPs", oPC, TRUE) ;
DelayCommand(2.5, PopUpDeathGUIPanel(oPC, TRUE, TRUE, 0, "You Stabilized, If You Respawn You Will Lose Some Experience!"));
}
}
if (GetLocalInt(oPC, "iDying") == 1)
{
effect eDamage = EffectDamage( 1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ApplyEffectToObject ( DURATION_TYPE_INSTANT, eDamage, oPC);
SetLocalInt( oPC, "iCurrhp", GetCurrentHitPoints( oPC));
string sCurrhp = IntToString( GetCurrentHitPoints( oPC));
if ( GetCurrentHitPoints( oPC) > -10)
{
FloatingTextStringOnCreature( sName + " is Bleeding! Hitpoints currently at " + sCurrhp, oPC, TRUE) ;
}
}
}
}
the popup death panel appears when you stabilize (if anyone could kindly
make a pop up gui panel that doesnt say your dead on it i would appreciate
it). if you choose wait for help when your stabilized you will not be able
to respawn later because the panel goes away!!! if anyone can tell me how to
map a hotkey to a user defined event i could fix that problem.
as in d&d rules ive given you a 10% chance of stabilizing on your own each
round. also if someone heals you but you still dont get up(ie 0 to -9
hitpoints) you stabilize also.
Important: make sure to add
NWScript: SetLocalInt( oPC, "iDying", 0) ;
to end of on death script to clear out the iDying flag or you will continue
to lose hit points after you respawn..hehee
|