Author Topic: [OSP][Code] Flipping coins with tavernkeepers  (Read 3234 times)

0 Members and 1 Guest are viewing this topic.

Albertus Magnus

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Nord
  • MP nick: Albertus_Magnus
  • M&BWBWF&SNW
[OSP][Code] Flipping coins with tavernkeepers
« on: June 10, 2011, 11:50:41 AM »
I had this in the Astorionar Adventure mod. It's a dialog with a tavernkeeper.
You can flip a coin with him and bet on either head or tail and select the amount
of money. It's random if you win or lose. To avoid becoming gambling-addicted
you can only do it every 6 hours (can easily be changed).
If you have unrealistic-saving-option it's an easy way to get unlimited money, but
that can be avoided by increasing the time and decreasing the bet-amounts.
Just as you like it...

Add the following lines in module_dialogs.py somewhere under other "tavernkeeper_talk".
Should work for both M&B and WB.

Code: [Select]
  [anyone|plyr,"tavernkeeper_talk", [
      (store_current_hours,":cur_hours"),
      (val_sub, ":cur_hours", 6),
      (gt, ":cur_hours", "$gamble_last_time"),
      ], "I'd like to flip a coin with you.", "tavernkeeper_coin",[]],

  [anyone,"tavernkeeper_coin", [
      ], "Alright. How much money do you want to lose?", "tavernkeeper_coin2",[]],

  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",50),
      ], "50 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 50),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",100),
      ], "100 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 100),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",200),
      ], "200 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 200),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",500),
      ], "500 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 500),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",1000),
      ], "1000 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 1000),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      (store_troop_gold, ":gold", "trp_player"),
      (ge,":gold",2000),
      ], "20000 Denars.", "tavernkeeper_coin3",[
          (assign, reg6, 2000),]],
  [anyone|plyr,"tavernkeeper_coin2", [
      ], "I can't afford it.", "tavernkeeper_coinn",[]],

  [anyone,"tavernkeeper_coinn", [
      ], "Nevermind.", "tavernkeeper_talk",[]],

  [anyone,"tavernkeeper_coin3", [
      ], "Okay. Head or tail?", "tavernkeeper_coin4",[]],

  [anyone|plyr,"tavernkeeper_coin4", [
      ], "Head.", "tavernkeeper_coin5",[
          (str_store_string, s2, "@head"),
          (str_store_string, s3, "@tail"),]],
  [anyone|plyr,"tavernkeeper_coin4", [
      ], "Tail.", "tavernkeeper_coin5",[
          (str_store_string, s2, "@tail"),
          (str_store_string, s3, "@head"),]],

  [anyone,"tavernkeeper_coin5", [
      ], "Well, here we go... (He flips the coin.)", "tavernkeeper_coin6",[
        (store_random_in_range, "$rand2", 0, 2),]],

  [anyone,"tavernkeeper_coin6", [
       (eq,"$rand2",0),
      ], "Look, it's {s3}! Bad luck for you.", "tavernkeeper_coin6a",[]],
  [anyone,"tavernkeeper_coin6", [
       (eq,"$rand2",1),
      ], "Damn, it's {s2}... Here's your money.", "tavernkeeper_pretalk",[
          (troop_add_gold,"trp_player",reg6),
          (store_current_hours,":cur_hours"),
          (assign, "$gamble_last_time", ":cur_hours"),]],

  [anyone|plyr,"tavernkeeper_coin6a", [
      ], "Here are your {reg6} Denars.", "tavernkeeper_pretalk",[
       (troop_remove_gold,"trp_player",reg6),
       (store_current_hours,":cur_hours"),
       (assign, "$gamble_last_time", ":cur_hours"),]],
« Last Edit: June 24, 2013, 01:21:38 PM by Albertus Magnus »
 

xPearse

  • Sergeant Knight
  • *
  • H.O.T.D. Check It Out
    • View Profile
  • Faction: Neutral
  • MP nick: xPearse
Re: [OSP] Filpping coins with tavernkeepers
« Reply #1 on: June 10, 2011, 12:19:47 PM »
alright sounds intresting will try this out


Specialist

  • Master Knight
  • *
  • Coder
    • View Profile
  • Faction: Neutral
  • MP nick: TheSpecialist
  • WB
