RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Pirates! Their Back!!! Enjoy.... [RunUO 2.0] [Callador2k's ML SVN]

Sythen

Sorceror
Pirates! Their Back!!! Enjoy.... [RunUO 2.0] [Callador2k's ML SVN]

This script is ingenious! Basically it involves an NPC controlled Pirate Ship that will follow any playermobile boat that gets close enough to it. The captain and crew of this ship will try and kill anyone on board the playermobile ship and even board the playermobile ship if necessary to finish the job! IMO A really true to life NPC pirating system!

What I did was (1) translate the code in this script from German to English; I did this so that server owners can read it more clearly and edit it as needed. (2) I made it so the Pirate Captain can say random phrases from a text file in the Data Folder. (3) The Crew and Captain now display their titles in brackets [Crew] and [Captain]. (4) I fixed an issue with the boat spawning under the water and I fixed an issue with the Captain and Crew spawning on top of each other and unable to move. So now the NPC's move around the deck and the boat will spawn at sea level. And (5) I changed the ship from a small boat to a large dragon ship! I figured that was more appropriate given the role-playing nature of this script.

Instructions: to add a pirate ship simple type: [add PirateCaptain
where ever the captain spawns is where the ship will spawn as well.

Also, you can add a ship without a captain simply by typing: [add PirateShip

I did not change any other features of this script. I think its perfect the way it is. I just felt it needed some touching up and I'm sure you all will appreciate it once you get this script running.

On A Final Note: I just wanted to say that if you download this script, please offer some feedback. Its very hard to determine what needs to be tweaked if no one offers up some ideas. Plus I like to know my work is of some benefit to everyone. I hope everyone enjoys this script as much as I have. :D

ORIGINAL THREAD AND DESCRIPTION

Original Change Log By: haazen
This guy Haazen... who's quoted is quoted below, is a boat scripting guru... meaning he has a ton of releases that just might improve boating on your servers. Click on his name above and check out his threads.

Thank you t.r.schmidt for releasing this. And thank you for allowing us to modify it. I feel obligated to give back a bit of the things I have found and fixed.

When the Captain is deleted or in my case, respawned, the ship now sinks.

I also changed so the ship sinks as soon as the Captain is killed so not having to wait for the next server save to decay.

The pirates that are still alive when the boat sinks, if any, they get killed.

I added pirates that can board the chased ship.

I gave the Captain a bit more hits so harder to kill.

The pirate ship will only target a ship with PlayerMobile on it.

I am still trying to find and fix a way to make it smarter following around land and to possibly return to spawn area when chased ship is removed from the water or for example, crosses the map edges from north to south or east to west.

This is for RunUO 2

Thanks again for releasing this script. It is great.
 

Attachments

  • Pirate Ship System.zip
    5.8 KB · Views: 429
  • Pirate Ship System.rar
    5.6 KB · Views: 312

Sythen

Sorceror
***Reserved For Change Log, Udates, And Script Additions***

**EDIT EDIT EDIT** 10:22 PM - Sorry But I Never Tested This On An OSI Map Until Tonight... Now That I Have, I Found An Issue With Z-Levels And Sea Level... This Is The Fix For It
The Settings For The Ship z-axis levels are in the PirateCaptain.cs script - These Settings Are Set For My Servers Custom Map And Not The OSI Map. To Change The Settings:

Find This Line:

Code:
loc = new Point3D( this.X, this.Y-1, [COLOR="Red"]this.Z[/COLOR] );
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

And Make It Read:

Code:
loc = new Point3D( this.X, this.Y-1,[COLOR="red"] this.Z-5[/COLOR] );
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

This Will Allow You To Place The Boat On The Water Properly On OSI Maps... For Most Custom Maps With Sea Level At 0 - Just Revert It Back To: this.Z Or Simply Edit It To Where Your Sea Level Is From this.Z-127 To this.Z+127.... Consequently Leave The Z+1 Level For 'loccrew' If You're Sea Level Is Z-127 to 0... The 'crew' Will Fall On The Deck. If Your Sea Level Is Higher Then Adjust The 'loccrew' Z level To +2 Above Your Custom Sea Level Z-axis.

TEMPORARY FIX FROM IN-GAME (REQUIRES NO CHANGES)... The Above Modifications Are RECOMMENDED To Permanently Fix This Issue
In-Game You Can Lower The Z-Axis Of The Ship Simply By Typing: [set Z -5 and targeting 1 tile behind the mast. This will lower your entire boat to your desired Z-Axis level :)
 

Thagoras

Sorceror
Yeah, I download that original one. That was fun to modify in German. Talk about having to understand the code to see what's going on. Needed a few adjustments. Nice to see someone translated it to english!
 

Thilgon

Sorceror
I downloaded the original long time ago, and translated it in italian (that's why i didn't release it), but i noticed the pirate ship movement was a bit messed up... i mean: when you spawn it and make it chase you (as a player), everything is fine, but if you let it alone for some time, then make yourself player, it won't chase you.
also, i remember sometimes the ship, instead of following me, started to go along a straight line at massive speed and lost sight of it.

i remember there were 2 versions around, from the same topic, i think... one would chase ANY boat, with or without players on it, and seemed to actually work better, and deleted the ship on captain's death...
the other one, instead, followed only ships with actual player on them, and on captain's death the ship started to wreck, killing all the other pirates on board, until it got underwater and only then get deleted...

i made tests with both, so... have you by any chance solved the "bugs" i'm speaking above? :)
 

Sythen

Sorceror
The First Thing To Note Is That This Script Is Based Off The Second Version In That Thread... Link Above​

I downloaded the original long time ago, and translated it in italian (that's why i didn't release it), but i noticed the pirate ship movement was a bit messed up... i mean: when you spawn it and make it chase you (as a player), everything is fine, but if you let it alone for some time, then make yourself player, it won't chase you.
also, i remember sometimes the ship, instead of following me, started to go along a straight line at massive speed and lost sight of it.

i remember there were 2 versions around, from the same topic, i think... one would chase ANY boat, with or without players on it, and seemed to actually work better, and deleted the ship on captain's death...
the other one, instead, followed only ships with actual player on them, and on captain's death the ship started to wreck, killing all the other pirates on board, until it got underwater and only then get deleted...

i made tests with both, so... have you by any chance solved the "bugs" i'm speaking above?

The Pirate Movement Seems To Be Working Fine. When I First Attempted To Fix This Script I Had The Issues You Mentioned Above With The Pirates Not Following Me. I Soon Realized It Was An Issue With The Z-Axis. It Needs To Be Modified For Every Server You Use This Script On... If Your Sea Levels Varry. Otherwise The Pirates Work As They Are Intended To. Now I Am A Perfectionist When It Comes To Scripts On My Server. So If They Don't Work 100% They Get Put Into An Unused [.bin]... A Place I Keep Scripts That Are Half-Assed Done So That I Can Go Back To Them Later And Try To Fix The Issues I'm Having Seizures Over. :eek:

To Ease Your Mind, These Pirates Will Chase You Down On A Boat... But Only If You're In A Playermobile Boat. Owner Or Not.... Players, Admins, and Owners Will Get Chased, But Only Players Will Die Unless Admin Make Themselves Into Players. As For The Coast Line Bug:

This Seems To Be Working Fine. The Boat Will Follow Me Into the Coast And If I Move Another Direction Will Follow Me In That Direction. Yes You Can Outrun The Boat But It Will Catch Up Eventually Until It Beaches Itself On Another Coast. If You're Out Of Site Then... It Will Give Up Its Pursuit. These Pirates Will Also Board Your Vessel So Be Forewarned. If You Attack The Captain, The Crew Will Teleport Over And 'Respawn' On Your Deck. The Boats Will Sink As Noted Above, Once Sunk They Will Delete Off Your Server. The Only Issue You'll Get Here With The Coast Lines Is If You Sail Into An Inlet... The Pirates Will Block You In... Likewise If They Sail Into An Inlet... They Will Become Stuck Unless You Are Directly Behind Them And Command Your Tillerman To Turn Around And Forward; Even Then I think These Pirates Are Really Land Lubbers In Disguise. Meaning The AI Might Be Too Dumb To Escape An Inlet. :) LOL

I Tested This Script Thoroughly Today. If Something Isn't Working Right, Just Let Me Know And I'll See If I Can Fix It. If Not And I Am Unable To, I Will Ask Help To Fix It Or I Will Kick It To My [.bin] And Work On It When I Know WTF I'm Doing... Which Is A Miracle Ofcourse. :p In A Few Short Words Or Less, I Think This Script Is Better Than The Past Two Versions. I've Not Experienced Any Issues With It The Second Time Around. :)
 

Thagoras

Sorceror
One of the mods I did for my server had to do with the ship key. The pirates would board the boat, kill the players and search the bodies for the key. Once found, they'd take the key and assume ownership of the boat. TRUE Pirates. I also made it so the PirateCaptain would spawn with a key for his boat. So a sneaky player could either steal the key or kill the captain for it. I modified the boat script so the tillerman would only accept commands from the mobile with the key.
 

JamzeMcC

Squire
How many of these will there be on the shard at any time? Is it one for each boat or just one? I found a similar script that my wife wanted to try. Literally 20 minutes after I restarted the server, there were 85 GhostPirateShips on the internal Map. Along with 85 tillerman and 85 planks.... Took it out as I didnt understand wth is was doing or why haha. As for this one, is it just the one or will more appear? Thanks for any info.. Btw it wasnt yours I had the issue with, it was another I saw. Just wanted to see what it did Guess I know now! lol
 

Sythen

Sorceror
ROFL...

You can spawn these ships by adding the PirateCaptain to a MoveSpawner... and setting the Z-Axis of the MoveSpawner to the same level as your playermobile while standing on the deck of a ship. That way when you pass over the MoveSpawner, it will trigger the PirateCaptain to appear!

<Sorry Just Figured That Out Last Night!>

<Now On To Your Questions> hehehe! :p

How many of these will there be on the shard at any time? Is it one for each boat or just one? I found a similar script that my wife wanted to try. Literally 20 minutes after I restarted the server, there were 85 GhostPirateShips on the internal Map. Along with 85 tillerman and 85 planks.... Took it out as I didnt understand wth is was doing or why haha. As for this one, is it just the one or will more appear? Thanks for any info

When Spawned, The Ship Will Appear With The PirateCaptain And His Crew! This Ship Will Only Be In The Game World For As Long As The PirateCaptain Lives... When The PirateCaptain Dies, His Ship Sinks Under The Water. At That Point (When The Ship Is No Longer Visible From The Surface) The Ship Deletes Itself And All Its Components: Mast, Plank, Hull, Hold, etc. This isn't a GhostPirateShip... This is a Living Pirate System And It Is Probably The Best One I've Seen Available. :D
 

tommenquar

Sorceror
This works on RunUO 2.0 Final with only the change noted above. just wanted to let others know.

NOTE: I have only tested this as far as adding them in game and spawning them around. It should be just fine however.
 

PandoraUO

Wanderer
this rules

but the pirates are not following the ship to chase

the ocean Z is at 3 -- so I put


loc = new Point3D( this.X, this.Y-1, this.Z-3 );
loccrew = new Point3D( this.X, this.Y-1, this.Z+3 );

and still no dice
 

Vladamir

Sorceror
PandoraUO;834372 said:
this rules

but the pirates are not following the ship to chase

the ocean Z is at 3 -- so I put


loc = new Point3D( this.X, this.Y-1, this.Z-3 );
loccrew = new Point3D( this.X, this.Y-1, this.Z+3 );

and still no dice

It says in the post...

Find this....
Code:
loc = new Point3D( this.X, this.Y-1, [COLOR="Red"]this.Z-3 );[/COLOR]
loccrew = new Point3D( this.X, this.Y-1, this.Z+3 );

And make it this.
Code:
loc = new Point3D( this.X, this.Y-1,[COLOR="Red"] this.Z-5 );[/COLOR]
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );
 

PandoraUO

Wanderer
Vladamir;834373 said:
It says in the post...

Find this....
Code:
loc = new Point3D( this.X, this.Y-1, [COLOR="Red"]this.Z-3 );[/COLOR]
loccrew = new Point3D( this.X, this.Y-1, this.Z+3 );

And make it this.
Code:
loc = new Point3D( this.X, this.Y-1,[COLOR="Red"] this.Z-5 );[/COLOR]
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

I am saying obviously that didnt work for me, the 3 / 3 I put was the last test I did , sorry should have mentioned that

and double checked for the 5 and 1 - doesnt work. Not sure what I am doing wrong, cause I can jump on their ship and make it move, like the Z isnt making it stuck.
 

Sythen

Sorceror
Try This: If Your Sea Level Is At A (z-axis of -3) then you want your crew to fall on the boat (-3 plus 2 equals -1) thats how you have to configure it. When dealing with negative numbers the lower you go numerically the higher in elevation you get. ;) Haven't looked at the script in a while, but I will say that I had the issue with the boat not moving and it had to do with the z-level of the crew spawn. So I'm pretty sure this should work. Just remember to put your loccrew z to -1 (negative 1) and I think it might even work at z0 as well.

loc = new Point3D( this.X, this.Y-1, this.Z-3 );
loccrew = new Point3D( this.X, this.Y-1, this.Z-1 );

___________________________________________________________

Find This Line:
Code:
loc = new Point3D( this.X, this.Y-1, this.Z );
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

And Make It Read:
Code:
loc = new Point3D( this.X, this.Y-1, this.Z-5 );
loccrew = new Point3D( this.X, this.Y-1, this.Z+1 );

This Will Allow You To Place The Boat On The Water Properly On OSI Maps... For Most Custom Maps With Sea Level At 0 - Just Revert It Back To: this.Z Or Simply Edit It To Where Your Sea Level Is From this.Z-127 To this.Z+127.... Consequently Leave The Z+1 Level For 'loccrew' If You're Sea Level Is Z-127 to 0... The 'crew' Will Fall On The Deck. If Your Sea Level Is Higher Then Adjust The 'loccrew' Z level To +2 Above Your Custom Sea Level Z-axis.
 

lemperor

Sorceror
Pirate Ship Script

Hail All,

I know this is an old thread. Has anyone had problems viewing the contents of the script files at the start of this thread? I'm stumped as to what format these files were saved in, anyone?
 
Top