• New Horizons on Maelstrom
    Maelstrom New Horizons


    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!

Mod Release Age of Pirates: Caribbean Tales - Historical Immersion Supermod

I also want checked how I plan to set up the character "Davy Jones" so the Dutchman can sail around the island Grenada when the player enters Grenada sea. The ship itself is linked properly and it plays wonderfully. The "refship.canencounter" is already set to false. Common.ini addition successful without incident.

Here is the codes I plan to introduce:

Add to "quests\story_line.c"
Code:
        iChar = GenerateCharacter(PIRATE, WITH_SHIP, "officer", MAN, 1, BOSS);
        characters[iChar].id = "Davy Jones";
        characters[iChar].name = "Davy";
        characters[iChar].lastname = "Jones";
        characters[iChar].model = "pirate_5";
        characters[iChar].Ship.Type = GenerateShip(SHIP_DUTCHMAN, 1);
        characters[iChar].ship.name = "The Flying Dutchman";
        characters[iChar].skill.Fencing = 10;
        characters[iChar].skill.Gun = 10;
        LAi_SetHP(CharacterFromID("Davy Jones"), 1000.0, 1000.0);
        GiveItem2Character(CharacterFromID("Davy Jones"), "blade15");
        EquipCharacterByItem(CharacterFromID("Davy Jones"), "blade15");
        characters[iChar].cannotsurrender = 1;
        break;

        //start check: exit to grenada sea
        pchar.quest.Exit_to_G_sea.win_condition.l1 = "location";
        pchar.quest.Exit_to_G_sea.win_condition.l1.location = "Grenada";
        pchar.quest.Exit_to_G_sea.win_condition = "Exit to G sea";
        break;

        case "Exit to G sea":
        //generate encounter
            iChar = GetCharacterIndex("Davy Jones");
            DeleteAttribute(&characters[iChar], "seaai");
            Group_CreateGroup("dutchman");
            Group_AddCharacter("dutchman", "Davy Jones");
            Ship_SetTaskDefend(PRIMARY_TASK, iChar);
            SetCharacterRelation (iChar, RELATION_FRIEND);
            Group_SetGroupCommander("dutchman", "Davy Jones");
            string sLocator = "quest_ship_1" + (rand(2)+4);
            Group_SetAddress("dutchman", "grenada", "quest_ships", "quest_ship_1");
            SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
            Group_SetTaskAttack("dutchman", PLAYER_GROUP);
            Group_LockTask("dutchman");
            UpdateRelations();

            //start check: kill ships
            pchar.quest.Kill_ships.win_condition.l1 = "npc_death";
            pchar.quest.Kill_ships.win_condition.l1.character = iChar;
            pchar.quest.Kill_ships.win_condition = "Ship dead";
            trace("!!! sea spawned");
            break;

            //start check: kill boss
            LAi_SetCheckMinHP(CharacterFromID("Davy Jones"), 200.0, 0, "Killed Jones");
  
            case "Ship dead":
            //start check: exit to grenada sea
            pchar.quest.Exit_to_G_sea.win_condition.l1 = "location";
            pchar.quest.Exit_to_G_sea.win_condition.l1.location = "Grenada";
            pchar.quest.Exit_to_G_sea.win_condition = "Exit to G sea";
            break;

            case "Killed Jones";
            //set SL var
            sStory = "quest_done";
            GiveItem2Character(pchar, "blade19");
            break;
 
Last edited:
I wished someone with specific knowledge of AoP/CoAS would have a look here. I do know about PotC, which is similar, but has been so heavily modded that things aren't quite the same anymore.
 
Guess it's plug and chug for the story_line. There was a thread addressing the sail issue, but I can't find it anymore. I lowered the pirate boss difficulty, he was too overpowered for someone even with a unique sabre. Now when you kill Krieger he gives you Blackbeard's Sword (used to be called "Scar"). I also documented all the cheats. Both Krieger and Jones are using the "Wasp", the highest non-unique sword in the game.

Everything seems to be working fine. I haven't added the code I pasted here for the Dutchman, but I plan to test it soon.

The encounter with the Flying Dutchman is supposed to be encountered late game, when the player already has Blackbeard's Sword from Krieger or has cheated for the best stuff (Duelist's Dream, Astralaid, Exquisite Spyglass).

I'm also planning to make the cheats accessible as a reward for defeating Krieger (only the gold and weapon/item cheats though). The cheats related to relations with other colonies will remain hidden.
 
Last edited:
I added the Items:
1. slip of paper (Davy Jones Quest) (ID = pslip)
2. Cheat List (reward for killing Krieger) (ID = cheatlist)

