Get rid of guild indefinite detention
Print a normal "access denied" message instead of teleporting offenders into the strange room. For trespassers who step on the traps, teleport them to jail. The curse no longer works and is probably cruel and unusual.master^2
parent
5f115dcda0
commit
ee73551e98
|
@ -1,62 +1,26 @@
|
||||||
import random,Crossfire,CFGuilds,sys,string
|
"""
|
||||||
|
This implements a custom trap that is put under doors in guilds to deal with
|
||||||
|
tailgaters (people without access who follow people with access through doors).
|
||||||
|
|
||||||
|
This used to do some weird cursing, but it's modern times now so this just
|
||||||
|
sends people to Scorn's jail.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import Crossfire
|
||||||
from CFGuildClearance import CheckClearance
|
from CFGuildClearance import CheckClearance
|
||||||
|
|
||||||
activator = Crossfire.WhoIsActivator()
|
activator = Crossfire.WhoIsActivator()
|
||||||
whoami=Crossfire.WhoAmI()
|
|
||||||
|
|
||||||
Crossfire.SetReturnValue(1)
|
Crossfire.SetReturnValue(1) # don't run the actual trap
|
||||||
|
|
||||||
def find_player(object):
|
|
||||||
while (object.Type != 1) : #1 is type 'Player'
|
|
||||||
object = object.Above
|
|
||||||
if not object:
|
|
||||||
return 0
|
|
||||||
return object
|
|
||||||
|
|
||||||
x3=1
|
|
||||||
y3=8
|
|
||||||
Params = Crossfire.ScriptParameters().split()
|
Params = Crossfire.ScriptParameters().split()
|
||||||
Approved="Access granted" if activator != None and CheckClearance(Params,activator) else "Access denied"
|
ActionRequired = Params[2] # formerly A for arrest and D for curse, no longer used (always A)
|
||||||
x= 26
|
|
||||||
y=0
|
|
||||||
guildname = Params[0]
|
|
||||||
guild=CFGuilds.CFGuild(guildname)
|
|
||||||
guildrecord=CFGuilds.CFGuildHouses().info(guildname)
|
|
||||||
ActionRequired=Params[2]
|
|
||||||
|
|
||||||
# things which are not a player are ok
|
if activator is None:
|
||||||
if activator == None or activator.Type != Crossfire.Type.PLAYER:
|
pass
|
||||||
Approved = 'Access granted'
|
elif activator.Type != Crossfire.Type.PLAYER:
|
||||||
|
pass
|
||||||
|
elif CheckClearance(Params, activator):
|
||||||
if (Approved != 'Access granted'):
|
pass
|
||||||
if (ActionRequired == "A"):
|
else:
|
||||||
activator.Teleport(Crossfire.ReadyMap('/scorn/misc/jail'),int(15),random.choice([1,3]))
|
activator.Teleport(Crossfire.ReadyMap('/scorn/misc/jail'), 15, 1) # 15 minute sentence
|
||||||
elif (ActionRequired == "D"):
|
|
||||||
x4=random.randint(21, 23)
|
|
||||||
y4=random.randint(22,24)
|
|
||||||
Corpse = activator.Map.ObjectAt(int (21), int (0))
|
|
||||||
Curse = activator.Map.ObjectAt(int(x4),int(y4))
|
|
||||||
mymap = activator.Map
|
|
||||||
Corpse.Name = str("%s's body" %(activator.Name))
|
|
||||||
Corpse.Race = str("%s's Curse" %(activator.Name))
|
|
||||||
Corpse.Weight = 1
|
|
||||||
Curse.Name = str("%s's Curse" %(activator.Name))
|
|
||||||
Corpse.Teleport(mymap, activator.X, activator.Y)
|
|
||||||
Curse.InsertInto(activator)
|
|
||||||
Curse1=activator.CheckArchInventory("amulet")
|
|
||||||
#whoami.Say(str(Curse1))
|
|
||||||
#whoami.Say(str(Curse))
|
|
||||||
Curse1.Applied = 1
|
|
||||||
|
|
||||||
activator.Teleport(mymap,int(23),int(0))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# whoami.Say('y')
|
|
||||||
# whoami.Say(Approved)
|
|
||||||
#activator.Teleport(mymap,int(x1),int(Y1))
|
|
||||||
# else:
|
|
||||||
# whoami.Say(Approved)
|
|
||||||
|
|
||||||
#else:
|
|
||||||
# whoami.Say('Say enter to request entry')
|
|
||||||
|
|
|
@ -28,10 +28,6 @@ import string
|
||||||
activator=Crossfire.WhoIsActivator()
|
activator=Crossfire.WhoIsActivator()
|
||||||
activatorname=activator.Name
|
activatorname=activator.Name
|
||||||
mymap = activator.Map
|
mymap = activator.Map
|
||||||
x=32
|
|
||||||
y=16
|
|
||||||
x1=36
|
|
||||||
y1=20
|
|
||||||
activatorx=activator.X
|
activatorx=activator.X
|
||||||
activatory=activator.Y
|
activatory=activator.Y
|
||||||
whoami=Crossfire.WhoAmI()
|
whoami=Crossfire.WhoAmI()
|
||||||
|
@ -58,8 +54,7 @@ if text:
|
||||||
message = 'Entry granted for %s' %activatorname
|
message = 'Entry granted for %s' %activatorname
|
||||||
mymap.TriggerConnected(int(Params[2]),1,activator)
|
mymap.TriggerConnected(int(Params[2]),1,activator)
|
||||||
else:
|
else:
|
||||||
message = 'You try my patience %s. BEGONE!' %activatorname
|
message = "You are not allowed through this door. Access denied."
|
||||||
activator.Teleport(mymap,int(x),int(y)) #teleport them
|
|
||||||
|
|
||||||
elif text[0].upper() == 'BUY' and whoami.Name=="Guardian":
|
elif text[0].upper() == 'BUY' and whoami.Name=="Guardian":
|
||||||
if guildrecord['Status'] == 'inactive':
|
if guildrecord['Status'] == 'inactive':
|
||||||
|
|
Loading…
Reference in New Issue