King Futtyglut V1.1


Author: mclm
Created: 2013-04-05T18:00:06-0400
Edited: 2013-04-08T10:38:31-0400
Denizen Version: 0.8
Views: 74
Downloads: 812
Likes: 0


WGET
Description: This is a feature script. it implements a new item to the game "The Crown of Cake".
This crown is simply a gold helmet. You can customize it here in the items section.

The king has a simple crafting type quest, create 100 cakes and return. The reward is the custom item ... The Crown of Cakes and an XP buff. The crown allows the player to type /getcake and will receive one whole glorious cake! This feature has a cooldown (we have it about an hour).

I will probably extend this with further crowns of baked goods for this NPC but probably in increasing quantities. This is used as an "achievement" style feature addition to the game.

The main guts of the script comes in two parts. a world script to listen for the /getcake command, checking for the player holding the correct item. Using lore in the item to prevent anvils from being used to cheat the system.

The second part is the delivery mechanism of the script, the chatty NPC to deliver, listen to the events and respond to the completed quest.

I have put everything needed into this file and call it futtyglut.dscript. Simply drop in and reload scripts.
just assign futtyglut to your NPC and you're done.
TIP:
Use customskulls plugin, NPC's can wear them so you can choose a nice head and then dress them in any colour leather armor. King futtyglut has a head with what looks like a crown on (i think its actually a miner) and some snazzy pastel colour dark clothing on. and you get to use whatever name you want, no more skin headaches!!


#################################################################
# This implements the npc KingFuttyglut, after a craft type     #
# quest the char receives a magic helmet; The Crown of Cake     #
# when held the crown gives char 1 cake on a  1 hour cooldown.  #
#command is /cakeme                                             #
#                                                               #
#Coded by (IGN) morlanius for MCLM - http://mc.lifemud.com      #
#    2013                                                       #
# Thanks to the people on the denizen irc for their support.    # 
#                                                               #
#################################################################

"World_Item_cake_crown":
    type: world
 
    events:
        on getcake command:
            - determine passively fulfilled
            - narrate 'You try to invoke the Cake Gods to do your will!!'
            - wait 1
            - if <player.item_in_hand.lore> contains 'The Crown of Cake' runtask 'cake helm'

'cake helm':
    type: task
    script:
    - if <flag.p:gotcake> runtask nocake
      else runtask getcake queue

'getcake':
    type: task
    script:
    - flag player gotcake:true duration:3600s
    - narrate 'The Cake Gods will bow to your will .... this time.'
    - wait 2
    - narrate 'LET THERE BE .... CAKE!!'
    - GIVE ITEM:CAKE QTY:1
 

'nocake':
    type: task
    script:
    - narrate 'The cake gods tire of your requests.'
 
####################################
#         Item Definitions         #
#                                  #
####################################
crown_of_cake:
    type: item
    material: 314
    display name: 'The Crown of Cake'
    lore:
        - 'The Crown of Cake'
        - 'type /getcake to use me'
 
####################################################################
#                  End of item handler                             #
#                                                                  #
#                   Start of Kingfuttyglut                         #
####################################################################
 

"futtyglut":
    type: assignment
    interact scripts:
    - 10 futtyglut script
    actions:
        on assignment:
        - trigger name:chat toggle:true
 

'futtyglut script':
    Type: Interact
    Requirements:
    Mode: None
    Steps:
        1:
            Click Trigger:
                Script:
                - cooldown duration:5s "script:futtyglut script"
                - CHAT "Hi, My name is king Futtyglut. You might have noticed I have been hanging about the place you call spawn a lot lately.."
                - WAIT 3
                - CHAT "You see, I lived in a day where everyone made cakes -You know, I really love cakes!."
                - WAIT 3
                - CHAT "Well, I would like to see how well practiced at cake making the people of Akra are these days."
                - WAIT 3
                - CHAT "If you can make &4ONE HUNDRED &fcakes, then I will give one of my magical crowns."
                - WAIT 3
                - CHAT "And thats no trinket I can tell you!!"
                - CHAT "So ... How about it?"
      
            Chat Trigger:
                1:
                    Trigger: /Yes/, <PLAYER> to save the world!!!
                    Script:
                    - WAIT 2
                    - CHAT "Great! lets see how good you are at making cakes."
                    - WAIT 2
                    - CHAT "I will whisper in your ear when you get to your target."
                    - WAIT 4
                    - CHAT "Then come back and ill give you your reward."
                    - ZAP 2
                    - LISTEN ITEM TYPE:CRAFT ID:listen_futtyglut NAME:CAKE QTY:100 'SCRIPT:futtyglut reward'
                    - FINISH
                2:
                    Trigger: /No/, too much work for me.
                    Script:
                    - CHAT "Cake hater!! Begone from my sight you foul being!"
        
        2:
            Click Trigger:
                Script:
                - CHAT "Still making cakes I see, keep it up!"
        
        3:
            Click Trigger:
                Script:
                - CHAT "Grand job! you truly do deserve ...."
                - WAIT 1
                - CHAT "The Crown of Cake! ... here you go!"
                - GIVE XP QTY:200
                - GIVE ITEM:crown_of_cake 
                - NARRATE "You've received The Crown of Cake!"
                - NARRATE "You've received 200 §2experience§f!"
                - COOLDOWN 'SCRIPT:futtyglut script' 604800
                - ZAP "futtyglut after"
    
'futtyglut reward':
    Type: Task
    Script:
    - NARRATE "You just reached your quota of cake making!"
    - ZAP 'SCRIPT:futtyglut script' 3
  
'futtyglut after':
    Type: Interact
    Requirements:
    Mode: None
    Steps:
        1:
            Click Trigger:
                Script:
                - CHAT "Hey there friend! Still making those cakes?."




Comments
No one has posted a comment! Post one below: