2025/10/21 Update

Added PEPS AI.
Hopefully stopped "bleed" bug after being healed from dying.
Full compile.
This commit is contained in:
Jaysyn904
2025-10-21 10:30:05 -04:00
parent aa4680cac9
commit cbf0febd8b
2268 changed files with 147050 additions and 907 deletions

View File

@@ -15,6 +15,9 @@
//::Modified by Genisys (Guile)
//::Modified On: 4/23/08 (Updated 8/10/08)
//////////////////////////////////////////////////
//::Modified by Jaysyn (Guile)
//::Modified On: 2025-10-21 08:50:59
//////////////////////////////////////////////////
//Required Include
#include "nw_i0_tool"
@@ -49,46 +52,101 @@ ExecuteScript("prc_ondying", OBJECT_SELF);
//Main Script End
}
//PROTOTYPE DEFINED
void bleed(int iBleedAmt)
{
object oPC = GetLastPlayerDying();
if (!GetIsPC(oPC))
return;
object oPC = GetLastPlayerDying();
if (!GetIsPC(oPC)){
return;
string ddVarName = "dd" + GetName(oPC);
object oModule = GetModule();
int nHP = GetCurrentHitPoints(oPC);
if (nHP > 0) // stop bleeding if above 0 HP
{
DeleteLocalInt(oModule, ddVarName);
return;
}
if (nHP <= -10)
{
SetLocalInt(oModule, ddVarName, 1);
PlayVoiceChat(VOICE_CHAT_DEATH);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oPC);
return;
}
// still bleeding
effect eBleedEff;
if (iBleedAmt > 0)
eBleedEff = EffectDamage(iBleedAmt);
else
eBleedEff = EffectHeal(-iBleedAmt);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, oPC);
// chance to stabilize
if (iBleedAmt > 0 && d10(1) == 1)
{
iBleedAmt = -iBleedAmt;
PlayVoiceChat(VOICE_CHAT_LAUGH);
}
else if (iBleedAmt > 0)
{
switch (d6())
{
case 1: PlayVoiceChat(VOICE_CHAT_PAIN1); break;
case 2: PlayVoiceChat(VOICE_CHAT_PAIN2); break;
case 3: PlayVoiceChat(VOICE_CHAT_PAIN3); break;
case 4: PlayVoiceChat(VOICE_CHAT_HEALME); break;
case 5: PlayVoiceChat(VOICE_CHAT_NEARDEATH); break;
case 6: PlayVoiceChat(VOICE_CHAT_HELP); break;
}
}
DelayCommand(6.0, bleed(iBleedAmt));
}
string ddVarName = "dd"+GetName(oPC);
object oModule = GetModule();
//PROTOTYPE DEFINED
/* void bleed(int iBleedAmt)
{
object oPC = GetLastPlayerDying();
if (!GetIsPC(oPC)){return;}
string ddVarName = "dd"+GetName(oPC);
object oModule = GetModule();
effect eBleedEff;
/* keep executing recursively until character is dead or at +1 hit points */
// keep executing recursively until character is dead or at +1 hit points
if (GetCurrentHitPoints() <= 0) {
/* a positive bleeding amount means damage, otherwise heal the character */
// a positive bleeding amount means damage, otherwise heal the character
if (iBleedAmt > 0) {
eBleedEff = EffectDamage(iBleedAmt);
} else {
eBleedEff = EffectHeal(-iBleedAmt); /* note the negative sign */
eBleedEff = EffectHeal(-iBleedAmt); // note the negative sign
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eBleedEff, OBJECT_SELF);
/* -10 hit points is the death threshold, at or beyond it the character dies */
// -10 hit points is the death threshold, at or beyond it the character dies
if (GetCurrentHitPoints() <= -10) {
SetLocalInt (oModule, ddVarName, 1);
PlayVoiceChat(VOICE_CHAT_DEATH); /* scream one last time */
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), OBJECT_SELF); /* make death dramatic */
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF); /* now kill them */
PlayVoiceChat(VOICE_CHAT_DEATH); // scream one last time
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), OBJECT_SELF); // make death dramatic
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF); // now kill them
return;
}
if (iBleedAmt > 0) { /* only check if character has not stablized */
if (iBleedAmt > 0) { // only check if character has not stablized
if (d10(1) == 1) {
/* 10% chance to stablize */
iBleedAmt = -iBleedAmt; /* reverse the bleeding process */
// 10% chance to stablize
iBleedAmt = -iBleedAmt; // reverse the bleeding process
PlayVoiceChat(VOICE_CHAT_LAUGH);
/* laugh at death -- this time */
// laugh at death -- this time
} else {
switch (d6()) {
case 1: PlayVoiceChat(VOICE_CHAT_PAIN1); break;
@@ -100,6 +158,7 @@ return;
}
}
}
DelayCommand(6.0,bleed(iBleedAmt)); /* do this again next round */
DelayCommand(6.0,bleed(iBleedAmt)); // do this again next round
}
}
*/