0 people like it.

quest

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
let beast = quest {
    let player = new Player()

    do! talk player "Rudolf" "KillBeast" // this is the beginning, we require player to talk with an npc using specified dialog node
    player.StartQuest("Beast") // and then, the rest will be called when player does this
    
    do! kill player "Beast" // so, when he talks to that npc, this piece is executed, and it attaches the rest, as the handler for kill event
    player.GiveXP(100) // and then, when monster is killed, this is executed
}

// let's simulate player
let player = new Player()
player.TalkTo("Rudolf", "KillBeast")
player.Kill("Beast")
val beast : obj

Full name: Script.beast
val player : obj

Full name: Script.player
Raw view Test code New version

More information

Link:http://fssnip.net/58
Posted:15 years ago
Author:
Tags: