• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Mod Release Jonesies Officer Loyalty Tweak-Pack (BETA)

Jonesie85

Boarding Master
Storm Modder
THIS IS COMPATIBLE WITH GOF v1.2 FULL PATCH 1 ONLY!!

This mod/tweak pack includes 2 tweaks and one cheat (large and small versions). The changes in this tweak pack ,ay have some unforseen side effects. please only use this if you a sure you wish to try it out. The changes i have made will be posted after this thread.

- Officer Recruitment Loyalty Tweak, This tweak increases the chances of finding officers with higher loyalty levels in taverns. (The know-how for this was taken from the forum, i take no credit for it).








- Jonesies' Officer Loyalty Tweak, This tweak simply changes the way your officers react to you actions. Rather than losing loyalty for something they dont like. They gain loyalty no matter what. To make sure that all of your officers respond the same way, there is now only one alignment (good). This could be a quest-breaking tweak but should not effect your game play if you are good or bad.

- Jonesies' Ultimate Officer Cheat, This is accessed through the Developer Console. This cheat ony applies to whatever officer is in the navigators slot but does remain once they are put elsewhere. There are 2 versions of this. The large:-
- Companion loyalty, reputation, capabilities, abilities and skills set to maximum.
- All companion perks added.
- Companion GOD-MODE (ON - OFF). This works for both land and ship. (The know-how for this was taken from the forum, i take no credit for it).
- Companion malee energy set to 2500.
- Companion health set to 2500 (just in case).

and the small version:-

- Companion loyalty and reputation set to maximum.

If you use just the two tweaks your officers/companions loyalty shoud never drop. The cheat ensures that the officer/companion is at max to start with. Some, values that have been modified refer not just to the players actions but to the officers reputation. The higher the rep the higher the loyalty values (i think).

INSTRUCTIONS:- First, you must choose if you want the full version or the small version. The differences between them are simple. the full version has all the above functions including the large cheat and the small version is the same but with the small cheat.

Copy and paste 'Debuger.c' into your 'game dir/Program/INTERFACE' folder, this file contains the cheat. If you do not wish to use the cheat then you do not need this file. Copy and paste 'officers.c' into your 'game dir/Program/scripts' folder, this file contains the two tweaks.

Please refer to the forum for instructions on how to activate and use the Dev-console. Also, Please contact me via Jonesie85@hotmail.co.uk if there are any problems.
 

Attachments

  • Jonesies' Officer Loyalty Tweak Pack.rar
    25.3 KB · Views: 329
The things i changes are as follows lines tagged with 'JONESIE' have been altered


GAME DIR/programs/scripts/officers.c for the 2 tweaks.
Lines 20 to 41, Seems to be loyalty given +1, loyalty taken -1. Changed to loyalty given +1 and loyalty taken +1 so no matter what loyalty alwats increases rather than decreases.

Code:
            //Trace("LOYALTY_MOD: before image >>>");
            //TraceCharacter(characters[iPassenger]);
            if (CheckAttribute(characters[iPassenger], "loyality"))
            {
                if (isOfficerNeutral(&characters[iPassenger]))
                {
                    characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + majorityResult;
                }
                else
                {
                    if (getOfficerAlignment(&characters[iPassenger]) == alignment)
                    {
                        characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;
                    }
                    else
                    {
                        characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1; // JONESIE (-1)
                    }
                }
            }
            //Trace("LOYALTY_MOD: after image <<<");
            //TraceCharacter(&characters[iPassenger]);

Next. Lines 44 to 79, two changes tagged with 'JONESIE'. Both were -1 loyalty change so i altered then to +1 to gain loyalty.

Code:
    for (i=1; i<COMPANION_MAX; i++)
    {
        cn = GetCompanionIndex(pchar, i);
        if(cn!=-1)
        {
            sld = GetCharacter(cn);
            //Trace("LOYALTY_MOD: before image >>>");
            //TraceCharacter(sld);
            if (CheckAttribute(sld, "loyality"))
            {
                if (isOfficerNeutral(&sld))
                {
                    sld.loyality = makeint(sld.loyality) + majorityResult;
                    if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, majorityResult); //navy
                }
                else
                {
                    if (getOfficerAlignment(&sld) == alignment)
                    {
                        sld.loyality = makeint(sld.loyality) + 1;
                        if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, 1); //navy
                    }
                    else
                    {
                        sld.loyality = makeint(sld.loyality)  + 1; //JONESIE (-1)
                        // ñïåöèàëüíî íå äàëåþ ïðèâåäåíèå ê 0 è ìàõ. ïîòîìó ÷òîá áûë çàïàñ ìèíóñîâ äëÿ ïðîâåðîê
                        if (CheckAttribute(sld, "PGGAi")) PGG_ChangeRelation2MainCharacter(sld, 1); //navy JONESIE (-1)
                    }
                }
            }
            //Trace("LOYALTY_MOD: after image <<<");
            //TraceCharacter(&sld);
        }
    }
    //Trace("LOYALTY_MOD: <<<======== end =============");
}


