You've fallen overboard in a storm, been washed ashore on Bonaire, made your way to the pirate fort and had an argument with Anacleto. He draws a gun and puts a small hole in you. You draw a better gun and put a big hole in him, and he drops dead. A pirate walks in, takes one look at the scene and walks back out without saying a word.
The problem is that if a fight ends with a gunshot instead of a sword swipe, usual methods of disarming the player - including a simple 'LAi_SetFightMode(PChar, false)' - don't seem to work. And if someone tries to initiate a dialog while you have weapons drawn, the dialog fails and quits at once, which leads to a variety of bugs and exploits but that's another story.
So, at the end of case "kill_anacleto_complete", I've added this:
The commented out lines are the original code. I'm not sure how much of the new stuff is really necessary or whether there's a tidier way to do it, but that works because I tried it - I reloaded the scene, shot Anacleto, and with that code in place I then automatically put away my weapons and the pirate says his piece.
So now you get Anacleto's ship - or do you? Here's the code to give you the ship:
The line added by KK is ineffective because 'SetBaseShipData' sets the ship to your nation. The line 'SetCrewQuantity(pchar,200)' is a relic from the stock game in which a pinnace had a crew of over 300, while ours has a crew of a little over 100. And in any case this whole lot is unnecessarily complicated because there's a neat function to do the job properly, and the original authors knew about it because they used it for a different purpose. 'ExchangeCharacterShip(Pchar, characterFromID("Ship Storage"))' gives your ship to a dummy character whose entire purpose is to look after the ship when it's taken from you, e.g. because you fell overboard. A similar line later gives you the ship back. It also works to take someone else's ship. So, in both cases "kill_anacleto_complete" and "kill_anacleto_complete_2", comment out or remove those five lines and add:
And now you get Anacleto's actual ship.
The problem is that if a fight ends with a gunshot instead of a sword swipe, usual methods of disarming the player - including a simple 'LAi_SetFightMode(PChar, false)' - don't seem to work. And if someone tries to initiate a dialog while you have weapons drawn, the dialog fails and quits at once, which leads to a variety of bugs and exploits but that's another story.
So, at the end of case "kill_anacleto_complete", I've added this:
Code:
// LAi_SetStayType(pchar);
// LAi_SetPlayerType(pchar);
LAi_SetFightMode(PChar, false); // GR: If player kills Anacleto with one shot, player isn't automatically disarmed, so force it
LAi_SetActorType(PChar);
LAi_type_actor_Reset(PChar);
LAi_ActorWaitDialog(PChar, sld);
LAi_ActorDialog(sld, pchar, "sld_exit_from_pirate_tavern", 3.0, 1.0);
So now you get Anacleto's ship - or do you? Here's the code to give you the ship:
Code:
pchar.ship.type = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].ship.type;
pchar.ship.name = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].ship.name;
pchar.ship.nation = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].nation; // KK
SetCrewQuantity(pchar, 200);
SetBaseShipData(pchar);
Code:
ExchangeCharacterShip(Pchar, characterFromID("Anacleto Rui Sa Pinto"));