Paste #2991: Untitled Paste

Date: 2014/03/29 12:38:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


kuechenhilfe:
    type: assignment
    debug: false
    actions:
        on assignment:
            - trigger name:chat toggle:true
            - trigger name:click toggle:true
            - lookclose state:true
    default constants:
    # At the first step the player has to kill 2 different mobtypes.
    # Here you can define which mobtypes he has to kill and how many.
        steakmobtype1: pig
        steakmobtype1amount: 10
        steakmobtype2: cow
        steakmobtype2amount: 10
        # At the second step the player has to deliver 2 different items.
        # I guess it makes the most sense when the player has to deliver
        # the items that the killed mobs drop. Here you can define which
        # items and how many.
        steakitem1: pork
        steakitem1amount: 64
        steakitem2: raw_beef
        steakitem2amount: 64
        # This quest is repeatable but it has a cooldown after finishing
        # it. You can change the cooldown time here. Use "1s" for 1 second,
        # "5m" for 5 minutes or "24h" for 24 hours.
        steakquestredodelay: 20h
        # After completing the quest the player gets a money reward. You
        # can change the amount of money here.
        steakmoneyreward: 10000
    interact scripts:
        - 10 steakquest

# There are no further comments because if you want to change something, which is highly
# recommended and probably needed if your server isnt german, you should understand it anyways.
steakquest:
    type: interact
    debug: false
    steps:
        "*meet":
            click trigger:
                script:
                    - if <player.flag[steakquest]> != done {
                      - random {
                        - ^chat "Hallo <player.name>."
                        - ^chat "Hi <player.name>."
                        - ^chat "Moin <player.name>."
                        }
                      - wait 1
                      - random {
                        - ^chat "Ich brauche noch einige Zutaten für das heutige Essen!"
                        - ^chat "Einige Zutaten für das heutige Essen wurden noch nicht geliefert!"
                        - ^chat "Uns wurde heute zu wenig Fleisch geliefert!"
                        }
                      - wait 1
                      - random {
                        - ^chat "Kannst du mir helfen?"
                        - ^chat "Hilfst du mir?"
                        }
                      - wait 1
                      - ^narrate "<&6>Schreibe <&a>Ja<&6> oder <&c>Nein<&6>!"
                      - zap step:accept duration:20s
                      } else {
                      - random {
                        - ^chat "Danke nochmal für das Fleisch!"
                        - ^chat "Ohne dich wären bestimmt einige verhungert!"
                        - ^chat "Wenn du mir nicht geholfen hättest, hätte es wahrscheinlich einen Aufstand gegeben!"
                        }
                      - wait 2
                      - random {
                        - ^chat "Melde dich in <player.flag[steakquest].expiration.formatted> nochmal, vielleicht brauche ich dann wieder welches!"
                        - ^chat "Momentan haben wir genügend Fleisch. Schau in <player.flag[steakquest].expiration.formatted> nochmal vorbei!"
                        }
                      }

        accept:
            chat trigger:
                "yes":
                    trigger: "/Ja/, ich werde dir helfen."
                    script:
                        - wait 1
                        - ^narrate "<&5>Steak Tag <&6>- Quest angenommen"
                        - wait 1
                        - ^chat "Töte <cons:steakmobtype1amount> Schweine und <cons:steakmobtype2amount> Kühe und bringe mir dann <cons:steakitem1amount> rohes Schweine- und <cons:steakitem2amount> rohes Kuhfleisch!"
                        - ^flag player steakmobtype1count:0
                        - ^flag player steakmobtype2count:0
                        - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
                        - ^listen kill "id:Steak Schwein Listener" type:entity name:<cons:steakmobtype1> qty:1 script:steakmob1check
                        - ^listen kill "id:Steak Kuh Listener" type:entity name:<cons:steakmobtype2> qty:1 script:steakmob2check
                        - zap step:huntpigcow

                "no":
                    trigger: "/Nein/, ich hab gerade keine Zeit."
                    script:
                        - wait 1
                        - random {
                          - ^chat "Schade, dann werde ich mal jemand anderes fragen."
                          - ^chat "Ok, hoffentlich hilft mir jemand anderes."
                          }
                        - wait 1
                        - random {
                          - ^chat "Solltest du doch irgendwann Zeit haben, dann melde dich einfach nochmal bei mir!"
                          - ^chat "Sprich mich einfach nochmal an, wenn du Zeit haben solltest."
                          }
                        - zap step:meet

                "everything else":
                    trigger: /REGEX:\w+/
                    script:
                        - wait 1
                        - random {
                          - ^chat "Tut mir leid <player.name>, aber ich weiß nicht was <&sq><&f><context.message><&9><&sq> bedeutet!"
                          - ^chat "Ich weiß nicht, was du mit <&sq><&f><context.message><&9><&sq> meinst!"
                          }
                        - wait 1
                        - ^narrate "<&6>Schreibe <&a>Ja<&6> oder <&c>Nein<&6>!"

        huntpigcow:
            click trigger:
                script:
                    - ^chat "<player.name>, du hast erst <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe getötet!"

        whiledelivering:
            click trigger:
                script:
                    - ^if <player.item_in_hand.material> == m@<cons:steakitem1> {
                      - ^if <player.flag[steakitem1count].as_int> < <cons:steakitem1amount> {
                        - ^define item_in_hand <player.item_in_hand.qty>
                        - ^define toomuch <math.as_int:<cons:steakitem1amount>-<player.flag[steakitem1count]>>
                        - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                        - ^flag player steakitem1count:++:<player.item_in_hand.qty>
                        - ^take i@<cons:steakitem1> qty:<player.item_in_hand.qty>
                        - ^if <player.flag[steakitem1count].as_int> < <cons:steakitem1amount> {
                          - ^chat "Danke für %item_in_hand% rohes Schweinefleisch!"
                          - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                          } else {
                          - ^chat "Danke für %toomuch% rohes Schweinefleisch!"
                          - ^flag player steakitem1:done
                          - ^if <player.flag[steakitem1count].as_int> > <cons:steakitem1amount> {
                            - ^give i@<cons:steakitem1> qty:<math.as_int:<player.flag[steakitem1count]>-<cons:steakitem1amount>>
                            }
                          - ^flag player steakitem1count:<cons:steakitem1amount>
                          - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                          - ^if <player.flag[steakitem1]> == done && <player.flag[steakitem2]> == done {
                            - random {
                              - ^chat "Danke für deine Hilfe. Hier hast du deine Belohnung!"
                              - ^chat "Vielen Dank! Über <cons:steakmoneyreward> Dollar freust du dich bestimmt!"
                              }
                            - ^give money qty:<cons:steakmoneyreward>
                            - ^narrate "<&2>[<&f>Money<&2>] Received <&f><cons:steakmoneyreward> Dollars <&2>from <&f><npc.name>"
                            - wait 1
                            - ^narrate "<&5>Steak Tag <&6>- Quest abgeschlossen"
                            - ^flag player steakquest:done duration:<cons:steakquestredodelay>
                            - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                            - ^flag player steakitem1count:!
                            - ^flag player steakitem2count:!
                            - ^flag player steakitem1:!
                            - ^flag player steakitem2:!
                            - zap script:steakquest step:meet
                            } else {
                            - ^chat "Du musst noch etwas rohes Kuhfleisch zu mir bringen!"
                            }
                          }  
                        } else {
                        - ^chat "Du hast bereits genügend rohes Schweinefleisch abgeliefert!"
                        }
                      } else if <player.item_in_hand.material> == m@<cons:steakitem2> {
                      - ^if <player.flag[steakitem2count].as_int> < <cons:steakitem2amount> {
                        - ^define item_in_hand <player.item_in_hand.qty>
                        - ^define toomuch <math.as_int:<cons:steakitem2amount>-<player.flag[steakitem2count]>>
                        - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                        - ^flag player steakitem2count:++:<player.item_in_hand.qty>
                        - ^take i@<cons:steakitem2> qty:<player.item_in_hand.qty>
                        - ^if <player.flag[steakitem2count].as_int> < <cons:steakitem2amount> {
                          - ^chat "Danke für %item_in_hand% rohes Kuhfleisch!"
                          - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                          } else {
                          - ^chat "Danke für %toomuch% rohes Kuhfleisch!"
                          - ^flag player steakitem2:done
                          - ^if <player.flag[steakitem2count].as_int> > <cons:steakitem2amount> {
                            - ^give i@<cons:steakitem2> qty:<math.as_int:<player.flag[steakitem2count]>-<cons:steakitem2amount>>
                            }
                          - ^flag player steakitem2count:<cons:steakitem2amount>
                          - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                          - ^if <player.flag[steakitem1]> == done && <player.flag[steakitem2]> == done {
                            - random {
                              - ^chat "Danke für deine Hilfe. Hier hast du deine Belohnung!"
                              - ^chat "Vielen Dank! Über <cons:steakmoneyreward> Dollar freust du dich bestimmt!"
                              }
                            - ^give money qty:<cons:steakmoneyreward>
                            - ^narrate "<&2>[<&f>Money<&2>] Received <&f><cons:steakmoneyreward> Dollars <&2>from <&f><npc.name>"
                            - wait 1
                            - ^narrate "<&5>Steak Tag <&6>- Quest abgeschlossen"
                            - ^flag player steakquest:done duration:<cons:steakquestredodelay>
                            - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
                            - ^flag player steakitem1count:!
                            - ^flag player steakitem2count:!
                            - ^flag player steakitem1:!
                            - ^flag player steakitem2:!
                            - zap script:steakquest step:meet
                            } else {
                            - ^chat "Du musst noch etwas rohes Schweinefleisch zu mir bringen!"
                            }
                          }  
                        } else {
                        - ^chat "Du hast bereits genügend rohes Kuhfleisch abgeliefert!"
                        }  
                      } else {
                      - random {
                        - ^chat "Ich brauche noch das Fleisch! Du kannst auch einzelne Portionen bringen!"
                        - ^chat "Wo bleibt das Fleisch? Du musst nicht alles auf einmal bringen!"
                        }
                      - wait 1
                      - ^chat "Du hast erst <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweinefleisch und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch zur mir gebracht!"
                      }

