Hi Everyone,
Since ChezJefrey has not responded for a while It is safe to say that he is taking a break (by his personal file data he is not banned so I don't know why else). Here is the current state of the dutchman quest:
The problem was that Davy Jones wasn't spawning in the cabin which takes us to LAI_Boarding.c for my logic addressing that issue:
I have also attached the log files and here is the test game link:
Meet Google Drive – One place for all your files
Note: This game is the full version of 5.0 as it is now. It is an experimental build of the game and as such those who respond to this topic will get credited for being play testers. Those who help fix it will also be credited to the bug fixing team. Since it is an experimental build there will be stability issues with the game from time to time.
Regards,
Modder01
Since ChezJefrey has not responded for a while It is safe to say that he is taking a break (by his personal file data he is not banned so I don't know why else). Here is the current state of the dutchman quest:
Code:
void DutchEncounterQuestComplete(string sQuestName, string qname)
{
ref chr;
//trace("--- QUEST " + sQuestName + " CHECKED ---");
switch(sQuestName)
{
case "begin_dutchencounter":
//UpdateLogbook
SetQuestHeader("Dutchman");
AddQuestRecord("Dutchman", "1");
trace("*** Slip of Paper Given");
//ReloadLocation
DoQuestReloadToLocation(pchar.location + "_upstairs", "goto", "goto1", "spawn_dutchman");
break;
case "spawn_dutchman":
//login Davy Jones
//generate encounter
int iChar = SpawnDutchman();
Pchar.quest.dutchman_KillJones.win_condition.l1 = "NPC_Death";
Pchar.quest.dutchman_KillJones.win_condition.l1.character = "Davy Jones";
PChar.quest.dutchman_KillJones.win_condition = "dutchman_KillJones";
break;
case "dutchman_KillJones":
//Kill Jones by function
//Play a sound here "Damn you jack sparrow" (sound sample filtered from original movie)
if (CheckAttribute(pchar , "DutchmanRespawn"))
{
trace("Flying Dutchman Killed by Cannonfire");
DeleteAttribute(pchar, "DutchmanRespawn");
SetQuestHeader("Dutchman");
AddQuestRecord("Dutchman", "2_failed");
LAi_group_Delete("FlyingDutchman"); //Sea group
Pchar.quest.dutchman_Respawn.win_condition.l1 = "ExitFromLocation";
Pchar.quest.dutchman_Respawn.win_condition.l1.location = "Grenada";
PChar.quest.dutchman_Respawn.win_condition = "spawn_dutchman";
}
else
{
SetQuestHeader("Dutchman");
AddQuestRecord("Dutchman", "3_captured");
trace("*** Davy Jones Killed by Abordage");
DoQuestCheckDelay("dutchman_dead", 2.0);
}
break;
case "dutchman_dead":
//Tell quest giver in Bridgetown tavern to give reward
characters[GetCharacterIndex("Chat_Quester_1")].dialog.currentnode = "dutchman_reward";
trace("*** Character has been told quest is complete");
break;
}
}
int SpawnDutchman()
{
int iChar = GetCharacterIndex("Davy Jones");
if(iChar < 0) { //New
iChar = GenerateCharacter(PIRATE, WITH_SHIP, "officer", MAN, 1, BOSS);
characters[iChar].id = "Davy Jones";
characters[iChar].name = "Davy";
characters[iChar].location = "Grenada";
characters[iChar].lastname = "Jones";
characters[iChar].model = "pirate_5";
characters[iChar].Ship.Type = GenerateShip(SHIP_DUTCHMAN, 1);
characters[iChar].Ship.Cannons.Type = CANNON_TYPE_CANNON_LBS48;
characters[iChar].ship.name = "The Flying Dutchman";
characters[iChar].skill.cannons = 5;
characters[iChar].skill.grappling = 5;
characters[iChar].skill.accuracy = 5;
characters[iChar].skill.defense = 10;
characters[iChar].rank = 20;
characters[iChar].skill.Fencing = 10;
characters[iChar].skill.Gun = 10;
characters[iChar].cannotsurrender = 1;
FaceMaker(&characters[iChar]);
}
else { //Reset ship attributes (restock HP, ammo, etc.)
SetBaseShipData(GetCharacter(iChar));
}
DeleteAttribute(&characters[iChar], "seaai");
Group_CreateGroup("FlyingDutchman");
Group_AddCharacter("FlyingDutchman", "Davy Jones");
Group_SetGroupCommander("FlyingDutchman", "Davy Jones");
Group_SetPursuitGroup("FlyingDutchman", PLAYER_GROUP);
string sLocator = "Grenada_locators" + (rand(2)+2);
Group_SetAddress("FlyingDutchman", "Grenada", "quest_ships", sLocator);
SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
Group_SetTaskAttack("FlyingDutchman", PLAYER_GROUP);
Group_LockTask("FlyingDutchman");
UpdateRelations();
trace("*** Davy Jones login successful");
return iChar;
}
The problem was that Davy Jones wasn't spawning in the cabin which takes us to LAI_Boarding.c for my logic addressing that issue:
Code:
void LAi_SetBoardingCaptain(string locID)
{
int i;
ref chr;
string model;
string ani;
string bString = "blade";
int xhp;
int locIndex = FindLocation(locID);
int eclass = sti(boarding_enemy.rank);
//Установим врагов
model = LAi_GetBoardingModel(boarding_enemy, &ani);
string sLoc = "aloc" + rand(3);
chr = LAi_CreateFantomCharacterEx(model, ani, "rld", sLoc);
if(pchar.location=="Grenada") {
if(!GetCharacterIndex("Davy Jones") < 0){
ref chr2 = GetCharacterIndex("Davy Jones");
chr.name = chr2.name;
chr.lastname = chr2.lastname;
chr.model = chr2.model;
chr.rank = chr2.rank + 20;
chr.skill.fencing = chr2.skill.fencing;
chr.skill.gun = chr2.skill.gun;
GiveItem2Character(chr, "blade19");
EquipCharacterByItem(chr, "blade19");
GiveItem2Character(chr, "gun6");
EquipCharacterByItem(chr, "gun6");
chr.ship.crew.morale = boarding_enemy.ship.crew.morale;
chr.ship.crew.experience = boarding_enemy.ship.crew.experience;
LAi_SetHP(chr, 500.0, 500.0);
} else {
chr.rank = boarding_enemy.rank;
chr.skill.fencing = boarding_enemy.skill.fencing;
chr.skill.gun = boarding_enemy.skill.gun;
chr.ship.crew.morale = boarding_enemy.ship.crew.morale;
chr.ship.crew.experience = boarding_enemy.ship.crew.experience;
chr.blade = "blade1";
bString=bString + makeint(6+rand(5)-eclass);
chr.blade.itemID = bString;
chr.blade.time = 0.1;
chr.blade.colorstart = argb(128, 22, 46, 190);
chr.blade.colorend = argb(0, 20, 60, 100);
Lai_CharacterChangeEnergy(chr, 100.0);
LAi_NPC_Equip(chr, eclass, true, true);
LAi_SetBoardingCaptainLevelHP(chr);
}
} else {
chr.rank = boarding_enemy.rank;
chr.skill.fencing = boarding_enemy.skill.fencing;
chr.skill.gun = boarding_enemy.skill.gun;
chr.ship.crew.morale = boarding_enemy.ship.crew.morale;
chr.ship.crew.experience = boarding_enemy.ship.crew.experience;
chr.blade = "blade1";
bString=bString + makeint(6+rand(5)-eclass);
chr.blade.itemID = bString;
chr.blade.time = 0.1;
chr.blade.colorstart = argb(128, 22, 46, 190);
chr.blade.colorend = argb(0, 20, 60, 100);
Lai_CharacterChangeEnergy(chr, 100.0);
LAi_NPC_Equip(chr, eclass, true, true);
LAi_SetBoardingCaptainLevelHP(chr);
}
LAi_group_MoveCharacter(chr, LAI_GROUP_BRDENEMY);
//Заставим драться эти 2 группы
LAi_group_FightGroupsEx(LAI_GROUP_PLAYER, LAI_GROUP_BRDENEMY, true, nMainCharacterIndex, -1, false, false);
LAi_group_SetCheckEvent(LAI_GROUP_BRDENEMY);
}
I have also attached the log files and here is the test game link:
Meet Google Drive – One place for all your files
Note: This game is the full version of 5.0 as it is now. It is an experimental build of the game and as such those who respond to this topic will get credited for being play testers. Those who help fix it will also be credited to the bug fixing team. Since it is an experimental build there will be stability issues with the game from time to time.
Regards,
Modder01
Attachments
Last edited: