Update of the Global Events scripts to the new 2.0 CFPython.

Update of the Guild-related scripts to the new 2.0 CFPython.
Update of the remaining scripts to the new 2.0 CFPython.
Gros - 18/10/2005


git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@3901 282e977c-c81d-0410-88c4-b93c2d0d6712
master
gros 2005-10-18 18:53:37 +00:00
parent 098e3e2016
commit 044d3851de
18 changed files with 207 additions and 209 deletions

View File

@ -20,11 +20,10 @@
#
#Updated to use new path functions in CFPython -Todd Mitchell
import CFPython
import Crossfire
import CFLog
activator = CFPython.WhoIsActivator()
name = CFPython.GetName(activator)
activator = Crossfire.WhoIsActivator()
log = CFLog.CFLog()
log.create(name)
log.create(activator.Name)

View File

@ -1,9 +1,9 @@
import CFPython;
import Crossfire
import os.path
import sys
print "Running python initialize script."
sys.path.insert(0, os.path.join(CFPython.GetDataDirectory(), CFPython.GetMapDirectory(), 'python'))
print "Running python initialize script."
sys.path.insert(0, os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(), 'python'))
import CFGuilds
print "Updating Guilds"

View File

@ -17,12 +17,11 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import CFPython
import Crossfire
import CFLog
activator = CFPython.WhoIsActivator()
name = CFPython.GetName(activator)
activator = Crossfire.WhoIsActivator()
log = CFLog.CFLog()
log.kick_update(name)
log.kick_update(activator.Name)

View File

@ -20,13 +20,13 @@
#
#Updated to use new path functions in CFPython -Todd Mitchell
import CFPython
import Crossfire
import CFMail
import CFLog
activator = CFPython.WhoIsActivator()
name = CFPython.GetName(activator)
ip = CFPython.WhatIsMessage()
activator = Crossfire.WhoIsActivator()
name = activator.Name
ip = Crossfire.WhatIsMessage()
log = CFLog.CFLog()
@ -38,7 +38,7 @@ else:
mail = CFMail.CFMail()
total = mail.countmail(name)
if total > 0:
CFPython.Write('You have some mail waiting for you', activator)
activator.Write('You have some mail waiting for you')
else:
CFPython.Write('No mail...', activator)
activator.Write('No mail...')

View File

@ -17,11 +17,11 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import CFPython
import Crossfire
import CFLog
activator = CFPython.WhoIsActivator()
name = CFPython.GetName(activator)
activator = Crossfire.WhoIsActivator()
name = activator.Name
log = CFLog.CFLog()
log.muzzle_update(name)

View File

@ -21,13 +21,13 @@
# Updated to use new path functions in CFPython and Bank
# acount cleanup - Todd Mitchell
import CFPython
import Crossfire
import CFLog
import CFBank
import CFGuilds
activator = CFPython.WhoIsActivator()
name = CFPython.GetName(activator)
activator = Crossfire.WhoIsActivator()
name = activator.Name
log = CFLog.CFLog()
log.remove(name)

View File

@ -16,27 +16,27 @@
#
# author:Avion temitchell@sourceforge.net
import CFPython
import Crossfire
import CFGuilds
import CFItemBroker
import random
import string
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
whoami=CFPython.WhoAmI()
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
whoami=whoami.WhoAmI()
remarklist = ['Excellent','Thank You','Thank You','Thank You', 'Thank You', 'Great', 'OK', 'Wonderful', 'Swell', 'Dude', 'Big Spender']
exclaimlist = ['Hey','Hey','Hey','Hey', 'Now just a minute', 'AHEM', 'OK...Wait a minute', 'Look chowderhead']
buddylist = ['buddy','buddy','buddy','buddy','pal','friend','friend','friend','friend','dude','chum', 'sweetie']
guildname=CFPython.GetEventOptions(whoami,6) # 6 is say event
text = string.split(CFPython.WhatIsMessage())
guildname=Crossfire.ScriptParameters() # 6 is say event
text = string.split(Crossfire.WhatIsMessage())
if (guildname):
guild = CFGuilds.CFGuild(guildname)
cointype = "imperial" #What type of token are we using for guild dues?
object = CFPython.CheckInventory(activator,cointype)
object = activator.CheckInventory(cointype)
if text[0] == 'help' or text[0] == 'yes':
message='Let me know how many %s you want to pay. Say pay <amount>' %cointype
@ -50,7 +50,7 @@ if (guildname):
guild.pay_dues(activatorname,cost)
message = "%s, %d %s paid to the guild." %(random.choice(remarklist),cost, cointype)
else:
if cost > 1:
if cost > 1:
message ="%s, you don't have %d %ss." %(random.choice(exclaimlist),cost,cointype)
else:
message ="You don't have any %s %s." %(cointype,random.choice(buddylist))
@ -59,7 +59,7 @@ if (guildname):
else:
message = "How much ya wanna pay %s?" %(random.choice(buddylist))
else:
message = "Howdy %s, paying some guild dues today?" %(random.choice(buddylist))
CFPython.Say(whoami, message)
message = "Howdy %s, paying some guild dues today?" %(random.choice(buddylist))
whoami.Say(message)
else:
CFPython.Write('Guildname Error, please notify a DM', activator)
activator.Write('Guildname Error, please notify a DM')

View File

@ -17,26 +17,26 @@
#
# authors: majorwoo josh@woosworld.net, Avion temitchell@sourceforge.net
import CFPython
import Crossfire
import CFGuilds
import sys
import string
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
mymap = CFPython.GetMap(activator)
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
mymap = activator.Map
x=15
y=29
whoami=CFPython.WhoAmI()
guildname=CFPython.GetEventOptions(whoami,6) # 6 is say event
whoami=Crossfire.WhoAmI()
guildname=Crossfire.ScriptParameters() # 6 is say event
if (guildname):
guild = CFGuilds.CFGuild(guildname)
text = string.split(CFPython.WhatIsMessage())
text = string.split(Crossfire.WhatIsMessage())
guildrecord = CFGuilds.CFGuildHouses().info(guildname)
found = 0
found = 0
if text[0] == 'enter' or text[0] == 'Enter':
if guildrecord['Status'] == 'inactive':
@ -47,7 +47,7 @@ if (guildname):
else:
if guildrecord['Status'] == 'probation':
CFPython.Write('This guild is currently under probation.\nPlease see a DM for more information', activator)
activator.Write('This guild is currently under probation.\nPlease see a DM for more information'
record = guild.info(activatorname) #see if they are on the board
if record:
@ -59,10 +59,10 @@ if (guildname):
y=22
else:
message = 'Entry granted for %s' %activatorname
y=22
y=22
else:
message = 'You try my patience %s. BEGONE!' %activatorname
CFPython.Teleport(activator,mymap,int(x),int(y)) #teleport them
activator.Teleport(mymap,int(x),int(y)) #teleport them
elif text[0] == 'buy' or text[0] == 'Buy':
if guildrecord['Status'] == 'inactive':
@ -71,16 +71,16 @@ if (guildname):
x = 30
y = 22
message = "Proceed, but know ye that three are required to found a guild and the cost is high"
CFPython.Teleport(activator,mymap,int(x),int(y)) #teleport them
activator.Teleport(mymap,int(x),int(y)) #teleport them
else:
message = "Sorry you already belong to the %s guild. You must quit that guild before founding your own." %in_guild
else:
message = 'This guild is already owned.'
else:
message = 'This is the entry to the great %s guild. Enter or begone!' %guildname
else:
message = 'Guild Guardian Error, please notify a DM'
CFPython.Say(whoami,message)
whoami.Say(message)

View File

@ -1,14 +1,14 @@
import CFPython
import Crossfire
import CFGuilds
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
whoami=CFPython.WhoAmI()
mymap = CFPython.GetMap(activator)
mapname = CFPython.GetName(mymap)
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
whoami=Crossfire.WhoAmI()
mymap = activator.Map
mapname = mymap.Name
trank = 0
points=CFPython.GetEventOptions(whoami,1) # 1 is apply event
points=Crossfire.ScriptParameters() # 1 is apply event
if points:
guild = CFGuilds.SearchGuilds(activatorname)

View File

@ -1,14 +1,14 @@
import CFPython
import Crossfire
import CFGuilds
def mycmp(a, b):
return cmp(a[1], b[1])
activator=CFPython.WhoIsActivator()
activator=Crossfire.WhoIsActivator()
guilds = CFGuilds.CFGuildHouses()
CFPython.Write('Guild Standings:', activator)
CFPython.Write('Guild - Points - Status', activator)
activator.Write('Guild Standings:')
activator.Write('Guild - Points - Status')
guildlist = guilds.list_guilds()
standings = []
@ -18,4 +18,4 @@ for guild in guildlist:
standings.append([record['Points'], guild, record['Status']])
standings.sort(mycmp)
for item in standings:
CFPython.Write('%s - %s - %s' %(item[1],item[0],item[2]), activator)
activator.Write('%s - %s - %s' %(item[1],item[0],item[2]))

View File

@ -1,36 +1,36 @@
import CFPython
import Crossfire
import CFGuilds
whoami=CFPython.WhoAmI()
guildname=CFPython.GetEventOptions(whoami,1) # 1 is 'apply' event
whoami=Crossfire.WhoAmI()
guildname=Crossfire.ScriptParameters() # 1 is 'apply' event
def find_player(object):
while (CFPython.GetType(object) != 1) : #1 is type 'Player'
object = CFPython.GetPreviousObject(object)
while (object.Type != 1) : #1 is type 'Player'
object = object.Above
if not object:
return 0
return object
activator=CFPython.WhoIsActivator()
map = CFPython.GetMap(activator)
activator=Crossfire.WhoIsActivator()
map = activator.Map
players = []
names = []
if (guildname):
#find players by coords
ob1=CFPython.GetObjectAt(map,33,24)
ob2=CFPython.GetObjectAt(map,33,26)
ob1=map.GetObjectAt(33,24)
ob2=map.GetObjectAt(33,26)
objects = [ob1, ob2]
for object in objects:
temp = find_player(object)
if temp:
players.append(temp)
players.append(activator)
for player in players:
names.append(CFPython.GetName(player))
names.append(player.Name)
if len(players) == 3:
print '%s,%s and %s found guild %s' %(names[0], names[1], names[2], guildname)
@ -39,18 +39,18 @@ if (guildname):
for player, name in zip(players, names):
CFGuilds.CFGuild(guildname).add_member(name, 'GuildMaster')
guildmarker = CFPython.CreateInvisibleObjectInside(player, guildname)
CFPython.SetName(guildmarker, guildname)
CFPython.SetSlaying(guildmarker, 'GuildMaster')
guildmarker.Name=guildname
guildmarker.Slaying='GuildMaster'
#teleport them
CFPython.Teleport(player,map,int(11),int(16))
player.Teleport(map,int(11),int(16))
message = "You have purchased the %s guild. Rule it wisely. (I would type 'save' right about now...)"
else:
message = 'To purchase a guild requires two additional persons to stand on the alcoves above.'
else:
print 'Guild Purchase Error: %s, %s' %(guildname, activatorname)
message = 'Guild Purchase Error, please notify a DM'
CFPython.Write(message,whoami)
whoami.Write(message)

View File

@ -19,35 +19,35 @@
# The author can be reached via e-mail at temitchell@sourceforge.net
#
import CFPython
import Crossfire
import CFGuilds
def find_player(object):
while (CFPython.GetType(object) != 1) : #1 is type 'Player'
object = CFPython.GetPreviousObject(object)
while (object.Type != 1) : #1 is type 'Player'
object = object.Above
if not object:
return 0
return object
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
map = CFPython.GetMap(activator)
whoami=CFPython.WhoAmI()
guildname=CFPython.GetEventOptions(whoami,1) # 1 is 'apply' event
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
map = activator.Map
whoami=Crossfire.WhoAmI()
guildname=Crossfire.ScriptParameters() # 1 is 'apply' event
if (guildname):
guild = CFGuilds.CFGuild(guildname)
#find players by coords
ob=CFPython.GetFirstObjectOnSquare(map,9,16)
ob=map.GetFirstObjectOnSquare(9,16)
player = find_player(ob)
if player: # look for player
charname=CFPython.GetName(player)
charname=player.Name
in_guild = CFGuilds.SearchGuilds(charname)
if in_guild == 0:
if guild.info(charname):
#already a member
message = '%s is already a member.' %charname
message = '%s is already a member.' %charname
else:
guild.add_member(charname, 'Initiate')
message = 'Added %s to the guild' %charname
@ -58,6 +58,6 @@ if (guildname):
else:
print 'Guild Join Error: %s' %(guildname)
message = 'Guild Join Error, please notify a DM'
CFPython.Say(whoami, message)
whoami.Say(message)

View File

@ -16,26 +16,26 @@
#
# authors: majorwoo josh@woosworld.net, Avion temitchell@sourceforge.net
import CFPython
import Crossfire
import CFGuilds
import CFLog
import sys
import string
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
whoami=CFPython.WhoAmI()
isDM=CFPython.IsDungeonMaster(activator)
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
whoami=Crossfire.WhoAmI()
isDM=activator.IsDungeonMaster
log=CFLog.CFLog()
guildname=CFPython.GetEventOptions(whoami,6) # 6 is say event
guildname=Crossfire.ScriptParameters() # 6 is say event
print "Activated %s" %guildname
if (guildname):
guild = CFGuilds.CFGuild(guildname)
guildhouse = CFGuilds.CFGuildHouses()
text = string.split(CFPython.WhatIsMessage())
text = string.split(Crossfire.WhatIsMessage())
if text[0] == 'help' or text[0] == 'yes':
if isDM:
@ -60,17 +60,17 @@ if (guildname):
#delete them
guild.remove_member(text[1])
else:
#if we didn't find them on the board
message = '%s was not a member' %text[1]
#if we didn't find them on the board
message = '%s was not a member' %text[1]
else:
message = 'Usage "remove <member_name>"'
elif text[0] == 'list':
list = guild.list_members()
for member in list:
CFPython.Write(member, activator)
activator.Write(member)
message = 'Total members = ' + str(len(list))
elif text[0] == 'promote':
if len(text)==2:
record = guild.info(text[1])
@ -80,8 +80,8 @@ if (guildname):
message = '%s promoted to %s' %(text[1], record['Rank'])
else:
message = 'You cannot promote %s' %text[1]
else:
message = '%s is not a member' %text[1]
else:
message = '%s is not a member' %text[1]
else:
message = 'Usage "promote <member_name>"'
@ -95,7 +95,7 @@ if (guildname):
else:
message = 'You cannot demote %s' %text[1]
else:
message = '%s is not a member' %text[1]
message = '%s is not a member' %text[1]
else:
message = 'Usage "demote <member_name>"'
@ -109,28 +109,28 @@ if (guildname):
else:
message = '%s is not a valid status' %text[2]
else:
message = '%s is not a member' %text[1]
message = '%s is not a member' %text[1]
else:
message = 'Usage "status <member_name> <status>\n%s"' %str(guild.status)
# DM commands
#add user directly
elif text[0] == 'add' and isDM:
elif text[0] == 'add' and isDM:
if len(text)==2:
#check if they are a player
if log.info(text[1]):
#see if they are on the board already
if guild.info(text[1]):
#already a member
message = '%s is already a member.' %text[1]
message = '%s is already a member.' %text[1]
else:
guild.add_member(text[1], 'Initiate')
message = 'Added %s to the guild' %text[1]
else:
message = 'Sorry, I don\'t know any %s' %text[1]
message = 'Sorry, I don\'t know any %s' %text[1]
else:
message = 'Usage "add <membername>"'
#change guild status
elif text[0] == 'guildstatus' and isDM:
if len(text)==2:
@ -142,7 +142,7 @@ if (guildname):
else:
message = '%s is not a valid status' %text[1]
else:
message = '%s is not a guild' %guildname
message = '%s is not a guild' %guildname
else:
message = 'Usage "guildstatus <status>\n%s"' %str(guildhouse.status)
@ -151,4 +151,4 @@ if (guildname):
else:
message = 'Board Error'
CFPython.Say(whoami, message)
whoami.Say(message)

View File

@ -1,43 +1,43 @@
import CFPython
import Crossfire
world_prefix = '/world/world_'
world_len = len( world_prefix ) + len( 'xxx_xxx' )
world_sep = '_'
world_map_size = 50
CFPython.SetReturnValue( 1 )
Crossfire.SetReturnValue( 1 )
player = CFPython.WhoIsActivator()
gps = CFPython.WhoAmI()
map = CFPython.GetMap( player )
player = Crossfire.WhoIsActivator()
gps = Crossfire.WhoAmI()
map = player.Map
if ( map == 0 ):
CFPython.CFWrite( 'You\'re lost in a vacuum!', player )
player.Write( 'You\'re lost in a vacuum!')
else:
path = CFPython.GetMapPath( map )
path = map.Path
if ( path.find( world_prefix ) != 0 ) or ( len( path ) != world_len ):
CFPython.Write( 'You can\'t position yourself here.', player )
player.Write( 'You can\'t position yourself here.' )
else:
marked = CFPython.GetMarkedItem( player )
marked = player.MarkedItem
if ( marked != gps ) and ( CFPython.GetFood( gps ) == 0 ):
CFPython.Write( 'You must fix the origin of the positioning system first!', player )
if ( marked != gps ) and ( gps.Food == 0 ):
player.Write( 'You must fix the origin of the positioning system first!' )
else:
coord = path.split( world_sep )
if ( len( coord ) != 3 ):
CFPython.Write( 'Strange place, you can\'t position yourself...', player )
player.Write( 'Strange place, you can\'t position yourself...' )
else:
map_x = int( coord[ 1 ] ) - 99
map_y = int( coord[ 2 ] ) - 99
x = map_x * world_map_size + CFPython.GetXPosition( player )
y = map_y * world_map_size + CFPython.GetYPosition( player )
x = map_x * world_map_size + player.X
y = map_y * world_map_size + player.Y
if ( marked == gps ):
CFPython.SetHP( gps, x )
CFPython.SetSP( gps, y )
CFPython.SetFood( gps, 1 )
CFPython.Write( 'You reset the origin of the system.', player )
gps.HP=x
gps.SP=y
gps.Food=1
player.Write( 'You reset the origin of the system.' )
else:
x = x - CFPython.GetHP( gps )
y = y - CFPython.GetSP( gps )
CFPython.Write( 'You are at %s:%s.'%( x, y ), player )
x = x - gps.HP
y = y - gps.SP
player.Write( 'You are at %s:%s.'%( x, y ))

View File

@ -1,32 +1,32 @@
import CFPython
import Crossfire
import random
me = CFPython.WhoAmI()
ac = CFPython.WhoIsActivator()
me = Crossfire.WhoAmI()
ac = Crossfire.WhoIsActivator()
r = random.random()
if (CFPython.IsApplied(me)):
if (me.Applied):
if (r <= 0.01):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetDexterity(me, CFPython.GetDexterity(me)+1)
me.Identified=0
me.Cursed= 1
me.Dexterity= me.Dexterity+1
elif (r <= 0.02):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetIntelligence(me, CFPython.GetIntelligence(me)+1)
me.Identified=0
me.Cursed= 1
me.Intelligence= me.Intelligence+1
elif (r <= 0.03):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetConstitution(me, CFPython.GetConstitution(me)+1)
me.Identified=0
me.Cursed= 1
me.Constitution= me.Constitution+1
elif (r >= 0.99):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetDexterity(me, CFPython.GetDexterity(me)-1)
me.Identified=0
me.Cursed= 1
me.Dexterity= me.Dexterity-1
elif (r >= 0.98):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetIntelligence(me, CFPython.GetIntelligence(me)-1)
me.Identified=0
me.Cursed= 1
me.Intelligence= me.Intelligence-1
elif (r >= 0.97):
CFPython.SetIdentified(me,0)
CFPython.SetCursed(me, 1)
CFPython.SetConstitution(me, CFPython.GetConstitution(me)-1)
me.Identified=0
me.Cursed= 1
me.Constitution= me.Constitution-1

View File

@ -1,37 +1,37 @@
import CFPython
import Crossfire
import random
me = CFPython.WhoAmI()
ac = CFPython.WhoIsActivator()
me = Crossfire.WhoAmI()
ac = Crossfire.WhoIsActivator()
r = random.random()
if (r <= 0.01):
CFPython.Write("Your weapon suddenly seems lighter !",ac)
CFPython.SetDamage(me,CFPython.GetDamage(me)+10)
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly seems lighter !")
me.Damage=me.Damage+10
me.Identified=0
me.BeenApplied=0
elif (r <= 0.02):
CFPython.Write("Your weapon suddenly seems darker !",ac)
CFPython.SetDamage(me,CFPython.GetDamage(me)-10)
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly seems darker !")
me.Damage=me.Damage-10
me.Identified=0
me.BeenApplied=0
elif (r <= 0.03):
CFPython.Write("Your weapon suddenly seems lighter !",ac)
CFPython.SetDamage(me,CFPython.GetDamage(me)+10)
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly seems lighter !")
me.Damage=me.Damage+10
me.Identified=0
me.BeenApplied=0
elif (r <= 0.04):
CFPython.Write("Your weapon suddenly seems colder !",ac)
CFPython.SetAttackType(me,CFPython.AttackTypeCold() + CFPython.AttackTypePhysical())
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly seems colder !")
me.AttackType=Crossfire.AttackTypeCold() + Crossfire.AttackTypePhysical())
me.Identified=0
me.BeenApplied=0
elif (r <= 0.05):
CFPython.Write("Your weapon suddenly seems warmer !",ac)
CFPython.SetAttackType(me,CFPython.AttackTypeFire() + CFPython.AttackTypePhysical())
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly seems warmer !")
me.AttackType=Crossfire.AttackTypeFire() + Crossfire.AttackTypePhysical())
me.Identified=0
me.BeenApplied=0
elif (r <= 0.06):
CFPython.Write("Your weapon suddenly emits sparks !",ac)
CFPython.SetAttackType(me,CFPython.AttackTypeElectricity() + CFPython.AttackTypePhysical())
CFPython.SetIdentified(me,0)
CFPython.SetBeenApplied(me,0)
ac.Write("Your weapon suddenly emits sparks !")
me.AttackType=Crossfire.AttackTypeElectricity() + Crossfire.AttackTypePhysical())
me.Identified=0
me.BeenApplied=0

