letbeast=quest {
letplayer=newPlayer()
do!talkplayer"Rudolf""KillBeast"// this is the beginning, we require player to talk with an npc using specified dialog nodeplayer.StartQuest("Beast") // and then, the rest will be called when player does thisdo!killplayer"Beast"// so, when he talks to that npc, this piece is executed, and it attaches the rest, as the handler for kill eventplayer.GiveXP(100) // and then, when monster is killed, this is executed
}
// let's simulate playerletplayer=newPlayer()
player.TalkTo("Rudolf", "KillBeast")
player.Kill("Beast")