Author Topic: Recommend bleed script?  (Read 628 times)

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Recommend bleed script?
« Reply #15 on: November 14, 2010, 05:12:15 pm »


               Well you still have a problem, like lightfoot said, he will just stabilize not necessarily at -8. That is the guy with the regen +1. So he could have -4, -5, etc... and just stay there. Better to just have a random chance the stable script fires than to base it on hp's everyrd, or everytime the script runs give it a 25% chance to fire. Also you have the stable script listed twice and a very small chance it runs, 1 in 20. if (d100()
Just make that 5 a 25 and put it in the main script body, so you have a trap door to get out of the +1regen trap.
Something like:



/*OK, this is complicated. This script started off with (my) WormHearts modification of
FadedShadows dying script. I added more gore (lots of gore) and removed the possibility
of natural recovery. It worked in singleplayer but not in multi-player.
Then Alen Elford stepped forward to help, but it was Silent Agent that finally made this work in multiplay.
You do need to inset the following line of script in your module respawn script, though:
DeleteLocalInt (oRespawner, "BLEEDING");
Otherwise, it only fires once! So, in order of appearence :
FadedShadow, WormHeart, Alen Elford & Silent Agent. And Yes, you too can modify this! '<img'>
09/12/2002 WormHeart
*/
void main()
{
    object oDying=GetLastPlayerDying();
    object oPC;
    if(!GetLocalInt(oDying,"BLEEDING"))
    {
        oPC=oDying;
        SetLocalInt(oPC,"BLEEDING",1);
        }
    else
    {
        oPC=GetLocalObject(OBJECT_SELF,"DYING_PC");
        DeleteLocalObject(oPC,"DYING_PC");
        }
    //If you're squirmish you might want to leave out the effects. They are quite graphic.
    int nHitPoints=GetCurrentHitPoints(oPC);
    effect eDamage=EffectDamage(1,DAMAGE_TYPE_MAGICAL,DAMAGE_POWER_PLUS_FIVE);
    effect eFirst=EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
    effect eTwo=EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM);
    if(nHitPoints-10&&GetLocalInt(oPC,"BLEEDING"))
    {
        ApplyEffectToObject(DURATION_TYPE_INSTANT,eDamage,oPC);
        //Now to check if the PC have reached -10, if s/he haves, then death!
        if (d20 () < 10 +GetAbilityModifier(ABILITY_CONSTITUTION,oPC))
           {
           effect eRecover = EffectHitPointChangeWhenDying(2.0);
           ApplyEffectToObject(DURATION_TYPE_INSTANT,eRecover,oPC);
           }
        //Now to check if the PC have reached -10, if s/he haves, then death!
        if(GetCurrentHitPoints(oPC)<=-10)
                 {
        AssignCommand(oPC,SpeakString("Goodbye, cruel world!"));
        ApplyEffectToObject(DURATION_TYPE_INSTANT,eTwo,oPC);
        effect eDeath=EffectDeath(FALSE, FALSE);
        ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oPC);
                }
                else
                {
        //If not, then play a animation of spurting gore and have the dying
        //PC mutter some stuff!
        ApplyEffectToObject(DURATION_TYPE_INSTANT,eFirst,oPC);
        switch (d8())
        {
        case 1:AssignCommand(oPC,SpeakString("Urgh..."));break;
        case 2:AssignCommand(oPC,SpeakString("*squirt, squirt*"));break;
        case 3:AssignCommand(oPC,SpeakString("I'm bleeding here!"));break;
        case 4:AssignCommand(oPC,SpeakString("It's in the BONE!"));break;
        case 5:AssignCommand(oPC,SpeakString("*squirt*"));break;
        case 6:AssignCommand(oPC,SpeakString("My life is fading..."));break;
        case 7:AssignCommand(oPC,SpeakString("*squirt*"));break;
        case 8:AssignCommand(oPC,SpeakString("Ralle..."));break;
        }
    //Finally to just loop the script, so it runs again!
    SetLocalObject(oPC,"DYING_PC",oPC);
    DelayCommand(6.0,ExecuteScript("module_dying",oPC));
    }
    }
}
 
 
 

 
               
               

               


                     Modifié par ffbj, 14 novembre 2010 - 05:41 .