| Revision: | 1.1.1.1 (vendor branch) |
| Committed: | Sun Feb 5 00:02:09 2006 UTC (20 years, 7 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 |
| # | Content |
|---|---|
| 1 | import Crossfire |
| 2 | import CFGuilds |
| 3 | |
| 4 | whoami=Crossfire.WhoAmI() |
| 5 | guildname=Crossfire.ScriptParameters() # 1 is 'apply' event |
| 6 | |
| 7 | def find_player(object): |
| 8 | while (object.Type != 1) : #1 is type 'Player' |
| 9 | object = object.Above |
| 10 | if not object: |
| 11 | return 0 |
| 12 | return object |
| 13 | |
| 14 | activator=Crossfire.WhoIsActivator() |
| 15 | map = activator.Map |
| 16 | |
| 17 | players = [] |
| 18 | names = [] |
| 19 | |
| 20 | if (guildname): |
| 21 | #find players by coords |
| 22 | ob1=map.GetObjectAt(33,24) |
| 23 | ob2=map.GetObjectAt(33,26) |
| 24 | objects = [ob1, ob2] |
| 25 | for object in objects: |
| 26 | temp = find_player(object) |
| 27 | if temp: |
| 28 | players.append(temp) |
| 29 | players.append(activator) |
| 30 | |
| 31 | for player in players: |
| 32 | names.append(player.Name) |
| 33 | |
| 34 | if len(players) == 3: |
| 35 | print '%s,%s and %s found guild %s' %(names[0], names[1], names[2], guildname) |
| 36 | |
| 37 | CFGuilds.CFGuildHouses().establish(guildname) |
| 38 | #Masterize them |
| 39 | for player, name in zip(players, names): |
| 40 | CFGuilds.CFGuild(guildname).add_member(name, 'GuildMaster') |
| 41 | guildmarker = CFPython.CreateInvisibleObjectInside(player, guildname) |
| 42 | guildmarker.Name=guildname |
| 43 | guildmarker.Slaying='GuildMaster' |
| 44 | |
| 45 | #teleport them |
| 46 | player.Teleport(map,int(11),int(16)) |
| 47 | message = "You have purchased the %s guild. Rule it wisely. (I would type 'save' right about now...)" |
| 48 | |
| 49 | else: |
| 50 | message = 'To purchase a guild requires two additional persons to stand on the alcoves above.' |
| 51 | else: |
| 52 | print 'Guild Purchase Error: %s, %s' %(guildname, activatorname) |
| 53 | message = 'Guild Purchase Error, please notify a DM' |
| 54 | |
| 55 | whoami.Write(message) |
| 56 |