Crossfire Server, Trunk
arrest.py
Go to the documentation of this file.
1 import random,Crossfire,CFGuilds,sys,string
2 from CFGuildClearance import CheckClearance
3 activator=Crossfire.WhoIsActivator()
4 whoami=Crossfire.WhoAmI()
5 
6 Crossfire.SetReturnValue(1)
7 
8 def find_player(object):
9  while (object.Type != 1) : #1 is type 'Player'
10  object = object.Above
11  if not object:
12  return 0
13  return object
14 
15 x3=1
16 y3=8
17 Params=Crossfire.ScriptParameters().split()
18 Approved="Access granted" if activator != None and CheckClearance(Params,activator) else "Access denied"
19 x= 26
20 y=0
21 guildname = Params[0]
22 guild=CFGuilds.CFGuild(guildname)
23 guildrecord=CFGuilds.CFGuildHouses().info(guildname)
24 ActionRequired=Params[2]
25 
26 # things which are not a player are ok
27 if activator == None or activator.Type != Crossfire.Type.PLAYER:
28  Approved = 'Access granted'
29 
30 
31 if (Approved != 'Access granted'):
32  if (ActionRequired == "A"):
33  activator.Teleport(Crossfire.ReadyMap('/scorn/misc/jail'),int(15),random.choice([1,3]))
34  elif (ActionRequired == "D"):
35  x4=random.randint(21, 23)
36  y4=random.randint(22,24)
37  Corpse = activator.Map.ObjectAt(int (21), int (0))
38  Curse = activator.Map.ObjectAt(int(x4),int(y4))
39  mymap = activator.Map
40  Corpse.Name = str("%s's body" %(activator.Name))
41  Corpse.Race = str("%s's Curse" %(activator.Name))
42  Corpse.Weight = 1
43  Curse.Name = str("%s's Curse" %(activator.Name))
44  Corpse.Teleport(mymap, activator.X, activator.Y)
45  Curse.InsertInto(activator)
46  Curse1=activator.CheckArchInventory("amulet")
47  #whoami.Say(str(Curse1))
48  #whoami.Say(str(Curse))
49  Curse1.Applied = 1
50 
51  activator.Teleport(mymap,int(23),int(0))
52 
53 
54 
55 # whoami.Say('y')
56 # whoami.Say(Approved)
57  #activator.Teleport(mymap,int(x1),int(Y1))
58 # else:
59 # whoami.Say(Approved)
60 
61 #else:
62 # whoami.Say('Say enter to request entry')
arrest.find_player
def find_player(object)
Definition: arrest.py:8
inja::string_view::split
std::pair< nonstd::string_view, nonstd::string_view > split(nonstd::string_view view, char Separator)
Definition: inja.hpp:1886
make_face_from_files.str
str
Definition: make_face_from_files.py:24
CFGuilds.CFGuild
Definition: CFGuilds.py:136
CFGuilds.CFGuildHouses
Definition: CFGuilds.py:52
make_face_from_files.int
int
Definition: make_face_from_files.py:26
CFGuildClearance.CheckClearance
def CheckClearance(lParams, oActivator)
Definition: CFGuildClearance.py:21