Next. Lines 91 to 101, 1 change tagged as 'JONESIE'. Simply changing good and bad officer alignment to good and good. I am unsure about neutral alignments and i am completely unsure how this will effect quest-lines or plot lines.

Code:
// simply returning officers alignment. In case attribute is missing, it is derived from offs reputation
string getOfficerAlignment(ref _officer)
{
    if (CheckAttribute(_officer, "alignment")) return _officer.alignment;
    int rep = REPUTATION_NEUTRAL;  // 45 = neutral as default setting in case officer has no rep
    string _alignment = "";
    if (CheckAttribute(_officer, "reputation")) rep = sti(_officer.reputation); // retrieve value if officer has rep
    if (rep > 41) _alignment = "good";
    else _alignment = "good"; // <--- JONESIE (bad)
    return _alignment;
}

Next. Lines 132 to 154, 3 changes tagged as 'JONESIE'. i assume this is the last vote/result of whatever action is made. originally meaning +1 = adding loyalty, 0 = no change and -1 = losing loyalty. All have been changed to +1 meaning no matter what. Loyalty increases.

Code:
    for (int i=1; i<COMPANION_MAX; i++)
    {
        iC = GetCompanionIndex(pchar, i);
        if(iC != -1)
        {
            companion = GetCharacter(iC);
            if (CheckAttribute(companion, "loyality"))
            {
                if (!isOfficerNeutral(&companion))
                {
                    if (getOfficerAlignment(&companion) == action) _vote++;
                    else _vote--;
                }
            }
        }
    }
   
    //Trace("LOYALTY_MOD: value of vote: " + _vote);
   
    // determine result: 0 = officers opinion on par, -1 = majority against captain, +1 = majority for captain
    if (_vote < 1) return +1; // JONESIE (-1)
    else if (_vote > 1) return +1; // JONESIE (1)
    return +1; // JONESIE (0)

Next. Lines 469 to 471, 1 change tagged as 'JONESIE'. This change increases the initial loyalty of all officers recruited through the tavern. I am unsure about companions.

Code:
    Npchar.reputation = rand(84) + 5;
    // ïðèñòðàñòèå îôèöåðà -->
    Npchar.loyality = 25 + rand(10);    //<--- JONESIES (WAS 5 +rand(10))


GAME DIR/programs/INTERFACE/Debuger.c for the LARGE cheat.

I placed this cheat in function 26 (F26) which begins at line 1067. it should look like this:-

Code:
string descF26 = "empty";
void CalculateInfoDataF26()
{
    totalInfo = descF26;
    // -->
    // <--
    totalInfo = totalInfo + NewStr() + NewStr() +
                "The command is executed successfully!";
    SetFormatedText("INFO_TEXT",totalInfo);
}

NEXT. I placed this code in its place.

