case "Barbossa_and_me_back_to_Beach":
LAi_SetOfficerType(characterFromID("Barbossa"));
LAi_SetPlayerType(pchar);
SetNextWeather("Blue Sky");
pchar.quest.before_first_marooning.win_condition.l1 = "MapEnter";
pchar.quest.before_first_marooning.win_condition = "before_first_marooning";
break;
case "before_first_marooning":
Locations[FindLocation("Oxbay_lighthouse")].reload.l4.disable = false;
Locations[FindLocation("Oxbay_lighthouse")].reload.l3.disable = false;
SetNextWeather("Blue Sky");
RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
RemoveCharacterEquip(pchar, GUN_ITEM_TYPE);
EnableEquip(pchar, BLADE_ITEM_TYPE, false);
EnableEquip(pchar, GUN_ITEM_TYPE, false);
EquipCharacterByItem(pchar, "bladeX4");
//--> CTM (Fix for Barbossa and Ragetti/Pintel turning up when landing on Isla with Interceptor)
RemovePassenger(Pchar, characterFromID("Barbossa"));
if (GetAttribute(pchar,"Rag")=="1"){
RemovePassenger(Pchar, characterFromID("Ragetti"));
}
// CTM <--
pchar.Bosun = "cursed";
if(IsPassenger(characterFromID("Bos'un")) || IsOfficer(characterFromID("Bos'un")))
{
Characters[GetCharacterIndex("Bos'un")].name = "Nigel";
Characters[GetCharacterIndex("Bos'un")].lastname = "the Slave";
Characters[GetCharacterIndex("Bos'un")].model = "Ancient";
Characters[GetCharacterIndex("Bos'un")].headmodel = "h_Ancient";
}
//StorePassengers("Blaze");
StorePassengers(Pchar.id);
pchar.tempmoney = pchar.money;
pchar.money = 100;
DoQuestReloadToLocation("ShipDeck7", "goto", "goto7", "talk_before_first_marooning");
break;
case "talk_before_first_marooning":
if(GetOfficersIndex(Pchar, 3) != -1)
{
iPassenger = GetOfficersIndex(Pchar, 3);
LAi_SetActorType(&characters[iPassenger]);
ChangeCharacterAddress(&characters[iPassenger], "none", "");
}
if(GetAttribute(pchar,"Rag")=="1")
{
ChangeCharacterAddressGroup(CharacterFromID("Ragetti"), "ShipDeck7", "rld", "wheel");
ChangeCharacterAddressGroup(CharacterFromID("Pintel"), "ShipDeck7", "goto", "goto8");
//-->CTM (adds Ragetti and Pintel on deck when Barbossa is being a B@$T@RD
LAi_SetActorType(characterFromID("Ragetti"));
LAi_ActorWaitDialog(pchar, characterFromID("Ragetti"));
LAi_SetActorType(characterFromID("Pintel"));
LAi_ActorWaitDialog(pchar, characterFromID("Pintel"));
//<--CTM
}
ChangeCharacterAddressGroup(CharacterFromID("Barbossa"), "ShipDeck7", "goto", "goto14");
pchar.quest.Beckett = "Barbossa_enacts_Mutiny";
characters[GetCharacterIndex("Barbossa")].Dialog.Filename = "Barbossa_dialog.c";
LAi_SetActorType(characterFromID("Barbossa"));
Characters[GetCharacterIndex("Barbossa")].dialog.CurrentNode = "first time";
LAi_ActorDialog(characterFromID("Barbossa"), pchar, "", 10.0, 10.0);
break;
case "Barbossa_leaves_for_now":
if(GetOfficersIndex(Pchar, 1) > 0)
{
Pchar.Temp.Officer.idx1 = getOfficersIndex(Pchar, 1);
Pchar.Temp.Officer.idx1.Dialog = Characters[getOfficersIndex(Pchar, 1)].Dialog.Filename;
Pchar.Temp.Officer.idx1.CurrentNode = Characters[getOfficersIndex(Pchar, 1)].Dialog.CurrentNode;
}
else
{
Pchar.Temp.Officer.idx1 = -1;
}
if(GetOfficersIndex(Pchar, 2) > 0)
{
Pchar.Temp.Officer.idx2 = getOfficersIndex(Pchar, 2);
Pchar.Temp.Officer.idx2.Dialog = Characters[getOfficersIndex(Pchar, 2)].Dialog.Filename;
Pchar.Temp.Officer.idx2.CurrentNode = Characters[getOfficersIndex(Pchar, 2)].Dialog.CurrentNode;
}
else
{
Pchar.Temp.Officer.idx2 = -1;
}
if(GetOfficersIndex(Pchar, 3) > 0)
{
Pchar.Temp.Officer.idx3 = getOfficersIndex(Pchar, 3);
Pchar.Temp.Officer.idx3.Dialog = Characters[getOfficersIndex(Pchar, 3)].Dialog.Filename;
Pchar.Temp.Officer.idx3.CurrentNode = Characters[getOfficersIndex(Pchar, 3)].Dialog.CurrentNode;
}
else
{
Pchar.Temp.Officer.idx3 = -1;
}
if (GetCompanionIndex(pchar,1) > 0)
{
Pchar.Temp.Companion.idx1 = GetCompanionIndex(pchar,1);
iPassenger = GetCompanionIndex(pchar,1);
RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
}
else
{
Pchar.Temp.Companion.idx1 = -1;
}
if (GetCompanionIndex(pchar,2) > 0)
{
Pchar.Temp.Companion.idx2 = GetCompanionIndex(pchar,2);
iPassenger = GetCompanionIndex(pchar,2);
RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
}
else
{
Pchar.Temp.Companion.idx2 = -1;
}
if (GetCompanionIndex(pchar,3) > 0)
{
Pchar.Temp.Companion.idx3 = GetCompanionIndex(pchar,3);
iPassenger = GetCompanionIndex(pchar,3);
RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
}
else
{
Pchar.Temp.Companion.idx3 = -1;
}
TakeItemFromCharacter(Pchar,"aztec_compass");
pchar.money = 100;
//AddQuestRecord("Hector Barbossa",4);
if (GetAttribute(pchar, "stolen") != "1")
{
SetQuestHeader("Stolen");
pchar.stolen = "1";
}
AddQuestRecord("Stolen",2);
SetCurrentTime(10, 0);
if(AUTO_SKILL_SYSTEM)
{
AddPartyExpChar(pchar, "Leadership", 500);
AddPartyExpChar(pchar, "Sneak", 50);
}
else { AddPartyExp(pchar, 500); }
// PB -->
// KK -->
if (PreprocessText("#scursed_ship#") == "Black Pearl")
GiveShip2Character(CharacterFromID("Barbossa"),"UncursedPearl",PreprocessText("#scursed_ship#"),-1,PIRATE,TRUE,TRUE);
else
{
GiveShip2Character(CharacterFromID("Barbossa"),"CrimsonBlood", PreprocessText("#scursed_ship#"),-1,PIRATE,TRUE,TRUE);
// <-- KK
characters[GetCharacterIndex("Barbossa")].Ship.EmblemedSails.normalTex = "sail_Petros_black_red.tga"; // PB
characters[GetCharacterIndex("Barbossa")].Ship.EmblemedSails.nationFileName = "sail_Petros_black_red.tga"; // PB
}
characters[GetCharacterIndex("Barbossa")].Flags.Pirate = 0; // PB: Jack Rackham Pirate Flag
characters[GetCharacterIndex("Barbossa")].Flags.Pirate.texture = 0;
setCharacterShipLocation(characterFromID("Barbossa"), "Deserted_Island_shore_01");
characters[GetCharacterIndex("Barbossa")].sailaway = true;
// PB <--
DoQuestReloadToLocation("Deserted_Island_shore_01", "officers", "reload1_3", "Barbossa_leaves_for_now2");
LAi_SetPlayerType(pchar);
locations[FindLocation("Deserted_island_Jungle_01")].vcskip = true;
break;
case "Barbossa_leaves_for_now2":
RestorePassengers(Pchar.id);
//StorePassengers("Blaze");
if(GetOfficersIndex(Pchar, 3) != -1)
{
iPassenger = GetOfficersIndex(Pchar, 3);
LAi_SetActorType(&characters[iPassenger]);
ChangeCharacterAddress(&characters[iPassenger], "none", "");
}
DeleteAttribute(characterFromID("Barbossa"), "sailaway"); // PB: Reset - just in case
Pchar.quest.get_the_Tartane.win_condition.l1 = "location";
Pchar.quest.get_the_Tartane.win_condition.l1.location = "Deserted_Island_Jungle_01";
PChar.quest.get_the_Tartane.win_condition = "get_a_ride_with_smugglers";
break;
case "get_a_ride_with_smugglers":
GiveShip2Character(pchar,"Barque4_47","Free at Last",-1,PIRATE,true,true);
SetCharacterShipLocation(Pchar, "Deserted_Island_shore_02");
EquipCharacterByItem(pchar, "bladeX4");
ChangeCharacterAddress(characterFromID("Barbossa"), "None", "");
RemovePassenger(Pchar, characterFromID("Barbossa"));
pchar.quest.gets_off_marooned_island2.win_condition.l1 = "location";
pchar.quest.gets_off_marooned_island2.win_condition.l1.location = "Deserted_Island_Jungle_01";
pchar.quest.gets_off_marooned_island2.win_condition = "gets_off_marooned_island2";
break;
case "gets_off_marooned_island2":
if(AUTO_SKILL_SYSTEM)
{
AddPartyExpChar(pchar, "Leadership", 5000);
AddPartyExpChar(pchar, "Sneak", 50);
}
else { AddPartyExp(pchar, 5000); }
ChangeCharacterAddressGroup(characterFromID("quest_smuggler_01"), "Deserted_Island_shore_02", "goto", "locator14");
ChangeCharacterAddressGroup(characterFromID("Treas_Pirate_1"), "Deserted_Island_shore_02", "goto", "citizen04");
LAi_SetActorType(characterFromID("quest_smuggler_01"));
LAi_SetActorType(characterFromID("Treas_Pirate_1"));
SetCrewQuantity(pchar, 3)
AddCharacterGoods(pchar, GOOD_WHEAT, 2);
AddCharacterGoods(pchar, GOOD_RUM, 40);
HoistFlag(PIRATE);
pchar.quest.Chatter_to_smuggler.win_condition.l1 = "location";
pchar.quest.Chatter_to_smuggler.win_condition.l1.location = "Deserted_Island_shore_02";
pchar.quest.Chatter_to_smuggler.win_condition = "Chatter_to_smuggler";
break;
case "Chatter_to_smuggler":
pchar.quest.Smuggler = "With_Smugglers_To_Tortuga";
bQuestDisableMapEnter = false;
LAi_ActorTurnToCharacter(characterFromID("Treas_Pirate_1"), pchar);
LAi_QuestDelay("Chatter_to_smuggler2", 5.0); //5.0);
break;
case "Chatter_to_smuggler2":
pchar.quest.Smuggler = "With_Smugglers_To_Tortuga";
LAi_SetActorType(characterFromID("quest_smuggler_01"));
LAi_ActorDialog(characterFromID("quest_smuggler_01"),PChar,"",10.0,1.0);
characters[GetCharacterIndex("quest_smuggler_01")].Dialog.Filename = "Port Guard_dialog.c";
Characters[GetCharacterIndex("quest_smuggler_01")].dialog.currentnode = "Smuggler Talk";
worldMap.playerShipX = -527; //stf(worldMap.islands.Turks.position.rx) + 19.;
worldMap.playerShipZ = -540; //stf(worldMap.islands.Turks.position.rz) + 18.;
worldMap.playerShipAY = 3.0;
worldMap.playerShipActionRadius = 20.0;
worldMap.playerShipDispX = stf(worldMap.playerShipX)- stf(worldMap.islands.Turks.position.rx);
worldMap.playerShipDispZ = stf(worldMap.playerShipZ)- stf(worldMap.islands.Turks.position.rz);
SetNextWeather("Blue Sky");
pchar.quest.position_smuggler_ship.win_condition.l1 = "MapEnter";
pchar.quest.position_smuggler_ship.win_condition = "position_smuggler_ship";
break;
case "position_smuggler_ship":
AddPassenger(Pchar, characterFromID("quest_smuggler_01"), 0);
SetOfficersIndex(Pchar, 1, getCharacterIndex("quest_smuggler_01"));
pchar.quest.Tortuga_Get_ready_for_Film.win_condition.l1 = "location";
pchar.quest.Tortuga_Get_ready_for_Film.win_condition.l1.location = "Tortuga_port";
pchar.quest.Tortuga_Get_ready_for_Film.win_condition = "Tortuga_Get_ready_for_Film";
break;