Re: [OSP] Filpping coins with tavernkeepers
« Reply #2 on: June 10, 2011, 04:02:00 PM »
Love this!
Now all those barbarian type players can gamble away a fortune in the Tavern.  :lol:

Belendor

  • Grandmaster Knight
  • *
  • When it doesn't feel right, go left.
    • Steam - Belendor
    • Twitch.tv - Belendorr
    • YouTube - Belendor
    • View Profile
    • Olympus Studios
  • Faction: Swadian
  • MP nick: WTF_Belendor
  • WBWF&SNW
Re: [OSP] Filpping coins with tavernkeepers
« Reply #3 on: June 10, 2011, 04:33:19 PM »
Haha, nice job bro :)

xPearse

  • Sergeant Knight
  • *
  • H.O.T.D. Check It Out
    • View Profile
  • Faction: Neutral
  • MP nick: xPearse
Re: [OSP] Filpping coins with tavernkeepers
« Reply #4 on: June 10, 2011, 04:59:27 PM »
I tried it out and it works, this will make a good addition to my mod.


Albertus Magnus

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Nord
  • MP nick: Albertus_Magnus
  • M&BWBWF&SNW
Re: [OSP] Filpping coins with tavernkeepers
« Reply #5 on: June 10, 2011, 05:08:12 PM »
Nice to hear! Do you mind giving credit?  :)
 

Specialist

  • Master Knight
  • *
  • Coder
    • View Profile
  • Faction: Neutral
  • MP nick: TheSpecialist
  • WB
Re: [OSP] Filpping coins with tavernkeepers
« Reply #6 on: June 10, 2011, 05:54:36 PM »
Of course not! I'll give you credit where your credit is due. :)

Alot of your stuff is good quality as well. Like Age of Blades!  :mrgreen:

Ikaguia

  • Master Knight
  • *
  • LWBR WarForge, Coder
    • Skype - Ikaguia
    • Steam - Ikaguia
    • View Profile
    • Bandits Rule Calradia
  • Faction: Sarranid
  • MP nick: Ldb_Ikaguia/Wololo
  • WBWF&SNW
Re: [OSP] Filpping coins with tavernkeepers
« Reply #7 on: June 10, 2011, 06:09:45 PM »
WOW, that's so briliant and simple that I don't know how I haven't thought of that before... THANK YOU!!!
I'm gonna use this in my mod and I'm gonna give credits
IkaWorks   FIMP   BRC   Usefull Scripts Compillation

Sorry for my poor English, I'm Brazilian.

Korgoth

  • Squire
  • *
  • I've dated girls uglier than you for Breakfast
    • View Profile
  • Faction: Neutral
  • MP nick: Korgoth_of_Barbaria
  • WBWF&S
Re: [OSP] Filpping coins with tavernkeepers
« Reply #8 on: June 10, 2011, 07:52:22 PM »
Albertus please make some other gambling games in Taverns and maybe even in back alleys of streets lol

xPearse

  • Sergeant Knight
  • *
  • H.O.T.D. Check It Out
    • View Profile
  • Faction: Neutral
  • MP nick: xPearse
Re: [OSP] Filpping coins with tavernkeepers
« Reply #9 on: June 10, 2011, 09:50:04 PM »
Nice to hear! Do you mind giving credit?  :)

Well obviously I am going to give credit so dont you worry, your name will be right on there with all the others. Thanks for releasing this to the public great job.


DWoodrum

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
  • WF&S
Re: [OSP] Filpping coins with tavernkeepers
« Reply #10 on: June 18, 2011, 09:45:09 PM »
This sounds really cool! I've got to try it!

Michadr

  • Grandmaster Knight
  • *
  • Perisno Lead Developer
    • Skype - Michadr
    • Twitter - @realmichadr
    • YouTube - michaeldecker7
    • View Profile
    • Perisno
  • Faction: Nord
  • MP nick: Michadr
  • WBM&B
Re: [OSP] Filpping coins with tavernkeepers
« Reply #11 on: June 22, 2013, 02:26:39 AM »
Added this to my mod! Works well, and thank you. (Credit given)

Oh and i think you spelled
Quote
Filpping
wrong... :)

Albertus Magnus

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Nord
  • MP nick: Albertus_Magnus
  • M&BWBWF&SNW
Re: [OSP] Flipping coins with tavernkeepers
« Reply #12 on: June 24, 2013, 01:21:10 PM »
Good to know someone uses it.
Fixed the spelling.