0.8 Banker


Author: linkindeath
Created: 2013-02-18T18:28:55-0500
Edited: 2013-03-03T11:54:24-0500
Denizen Version: 0.8
Views: 97
Downloads: 941
Likes: 1


WGET
Description: Here is a banker which works with Denizen 0.8.


- Fix a bug which allow player to deposit more money than he has.


02/25:
- Fix the whole script

03/03:
- Fix a zap issue

"banker":
  type: assignment

  interact scripts:
  - 10 banker_script

  actions:
    on assignment:
    - trigger name:click toggle:true
    - trigger name:proximity toggle:true
    - trigger name:chat toggle:true

'banker_script':
  type: interact
  steps:
    'announce banker*':
       proximity trigger:
         Entry:
           script:
           - chat "Venez déposer/retirer votre argent à la banque, <player.name> !"
       click trigger: 
           script:
           - chat "Voulez vous &4déposer&a ou &4retirer &ade l'argent ?"
           - chat "Ou bien savoir &4combien&a d'argent vous pouvez retirer ?" 
           - if '<flag.p:inbank_money || none>' == none
             flag player inbank_money:100
       chat trigger: 
         1:
           trigger: /déposer/
           script:
           - chat "&4Combien &avoulez-vous déposer ?"
           - zap step:deposit
         2:
           trigger: /retirer/
           script:
           - chat "&4Combien &avoulez-vous retirer ?"
           - zap step:take
         3:
           trigger: /combien/
           script:
           - runtask "script:showhowmany"

    'deposit':
      chat trigger:
        1:
          trigger: /REGEX:^\d+$/
          script:
          - zap 'step:announce banker'
          - ^if '<player.money.asint>' >= <player.chat_history>
            chat "Il y a maintenant <proc:deposit procedure> Po dans votre coffre."
            else chat "Vous n'avez pas assez d'argent pour effectuer cette opération !"
 

    'take':
      chat trigger:
        1:
          trigger: /REGEX:^\d+$/
          script:
          - zap 'step:announce banker'
          - if '<flag.p:inbank_money>' >= <player.chat_history>
            chat "Il reste <proc:take procedure> Po dans votre coffre."
            else chat "Vous n'avez pas assez d'argent en banque !"

'showhowmany':
  type: task
  script:
  - zap 'step:announce banker'
  - if <flag.p:inbank_money> == 0
    chat "Vous n'avez plus d'argent en banque !"
  - if <flag.p inbank_money> > 0
    chat "Il reste <^flag.p:inbank_money.asint> Po dans votre coffre." 
  
'deposit procedure':
  type: procedure
  script:
  - flag player 'inbank_money:+:<player.chat_history>'
  - take money qty:<player.chat_history>
  - determine "<flag.p:inbank_money.asint>"
  
'take procedure':
  type: procedure
  script:
  - flag player 'inbank_money:-:<player.chat_history>'
  - give money qty:<player.chat_history>
  - determine "<flag.p:inbank_money.asint>"




Comments
2013-04-19 15:14:18 - Felln:

Really cool little script! I wrote some addons for interest and that the players loose their money in their pockets on death! + a little atmmachine which is a little box around a npc! 0.8 banker addon