Paste #2791: Untitled Paste

Date: 2014/03/22 13:37:18 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


killtenpigsandtencows:
    type: assignment
    actions:
        on assignment:
            - trigger name:chat toggle:true
            - trigger name:click toggle:true
            - lookclose state:true
    default constants:
        mobtype1: pig
        mobtype1amount: 10
        mobtype2: cow
        mobtype2amount: 10
        questredodelay: 1m
        item1: pork
        item1amount: 64
        item2: raw_beef
        item2amount: 64
        moneyreward: 10000
    interact scripts:
        - 10 pigcowquest

pigcowquest:
    type: interact
    steps:
        "*meet":
            click trigger:
                script:
                    - if <player.flag[pigcowquest]> != done {
                      - chat "Hallo <player.name>."
                      - wait 1
                      - chat "Ich brauche noch einige Zutaten für das heutige Essen!"
                      - wait 1
                      - chat "Kannst du mir helfen?"
                      - narrate "<&6>Schreibe <&a>Ja<&6> oder <&c>Nein<&6>!"
                      - zap step:accept duration:10s
                      } else {
                      - chat "Danke nochmal für das Fleisch!"
                      - wait 1
                      - chat "Melde dich morgen nochmal, vielleicht brauche ich dann wieder welches!"
                      }

        accept:
            chat trigger:
                "yes":
                    trigger: "/Ja/, ich werde dir helfen."
                    script:
                        - narrate "<&5>Steak Tag <&6>- Quest gestartet"
                        - chat "Heute soll es ordentlich Fleisch geben!"
                        - wait 1
                        - chat "Töte <cons:mobtype1amount> Schweine und <cons:mobtype2amount> Kühe und bringe mir dann <cons:item1amount> rohes Schweine- und <cons:item2amount> rohes Kuhfleisch!"
                        - ^flag player mob1count:0
                        - ^flag player mob2count:0
                        - listen kill "id:Schwein Listener" type:entity name:<cons:mobtype1> qty:1 script:pigcheck
                        - listen kill "id:Kuh Listener" type:entity name:<cons:mobtype2> qty:1 script:cowcheck
                        - zap step:huntpigcow

                "no":
                    trigger: "/Nein/, ich hab gerade keine Zeit."
                    script:
                        - chat "Schade, dann werde ich mal jemand anderes fragen."
                        - wait 1
                        - chat "Solltest du doch irgendwann Zeit haben, dann melde dich einfach nochmal bei mir!"
                        - zap step:meet

        huntpigcow:
            click trigger:
                script:
                    - chat "<player.name>, du hast erst <player.flag[mob1count].as_int>/<cons:mobtype1amount> Schweine und <player.flag[mob2count].as_int>/<cons:mobtype2amount> Kühe getötet!"

        whiledelivering:
            click trigger:
                script:
                    - ^if <player.item_in_hand.material> == m@<cons:item1> {
                      - ^if <player.flag[item1delivered].as_int> < <cons:item1amount> {
                        - define item_in_hand <player.item_in_hand.qty>
                        - define toomuch <math.as_int:64-<player.flag[item1delivered]>>
                        - ^flag player item1delivered:++:<player.item_in_hand.qty>
                        - ^take i@<cons:item1> qty:<player.item_in_hand.qty>
                        - if <player.flag[item1delivered].as_int> < <cons:item1amount> {
                          - ^chat "Danke für <player.item_in_hand.qty> rohes Schweinefleisch!"
                          } else {
                          - ^chat "Danke für %toomuch% rohes Schweinefleisch!"
                          - flag player item1:done
                          - flag player item1delivered:<cons:item1amount>
                          - if <player.flag[item1delivered].as_int> > <cons:item1amount> {
                            - give i@<cons:item1> qty:<math.as_int:<player.flag[item1delivered]>-<cons:item1amount>>
                            } else {
                            }
                            - if <player.flag[item1]> == done && <player.flag[item2]> == done {
                              - chat "Danke für deine Hilfe. Hier hast du deine Belohnung!"
                              - give money qty:<cons:moneyreward>
                              - narrate "<&2>[<&f>Money<&2>] Received <&f><cons:moneyreward> Dollars <&2>from <&f><player.name>"
                              - narrate "<&5>Steak Tag <&6>- Quest abgeschlossen"
                              - flag player pigcowquest:done duration:<cons:questredodelay>
                              - zap script:pigcowquest 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:item2> {
                        - ^if <player.flag[item2delivered].as_int> < <cons:item2amount> {
                          - define item_in_hand <player.item_in_hand.qty>
                          - define toomuch <math.as_int:64-<player.flag[item2delivered]>>
                          - ^flag player item2delivered:++:<player.item_in_hand.qty>
                          - ^take i@<cons:item2> qty:<player.item_in_hand.qty>
                          - if <player.flag[item2delivered].as_int> < <cons:item2amount> {
                            - ^chat "Danke für <player.item_in_hand.qty> rohes Kuhfleisch!"
                            } else {
                            - ^chat "Danke für %toomuch% rohes Kuhfleisch!"
                            - flag player item2:done
                            - flag player item2delivered:<cons:item2amount>
                            - if <player.flag[item2delivered].as_int> > <cons:item2amount> {
                              - give i@<cons:item2> qty:<math.as_int:<player.flag[item2delivered]>-<cons:item2amount>>
                              } else {
                              }
                              - if <player.flag[item1]> == done && <player.flag[item2]> == done {
                                - chat "Danke für deine Hilfe. Hier hast du deine Belohnung!"
                                - give money qty:<cons:moneyreward>
                                - narrate "<&2>[<&f>Money<&2>] Received <&f><cons:moneyreward> Dollars <&2>from <&f><player.name>"
                                - narrate "<&5>Steak Tag <&6>- Quest abgeschlossen"
                                - flag player pigcowquest:done duration:<cons:questredodelay>
                                - zap script:pigcowquest step:meet
                                } else {
                                - chat "Du musst noch etwas rohes Schweinefleisch zu mir bringen!"
                                }
                              }
                            } else {
                            - chat "Du hast bereits genügend rohes Kuhfleisch abgeliefert!"
                            }
                          }
                        } else {
                        - chat "Ich brauche noch das Fleisch! Du kannst auch einzelne Portionen bringen!"
                        - wait 1
                        - chat "Du hast erst <player.flag[item1delivered].as_int>/<cons:item1amount> rohes Schweinefleisch und <player.flag[item2delivered].as_int>/<cons:item2amount> rohes Kuhfleisch zur mir gebracht!"
                        }

pigcheck:
    type: task
    script:
        - ^flag player mob1count:++
        - ^narrate "<&5>[QUEST]<&f><&co> Du hast <player.flag[mob1count].as_int>/<cons:mobtype1amount> Schweine getötet!"
        - ^if <player.flag[mob1count].as_int> >= <cons:mobtype1amount> {
          - flag player mob1:done
          - if <player.flag[mob1]> == done && <player.flag[mob2]> == done {
            - narrate "<&5>[QUEST]<&f><&co> Du hast <cons:mobtype1amount> Schweine und <cons:mobtype2amount> Kühe getötet. Bring der Küchenhilfe <cons:item1amount> rohes Schweine- und <cons:item2amount> rohes Kuhfleisch!"
            - ^flag player mob1count:0
            - ^flag player mob2count:0
            - ^flag player item1delivered:0
            - ^flag player item2delivered:0
            - ^flag player mob1:!
            - ^flag player mob2:!
            - ^flag player item1:!
            - ^flag player item2:!
            - zap script:pigcowquest step:whiledelivering
            } else {
            - narrate "<&5>[QUEST]<&f><&co> Du musst noch ein paar Kühe töten!"
            }
          } else {
          - ^listen kill "id:Schwein Listener" type:entity name:<cons:mobtype1> qty:1 script:pigcheck
          }

cowcheck:
    type: task
    script:
        - ^flag player mob2count:++
        - ^narrate "<&5>[QUEST]<&f><&co> Du hast <player.flag[mob2count].as_int>/<cons:mobtype2amount> Kühe getötet!"
        - ^if <player.flag[mob2count].as_int> >= <cons:mobtype2amount> {
          - flag player mob2:done
          - if <player.flag[mob1]> == done && <player.flag[mob2]> == done {
            - narrate "<&5>[QUEST]<&f><&co> Du hast <cons:mobtype1amount> Schweine und <cons:mobtype2amount> Kühe getötet. Bring der Küchenhilfe <cons:item1amount> rohes Schweine- und <cons:item2amount> rohes Kuhfleisch!"
            - ^flag player mob1count:0
            - ^flag player mob2count:0
            - ^flag player item1delivered:0
            - ^flag player item2delivered:0
            - ^flag player mob1:!
            - ^flag player mob2:!
            - ^flag player item1:!
            - ^flag player item2:!
            - zap script:pigcowquest step:whiledelivering
            } else {
            - narrate "<&5>[QUEST]<&f><&co> Du musst noch ein paar Schweine töten!"
            }
          } else {
          - ^listen kill "id:Kuh Listener" type:entity name:<cons:mobtype2> qty:1 script:cowcheck
          }