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 |
|