Recommend bleed script?
#1
Posté 13 novembre 2010 - 08:58
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
Posté 13 novembre 2010 - 09:04
#3
Posté 13 novembre 2010 - 09:14
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
Posté 13 novembre 2010 - 09:38
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
Posté 13 novembre 2010 - 10:14
#6
Posté 13 novembre 2010 - 11:01
#7
Posté 13 novembre 2010 - 11:10
#8
Posté 13 novembre 2010 - 11:14
Modifié par Knight_Shield, 13 novembre 2010 - 11:26 .
#9
Posté 13 novembre 2010 - 11:32
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
Posté 13 novembre 2010 - 11:37
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
Posté 14 novembre 2010 - 02:04
#12
Posté 14 novembre 2010 - 03:28
#13
Posté 14 novembre 2010 - 04:08
Modifié par ffbj, 14 novembre 2010 - 04:17 .
#14
Posté 14 novembre 2010 - 02:57
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
Posté 14 novembre 2010 - 03:01
"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
Posté 14 novembre 2010 - 05:12
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 .





Retour en haut







