<!--quoteo(post=257315:date=May 16 2008, 09:27 PM:name=TyDoMaster)--><div class='quotetop'>QUOTE (TyDoMaster @ May 16 2008, 09:27 PM) <a href="index.php?act=findpost&pid=257315"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hello all
I know how to add a new ship into the game, however how do you make that ship unique?
I'll explain what I mean: I want to have the black pearl and the flying dutchman sail around at random. there should be just one of each ship, and if I capture one they should not show up on the map anymore. can anyone please help me do that?
thanks in advance!<!--QuoteEnd--></div><!--QuoteEEnd-->
first of all, in ships_init.c file, add this string below the black pearl description
refship.canencounter = false;
this prevents the ai from adding the pearl to sea encounters, otherwise you may happen to find a merchant fleet escorted by two pearls!!
then you have to create a character. for example, in characters/init/islamona.c add the following lines
makeref(ch,Characters[n]);
ch.id = "Barbossa";
ch.name = "Barbossa";
ch.lastname = "";
ch.nation = PIRATE;
ch.model = "pirat_10";
ch.sex = "man";
ch.model.animation = "man";
ch.location = "";
ch.location.group = "";
ch.location.locator = "";
ch.rank = 60;
ch.experience = 1000000;
ch.loyality = 99;
ch.skill.Leadership = "9";
ch.skill.Fencing = "10";
ch.skill.Gun = "10";
ch.skill.Sailing = "10";
ch.skill.Tactic = "10";
ch.skill.Accuracy = "10";
ch.skill.Cannons = "10";
ch.skill.Grappling = "10";
ch.skill.Repair = "8";
ch.skill.Defence = "10";
ch.skill.Commerce = "5";
ch.skill.Sneak = "9";
ch.money = "10000";
ch.ship.type = generateship(SHIP_blackpearl, 1);
n = n + 1;
you may also edit this character's stats adn skills, and make the battle easier ot tougher. this character is the only one in the game who will sail with the pearl.
now you have to place it somewhere. to do so, you may add these lines in quests\story_line.c, below 'case "begin story line"'
Group_CreateGroup("pearl");
Group_AddCharacter("pearl", "barbossa");
Group_SetGroupCommander("pearl", "barbossa");
Group_SetTaskAttack("pearl", PLAYER_GROUP);
Group_SetAddress("pearl", "islamona", "quest_ships","quest_ship_1");
Group_LockTask("pearl");
(you can replace islamona with another island if you like)
now the pearl will be there, and if you sink it or board it, you won't find another one.
the only problem is that the pearl will stay near that island forever, so you can't find it elsewhere. if you want to find it in open sea at random, that would be more complex, i think... maybe you could add a script that shifts the pearl's location at random, by editing the 'time_events.c' file... i'll think about it <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="

" border="0" alt="smile.gif" />