Code:
string descF26 = "Jonesies' Ultimate Companion Cheat";
void CalculateInfoDataF26()
{
totalInfo = descF26;
// -->
if (sti(pchar.Fellows.Passengers.navigator) != -1)
{
ref mc;
mc = GetCharacter(sti(pchar.Fellows.Passengers.navigator));
if(LAi_IsImmortal(mc))
{
LAi_SetImmortal(mc, false);
Log_SetStringToLog("Companion god mode OFF");
}else{
LAi_SetImmortal(mc, true);
Log_SetStringToLog("Companion god mode ON");
}
}
else
{
totalInfo = "No officer available to modify";
}   
 
if (sti(pchar.Fellows.Passengers.navigator) != -1)
{
ref chr = GetCharacter(sti(pchar.Fellows.Passengers.navigator));
 
chr.Loyality = sti(chr.Loyality) + 200;
chr.Reputation = sti(chr.Reputation) + 200;
chr.skill.freeskill=sti(pchar.skill.freeskill)=1;
chr.skill.leadership=sti(pchar.skill.leadership)=100;
chr.skill.fencinglight=sti(pchar.skill.fencinglight)=100;
chr.skill.fencing=sti(pchar.skill.fencing)=100;
chr.skill.fencingheavy=sti(pchar.skill.fencingheavy)=100;
chr.skill.pistol=sti(pchar.skill.pistol)=100;
chr.skill.fortune=sti(pchar.skill.fortune)=100;
chr.skill.sneak=sti(pchar.skill.sneak)=100;
chr.skill.commerce=sti(pchar.skill.commerce)=100;
chr.skill.defence=sti(pchar.skill.defence)=100;
chr.skill.accuracy=sti(pchar.skill.accuracy)=100;
chr.skill.sailing=sti(pchar.skill.sailing)=100;
chr.skill.cannons=sti(pchar.skill.cannons)=100;
chr.skill.repair=sti(pchar.skill.repair)=100;
chr.skill.grappling=sti(pchar.skill.grappling=100;
 
ref ch=getcharacter(sti(pchar.fellows.passengers.navigator));
 
ch.perks.list.IronWill = "1";
ch.perks.list.BasicDefense = "1";
ch.perks.list.AdvancedDefense = "1";
ch.perks.list.Ciras = "1";
ch.perks.list.CriticalHit = "1";
ch.perks.list.HPPlus = "1";
ch.perks.list.HardHitter = "1";
ch.perks.list.Tireless = "1";
ch.perks.list.Rush = "1";
ch.perks.list.EnergyPlus = "1";
ch.perks.list.Sliding.descr = "1";
ch.perks.list.BladeDancer = "1";
ch.perks.list.SwordplayProfessional = "1";
ch.perks.list.Gunman = "1";
ch.perks.list.GunProfessional = "1";
ch.perks.list.Grus = "1";
ch.perks.list.Medic = "1";
ch.perks.list.ByWorker = "1";
ch.perks.list.ByWorker2 = "1";
ch.perks.list.SharedExperience = "1";
ch.perks.list.ShipEscape = "1";
ch.perks.list.Trustworthy = "1";
ch.perks.list.FlagFra = "1";
ch.perks.list.FlagSpa = "1";
ch.perks.list.FlagHol = "1";
ch.perks.list.FlagEng = "1";
ch.perks.list.Brander = "1";
ch.perks.list.Aboard = "1";
ch.perks.list.Troopers = "1";
ch.perks.list.LongRangeGrappling = "1";
ch.perks.list.GrapplingProfessional = "1";
ch.perks.list.MusketsShoot = "1";
ch.perks.list.BasicCommerce = "1";
ch.perks.list.AdvancedCommerce = "1";
ch.perks.list.FastReload = "1";
ch.perks.list.ImmediateReload = "1";
ch.perks.list.HullDamageUp = "1";
ch.perks.list.SailsDamageUp = "1";
ch.perks.list.CrewDamageUp = "1";
ch.perks.list.CriticalShoot = "1";
ch.perks.list.LongRangeShoot = "1";
ch.perks.list.CannonProfessional = "1";
ch.perks.list.Carpenter = "1";
ch.perks.list.Builder = "1";
ch.perks.list.LightRepair = "1";
ch.perks.list.InstantRepair = "1";
ch.perks.list.BasicBattleState = "1";
ch.perks.list.AdvancedBattleState = "1";
ch.perks.list.ShipDefenseProfessional = "1";
ch.perks.list.ShipSpeedUp = "1";
ch.perks.list.ShipTurnRateUp = "1";
ch.perks.list.StormProfessional = "1";
ch.perks.list.WindCatcher = "1";
ch.perks.list.SailsMan = "1";
ch.perks.list.Turn180 = "1";
ch.perks.list.SandbankManeuver = "1";
ch.perks.list.SailingProfessional = "1";
ch.perks.list.Doctor1 = "1";
ch.perks.list.Doctor2 = "1";
ch.perks.list.Smuggler = "1";
LAi_SetHP(ch,2500,2500);
ch.PerkValue.EnergyPlus=sti(ch.PerkValue.EnergyPlus)=2500;
SetSPECIAL(ch, 10,10,10,10,10,10,10);
 
}
else
{
totalInfo = "No officer available to modify";
}
// OLD COMMAND, UNDERNEATH
//ref chr = GetCharacter(302);
//chr.Skill.FreeSkill  = sti(chr.Skill.FreeSkill) + 35;
// <--
totalInfo = totalInfo + NewStr() + NewStr() +
"Companion stats, loyalty, reputation, health & malee energy set to maximum. All perks and god mode activated";
SetFormatedText("INFO_TEXT",totalInfo);
}


GAME DIR/programs/INTERFACE/Debuger.c for the small cheat.

I placed this cheat in function 26 (F26) which begins at line 1067. it should look like this:-

Code:
string descF26 = "empty";
void CalculateInfoDataF26()
{
    totalInfo = descF26;
    // -->
    // <--
    totalInfo = totalInfo + NewStr() + NewStr() +
                "The command is executed successfully!";
    SetFormatedText("INFO_TEXT",totalInfo);
}

NEXT. I placed this code in its place.

Code:
string descF26 = "Jonesies' Ultimate Companion Cheat";
void CalculateInfoDataF26()
{
totalInfo = descF26;
// -->
if (sti(pchar.Fellows.Passengers.navigator) != -1)
{
ref chr = GetCharacter(sti(pchar.Fellows.Passengers.navigator));
 
chr.Loyality = sti(chr.Loyality) + 200;
chr.Reputation = sti(chr.Reputation) + 200;
}
else
{
totalInfo = "No officer available to modify";
}
// OLD COMMAND, UNDERNEATH
//ref chr = GetCharacter(302);
//chr.Skill.FreeSkill  = sti(chr.Skill.FreeSkill) + 35;
// <--
totalInfo = totalInfo + NewStr() + NewStr() +
"Various companion stats reduced to allow further leveling.";
SetFormatedText("INFO_TEXT",totalInfo);
}

Thank you for your time and patience.

Also, if anybody has the ability to improve this. Please do so.
 
Back
Top