case "gunner_ammo":
bool tmpAbleRefill = false;
if (CharacterHasOfficerType(pchar, OFFIC_TYPE_CANNONEER)) { tmpAbleRefill = true; }
if (AMMOMOD_ABLECAPTAIN) { tmpAbleRefill = true; }
if (tmpAbleRefill)
{
//PLAYER AND OFFICERS
for(i = 0; i < 4; i++)
{
iOfficer = GetOfficersIndex(PChar, i);
if(iOfficer < 0) continue;
NPChar = GetCharacter(iOfficer);
if(!CheckAttribute(NPChar,"equip."+GUN_ITEM_TYPE) )
{
//do nothing
}
else
{
weaponID2 = GetCharacterEquipByGroup(NPChar,GUN_ITEM_TYPE);
Items_FindItem(weaponID2, &weapon2);
if(CheckAttribute(weapon2, "shottype"))
{
if(weapon2.shottype == "pg2" || weapon2.shottype == "pg" || weapon2.shottype == "mb" || weapon2.shottype == "pb" || weapon2.shottype == "pb2")
{
DeleteAttribute(NPChar,"Items.gunpowder");
DeleteAttribute(NPChar,"Items.pistolbullets");
DeleteAttribute(NPChar,"Items.pistolgrapes");
DeleteAttribute(NPChar,"Items.musketbullets");
if(CheckCharacterItem(NPChar,"powderbarrel")) { TakeNItems(NPChar,"gunpowder", (4 * MAX_GUNPOWDER)); }
else
{
if(CheckCharacterItem(NPChar,"powderflask")) { TakeNItems(NPChar,"gunpowder", (2 * MAX_GUNPOWDER)); }
else { TakeNItems(NPChar,"gunpowder", MAX_GUNPOWDER); }
}
if(CheckCharacterItem(NPChar,"ammobag")) { cc = (4 * MAX_SHOTS); }
else
{
if(CheckCharacterItem(NPChar,"ammopouch")) { cc = (2 * MAX_SHOTS); }
else { cc = MAX_SHOTS; }
}
//LogIt("cc = " + cc);
if(weapon2.shottype == "pg2" || weapon2.shottype == "pg") { TakeNItems(NPChar,"pistolgrapes" , cc); }
if(weapon2.shottype == "mb") { TakeNItems(NPChar,"musketbullets", cc/2); }
if(weapon2.shottype == "pb2" || weapon2.shottype == "pb") { TakeNItems(NPChar,"pistolbullets", cc); }
}
}
}
}
Log_SetStringToLog(TranslateString("","Your shore party has been resupplied with Ammunition!"));
PlaySound("INTERFACE\important_item.wav");
}
break;