Crossfire Server, Trunk
quest.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # basic quest-related tests
3 
4 import Crossfire
5 
6 msg = Crossfire.WhatIsMessage()
7 me = Crossfire.WhoAmI()
8 who = Crossfire.WhoIsActivator()
9 
10 qn = 'darcap/Spike' # quest name to use, if not defined things may work weirdly/crash!
11 
12 if (msg == 'st'):
13  state = who.QuestGetState(qn)
14  me.Say('quest status:%s'%state)
15 elif (msg == 'ch'):
16  who.QuestSetState(qn, 30)
17 elif (msg == 'co'):
18  who.QuestSetState(qn, 50)
19 elif (msg == 'wc'):
20  me.Say('was completed: %s'%who.QuestWasCompleted(qn))
21 elif (msg == 'qs'):
22  who.QuestStart(qn, 1)
23 else:
24  me.Say('...')
25