Is there a way to do damage to a PC who walks into an area that is not part of the normal damage like piercing, bludgeoning, slashing, elemental damages, etc…
If they are protected from most damages…is there a way to damage them?
i.e. I have a desert and when they enter the desert they take heat damage (fire). But if they have 100% damage resistance to fire…how else can I simulate “heat, being tired from thirst, etc” as one who would walk a long distances in a desert?
I can’t incorporate the hunger/thirst systems into my module…too complicated for me to script in…I don’t have that skill…just something I can damage them with to make them say in the area they enter: “You get more thirsty and tired as you trudge forward” say every turn and take 2 points of damage that gets worse over time… a damage of sorts to represent this that is not fire damage.
In NWN2 (and I would guess NWN:EE too?) there are quite many types of damages:
Bludgeoning
Cold
Acid
Divine
Electrical
Fire
Magical
Negative
Piercing
Positive
Slashing
Sonic
Can’t you use any of them you mean? What about Magical or Divine? Or do you think the player would be immune to that?
EDIT: There’s a function called EffectDamage (at least in NWN2) that can ignore resistances. Maybe that’s what you should use.
EDIT2: In the NWN Lexicon it says about EffectDamage: “With the patch/HotU release, 1.59, you can add all damage types (even magical, stupidly) to items as properties. Big note: This is for NPC’s only, and PC’s should never be able to resist divine or magical damage!”
Yeah…I need to have damage done outside of those normal damages listed. I thought there might be a hidden damage not included in the normal damages. I don’t know much about “monster damage” but it seems like there is no protection against it.
I will use your sample script above for starters to do “a” damage of sorts I need to determine.
Yes, there is. I’m trying to look into how to increase the damage over time. I had some similar script in my soon to be released module. Gotta look how it was done there.
EDIT:Gotta go away for an hour, but I’ll continue to work on the script then. It’s almost finished, I think.
If for some reason the PC does have divine or magical damage resistances (shouldn’t really…) then you can use SetCurrentHitPoints and just provide a feedback string along the lines of damage happening.
You will lose some reaction animations that’s all. And if you want to kill them you’ll need to use EffectDeath if you want them to go under 1HP.
I don’t know if this script would work, but you could maybe try it? Place it on the OnHeartbeat slot of the area.
void main()
{
object oPC = GetFirstPC();
object oArea = GetArea(oPC);
int nDamage = GetLocalInt(oArea, "damage");
nDamage = nDamage + 2;
SetLocalInt(oArea, "damage", nDamage);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamage, DAMAGE_TYPE_DIVINE), oPC);
if(!GetLocalInt(OBJECT_SELF,"FirstTime"))
{
SetLocalInt(OBJECT_SELF,"FirstTime",1);
string sThirsty = "Whew…it’s so hot and I’m thirsty and tired.";
AssignCommand(oPC, ActionSpeakString(sThirsty));
}
}
The SetCurrentHitPoints approach would require that you know how many hitpoints the PC have at this particular instant, which is why I wouldn’t use that.
EDIT: Ok, maybe one could use GetCurrentHitPoints first and then use SetCurrentHitPoints. We don’t have the SetCurrentHitPoints in NWN2 though so I can’t check and compile it there.
EDIT2: Ok, maybe not. The Lexicon says this: “It also does nothing to temporary hit points effects - thusly GetCurrentHitPoints may return an odd value after using this. If you know there are no temporary hit point effects available you can safely use this with GetCurrentHitPoints.”
EDIT3: We should probably incorporate something in my script that ends the heartbeat script I guess…but that’s for you to decide.
Maybe one could use a script like this too? Untested. Requires NWN:EE. Tried to compile it with the NWN1 toolset but it doesn’t contain the SetCurrentHitPoints function:
void main()
{
object oPC = GetFirstPC();
if(!GetLocalInt(OBJECT_SELF,"FirstTime"))
{
SetLocalInt(OBJECT_SELF,"FirstTime",1);
string sThirsty = "Whew…it’s so hot and I’m thirsty and tired.";
AssignCommand(oPC, ActionSpeakString(sThirsty));
int i = GetMaxHitPoints(oPC);
int iDamage = SetCurrentHitPoints(oPC,i-2);
}
else
{
int i = GetCurrentHitPoints(oPC);
int iDamage = SetCurrentHitPoints(oPC,i-2);
}
}
The way I accomplish this in my desert areas is by taxing the PC’s constitution rather than traditional damage. The higher the Constitution, the further you can travel. There’s feedback, obviously, letting the PC know they are thirsty and hot and such, ad if the Constitution reaches 3, then we all know what happens.
Of course, to remove the effects one simply needs to drink from their canteen (2 swigs at most) which may be filled at hidden oasises (oasi?), or from an oasis directly.
Anyway, just another way to go about it. It doesn’t always have to be damage.
As rules say it should do non lethal damage. But as there is no NLD in nwn, I would run a script from the module onEnter script that do the following
Check if área has variable (isDesert)
If isDesert and isDay make fortitude save
If save fails take 1 CON damage (only if CON > 3)
Delay for 1 game hour (not real hour) and run again.
I would pack this function and others that must run once a game hour in only one pseudo heartbeat (hourly based)