Yes, and I have expanded it now but it's not 100% safe by that either.
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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
How come?Yes, and I have expanded it now but it's not 100% safe by that either.
but I still get the wrong item sometimes.if(CheckCharacterItem(chr, "blade_mKnife") && CheckCharacterItem(chr, "pistolmket"))
{
RemoveCharacterEquip(chr, GUN_ITEM_TYPE);
RemoveCharacterEquip(chr, BLADE_ITEM_TYPE);
TakeItemFromCharacter(chr, "pistolmket");
TakeItemFromCharacter(chr, "blade_mKnife");
GiveItem2Character(chr, "blademketK");
EquipCharacterByItem(chr, "blademketK");
}
if(CheckCharacterItem(chr, "blademketK"))
{
RemoveCharacterEquip(chr, GUN_ITEM_TYPE);
RemoveCharacterEquip(chr, BLADE_ITEM_TYPE);
TakeItemFromCharacter(chr, "blademketK");
GiveItem2Character(chr, "blade_mKnife");
GiveItem2Character(chr, "pistolmket");
EquipCharacterByItem(chr, "blade_mKnife");
EquipCharacterByItem(chr, "pistolmket");
}
if(CheckCharacterItem(chr, "blademketB"))
{
RemoveCharacterEquip(chr, GUN_ITEM_TYPE);
RemoveCharacterEquip(chr, BLADE_ITEM_TYPE);
TakeItemFromCharacter(chr, "blademketB");
GiveItem2Character(chr, "pistolmketB");
if(!CheckCharacterItem(chr, "bladeX4")) GiveItem2Character(chr, "bladeX4");
EquipCharacterByItem(chr, "bladeX4");
EquipCharacterByItem(chr, "pistolmketB");
}
I was specifically talking about the "looting situation" when I referred to LAi_Character_Dead_Event in LAi_events.c .It's not the quick-equip so much as the looting situation.
The visible corpse on the ground shouldn't matter one way or another; that isn't what you loot.Guards with the knife and a not yet fired musket on their hip give blademketK in the looting interface.
The visible corpse on the ground still has got knife + hip musket equipped.
void LAi_ApplyCharacterBladeDamage(aref attack, aref enemy, float attackDmg, float hitDmg, bool isBlocked)
{
[...]
// Baste <--
if(LAi_IsDead(enemy))
{
//Начислим за убийство
exp = exp + LAi_CalcDeadExp(attack, enemy);
you can (at least you think so) pick up blademketK but when leaving this interface andvoid IDoExit(int exitCode)
{
int s; // NK for below for() statements
ref pchar = GetMainCharacter();
//JRH -->
if(sti(GetAttribute(pchar, "items.blademketK")) >0)
{
RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
TakeItemFromCharacter(Pchar, "blademketK");
GiveItem2Character(Pchar, "blade_mKnife");
GiveItem2Character(Pchar, "pistolmket");
EquipCharacterByItem(Pchar, "blade_mKnife");
EquipCharacterByItem(Pchar, "pistolmket");
}
//<--JRH
Have you already tried my LAi_IsDead suggestion? I think that one might just work.Now I have tried your suggestion Pieter but sorry not better.
bool LAi_IsDead(aref chr)
{
if(CheckAttribute(chr, "chr_ai.hp") == false) return true;
if(stf(chr.chr_ai.hp) < 1.0) return true;
return false;
}
bool LAi_IsDead(aref chr)
{
bool bDead = false;
if (CheckAttribute(chr, "chr_ai.hp") == false) bDead = true;
if (stf(chr.chr_ai.hp) < 1.0) bDead = true;
//JRH -->
if (bDead && !IsMainCharacter(chr))
{
if(CheckCharacterItem(chr, "blademketK"))
{
TakeItemFromCharacter(chr, "blademketK");
GiveItem2Character(chr, "blade_mKnife");
GiveItem2Character(chr, "pistolmket");
}
if(CheckCharacterItem(chr, "blademketB"))
{
TakeItemFromCharacter(chr, "blademketB");
GiveItem2Character(chr, "pistolmketB");
}
}
//<-- JRH
return bDead;
}
If you are going to do that, you probably need to count the number of items and swap multiple if there are multiple ones.you can (at least you think so) pick up blademketK but when leaving this interface and
checking in your inventory that terrible item is switched to what we want.
Hmm I was in the wrong file but tested with LAi_character now......I think that one might just work.
Thanks. Then I know we can mark this one for testing and no more work needs to be done unless we find mor ecrazy stuff.No I think the problem was getting those blademuskets at all.
If you can't get them you can't wrongly equip them so I have skipped the equip check.
Thanks!One thing I missed though is cleaning up LAi_utils.c where my first anti-looting code still is.
Here's a clean one.
In a fight they should switch to blademuskets after a shot. During that fight they shouldn't equip the musket again as they can't reload during the figtht.but I've seen a few occasions when they kept the blademusket yet still had at least 2 gunpowder and 1 musket bullet.
But that was my idea: by sheathing your blade all NPC:s should reset too. Maybe I have missed something with the officers.But I don't know how to order the officer to draw and sheathe his own blademusket in an attempt to convert it back.
What happens if the NPC hasn't sheathed his weapon at the time that you sheathe yours? I've occasionally seen them keep their weapons drawn long after the battle has finished. So you put your weapon away, everyone else's blademuskets are converted to musket and bayonet, but this guy is still waving his blademusket around. (Perhaps that's what caused the other weirdness, which is that someone started a battle with one musket and bayonet, and ended it with two - I'll have to watch for that next time...)But that was my idea: by sheathing your blade all NPC:s should reset too. Maybe I have missed something with the officers.
I'll take a look.
And please watch for those that have sheathed their blades: if they are reset ok so we know that at least thatI'll have to watch for that next time...