• 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!

Sword of triton

Captain92

Sailor Apprentice
First ting first, sorry for my bad english, and if i'm wrong to write here. Second how can i make sword of triton more deadly? It's ok to have a speed burst but if I can get more deadly secondary effect...
 
Second how can i make sword of triton more deadly? It's ok to have a speed burst but if I can get more deadly secondary effect...
That is a very general question. What else would you want it to do?
It is a fairly high-level weapon in armed combat as it is.
And in the film, it's only power seems to be to "control the rigging of a ship".
 
And what about command other ships or destroy them? Like destroy the rigging of the enemy ship, this can be result in game as a speed rate decrease of the ship or this rigging exterminate the crew so the number of men is reduced drasticly...
 
Last edited:
"Destroy other ship" is something you can already do if you have the cursed Flying Dutchman in your fleet.
Just "Summon the Kraken".

Your other suggestions do sound possible in theory.
Are you willing to try and make that work yourself?
I can provide clues and suggestions on how, but I have absolutely no time to actually do it myself.
 
Yes I will try to do it my self whit your suggestion, i need only to knoe wich documents must be modiefied and wat code to write
 
Yes I will try to do it my self whit your suggestion, i need only to knoe wich documents must be modiefied and wat code to write
How much coding knowledge to you have?

Relevant files are PROGRAM\BATTLE_INTERFACE\Battle_interface.c and PROGRAM\NK.c .
Search for "Triton", "QAR" and "Kraken" in those files to find find relevant bits.
 
My knowledge of the code is very little...in fact i know how to modify very simply documents like ship init...but i can learn very quickly...
 
i can learn very quickly
That's a good start! :onya

Then I'll recommend that you have a look at this thread:
Tutorial - Modding Tips & Tricks | PiratesAhoy!
Do what is suggested there, then have a look at the two files I mentioned.

That should give you a general idea of how what we have now works and hopefully that'll give you some inspiration for how to tweak it.
If you want to know what certain bits of the code do, you're welcome to ask. :doff
 
Ok I tried to have a look at the documents, but I must admit I'm still too stupid to understand somenting. So certain of the codes do it's higly neeeded and appreciated...:p
 
Ok I tried to have a look at the documents, but I must admit I'm still too stupid to understand somenting. So certain of the codes do it's higly neeeded and appreciated...:p
Have you been able to find the sections relevant Triton/QAR/Kraken sections at all? That would be a start, at least.
If you find those bits and post them here, we can then go over what those sections of code actually do.
 
// PB: Kraken Attack -->
case "BI_KrakenAttack":
BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
BattleInterface.Commands.KrakenAttack.EffectRadius = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
break;
// PB: Kraken Attack <--

// PB: Kraken Attack -->
case "BI_KrakenAttack":
KrakenAttack(Characters[targetNum], GetCharacterShipHP(Characters[targetNum])/100 );
break;
// PB: Kraken Attack <--
// PB: Flying Dutchman -->
case "BI_SubmergeDutchman":
if(!CheckAttribute(PChar, "ship.SubmergeDutchman")) PChar.ship.SubmergeDutchman = PChar.ship.CorrectImmersion;
else PChar.ship.EmergeDutchman = 0;
DeleteAttribute(PChar, "ship.PlayedSplash");
break;
// PB: Flying Dutchman <--

BattleInterface.Commands.KrakenAttack.enable = KrakenAttackEnabled(); // PB: Kraken Attack
BattleInterface.Commands.KrakenAttack.enable = false; // PB: Kraken Attack

// PB: Kraken Attack -->
BattleInterface.Commands.KrakenAttack.enable = false;
BattleInterface.Commands.KrakenAttack.picNum = 19;
BattleInterface.Commands.KrakenAttack.event = "BI_KrakenAttack";
BattleInterface.Commands.KrakenAttack.note = LanguageConvertString(idLngFile, "sea_KrakenAttack");
// PB: Kraken Attack <--

These are all the line I had found in battle.interface
 
