File: quest.py

package info (click to toggle)
crossfire-maps 1.75.0%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 275,656 kB
  • sloc: python: 7,711; sql: 92; sh: 73; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
# basic quest-related tests

import Crossfire

msg = Crossfire.WhatIsMessage()
me = Crossfire.WhoAmI()
who = Crossfire.WhoIsActivator()

qn = 'darcap/Spike' # quest name to use, if not defined things may work weirdly/crash!

if (msg == 'st'):
	state = who.QuestGetState(qn)
	me.Say('quest status:%s'%state)
elif (msg == 'ch'):
	who.QuestSetState(qn, 3)
elif (msg == 'co'):
	who.QuestEnd(qn)
elif (msg == 'wc'):
	me.Say('was completed: %s'%who.QuestWasCompleted(qn))
elif (msg == 'qs'):
	who.QuestStart(qn, 1)
else:
	me.Say('...')