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 -
void EquipCharacterByItem(ref chref, string itemID)
{
aref arItm;
trace("EquipCharacterByItem " + itemID);
if( !CheckCharacterItem(chref, itemID) ) return;
if( Items_FindItem(itemID, &arItm)<0 ) return;
if( !CheckAttribute(arItm, "groupID") ) return;
string groupName = arItm.groupID;
string oldItemID = GetCharacterEquipByGroup(chref, groupName);
if(oldItemID==itemID) return;
chref.equip.(groupName) = itemID;
if(IsEntity(chref))
{ trace("calling SetEquipedItemToCharacter " + itemID);
SetEquipedItemToCharacter(chref, groupName, itemID);
}
if(groupName==GUN_ITEM_TYPE && sti(chref.index)==GetMainCharacterIndex())
{ LAi_GunSetUnload(chref);
}
if(groupName==SABERGUN_ITEM_TYPE && sti(chref.index)==GetMainCharacterIndex())
{ LAi_GunSetUnload(chref);
}
}
void SetEquipedItemToCharacter(ref chref, string groupID, string itemID)
{
object emptyItm;
aref arItm;
string modelName = "";
makearef(arItm,emptyItm);
if(itemID!="")
{
if( !CheckCharacterItem(chref,itemID) ) return;
Items_FindItem(itemID,&arItm);
}
switch(groupID)
{
case SPYGLASS_ITEM_TYPE:
if(CheckAttribute(arItm,"id"))
{
setTelescopeInitParameters(arItm);
}
break;
case GUN_ITEM_TYPE:
trace("GUN_ITEM_TYPE " + itemID);
if(CheckAttribute(arItm,"model")) {modelName = arItm.model;}
SendMessage(chref,"ls",MSG_CHARACTER_SETGUN,modelName);
if(CheckAttribute(arItm,"chargeQ"))
{
trace("calling LAi_GunSetChargeQuant " + arItm.chargeQ);
LAi_GunSetChargeQuant(chref,sti(arItm.chargeQ));
} else
{ LAi_GunSetChargeQuant(chref,0);
}
if(CheckAttribute(arItm,"chargespeed") && stf(arItm.chargespeed)>0.0)
{ LAi_GunSetChargeSpeed(chref,1.0/stf(arItm.chargespeed));
} else
{ LAi_GunSetChargeSpeed(chref,0.0);
}
if(CheckAttribute(arItm,"dmg_min"))
{ LAi_GunSetDamageMin(chref,stf(arItm.dmg_min));
} else
{ LAi_GunSetDamageMin(chref,0.0);
}
if(CheckAttribute(arItm,"dmg_max"))
{ LAi_GunSetDamageMax(chref,stf(arItm.dmg_max));
} else
{ LAi_GunSetDamageMax(chref,0.0);
}
if(CheckAttribute(arItm,"accuracy"))
{ LAi_GunSetAccuracy(chref,stf(arItm.accuracy)*0.01);
} else
{ LAi_GunSetAccuracy(chref,0.0);
}
break;
case BLADE_ITEM_TYPE:
float liveTime = 0.1;
int colors = argb(64, 64, 64, 64);
int colore = argb(0, 32, 32, 32);
if(CheckAttribute(arItm,"model")) {modelName = arItm.model;}
if(CheckAttribute(arItm, "blade.time")) {liveTime = stf(arItm.blade.time);}
if(CheckAttribute(arItm, "blade.colorstart")) {colors = sti(arItm.blade.colorstart);}
if(CheckAttribute(arItm, "blade.colorend")) {colore = sti(arItm.blade.colorend);}
SendMessage(chref, "llsfll", MSG_CHARACTER_SETBLADE, 0, modelName, liveTime, colors, colore);
if(CheckAttribute(arItm,"dmg_min"))
{ LAi_BladeSetDamageMin(chref,stf(arItm.dmg_min));
} else
{ LAi_BladeSetDamageMin(chref,0.0);
}
if(CheckAttribute(arItm,"dmg_max"))
{ LAi_BladeSetDamageMax(chref,stf(arItm.dmg_max));
} else
{ LAi_BladeSetDamageMax(chref,0.0);
}
if(CheckAttribute(arItm,"piercing"))
{ LAi_BladeSetPiercing(chref,stf(arItm.piercing)*0.01);
} else
{ LAi_BladeSetPiercing(chref,0.0);
}
if(CheckAttribute(arItm,"block"))
{ LAi_BladeSetBlock(chref,stf(arItm.block)*0.01);
} else
{ LAi_BladeSetBlock(chref,0.0);
}
break;
case SABERGUN_ITEM_TYPE:
float liveTime2 = 0.1;
int colors2 = argb(64, 64, 64, 64);
int colore2 = argb(0, 32, 32, 32);
if(CheckAttribute(arItm,"model")) {modelName = arItm.model;}
if(CheckAttribute(arItm, "blade.time")) {liveTime2 = stf(arItm.blade.time);}
if(CheckAttribute(arItm, "blade.colorstart")) {colors2 = sti(arItm.blade.colorstart);}
if(CheckAttribute(arItm, "blade.colorend")) {colore2 = sti(arItm.blade.colorend);}
SendMessage(chref, "llsfll", MSG_CHARACTER_SETBLADE, 1, modelName, liveTime2, colors2, colore2);
if(CheckAttribute(arItm,"dmg_min"))
{ LAi_BladeSetDamageMin(chref,stf(arItm.dmg_min));
} else
{ LAi_BladeSetDamageMin(chref,0.0);
}
if(CheckAttribute(arItm,"dmg_max"))
{ LAi_BladeSetDamageMax(chref,stf(arItm.dmg_max));
} else
{ LAi_BladeSetDamageMax(chref,0.0);
}
if(CheckAttribute(arItm,"piercing"))
{ LAi_BladeSetPiercing(chref,stf(arItm.piercing)*0.01);
} else
{ LAi_BladeSetPiercing(chref,0.0);
}
if(CheckAttribute(arItm,"block"))
{ LAi_BladeSetBlock(chref,stf(arItm.block)*0.01);
} else
{ LAi_BladeSetBlock(chref,0.0);
}
break;
}
}
void LAi_GunSetChargeQuant(aref chr, int quant)
{
trace("LAi_GunSetChargeQuant " + quant);
if(quant < 0) quant = 0;
if(quant > 4) quant = 4;
trace("setting charge_max " + quant);
chr.chr_ai.charge_max = quant;
chr.chr_ai.charge = quant;
chr.chr_ai.chargeprc = "1";
}
void EquipCharacterByItem(ref chref, string itemID)
{
aref arItm;
trace("EquipCharacterByItem " + itemID);
if( !CheckCharacterItem(chref, itemID) ) return;
trace("checked " + itemID);
if( Items_FindItem(itemID, &arItm)<0 ) return;
if( !CheckAttribute(arItm, "groupID") ) return;
string groupName = arItm.groupID;
string oldItemID = GetCharacterEquipByGroup(chref, groupName);
trace("oldItemID " + oldItemID);
if(oldItemID==itemID) return;
chref.equip.(groupName) = itemID;
trace("IsEntity(chref) " + IsEntity(chref));
if(IsEntity(chref))
{ trace("calling SetEquipedItemToCharacter " + chref.id + ", " + itemID);
SetEquipedItemToCharacter(chref, groupName, itemID);
}
if(groupName==GUN_ITEM_TYPE && sti(chref.index)==GetMainCharacterIndex())
{ LAi_GunSetUnload(chref);
}
if(groupName==SABERGUN_ITEM_TYPE && sti(chref.index)==GetMainCharacterIndex())
{ LAi_GunSetUnload(chref);
}
}
if (CheckAttribute(PastChref, "equip.blade"))
{
//CopyChref.equip.blade = PastChref.equip.blade;
EquipCharacterByItem(CopyChref, PastChref.equip.blade);
}
if (CheckAttribute(PastChref, "equip.gun"))
{
//CopyChref.equip.gun = PastChref.equip.gun;
EquipCharacterByItem(CopyChref, PastChref.equip.gun);
}
TempFightChar.skill.fencing = boarding_enemy.skill.fencing;
TempFightChar.skill.gun = boarding_enemy.skill.gun;
chr = LAi_CreateFantomCharacterEx(model, ani, "rld", sLoc);
The gun fix has made the boarding defenders more trigger happy, but the commander still refuses to return fire...Logs:Pick it up here: MEGA
GunFix.zip
Also, in void LAi_SetBoardingCaptain, add two lines before LAi_CreateFantomCharacterEx:
Code:TempFightChar.skill.fencing = boarding_enemy.skill.fencing; TempFightChar.skill.gun = boarding_enemy.skill.gun; chr = LAi_CreateFantomCharacterEx(model, ani, "rld", sLoc);
void ExecuteConsole()
{
ref pchar = GetMainCharacter();
int limit = SpawnDutchman();
ref chr;
string ani;
ref boarding_enemy = &characters[limit];
string model = LAi_GetBoardingModel(boarding_enemy, &ani);
string sLoc = "reload1";
TempFightChar.skill.fencing = boarding_enemy.skill.fencing;
TempFightChar.skill.gun = boarding_enemy.skill.gun;
chr = LAi_CreateFantomCharacterEx(model, ani, "reload", sLoc);
if(CheckAttribute(boarding_enemy, "copyme") && sti(boarding_enemy.copyme) == 1) {
trace("Special Character");
ChangeAttributesFromCharacter(chr, boarding_enemy, false);
}
SetNewModelToChar(chr);
LAi_group_MoveCharacter(chr, LAI_GROUP_BRDENEMY);
LAi_group_FightGroupsEx(LAI_GROUP_PLAYER, LAI_GROUP_BRDENEMY, true, nMainCharacterIndex, -1, false, false);
LAi_group_SetCheckEvent(LAI_GROUP_BRDENEMY);
Log_SetStringToLog("Executed Console");
}
if (CheckAttribute(PastChref, "SuperShooter"))
{
CopyChref.SuperShooter = PastChref.SuperShooter;
}
float LAi_NPC_GetFireActive()
{
float MOD_SKILL_ENEMY_RATE = 3.0;
aref chr = GetEventData();
float level = LAi_GetCharacterGunLevel(chr);
npc_return_tmp = 0.001 + level*0.06;
// boal íàøè îôèöåðû ïóëÿò èç âñåõ ñòâîëîâ -->
if (chr.chr_ai.group == LAI_GROUP_PLAYER)
{
npc_return_tmp = 0.38 + npc_return_tmp;
}
else
{
// boal íàøè îôèöåðû ïóëÿò èç âñåõ ñòâîëîâ <--
if (CheckAttribute(chr, "SuperShooter"))
{
npc_return_tmp = npc_return_tmp + 0.4 * MOD_SKILL_ENEMY_RATE / 10.0;
}
else
{
npc_return_tmp = npc_return_tmp + 0.1 * MOD_SKILL_ENEMY_RATE / 10.0;
}
}
//if (npc_return_tmp > 0.5) npc_return_tmp = 0.5;
if(!iArcadeFencingAI)
{
npc_return_tmp = npc_return_tmp + 0.03;
//if (npc_return_tmp > 0.5) npc_return_tmp = 0.5;
}
return npc_return_tmp;
}
void ProcessCancelExit()
if(n<0) {
trace("ransack n is zero " + refEnepchararacter.id);
ShipDead(sti(refEnepchararacter.index),KILL_BY_ABORDAGE,sti(pchar.index));
} else {
trace("ransack n is other " + refEnepchararacter.id);
....
case "NPC_Death":
trace("NPC_Death " + refcharacter.id);
return CharacterIsDead(refCharacter);
break;
void procTimerTimeOut()
{
QuestComplete(objTimerInterface.questtype, objTimerInterface.questname);
StoryLineQuestComplete(objTimerInterface.questtype, objTimerInterface.questname);
DutchEncounterQuestComplete(objTimerInterface.questtype, objTimerInterface.questname);
}
void OnQuestComplete(aref quest, string sQuestname)
{
if(!CheckAttribute(quest,"over") && CheckAttribute(quest,"win_condition"))
{
quest.over = "yes";
QuestComplete(quest.win_condition, sQuestName);
StoryLineQuestComplete(quest.win_condition, sQuestName);
DutchEncounterQuestComplete(quest.win_condition, sQuestName);
}
}
void OnQuestFailed(aref quest, string sQuestName)
{
if(CheckAttribute(quest,"fail_condition"))
{
quest.over = "yes";
QuestComplete(quest.fail_condition, sQuestName);
StoryLineQuestComplete(quest.fail_condition, sQuestName);
DutchEncounterQuestComplete(quest.fail_condition, sQuestName);
}
}