From 4d433955d8cd50b89c77475215e184e1a7913370 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sat, 12 Jun 2010 16:50:41 +0000 Subject: [PATCH] Pre-condition script, checking for some archetype in the inventory. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13388 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/dialog/pre/archininventory.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 python/dialog/pre/archininventory.py diff --git a/python/dialog/pre/archininventory.py b/python/dialog/pre/archininventory.py new file mode 100644 index 000000000..0bfc44057 --- /dev/null +++ b/python/dialog/pre/archininventory.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# archininventory.py +# This is one of the files that can be called by an npc_dialog, +# The following code runs when a dialog has a pre rule of 'archininventory' +# The syntax is ["archininventory", "arch"] +# To deliver a True verdict, the player must have in his inventory as least one +# item of the specified archetype. +# This is useful to check for skills, or spells, the player knows. +# +## DIALOGCHECK +## MINARGS 1 +## MAXARGS 1 +## .* +## ENDDIALOGCHECK + +arch = args[0] +if character.CheckArchInventory(arch) == None: + verdict = False