bool KrakenAttackEnabled()
{
ref pchar = GetMainCharacter();
ref ch;
if(CheckAttribute(pchar, "KrakenAttack")) return false; // No Kraken attack is available until a set time after the previous attack
if(CheckAttribute(pchar, "ship.SubmergeDutchman")) return false; // No Kraken attack is available while the Dutchman is submerged
for (int i = 0; i <= GetCompanionQuantity(PChar); i++) {
ch = GetCharacter(GetCompanionIndex(pchar, sti(i)));
if(GetAttribute(ch, "ship.type") == "CursedDutchman") return true; // Only the CURSED Flying Dutchman can call upon the Kraken
}
return false;

void KrakenAttack(aref rCharacter, int iSwimQuantity)
// Character and number of tentacles
{
if (!bSeaActive) return;
ref pchar = GetMainCharacter();
int delay = 0;
for (int i=0; i < iSwimQuantity; i++)
{
PostEvent("CreateKrakenTentacle", delay, "i", rCharacter);
delay = delay + rand(1000);
}
if(IsMainCharacter(rCharacter)) LogIt("Captain, we're being attacked by the Kraken!");
else
{
LogIt("Captain, the " + rCharacter.ship.name + " is under attack by the Kraken!");
pchar.KrakenAttack = true;
}
PostEvent("KrakenAttackFinished", delay, "i", rCharacter);
}

#event_handler("KrakenAttackFinished", "FinishKrakenAttack");
void FinishKrakenAttack()
{
ref pchar = GetMainCharacter();
aref rCharacter = GetEventData();
LogIt("Captain, the Kraken has finished its attack on the " + rCharacter.ship.name + "!");
if(CheckAttribute(pchar, "KrakenAttack")) PostEvent("EnableKraken", 5*60*1000);
}

#event_handler("EnableKraken", "KrakenEnabled");
void KrakenEnabled()
{
ref pchar = GetMainCharacter();
DeleteAttribute(pchar, "KrakenAttack");
if(KrakenAttackEnabled()) LogIt("Captain, the Kraken is ready for another attack!"); // Just in case you swap ships
}

#event_handler("CreateKrakenTentacle", "KrakenTentacle");
void KrakenTentacle()
{
if (!bSeaActive) return;
aref rCharacter = GetEventData();
if(CheckAttribute(rCharacter,"Ship"))
{
switch(rand(15))
{
case 0: Direct_AddGood(rCharacter, "Oil", "tentacle1_0", 0.0,105,10+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(135.0)-stf(rCharacter.Ship.Ang.y)); break;
case 1: Direct_AddGood(rCharacter, "Oil", "tentacle1_90", 0.0,105,10+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(225.0)-stf(rCharacter.Ship.Ang.y)); break;
case 2: Direct_AddGood(rCharacter, "Oil", "tentacle1_180",0.0,105,10+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(315.0)-stf(rCharacter.Ship.Ang.y)); break;
case 3: Direct_AddGood(rCharacter, "Oil", "tentacle1_270",0.0,105,10+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(45.0) -stf(rCharacter.Ship.Ang.y)); break;
case 4: Direct_AddGood(rCharacter, "Oil", "tentacle2_0", 0.0,105, 5+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(70.0) -stf(rCharacter.Ship.Ang.y)); break;
case 5: Direct_AddGood(rCharacter, "Oil", "tentacle2_90", 0.0,105, 5+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(160.0)-stf(rCharacter.Ship.Ang.y)); break;
case 6: Direct_AddGood(rCharacter, "Oil", "tentacle2_180",0.0,105, 5+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(250.0)-stf(rCharacter.Ship.Ang.y)); break;
case 7: Direct_AddGood(rCharacter, "Oil", "tentacle2_270",0.0,105, 5+rand(40),Degree2Radian(rand(20)-10)+Degree2Radian(340.0)-stf(rCharacter.Ship.Ang.y)); break;
case 8: Direct_AddGood(rCharacter, "Oil", "tentacle3_0", 0.0,105,10+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(90.0) -stf(rCharacter.Ship.Ang.y)); break;
case 9: Direct_AddGood(rCharacter, "Oil", "tentacle3_90", 0.0,105,10+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(180.0)-stf(rCharacter.Ship.Ang.y)); break;
case 10: Direct_AddGood(rCharacter, "Oil", "tentacle3_180",0.0,105,10+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(270.0)-stf(rCharacter.Ship.Ang.y)); break;
case 11: Direct_AddGood(rCharacter, "Oil", "tentacle3_270",0.0,105,10+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(0.0) -stf(rCharacter.Ship.Ang.y)); break;
case 12: Direct_AddGood(rCharacter, "Oil", "tentacle4_0", 0.0,105, 5+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(90.0) -stf(rCharacter.Ship.Ang.y)); break;
case 13: Direct_AddGood(rCharacter, "Oil", "tentacle4_90", 0.0,105, 5+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(180.0)-stf(rCharacter.Ship.Ang.y)); break;
case 14: Direct_AddGood(rCharacter, "Oil", "tentacle4_180",0.0,105, 5+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(270.0)-stf(rCharacter.Ship.Ang.y)); break;
case 15: Direct_AddGood(rCharacter, "Oil", "tentacle4_270",0.0,105, 5+rand(20),Degree2Radian(rand(20)-10)+Degree2Radian(0.0) -stf(rCharacter.Ship.Ang.y)); break;
}
}
}

#event_handler("UpdateDutchmanSubmersion", "SubmergeDutchman");

void SubmergeDutchman()
{
aref rCharacter = GetEventData();

if(CheckAttribute(rCharacter, "ship.SubmergeDutchman"))
{
float fX, fY, fZ, fAY, gX, gY, gZ;
fX = 0; fY = 0; fZ = 0;
if(CheckAttribute(rCharacter,"Ship.pos.x")) fX=stf(rCharacter.Ship.pos.x);
else return;
if(CheckAttribute(rCharacter,"Ship.pos.y")) fY=stf(rCharacter.Ship.pos.y);
else return;
if(CheckAttribute(rCharacter,"Ship.pos.z")) fZ=stf(rCharacter.Ship.pos.z);
else return;
if(CheckAttribute(rCharacter,"Ship.Ang.y")) fAY=stf(rCharacter.Ship.Ang.y);
else return;
rCharacter.firedrill = true;
if(!CheckAttribute(rCharacter, "ship.EmergeDutchman"))
{
rCharacter.ship.SubmergeDutchman = makefloat(rCharacter.ship.SubmergeDutchman) + 0.35;
if(!CheckAttribute(rCharacter, "ship.PlayedSplash"))
{
rCharacter.ship.PlayedSplash = 1;
gX = 0; gY = 0; gZ = 30;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 5; gY = 0; gZ = 20;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = -5; gY = 0; gZ = 20;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 5; gY = 0; gZ = 10;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = -5; gY = 0; gZ = 10;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 5; gY = 0; gZ = 0;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = -5; gY = 0; gZ = 0;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 5; gY = 0; gZ = -10;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = -5; gY = 0; gZ = -10;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 5; gY = 0; gZ = -20;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = -5; gY = 0; gZ = -20;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
gX = 0; gY = 0; gZ = -30;
CreateParticleSystemX("dutchman_submerge",fX - gX*cos(fAY) + gZ*sin(fAY), fY + gY, fZ + gX*sin(fAY) + gZ*cos(fAY), 0.0, 3.0, 0.0, 2);
PlayStereoSound("objects\shipcharge\take_prey.wav");
}
if(stf(rCharacter.ship.SubmergeDutchman) >= 53)
{
rCharacter.ship.SubmergeDutchman = 53;
}
rCharacter.ship.immersion = rCharacter.ship.SubmergeDutchman;
}
else
{
rCharacter.ship.SubmergeDutchman = makefloat(rCharacter.ship.SubmergeDutchman) - 0.30;
if(stf(rCharacter.ship.SubmergeDutchman)-50 <= stf(rCharacter.ship.CorrectImmersion) && !CheckAttribute(rCharacter, "ship.PlayedSplash"))

This is what i had found in nk.c about the kraken and flying dutchman special abilieties
 
If I recall, this code makes a "general icon" show up in the on-sea [ENTER] menu:
Code:
        case "BI_QARSword":
            BI_retComValue = 0;
        break;

While this gives a choice menu to select a "target ship":
Code:
        case "BI_KrakenAttack":
            BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
            BattleInterface.Commands.KrakenAttack.EffectRadius    = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
        break;
If you want to specifically target other ships' rigging, you'll need that second one.

Then this code starts and stops the Sword of Triton speed burst:
Code:
    case "BI_QARSword":
        if(IsPerkIntoList("QARSword"))
        {
            pchar.Ship.Impulse.Rotate.z = 0.0;
            DelPerkFromActiveList("QARSword");
            PChar.ship.speedburst = "QARSword";
            PostEvent("SpeedBurstFinished",120000, "i", pchar);
        }
        else
        {
            AddPerkToActiveList("QARSword");
            PChar.Ship.Impulse.Rotate.z = 0.16; // = 8 knots max
        }
    break;
While this instead calls up a Kraken Attack on the targeted ship:
Code:
    case "BI_KrakenAttack":
        KrakenAttack(Characters[targetNum], GetCharacterShipHP(Characters[targetNum])/100 );
    break;
So again, replace the current QAR code with something resembling that KrakenAttack bit.

Maybe it is even as simple as using this:
Code:
        case "BI_QARSword":
            BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
            BattleInterface.Commands.KrakenAttack.EffectRadius    = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
        break;
And:
Code:
    case "BI_QARSword":
       float fDamageMultiply = 0.5;
       ref        rShip = GetShipByType(GetCharacterShipType(&Characters[targetNum]));
       float fBaseSailHP = stf(rShip.SP);
       MakeSailDmg(targetNum, fDamageMultiply * (fBaseSailHP / 100.0) * 0.05);
    break;
I have not tested this and, unfortunately, applying sail damage is less straightforward than applying hull or crew damage.
But something it should at least be something similar to what I suggest above. :doff
 
For the record, even if it does work, it is still quite basic.
The amount of damage should be tweaked.
And probably a time limit imposed to prevent it from being overpowered.
 
Only a question...thesse commands that you wrote yesterday...are only for nk.c file or for both nk.c and battle_intreface file?
 
Back
Top