ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/python/guilds/guild_entry.py
Revision: 1.1.1.1 (vendor branch)
Committed: Sun Feb 5 00:02:09 2006 UTC (18 years, 3 months ago) by root
Content type: text/x-python
Branch: UPSTREAM, MAIN
CVS Tags: post_fixaltar, last_stable, post_fixaltar2, rel-2_82, rel-2_81, rel-2_80, pre_coinconvert, UPSTREAM_2006_03_15, rel-3_0, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, UPSTREAM_2006_02_01, rel-2_53, pre_material_cfarch_normalize_run, rel-2_32, pre_fixconverter, post_coinconvert, pre_fixaltar2, pre_map_rename, UPSTREAM_2006_02_22, rel-2_90, rel-2_92, rel-2_93, rel-2_78, post_fixconverter, pre_fixaltar, rel-2_61, rel-2_43, rel-2_42, rel-2_41, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
Initial Import

File Contents

# Content
1 # Script for entering guild houses
2 #
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #
18 # authors: majorwoo josh@woosworld.net, Avion temitchell@sourceforge.net
19
20 import Crossfire
21 import CFGuilds
22
23 import sys
24 import string
25
26 activator=Crossfire.WhoIsActivator()
27 activatorname=activator.Name
28 mymap = activator.Map
29 x=15
30 y=29
31 whoami=Crossfire.WhoAmI()
32 guildname=Crossfire.ScriptParameters() # 6 is say event
33
34 if (guildname):
35
36 guild = CFGuilds.CFGuild(guildname)
37 text = string.split(Crossfire.WhatIsMessage())
38 guildrecord = CFGuilds.CFGuildHouses().info(guildname)
39 found = 0
40 if text[0] == 'enter' or text[0] == 'Enter':
41
42 if guildrecord['Status'] == 'inactive':
43 message = 'This guild is currently inactive and available to be bought.'
44
45 elif guildrecord['Status'] == 'suspended':
46 message = 'This guild is currently under suspension.\nPlease see a DM for more information'
47
48 else:
49 if guildrecord['Status'] == 'probation':
50 activator.Write('This guild is currently under probation.\nPlease see a DM for more information'
51
52 record = guild.info(activatorname) #see if they are on the board
53 if record:
54 #check their status
55 if record['Status'] == 'suspended':
56 message = 'You are currently suspended from the guild'
57 elif record['Status'] == 'probation':
58 message = 'Granted, but you are on probation'
59 y=22
60 else:
61 message = 'Entry granted for %s' %activatorname
62 y=22
63 else:
64 message = 'You try my patience %s. BEGONE!' %activatorname
65 activator.Teleport(mymap,int(x),int(y)) #teleport them
66
67 elif text[0] == 'buy' or text[0] == 'Buy':
68 if guildrecord['Status'] == 'inactive':
69 in_guild = CFGuilds.SearchGuilds(activatorname)
70 if in_guild == 0:
71 x = 30
72 y = 22
73 message = "Proceed, but know ye that three are required to found a guild and the cost is high"
74 activator.Teleport(mymap,int(x),int(y)) #teleport them
75 else:
76 message = "Sorry you already belong to the %s guild. You must quit that guild before founding your own." %in_guild
77 else:
78 message = 'This guild is already owned.'
79 else:
80 message = 'This is the entry to the great %s guild. Enter or begone!' %guildname
81
82 else:
83 message = 'Guild Guardian Error, please notify a DM'
84
85 whoami.Say(message)
86