ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/deliantra/maps/python/misc/CFweardisguise.py
Revision: 1.1
Committed: Sun Feb 5 00:02:09 2006 UTC (20 years, 8 months ago) by root
Content type: text/x-python
Branch point for: UPSTREAM, MAIN
Log Message:
Initial revision

File Contents

# User Rev Content
1 root 1.1 #CFweardisguise.py
2     # A little script to insert an informational force into the player inventory
3     # if a article is applied and remove the force if it is unapplied.
4     # For example if you put on a priest robe it will insert the option value into
5     # a force slaying field which can be checked against on a map.
6     #
7     # This script is meant for items that can be worn or carried really
8     # I can't say how it will react if you hook it to other types of objects.
9    
10     import Crossfire
11    
12     activator=Crossfire.WhoIsActivator()
13     activatorname=activator.Name
14     whoami=Crossfire.WhoAmI()
15    
16     option=Crossfire.ScriptParameters() # 1 is apply event
17    
18     if option:
19     inv = activator.CheckInventory(option) #Remove any previous disguise
20     if inv:
21     inv.Remove()
22     #print "removing tag"
23    
24     if not whoami.Applied: #is the object is being applied
25     tag = activator.CreateInvisibleObjectInside(option)
26     tag.Name=option
27     #print "adding tag"
28