logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
vir_oncdamage ?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Mar 21, 2016 17:10    Post subject: vir_oncdamage ? Reply with quote

I was just going through my fork of nwnx2 for linux, and I found in the fixes plugin a reference to a RunScript("vir_oncdamage");

I was wondering if anyone has this script, or knows what it does?
I don't think it was included in the git upload?

Code:

int CNWSCreature__DoDamage_hook(CNWSCreature *a1, unsigned int a2)
{
    fixes.Log(3, "DoDamage: %08lX, %d, Current: %d\n", a1->Object.ObjectID, a2, a1->Object.HitPoints);
    if (a1->IsPC && a1->Object.HitPoints > 0 && (int)a2 > a1->Object.HitPoints + 5) {
        a2 = a1->Object.HitPoints + 5;
        int ret = CNWSCreature__DoDamage(a1, a2);
        fixes.Log(3, "Running script...\n");
        RunScript("vir_oncdamage", a1->Object.ObjectID);
        return ret;
    }
    return CNWSCreature__DoDamage(a1, a2);
}



In https://github.com/NWNX/nwnx2-linux/blob/master/plugins/fixes/FixesHooks.cpp
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1018
Location: Russia

PostPosted: Thu Mar 24, 2016 15:26    Post subject: Reply with quote

It was really a PW-specific tweak that prevents players from dying instantly, instead setting their HP to -5 to let other players revive them, or for them to have a chance to recover. Without this, low-level players used to die far too often on our PW.
The script contained a command to nearby creatures to stop attacking this PC.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group