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

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« on: November 13, 2010, 08:58:03 pm »


               I have tried a couple diff bleed script.  I have right now the one from the wiki that just goes to -10 with no chance of recovery.Not in haertbeat event .

Pro's 
Not in heartbeat event

Con's
no chance to recover
if waering =1 regen you get stuck

I  think I would like the chance to recover but if it goes in heartbeat I think I just keep what I have and ask someone to help me deal with the +1 regen problem.

Any recommendations or links appreciated.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Recommend bleed script?
« Reply #1 on: November 13, 2010, 09:04:33 pm »


               If you could either post your current script or give a link to it in the wiki It would help people give you a faster responce.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #2 on: November 13, 2010, 09:14:43 pm »


               I thought you could read minds Lightfoot8:)


Ok here is the ( ondying ) script


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




Then added this line to my (respawn ) event


DeleteLocalInt (oRespawner, "BLEEDING");
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Recommend bleed script?
« Reply #3 on: November 13, 2010, 09:38:22 pm »


               You could just add in:

if (GetCurrentHitPoints(oPC)==0)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(1),oPC);
}


Also I would put the deletion of the Bleeding int ondeath not onrespawn.
               
               

               


                     Modifié par ffbj, 13 novembre 2010 - 11:08 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #4 on: November 13, 2010, 10:14:53 pm »


               Where would I put yuor lines ffbj ...and what exactly will it do ?
               
               

               
            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Recommend bleed script?
« Reply #5 on: November 13, 2010, 11:01:14 pm »


               Tom Banjo has one on the Vault that you would dig I would bet quite a bit. It works very well and one I dig alot.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Recommend bleed script?
« Reply #6 on: November 13, 2010, 11:10:46 pm »


               Just add it in at the top of the script.  What it does is check if the PC's current hitpoints are equal to zero 0.  If so give them a hp.  I thought that is one thing you were concerned about a person with regeneration stopping at zero.  Those lines fix that.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #7 on: November 13, 2010, 11:14:50 pm »


               TSMDude I had seen his name before but when I looked for his script I could not find the link.. must be secret pages on the vault or something lol
               
               

               


                     Modifié par Knight_Shield, 13 novembre 2010 - 11:26 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Recommend bleed script?
« Reply #8 on: November 13, 2010, 11:32:25 pm »


               

ffbj wrote...

Just add it in at the top of the script. What it does is check if the PC's current hitpoints are equal to zero 0. If so give them a hp. I thought that is one thing you were concerned about a person with regeneration stopping at zero. Those lines fix that.


The problem with the current script is if the PC has a regeneration of One  counter acting the bleeding of 1 causing the PC to stay at a constant HP anywhere in the 0 to -10 range.  
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #9 on: November 13, 2010, 11:37:07 pm »


               Yes thats exactly it ..the player  gets stuck...
 
I did put the delete int in the ondeath instead of respawn ...

I also just searched vault and googled Tom_Banjo and still no luck finding his script.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Recommend bleed script?
« Reply #10 on: November 14, 2010, 02:04:47 am »


               How about run a check to see if the pc has any regen effect, if so just abort the bleed since they should technically regen back to living?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #11 on: November 14, 2010, 03:28:48 am »


               How about if they only have +1 regen cancel bleed at -8  ?
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Recommend bleed script?
« Reply #12 on: November 14, 2010, 04:08:35 am »


               Yeah I have % chance based on con that you get 1-5 hp's back, everytime the script runs and hits a 1d6, so no one gets stuck like that. You either die or eventually recover. In mine you can bleed for a while get some back and then bleed again, but that does not really solve your problem. 
               
               

               


                     Modifié par ffbj, 14 novembre 2010 - 04:17 .
                     
                  


            

Legacy_TSMDude

  • Hero Member
  • *****
  • Posts: 1515
  • Karma: +0/-0
Recommend bleed script?
« Reply #13 on: November 14, 2010, 02:57:54 pm »


               

Knight_Shield wrote...




TSMDude I had seen his name before but when I looked for his script I could not find the link.. must be secret pages on the vault or something lol


Actually it was revised script. We further adapted it for our use too but here is the orginal link. If you wish I can send you our adapted one but we use it because we have a different death system.



Bleeding / Dying w/o heartbeat

1. hostle creatures will now ignore you while you are lying unconcious.
2. if your killer is injured, they will rest while you are dying. (this part is easily disabled.)
3. if your killer is uninjured and a human, goblin, orc, or half-orc, they will steal some of your gold. (of course, you can kill them to take it back. this part is easily disabled.)
4. now you can see the blood while your pc is bleeding to death.
5. if there are hostle creatures around when you become concious (if you do), they may notice you moving and attack.
6. this script has been PW tested and works fine.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Recommend bleed script?
« Reply #14 on: November 14, 2010, 03:01:51 pm »


               How does this look ?  

"ondying"

/*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(GetCurrentHitPoints(oPC)<=-8)
           ExecuteScript("stable",OBJECT_SELF);
 
 
        //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));
    }
    }
}






script  "stable"

void main()
{
  object oDying=GetLastPlayerDying();
    object oPC;
    if (d100()<=5)
    {
        DeleteLocalInt (oDying, "BLEEDING");
        effect eEffect;
eEffect = EffectRegenerate(1, 5.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 45.0f);
}}
void main()
{
  object oDying=GetLastPlayerDying();
    object oPC;
    if (d100()<=5)
    {
        DeleteLocalInt (oDying, "BLEEDING");
        effect eEffect;
eEffect = EffectRegenerate(1, 5.0f);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, 45.0f);
}}
               
               

               


                     Modifié par Knight_Shield, 14 novembre 2010 - 03:04 .