Here is the code that includes the dialogue for the quester in Bridgetown tavern so that a quest and the dialogue could be combined without potentially voiding the "story_line".:)
Code:
void ProcessDialogEvent()
{
ref NPChar, PChar, d;
PChar = GetMainCharacter();
aref Link, NextDiag;
DeleteAttribute(&Dialog,"Links");

makeref(NPChar,CharacterRef);
makearef(Link, Dialog.Links);
makeref(d, Dialog);
makearef(NextDiag, NPChar.Dialog);

switch(Dialog.CurrentNode)
{
case "First Time":
d.Text = "Hello, captain! Will you join an old drunkard? I cannot wish you kind morning, Because I went out to take a leak!";
Link.l1 = "(To listen further)";
Link.l1.go = "next1";
Link.l2 = "For a long time I did not belive it, an old drunkard?! Barman! It is time for this person to be freshened!";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next1":
d.Text = "What is the date today, captain? Eh? Not important I know. I knew the person said to me hurry up? No, it is not necessary to answer. It was a rhetorical question!";
Link.l1 = "(To listen further)";
Link.l1.go = "next2";
Link.l2 = "It is time for you to sober up.";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next2":
d.Text = "You decide to keep me company? Look! Bad luck is infectious! You will soon be the same wreck as I!";
Link.l1 = "This does not threaten me, I already knew the risks when I walked into this establishment.";
Link.l1.go = "next3";
Link.l2 = "This is ridiculous! (Go and do something else)";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next3":
d.Text = "Look, captain! Look! Here is a man! Corona of the gods creation! He is pity and drunk, disturbs no one, earns fairly to itself on an old age, to grandsons in diapers. And suddenly, all was changed! By the same foresight, which leaves you without the half gold coin in the purse. It appears, You do believe, captain, but I do not have money even to confess. Are you ready to become my posthumous pastor?";
Link.l1 = "I am preared to hear you out, my son! Go on!";
Link.l1.go = "next4";
Link.l2 = "Barman! Do this poor soul a favor! Give him some fresh air!";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next4":
d.Text = "Here and now! In this dirty tavern, in the God forgotten sea, were angels casting down their golden crowns among these smelly seamen-drunkards. I shall tell you a story, captain. Are you ready to glance into the past and see your the terrible future?";
Link.l1 = "I listen to you, drunkard. Go on!";
Link.l1.go = "next5";
Link.l2 = "(Run! You didn't catch madness from this strange person!)";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next5":
d.Text = "Many years ago I entered as captain for a ship. The commonplace beginning of history, am I correct? But the vessel was very old, legends circulated about it. I have heard one of these rumors in a god forgotten tavern on one of these colonies. I do not remember on what colony. But it is not important. It is more than resembled the anecdote, I was spoken about the first captain of an old tramp on which I then served. During those gray times this I thought was a contemporary fighting ship! Not known to defeat!";
Link.l1 = "I see, you sober in your eyes! Will you tell me about all your life? Can you begin with the secret of your vessel?";
Link.l1.go = "next6";
Link.l2 = "Ach! I wouldn't dare hear your stories, even if I was a pastor. Go and confess to the Lord and save yourself from eternal damnation!";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next6":
d.Text = "In what there was a secret of this vessel, you ask? The Captain did not give an answer. I began to ask an old seaman, who served on my vessel, The first captain of The Dutchman, thus was called the ship on the story of decrepit spinner, he concluded a transaction with Calypso a seagoddess. Such histories are now popular, I know. But you did hear, so that the sea witch would be moved into port and would tempt the captain!";
Link.l1 = "What did Calypso want? How did the captain make a deal with him?";
Link.l1.go = "next7";
Link.l2 = "Excuse me, but it is time for me to go to the ship. Business awaits.";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next7":
d.Text = "Calypso simply wanted to be entertained, but captain it proved to be not oversight! Believe it or not, she did not know what it would do. The son of darkness accustomed to terrestrial joys, has got dependence on Calypso!  The captain then married her. Trust it or not, but to be released from this twice vicious communication the she promised to the captain to execute his any desire.";
Link.l1 = "And the captain wished, his ship could never be touched by cannon fire?";
Link.l1.go = "next8";
Link.l2 = "You have bothered me with stories of your imagination! Bartender, give him some water!";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next8":
d.Text = "Yes, captain. Yes! What any person enamoured by the sea could wish! His ship was granted invulnerability with only one payment, to ferry lost souls of the dead and/or dying sailors to the next world in peace. The Captain, after 10 years, when he could come ashore to be with his wife, his wife wasn't there. Engraged and feeling betrayed, he gave up his debt to Calypso and now is forever cursed. The first chance I got I escaped the wretched ship. I was identified at every port I came to, but when I was able to settle down I started seeking my old ship where many of my best mates lost their lives!";
Link.l1 = "Is it all? Do you cry for your shipmates?";
Link.l1.go = "next9";
Link.l2 = "I shall go I shall find and check up on the ship. If it even misses me! Bartender! Get this man some lodgings I'll give ya 20 paisters for a four night stay.";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next9":
d.Text = "No! This is not the end! I served as the fifth first mate of that vessel. As I already spoke, It was an ancient tubby ship. We constantly got into storms! The life on that ship was not sweet. Once after a storm we have appeared near to a tiny island on which an Indian died of famine. To me and it was not possible to achieve from it the answer to the question I seek. It did not know any of the civilized languages. But once at night the body awoke and commanded in terrible shouts! The sailors were so malicious, that they nearly would have thrown it overboard if it weren't for me.";
Link.l1 = "This is getting more interesting by the second! Go on!";
Link.l1.go = "next10";
Link.l2 = "It is necessary for you to go to the doctor, Drunkenness can be a fatal illness! I shall go I shall find somebody.";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next10":
d.Text = "Only by efforts of the captain it was possible to stop them. Better sailors would throw out the native overboard! Then he could not show us what he knew. On a lower deck there was a pantry filled up by old ropes. The native found in that pantry a secret door for which was the captain's sanctuary for Calypso! The native was in horror, he continuously spent hours doing rituals. But what happened next began later! Naturally,  all the junk from that room was thrown out to sea. But in the week the native took his own life. Within six months we wandered in the sea on cards for a long time! To fear I had suffered much in those days! All the time I attended the terrible visions, which I fear to recall, and especially to describe.";
Link.l1 = "(To listen further)";
Link.l1.go = "next11";
Link.l2 = "Devils hide behind a mental screen of vain imaginations! I will have the pastor perform an exorcism!";
Link.l2.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "next11":
d.Text = "Thank you captain! Thank you for listening to me. I did not think that to me it would be easier to live after I have told my story. I still was surprised that it was possible to live in general before today! Here. Take this money as my gratitude for that help which you have rendered me. I stored this gold to the funeral, but, I think, I should not yet pass over to the promised land. Here's a paper about the whereabouts of my ship.";
Link.l1 = "Keep your money. We will descend to the priest together and confess before god. All the stigma and stench of sin will be buried, The Father shall save his people from their sins, as the Judge of atonement. I will find this ship that you speak of and bring it back to you. (+20,000 Experience and +10,000 Gold)";
Link.l1.go = "Exp";
Link.l2 = "Thank you kindly sir for letting me listen to your stories. Keep half of what you intend to give me. The rest you shall donate to the pastor. Even a small donation will forgive you of your sins in God's eyes. I will find this ship that you speak of and bring it back to you. (+20,000 Gold and +10,000 Experience)";
Link.l2.go = "Money";
Link.l3 = "Enough! Enough of this madness! Keep your money. You were meant to rot in Lucifer's hot hell forever while you beg your god forgiveness. Bartender! This man needs some coffee. Give him a round on my tab.";
Link.l3.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "Lose":
d.Text = "Do not prevent me to drink for my lost shipmates!";
Link.l1 = "Keep well, drunkard!";
Link.l1.go = "exit";
NextDiag.TempNode = "Lose";
break;

case "Win":
d.Text = "Hello, captain! How is your life?";
Link.l1 = "Perfectly, my friend! Perfectly!";
Link.l1.go = "exit";
NextDiag.TempNode = "Win";
break;

case "Money":
NextDiag.CurrentNode = "Win";
DialogExit();
pchar.money = makeint(pchar.money) + 20000;
pchar.Experience = makeint(pchar.Experience) + 10000;
break;

case "Exp":
NextDiag.CurrentNode = "Win";
DialogExit();
pchar.money = makeint(pchar.money) + 10000;
pchar.Experience = makeint(pchar.Experience) + 20000;
break;

case "exit":
NextDiag.CurrentNode = NextDiag.TempNode;
DialogExit();
break;

If NextDiag.CurrentNode = "Win";
GiveItem2Character(pchar, "pslip");
break;

//start check: exit to sea
pchar.quest.Exit_to_sea.win_condition.l1 = "location";
pchar.quest.Exit_to_sea.win_condition.l1.location = "Barbados";
pchar.quest.Exit_to_sea.win_condition = "Exit to sea";
break;

        case "Exit to sea":
        iChar = GenerateCharacter(PIRATE, WITH_SHIP, "officer", MAN, 1, BOSS);
        characters[iChar].id = "Davy Jones";
        characters[iChar].name = "Davy";
        characters[iChar].lastname = "Jones";
        characters[iChar].model = "pirate_5";
        characters[iChar].Ship.Type = GenerateShip(SHIP_DUTCHMAN, 1);
        characters[iChar].ship.name = "The Flying Dutchman";
        characters[iChar].skill.Fencing = 10;
        characters[iChar].skill.Gun = 10;
        LAi_SetHP(CharacterFromID("Davy Jones"), 1000.0, 1000.0);
        GiveItem2Character(CharacterFromID("Davy Jones"), "blade15");
        EquipCharacterByItem(CharacterFromID("Davy Jones"), "blade15");
        characters[iChar].cannotsurrender = 1;
        break;
 
     //start check: exit to grenada sea
        pchar.quest.Exit_to_G_sea.win_condition.l1 = "location";
        pchar.quest.Exit_to_G_sea.win_condition.l1.location = "Grenada";
        pchar.quest.Exit_to_G_sea.win_condition = "Exit to G sea";
        break;

     case "Exit to G sea":
        //generate encounter
            iChar = GetCharacterIndex("Davy Jones");
            DeleteAttribute(&characters[iChar], "seaai");
            Group_CreateGroup("dutchman");
            Group_AddCharacter("dutchman", "Davy Jones");
            Ship_SetTaskDefend(PRIMARY_TASK, iChar);
            SetCharacterRelation (iChar, RELATION_FRIEND);
            Group_SetGroupCommander("dutchman", "Davy Jones");
            string sLocator = "quest_ship_1" + (rand(2)+4);
            Group_SetAddress("dutchman", "grenada", "quest_ships", "quest_ship_1");
            SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
            Group_SetTaskAttack("dutchman", PLAYER_GROUP);
            Group_LockTask("dutchman");
            UpdateRelations();

            //start check: kill ships
            pchar.quest.Kill_ships.win_condition.l1 = "npc_death";
            pchar.quest.Kill_ships.win_condition.l1.character = iChar;
            pchar.quest.Kill_ships.win_condition = "Ship dead";
            trace("!!! sea spawned");
            break;

            //start check: kill boss
            LAi_SetCheckMinHP(CharacterFromID("Davy Jones"), 200.0, 0, "Killed Jones");

            case "Ship dead":
            //start check: exit to grenada sea
            pchar.quest.Exit_to_G_sea.win_condition.l1 = "location";
            pchar.quest.Exit_to_G_sea.win_condition.l1.location = "Grenada";
            pchar.quest.Exit_to_G_sea.win_condition = "Exit to G sea";
            break;

            case "Killed Jones";
            GiveItem2Character(pchar, "blade19");
            GiveItem2Character(pchar, "gun6");
            TakeItemFromCharacter(pchar, "pslip");
            break; 
}
}
 
