Page 1 of 1

Issue: Darkness and faction reputation

Posted: Thu Jun 04, 2015 5:06 pm
by Dander7BD
So a caravan I was escorting walked through a darkness sphere by its OWN volition I previously cast to chase of a bunch of bandits. And thus the caravan got a bit of angry about it. Nordockians have a thing against those who blows out candles and such?
Darkness onEnter script uses the GetIsFriend(caster) check to determine if the spell effect event should be considered hostile or not. Take note that GetIsFriend returns FALSE when OBJECT_SELF considers the caster an enemy OR is simply neutral. I suppose the caravan ox had a neutral relation to me.

Code: Select all

if(GetIsFriend(oTarget))
{
  SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DARKNESS, FALSE));
}
if(!GetIsFriend(oTarget))
{
  SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DARKNESS));
}
What the AI that receives a spell effect event flagged as hostile, does is speak the silent "NW_ATTACK_MY_TARGET" with the caster as target. And all NPCs that hears that (including itself) will do this following as response:

Code: Select all

AdjustReputation(oIntruder, OBJECT_SELF, -100);
if(GetIsFriend(oShouter))
{
  SetIsTemporaryEnemy(oIntruder);
  ClearActions(CLEAR_NW_I0_GENERIC_834);
  DetermineCombatRound(oIntruder);
}
Back then at that time I figured that the Caravan Ox only reduced it's own personal reputation relation with me. And that it would only be a temporary effect as personal animosity I thought to be usually. I continued the escort to successfully bring it to the town gates without a single strain of hair on it harmed. There I spot the that the city guard is now enemies.

I can't now approach any towns because a single ox walked harmlessly though a darkness sphere at it's own volition. Until a server reset or whatnot. (relogging did not help)

Re: Issue: Darkness and faction reputation

Posted: Thu Jun 04, 2015 5:22 pm
by Dander7BD
I suggest that we take code like this in all none lethal spells/effects (web, shadow web, stinking cloud, darkness, hold etc) that only causes a temporary discomfort:

Code: Select all

if(GetIsFriend(oTarget))
{
  SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DARKNESS, FALSE));
}
if(!GetIsFriend(oTarget))
{
  SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_DARKNESS));
}
And change them all to something like this:

Code: Select all

if( GetIsEnemy(oTarget) )
{
  SignalEvent( oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_*) );
}
else
{
  SignalEvent( oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_*, FALSE) );
}

// there SPELL_* is the spellID of that spell
Motivation: None lethal spells causes discomfort but is harmless until it is followed up by an harmful action. And it is the latter harming action that should be what changes the faction reputations.

Harming spells/effects would be any that causes directly or indirectly ability/health damage. All from fireballs(direct), contagion(direct), dominate(indirect), confusion(indirect) etc

Re: Issue: Darkness and faction reputation

Posted: Thu Jun 04, 2015 5:33 pm
by Dander7BD
Suggestion Appendum:

It would certainly not hurt if nw_i0_generic lines 1216 through 1222:

Code: Select all

AdjustReputation(oIntruder, OBJECT_SELF, -100);
if(GetIsFriend(oShouter))
{
  SetIsTemporaryEnemy(oIntruder);
  ClearActions(CLEAR_NW_I0_GENERIC_834);
  DetermineCombatRound(oIntruder);
}
Was made less harsh similar to something like this:

Code: Select all

AdjustReputation( oIntruder, OBJECT_SELF, -20 );
if( GetIsFriend(oShouter) )
{
  SetIsTemporaryEnemy( oIntruder, OBJECT_SELF, TRUE, TurnsToSeconds(24) );
  ClearActions( CLEAR_NW_I0_GENERIC_834 );
  DetermineCombatRound( oIntruder );
}

Re: Issue: Darkness and faction reputation

Posted: Sun Jun 07, 2015 2:01 am
by Beard
that would have global impact, much easier to change the ox.

Re: Issue: Darkness and faction reputation

Posted: Tue Jun 09, 2015 10:08 pm
by Dander7BD
I admit that I was thinking in a macro level. To spare DMs from resetting the module every time anyone accidentally touch a "helping" friendly NPC with an none lethal AOE. Thinking that the caravan ox situation to only be an indicator of the bigger problem.

But it is up to you to decide. ;)

Re: Issue: Darkness and faction reputation

Posted: Tue Jun 09, 2015 10:59 pm
by Beard
global changes like that tend to bork more than they fix is all.