steakmob1check:
    type: task
    debug: false
    script:
        - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
        - ^flag player steakmobtype1count:++
        - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
        - ^narrate "<&5>[QUEST]<&f><&co> Du hast <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine getötet!"
        - ^if <player.flag[steakmobtype1count].as_int> >= <cons:steakmobtype1amount> {
          - flag player mob1:done
          - ^if <player.flag[mob1]> == done && <player.flag[mob2]> == done {
            - narrate "<&5>[QUEST]<&f><&co> Du hast <cons:steakmobtype1amount> Schweine und <cons:steakmobtype2amount> Kühe getötet. Bringe der Küchenhilfe <cons:steakitem1amount> rohes Schweine- und <cons:steakitem2amount> rohes Kuhfleisch!"
            - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
            - ^flag player steakmobtype1count:!
            - ^flag player steakmobtype2count:!
            - ^flag player mob1:!
            - ^flag player mob2:!
            - ^flag player steakitem1count:0
            - ^flag player steakitem2count:0
            - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
            - zap script:steakquest step:whiledelivering
            } else {
            - narrate "<&5>[QUEST]<&f><&co> Du musst noch ein paar Kühe töten!"
            }
          } else {
          - ^listen kill "id:Steak Schwein Listener" type:entity name:<cons:steakmobtype1> qty:1 script:steakmob1check
          }

