If you talk to one of the regulars in a tavern which has regulars, he'll randomly either want to drink or gamble with you. Gambling has been getting all the attention lately. Time to look at the other option.
I'd noticed that, near the top of "Habitue_dialog.c", there are a list of taverns for which quests are allowed. I found out what that's for. If the guy at the table chooses to drink, the conversation can go various ways. He can ask for another drink, he can accuse you of trying to steal his money, or he can ask you to help with a soldier who offended him, which you decline. If quests are allowed then there are a few other options. You can pass out, be robbed and be woken by the tavern girl; you can be attacked by a would-be mugger; or you can choose to help your drinking partner with the offensive soldier. Since I added tavern partners to Port au Prince, Santiago and Havana, I've started by adding the necessary code to "quests_common.c" for these taverns, and ended up rewriting a lot of the existing code.
If you choose to help with the soldier, you get teleported outside the tavern, where you meet a soldier character specifically set up for the encounter. There's one soldier for each different tavern. Rather than define yet more soldier characters who only serve one purpose, I created a single character "Drink Soldier" and customised him for each of the newly added taverns. Then I changed the previously existing taverns to use the same character. This means the individual soldiers can be removed, freeing up some character slots. They all have the same dialog for the encounter anyway so it doesn't matter that they're all the same character using the same new, small dialog file. The exceptions are the pirate soldiers in Nevis Pirate Settlement and Bonaire Pirate Fort, who use a different, more piratey dialog.
The case in which you pass out and the tavern girl then tells you that you've been robbed is even easier. Instead of numerous quest cases for each tavern, I've been collapsing almost all of them into one piece of code which uses 'GetTownOfficiant(GetCurrentTownID())' to figure out who the local tavern girl is. The exception is the brothel in Nevis Pirate Settlement which will still have its own code as it doesn't use the town officiant - she's in the tavern along the street.
And then I found a piece of weirdness in Santiago tavern. When I talked to the new drinker/gambler and sat down, the room went very dark. A bit of experimenting with console to teleport me to various locators showed that both the "sit" locators on the left of the tavern facing towards the back did this. If I used TOOL to turn them round to face the front of the tavern, they worked fine. OK, this is stupid, so try a stupid solution. To turn a locator to face backwards, you change its XX and ZZ values to -1. I changed them to -0.99, then changed XZ and ZX to 0.01 to compensate - and it worked!
Now I'm on a pub crawl to check that the various encounters work properly in every tavern which I've changed. A lot of rum is going to be involved. Hic!
I'd noticed that, near the top of "Habitue_dialog.c", there are a list of taverns for which quests are allowed. I found out what that's for. If the guy at the table chooses to drink, the conversation can go various ways. He can ask for another drink, he can accuse you of trying to steal his money, or he can ask you to help with a soldier who offended him, which you decline. If quests are allowed then there are a few other options. You can pass out, be robbed and be woken by the tavern girl; you can be attacked by a would-be mugger; or you can choose to help your drinking partner with the offensive soldier. Since I added tavern partners to Port au Prince, Santiago and Havana, I've started by adding the necessary code to "quests_common.c" for these taverns, and ended up rewriting a lot of the existing code.
If you choose to help with the soldier, you get teleported outside the tavern, where you meet a soldier character specifically set up for the encounter. There's one soldier for each different tavern. Rather than define yet more soldier characters who only serve one purpose, I created a single character "Drink Soldier" and customised him for each of the newly added taverns. Then I changed the previously existing taverns to use the same character. This means the individual soldiers can be removed, freeing up some character slots. They all have the same dialog for the encounter anyway so it doesn't matter that they're all the same character using the same new, small dialog file. The exceptions are the pirate soldiers in Nevis Pirate Settlement and Bonaire Pirate Fort, who use a different, more piratey dialog.
The case in which you pass out and the tavern girl then tells you that you've been robbed is even easier. Instead of numerous quest cases for each tavern, I've been collapsing almost all of them into one piece of code which uses 'GetTownOfficiant(GetCurrentTownID())' to figure out who the local tavern girl is. The exception is the brothel in Nevis Pirate Settlement which will still have its own code as it doesn't use the town officiant - she's in the tavern along the street.
And then I found a piece of weirdness in Santiago tavern. When I talked to the new drinker/gambler and sat down, the room went very dark. A bit of experimenting with console to teleport me to various locators showed that both the "sit" locators on the left of the tavern facing towards the back did this. If I used TOOL to turn them round to face the front of the tavern, they worked fine. OK, this is stupid, so try a stupid solution. To turn a locator to face backwards, you change its XX and ZZ values to -1. I changed them to -0.99, then changed XZ and ZX to 0.01 to compensate - and it worked!
Now I'm on a pub crawl to check that the various encounters work properly in every tavern which I've changed. A lot of rum is going to be involved. Hic!