Paste #35960: Edit of P#35958 Ditems Blacksmith

Date: 2016/09/11 05:12:38 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NPC_Blacksmith:
    type: assignment

    interact scripts:
    - 10 Blacksmith

    actions:
      on assignment:
      - trigger name:chat toggle:true radius:2
      - trigger name:click toggle:true

Blacksmith:

    type: interact
    steps:
      '1':
        click trigger:
          script:
          - narrate "<npc.name> : Greeting, i am <npc.name>, i can repair your Ditem for 0,10 money"
          - wait 2
          - narrate "<npc.name> : To begin hold the item that you want to repair in your hand, and confirm me by saying <&9>Yes or <&9>No"

        chat trigger:
          'oui':
            trigger: '/yes/'
            script:
            - if <pl.item_in_hand.scriptname||null> && <pl.item_in_hand.is_repairable||null> == null {
              - narrate "<npc.name> : If you want me to repair your Ditem, you must hold it in your hand"
              - queue clear
              }
              else {
              - ^adjust <pl.item_in_hand> durability:0 save:item_reparation
              - ^take <pl.item_in_hand>
              - ^money take qty:0.10
              - ^inventory set d:<player.inventory> o:i@<entry[item_reparation].result> slot:<pl.item_in_hand.slot>
              - ^narrate "<npc.name> : <pl.item_in_hand.display_name> <&7>--><gold> Repair done!"
              - random {
                - narrate "<npc.name> : Goodbye !"
                - narrate "<npc.name> : See you soon !"
                }
              - queue clear
              }
          'non':
            trigger: '/no/'
            script:
            - random {
              - narrate "<npc.name> : Ok !"
              - narrate "<npc.name> : Ok then !"
              }
            - queue clear