From 0dc753ac810eed4399f21d29ac6a2a5637fa1a26 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sat, 5 May 2007 16:56:02 +0000 Subject: [PATCH] Smoking pipe script. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@6182 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/items/smoking_pipe.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 python/items/smoking_pipe.py diff --git a/python/items/smoking_pipe.py b/python/items/smoking_pipe.py new file mode 100644 index 000000000..b906cfb91 --- /dev/null +++ b/python/items/smoking_pipe.py @@ -0,0 +1,34 @@ +import Crossfire + +# archetype that'll be smoked +smoke_what = 'pipeweed' +color = Crossfire.MessageFlag.NDI_BLUE + +def smoke(): + if who.Type != Crossfire.Type.PLAYER: + return + what = who.Inventory + while what: + if what.ArchName == smoke_what: + break + what = what.Below + if what == None: + who.Write('You don\'t have anything to smoke.', color) + return + + what.Quantity = what.Quantity - 1 + force = who.CreateObject('force_effect') + force.Speed = 0.1 + force.Duration = 50 + force.Con = -2 + force.Dex = -2 + force.Applied = 1 + force.SetResist(Crossfire.AttackTypeNumber.FEAR, 100) + who.ChangeAbil(force) + +Crossfire.SetReturnValue(1) + +me = Crossfire.WhoAmI() +who = Crossfire.WhoIsActivator() + +smoke()