Crossfire Server, Trunk
smoking_pipe.py
Go to the documentation of this file.
1 import Crossfire
2 
3 # archetype that'll be smoked
4 smoke_what = 'pipeweed'
5 color = Crossfire.MessageFlag.NDI_BLUE
6 
7 def smoke():
8  if who.Type != Crossfire.Type.PLAYER:
9  return
10  what = who.Inventory
11  while what:
12  if what.ArchName == smoke_what:
13  break
14  what = what.Below
15  if what == None:
16  who.Write('You don\'t have anything to smoke.', color)
17  return
18 
19  what.Quantity = what.Quantity - 1
20  force = who.CreateObject('force_effect')
21  force.Speed = 0.1
22  force.Duration = 50
23  force.Con = -2
24  force.Dex = -2
25  force.Applied = 1
26  force.SetResist(Crossfire.AttackTypeNumber.FEAR, 100)
27  who.ChangeAbil(force)
28 
29 Crossfire.SetReturnValue(1)
30 
31 me = Crossfire.WhoAmI()
32 who = Crossfire.WhoIsActivator()
33 
34 smoke()
smoking_pipe.smoke
def smoke()
Definition: smoking_pipe.py:7