Aller au contenu

Photo

Recommend bleed script?


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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.

#3
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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! ;)
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");

#4
ffbj

ffbj
  • Members
  • 593 messages
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 .


#5
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
Where would I put yuor lines ffbj ...and what exactly will it do ?

#6
TSMDude

TSMDude
  • Members
  • 865 messages
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.

#7
ffbj

ffbj
  • Members
  • 593 messages
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.

#8
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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 .


#9
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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.  

#10
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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.

#11
Baragg

Baragg
  • Members
  • 271 messages
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?

#12
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
How about if they only have +1 regen cancel bleed at -8 ?

#13
ffbj

ffbj
  • Members
  • 593 messages
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 .


#14
TSMDude

TSMDude
  • Members
  • 865 messages

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.

#15
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
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! ;)
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 .


#16
ffbj

ffbj
  • Members
  • 593 messages
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! ;)
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 .