Thanks for the input Armada and Homo Erectus!
Ok, fixed things up I think.
@Pieter Boelen , can you look the new code over?
In particular, did I definite deathfight as true properly first?
On the pirate nation string issue, the begining of the file has this:
Code:
string NPC_Meeting, blade, gun, cuirass, reload_locator, old;
int iNation = sti(NPChar.nation);
string pNation = XI_ConvertString("p"+GetNationNameByType(iNation));
if(GetNationNameByType(iNation)=="no nation") pNation = XI_ConvertString("pPirate");
if(GetNationNameByType(iNation)=="Pirates") pNation = XI_ConvertString("pPirate");
Does that beginning of the file part addresses the interger issue with the pirate term and make the below code work? Or is it not enough and needs to be done differently? Sorry about so many questions!
Also, if it does need to be changed, much later in the file things are set by directly saying if(NPChar.nation!=PIRATE), do I need to change those as well?
Code:
//TY Changed to check on AI reputation, skills, and piracy, and random chance, to engage in extreme act of attacking after surrender.
bDeathFight = false;
if(IsCharacterPerkOn(NPChar, "SwordplayProfessional")
{
if(frnd() < 0.2)
{
if(GetCharacterReputation(PChar) > REPUTATION_NEUTRAL && GetCharacterReputation(NPChar) < REPUTATION_NEUTRAL)
{bDeathFight = true;}
if(GetCharacterReputation(PChar) < REPUTATION_NEUTRAL && GetCharacterReputation(NPChar) > REPUTATION_NEUTRAL)
{bDeathFight = true;}
}
}
if(NPChar.nation=PIRATE)
{
if(frnd() < 0.3)
{
bDeathFight = true;
}
}
I went ahead and pulled the pirate condition out from being dependent on swordplay professional (while reducing chance), so that low level pirates sometimes attack as well.
On the duplicate issue, commented it out in accordance with general opinion, leaving a note as to why it was done for the future.
Code:
//if(IsUsedAlliesModel(NPChar)) { bDeathFight = true; }//MAXIMUS: ally's twin will always be agressive [twin officers looks strange, not so?] TY after discussion generally people believe better to allow player to make choice of changing outfit or otherwise dealing with duplicates
//MAXIMUS: [if enemy captain is stronger than player, you'll fight with him] <--
So, in effect, now any swordplay professional with opposite reputation has a 20% chance of attacking, and any pirate regardless of skills has a 30% chance of attacking after surrendering.
(meaning a pirate with swordplay professional and opposite rep has a 44% chance of attacking, since he gets two rolls)
File attached EDIT ok correct file attached now