- Governor Ship Hunting quests to DO lose you points with the target nation, but ONLY the target nation.
If the target is friendly/neutral, they would turn immediately hostile. If you had a LoM with the target, you will "leave bad".
Simplest solution is to just call the 'AttackRMRelation' function like this:
Code:
// PB: Add relation points -->
float points = stf(GetAttribute(CharacterFromID("Quest pirate"), "Points"));
if (points < 1.0) points = 1.0;
if (!IsInServiceOf(iNation)) // Prevent becoming MORE than Friendly if you're not yet in the service
{
float rel = GetRMRelation(pchar, iNation);
if (makeint(rel) <= REL_NEUTRAL && rel + points >= REL_NEUTRAL) points = -rel;
}
ChangeRMRelation(pchar, iNation, points);
AttackRMRelation(pchar, sti(pchar.quest.generate_kill_quest.nation) );
// PB: Add relation points <--
So that triggers the following code:
Code:
//run this whenever friendly or neutral thing of iNation is /attacked/ by char.
float AttackRMRelation(ref char, int iNation)
{
bool bad = false;
float rel = GetRMRelation(char, iNation);
if(rel > REL_NEUTRAL) // Relation is Friendly or better
{
bad = true; // Leave service on BAD terms
ChangeCharacterReputation(char, REPCH_FRIENDLY); // Lose 30(!) reputation points
SetRMRelation(char, iNation, REL_AFTERATTACK); // You immediately become WARY with this nation
}
else
{
if(rel > REL_AFTERATTACK) // Relation is above Wary
{
ChangeCharacterReputation(char, REPCH_NEUTRAL); // Lose another 1 reputation point
SetRMRelation(char, iNation, REL_AFTERATTACK); // You immediately become WARY with this nation
}
else
{
if(GetRMRelation(char, iNation) > REL_WAR) SetRMRelation(char, iNation, REL_WAR); // You immediate become HOSTILE with this nation!
}
}
LeaveService(char, iNation, bad); // Leave service with this nation
return GetRMRelation(char, iNation); // NK 04-09-20 func must return something, it's a float. Oops!
}
Which means that you won't ever get
lower than hostile this way.
But at least you WILL become hostile
eventually, rather than being able to remain friendly with the nation whose ship you just attacked.
I'm not 100% happy with the Nation Relation code just yet as there is still some confusing stuff cluttering things up.
For example, WHY would we need this 'AttackNation' function in the first place?
And why are we
setting relations in some cases like this, but giving relation
changes in other cases, such as sinking/capturing ships.
Then there is also the seeming difference between "nation relations" and "GOVERNOR relations". I don't think that is quite functional.
Neither is this "number of soldiers killed" counter that is supposed to do....
things.
Anyway, I think this is technically more functional than it was and at least not "broken".
So as far as I'm concerned, this will be good enough for the Beta 4 public release.
We can always do further clean up and finishing these things
later. Rome wasn't built in a day....