DMH-Online

Dungeon Masters Helper · Est. 2005

PCs Scripts

NWN Script: bleeding_003.htm

Author Sticky: Post Working Scripts Here
EtherDragon Posted: Thursday, 27 June 07:21PM
Hey all, here's my On-Dying work. It's much closer to D&D3e rules.

1. On_Dying

2. Players who are between 0 and -10 hitpoints will lose one hit point per round. Once at -10 they will die.

4.

NWScript:
/*
    On Dying script created by EtherDragon, Jun 27, 2002.
    Send comments to my Bioware Message Board account.
    This script creates an more authentic D&D3e dying
    sequence. The character will begin to bleed at 0 HPs.
    When they reach -10 HPs they will die.
    NPCs and Monsters will stop attacking the character
    once they are unconcious.
*/

void main()
{
    //Initialize objects, variables and effects.
    object oPlayerDying = GetLastPlayerDying();
    object oAttacker = GetLastAttacker(oPlayerDying);
    int iHPs = GetCurrentHitPoints(oPlayerDying);
    effect eHPLoss = EffectHitPointChangeWhenDying(-1.0);
    effect eSanctuary = EffectSanctuary(99);
    effect eGive1HP = EffectHeal(abs(iHPs)+1);
    effect eDeath = EffectDeath(FALSE, FALSE);
    //Main condition, If the Player is between 0 and -9 HPs make them bleed.
    //...otherwise make them die.
    if (iHPs >= -9)
    {
        //Inform the people around that the player is dying.
        AssignCommand(oPlayerDying, SpeakString("Help! I'm Dying!", TALKVOLUME_TALK));
        FloatingTextStringOnCreature("You are bleeding to death!", oPlayerDying);
        //Stop the NPC from attacking the player
        SetPCLike(oPlayerDying, oAttacker);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSanctuary, oPlayerDying, 10.0);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHPLoss, oPlayerDying, 10.0);
    }
    else
    {
        //Make the Player die if at -10 or below.
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPlayerDying);
    }
}



~ED

⌂ All Scripts ← PreviousNext → 👁 Category List

All PCs Scripts

📄 adjust_faction 📄 alt_idle_pc_anim 📄 bleeding 📄 bleeding_002 📄 bleeding_003 📄 bleeding_004 📄 creature_item 📄 drop_items 📄 force_zone 📄 give_pc_item 📄 inspect_inv 📄 limited_druid 📄 move_items_to_container 📄 notify_of_loot 📄 pc_respawn 📄 pc_respawn_002 📄 pc_respawn_003 📄 pc_respawn_004 📄 pc_respawn_005 📄 pc_respawn_006 📄 pc_respawn_007 📄 remove_neg 📄 save_spots 📄 strip_inv_give_gold 📄 strip_inv_plot 📄 subraces 📄 subraces_002 📄 voting