Paste #50648: Untitled Paste

Date: 2018/11/08 16:15:42 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NPCSwordRepairman1:
    type: assignment
    actions:
        on assignment:
            - trigger name:click state:true
            - trigger name:proximity state:true radius:3
#items price
            - flag npc m@wooden_sword:!|:50 
            - flag npc m@stone_sword:!|:100
            - flag npc m@iron_sword:!|:200
            - flag npc m@golden_sword:!|:500
            - flag npc m@diamond_sword:!|:1000
        on enter proximity:
             - narrate format:sword "Вы повредили свой меч? Я тот, кто вам нужен"
    Interact Scripts:
    - 10 NPCSwordRepairman1_interact
NPCSwordRepairman1_interact:
    type: Interact
    Steps:
        1:
            click trigger:
                    Script:
                            - engage
#if in the hands of the material from the list, reports its price, if not, says that it can repair for a small amount
                            - if <npc.has_flag[<player.item_in_hand.material>]> = true {
                                - narrate format:sword  "Здравствуй, меня зовут <npc.name>, я могу починить твой меч за <npc.flag[<player.item_in_hand.material>]> рублей"
                                } else {
                                - narrate format:sword  "Здравствуй, меня зовут <npc.name>, я могу починить твой меч за небольшую сумму"
                                }
                            - narrate format:sword  "Если вы согласны, передайте мне меч ПКМ"
#if in the hands of the material from the list, reports its price, if not, says that it can repair for a small amount
                            - if <npc.has_flag[<player.item_in_hand.material>]> != true {
                                - zap 4
                                } else {
                                - if <player.item_in_hand.durability> != 0 {
                                    - if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
                                        - zap 2
                                        } else {
                                        - zap 3
                                        }
                                    } else {
                                    - zap 6
                                    }
                                }
                            - disengage
#zap 2 repair
#zap 3 no money
#zap 4 checking on: item from the list; enough money; need to repair
#zap 5 re-check
#zap 6 item does not need to be repaired
        2:
            click trigger:
                    Script:
                        - engage
                        - money take quantity:<npc.flag[<player.item_in_hand.material>]>
                        - narrate format:economy  "Вы заплатили <&f><npc.flag[<player.item_in_hand.material>]><&e> рублей."
                        - ^adjust <player.item_in_hand> durability:<player.item_in_hand.durability.add[-1000]> save:myitem 
                        - ^take iteminhand
                        - ^equip npc.name <entry[myitem].result> hand
                        - random {
                            - wait 3s
                            - wait 5s
                            - wait 7s
                        }
                        - equip npc.name hand:i@air
                        - drop <entry[myitem].result> <npc.locations>
                        - random {
                            - narrate format:sword  "Пока!"
                            - narrate format:sword  "Рад буду видеть снова!"
                        }
                        - disengage
                        - zap 1
                        - queue clear
        3:
            click trigger:
                    Script:
                        - narrate format:sword_red "Вам нечем платить"
                        - zap 1
                        - queue clear
        4:
            click trigger:
                    Script:
                        - narrate format:sword_red   чиню только мечи"
                        - narrate format:sword  "Передай мне свой меч пожалуйста."
                        - if <npc.has_flag[<player.item_in_hand.material>]> != true {
                            - zap 5
                            } else {
                               - if <player.item_in_hand.durability> != 0 {
                                    - if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
                                    - zap 2
                                    } else {
                                    - zap 3
                                    }
                                } else {
                                - zap 6
                                }
                            }
        5:
            click trigger:
                    Script:
                        - if <npc.has_flag[<player.item_in_hand.material>]> != true {
                            - narrate format:sword  "Не хочешь? ну и ладно"
                            - zap 1
                            - queue clear
                            } else {
                                - if <player.item_in_hand.durability> != 0 {
                                    - if <player.money> >= <npc.flag[<player.item_in_hand.material>]> {
                                    - zap 2
                                    } else {
                                    - zap 3
                                    }
                                } else {
                                - zap 6
                                }
                            }
        6:
            click trigger:
                    Script:
                        - narrate format:sword_green "Друг, твой меч в полном порядке"
                        - zap 1
                        - queue clear