View File

@ -10,7 +10,7 @@
#
# Please help by adding new styles of insults to this fine script.
import CFPython
import Crossfire
from random import choice
def Insult(style):
@ -42,13 +42,13 @@ def Insult(style):
prefixA = ['You are a','Your Matron\'s a', 'You']
prefixAn = ['You are an', 'Your Matron\'s an', 'You']
##NO STYLE
##NO STYLE
else:
return "No such style stupid."
vowels = ['a', 'e', 'i', 'o', 'u']
isvowel = 0
rnoun = choice(noun)
radj1 = choice(adj1)
radj2 = choice(adj2)
@ -63,9 +63,9 @@ def Insult(style):
return insult
activator=CFPython.WhoIsActivator()
whoami=CFPython.WhoAmI()
activator=Crossfire.WhoIsActivator()
whoami=Crossfire.WhoAmI()
#style of insult desired to hurl in event options
style = CFPython.GetEventOptions(whoami,1) # 1 is apply event
style = Crossfire.ScriptParameters() # 1 is apply event
CFPython.Write(Insult(style),activator)
activator.Write(Insult(style))

View File

@ -7,22 +7,22 @@
# This script is meant for items that can be worn or carried really
# I can't say how it will react if you hook it to other types of objects.
import CFPython
import Crossfire
activator=CFPython.WhoIsActivator()
activatorname=CFPython.GetName(activator)
whoami=CFPython.WhoAmI()
activator=Crossfire.WhoIsActivator()
activatorname=activator.Name
whoami=Crossfire.WhoAmI()
option=Crossfire.ScriptParameters() # 1 is apply event
option=CFPython.GetEventOptions(whoami,1) # 1 is apply event
if option:
inv = CFPython.CheckInventory(activator, option) #Remove any previous disguise
inv = activator.CheckInventory(option) #Remove any previous disguise
if inv:
CFPython.RemoveObject(inv)
#print "removing tag"
inv.Remove()
#print "removing tag"
if not CFPython.IsApplied(whoami): #is the object is being applied
tag = CFPython.CreateInvisibleObjectInside(activator, option)
CFPython.SetName(tag, option)
if not whoami.Applied: #is the object is being applied
tag = activator.CreateInvisibleObjectInside(option)
tag.Name=option
#print "adding tag"