Last edited:
I've hit a snag.:modding

The Quest that I did is coming back with errors:
I put it in a unique .c file because the dialog file couldn't handle it.
I fixed them so it would not generate a critical runtime error, but it is still not working.

The Quest is linked to quests.c
I have Notepad++

What I want:
I want the quest to start at the same time the main quest starts, but not interfere with the Storyline.
I want the quest when the player >= rank 2 he will get the slip of paper. Then an encounter will generate the Flying Dutchman circling around the island Grenada.
The quest will then check if the ship is sunk, or the Captain is dead from you killing him while boarding.
If the ship is sunk, the quest will reload the encounter when you refresh the Grenada sea.
If the Captain is killed the quest will remove the slip of paper from your person signifying the quest is done and replace it with a unique sword and a 4 barreled pistol.

Here is the new code (i don't know how to debug in relation to the game):
Code:
{
    //login Davy Jones
    iChar = GenerateCharacter(PIRATE, WITH_SHIP, "officer", MAN, 1, BOSS);
    characters[iChar].id = "Davy Jones";
    characters[iChar].name = "Davy";
    characters[iChar].lastname = "Jones";
    characters[iChar].model = "pirate_5";
    characters[iChar].Ship.Type = GenerateShip(SHIP_DUTCHMAN, 1);
    characters[iChar].ship.name = "The Flying Dutchman";
    characters[iChar].skill.Fencing = 10;
    characters[iChar].skill.Gun = 10;
    LAi_SetHP(CharacterFromID("Davy Jones"), 1000.0, 1000.0);
    GiveItem2Character(CharacterFromID("Davy Jones"), "blade15");
    EquipCharacterByItem(CharacterFromID("Davy Jones"), "blade15");
    characters[iChar].cannotsurrender = 1;

            if (characters[pchar].rank) >= 2;
            GiveItem2Character(pchar, "pslip");
           
                //generate encounter
                iChar = GetCharacterIndex("Davy Jones");
                DeleteAttribute(&characters[iChar], "seaai");
                Group_CreateGroup("dutchman");
                Group_AddCharacter("dutchman", "Davy Jones");
                Group_SetGroupCommander("dutchman", "Davy Jones");
                Group_SetAddress("dutchman", "grenada", "quest_ships", "quest_ship_1");
                SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
                Group_SetTaskAttack("dutchman", PLAYER_GROUP);
                Group_LockTask("dutchman");
                UpdateRelations();

                //start check: kill ships
                pchar.quest.Kill_ships.win_condition.l1 = "npc_death";
                pchar.quest.Kill_ships.win_condition.l1.character = iChar;
                pchar.quest.Kill_ships.win_condition = "Ship dead";
                trace("!!! sea spawned");

            //start check: kill boss
            LAi_SetCheckMinHP(CharacterFromID("Davy Jones"), 200.0, 0, "char_dead");

        case "Ship dead":
        //generate encounter
        iChar = GetCharacterIndex("Davy Jones");
        DeleteAttribute(&characters[iChar], "seaai");
        Group_CreateGroup("dutchman");
        Group_AddCharacter("dutchman", "Davy Jones");
        Group_SetGroupCommander("dutchman", "Davy Jones");
        Group_SetAddress("dutchman", "grenada", "quest_ships", "quest_ship_1");
        SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
        Group_SetTaskAttack("dutchman", PLAYER_GROUP);
        Group_LockTask("dutchman");
        UpdateRelations();
        break;

    case "char_dead":
    GiveItem2Character(pchar, "blade19");
    GiveItem2Character(pchar, "gun6");
    TakeItemFromCharacter(pchar, "pslip");
    break;
}

I rarely edit/code quests.
Pieter, Should I address this issue in a separate (need help) topic?
 
Last edited:
Indeed a new thread might be a good idea. It seems like nobody but me reads this thread and I don't have time to help just yet.
However, I will be returning home in a few days so should hopefully be able to provide a bit more support then.
 
This thread has almost 1,800 views in about 5 weeks, so it is hard to say no one is watching this. :popcorn:

The interest is there but not the comments. :cheers
 
I'll create a new thread to see if anyone has any experience with creating a quest from scratch. COAS is very similar, in fact the coding is near identical to the original AoP.
 
The code is also pretty close to PotC, so once I do get home, I should be able to provide some assistance. I hope.
You could also try sending a PM to Jack Rackham and/or Bartolomeu o Portugues. They have done a lot of quest coding for PotC.
 
So I'm back home! Now what needs doing for that installer of yours? :cheers
 
I have the installer covered. I'm going to make the installer self extracting. I just need to iron out the quest and all will be fine.
 
You mean a 7-Zip self-extracting installer? That would work as well, of course.
I made my first installers that way too, though managed to figure out a more professional method several years later.
 
You mean a 7-Zip self-extracting installer? That would work as well, of course.
I made my first installers that way too, though managed to figure out a more professional method several years later.
Yes That is exactly it. There was a more elaborate installer for the original supermod, but since I blitzed it and you were busy I thought a self-extracting archive would suffice at least for now. I think we (Bart and Jack) are reaching a turning point in the quest.
 
As I was saying, I'm not so busy anymore. So I can help you with a "fancy" installer if you want.
Anyway, that's all up to you. :doff
 
Interesting project, I'm really curious to see your final product Modder01. I was always a bit disappointed that this game never got the attention it deserved. There were really some things that it did better than POTC. It's unfortunate they decided to saddle it with Starforce.
 
Hi.

Downloaded and tried what you've done so far.

It is very much like the old Supermod so far. New ships, some new posibillities, marred by oddball stuff and terrible English grammar. What's the point of the drunkard in the inn? The English he relays his tale in, is so bad that I have a hard time understanding what's written and the XP you receive doesn't actually do anything. Same with the shipyard vendors. Awful english, although you ~have~ removed the screeching voices from the old Supermod and that is a very good thing.

You should have someone go through the writing with a very fine sieve and fix the odd stuff or remove it.

I'll try it again in a few weeks. Good luck and thanks for the effort. :)
 
Back
Top