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
Kevin Zheng 2024-03-21 21:54:03 -07:00
parent 5f115dcda0
commit ee73551e98
2 changed files with 22 additions and 63 deletions

View File

@ -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
activator=Crossfire.WhoIsActivator()
whoami=Crossfire.WhoAmI()
Crossfire.SetReturnValue(1)
activator = Crossfire.WhoIsActivator()
def find_player(object):
while (object.Type != 1) : #1 is type 'Player'
object = object.Above
if not object:
return 0
return object
Crossfire.SetReturnValue(1) # don't run the actual trap
x3=1
y3=8
Params=Crossfire.ScriptParameters().split()
Approved="Access granted" if activator != None and CheckClearance(Params,activator) else "Access denied"
x= 26
y=0
guildname = Params[0]
guild=CFGuilds.CFGuild(guildname)
guildrecord=CFGuilds.CFGuildHouses().info(guildname)
ActionRequired=Params[2]
Params = Crossfire.ScriptParameters().split()
ActionRequired = Params[2] # formerly A for arrest and D for curse, no longer used (always A)
# things which are not a player are ok
if activator == None or activator.Type != Crossfire.Type.PLAYER:
Approved = 'Access granted'
if (Approved != 'Access granted'):
if (ActionRequired == "A"):
activator.Teleport(Crossfire.ReadyMap('/scorn/misc/jail'),int(15),random.choice([1,3]))
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')
if activator is None:
pass
elif activator.Type != Crossfire.Type.PLAYER:
pass
elif CheckClearance(Params, activator):
pass
else:
activator.Teleport(Crossfire.ReadyMap('/scorn/misc/jail'), 15, 1) # 15 minute sentence

View File

@ -28,10 +28,6 @@ import string
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
mymap = activator.Map
x=32
y=16
x1=36
y1=20
activatorx=activator.X
activatory=activator.Y
whoami=Crossfire.WhoAmI()
@ -58,8 +54,7 @@ if text:
message = 'Entry granted for %s' %activatorname
mymap.TriggerConnected(int(Params[2]),1,activator)
else:
message = 'You try my patience %s. BEGONE!' %activatorname
activator.Teleport(mymap,int(x),int(y)) #teleport them
message = "You are not allowed through this door. Access denied."
elif text[0].upper() == 'BUY' and whoami.Name=="Guardian":
if guildrecord['Status'] == 'inactive':