steakmob2check:
    type: task
    debug: false
    script:
        - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
        - ^flag player steakmobtype2count:++
        - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
        - ^narrate "<&5>[QUEST]<&f><&co> Du hast <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe getötet!"
        - ^if <player.flag[steakmobtype2count].as_int> >= <cons:steakmobtype2amount> {
          - flag player mob2:done
          - ^if <player.flag[mob1]> == done && <player.flag[mob2]> == done {
            - narrate "<&5>[QUEST]<&f><&co> Du hast <cons:steakmobtype1amount> Schweine und <cons:steakmobtype2amount> Kühe getötet. Bring der Küchenhilfe <cons:steakitem1amount> rohes Schweine- und <cons:steakitem2amount> rohes Kuhfleisch!"
            - ^flag player "questaufgabe:<-:<&5>[Steak Tag]<&a> Töte <player.flag[steakmobtype1count].as_int>/<cons:steakmobtype1amount> Schweine und <player.flag[steakmobtype2count].as_int>/<cons:steakmobtype2amount> Kühe!"
            - ^flag player steakmobtype1count:!
            - ^flag player steakmobtype2count:!
            - ^flag player mob1:!
            - ^flag player mob2:!
            - ^flag player steakitem1count:0
            - ^flag player steakitem2count:0
            - ^flag player "questaufgabe:->:<&5>[Steak Tag]<&a> Bringe der Küchenhilfe <player.flag[steakitem1count].as_int>/<cons:steakitem1amount> rohes Schweine- und <player.flag[steakitem2count].as_int>/<cons:steakitem2amount> rohes Kuhfleisch!"
            - zap script:steakquest step:whiledelivering
            } else {
            - narrate "<&5>[QUEST]<&f><&co> Du musst noch ein paar Schweine töten!"
            }
          } else {
          - ^listen kill "id:Steak Kuh Listener" type:entity name:<cons:steakmobtype2> qty:1 script:steakmob2check
          }