- move event scripts into their own directory
- add README - add disguise script (warning usage still subject to bug 878949) git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@2867 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
159c3d252a
commit
4b57ac9506
|
@ -0,0 +1,14 @@
|
||||||
|
The script names following are reserved for global events.
|
||||||
|
They will be triggered automatically when the event occurs.
|
||||||
|
|
||||||
|
EVENT_BORN - python_born.py
|
||||||
|
EVENT_LOGIN - python_login.py
|
||||||
|
EVENT_LOGOUT - python_logout.py
|
||||||
|
EVENT_REMOVE - python_remove.py
|
||||||
|
EVENT_SHOUT - python_shout.py
|
||||||
|
EVENT_MUZZLE - python_muzzle.py
|
||||||
|
EVENT_KICK - python_kick.py
|
||||||
|
EVENT_MAPENTER - python_mapenter.py
|
||||||
|
EVENT_MAPLEAVE - python_mapleave.py
|
||||||
|
EVENT_CLOCK - python_clock.py
|
||||||
|
EVENT_MAPRESET - python_mapreset.py
|
|
@ -0,0 +1,31 @@
|
||||||
|
#CFweardisguise.py
|
||||||
|
# A little script to insert an informational force into the player inventory
|
||||||
|
# if a article is applied and remove the force if it is unapplied.
|
||||||
|
# For example if you put on a priest robe it will insert the option value into
|
||||||
|
# a force slaying field which can be checked against on a map.
|
||||||
|
#
|
||||||
|
# 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 sys
|
||||||
|
sys.path.append('%s/%s/python' %(CFPython.GetDataDirectory(),CFPython.GetMapDirectory()))
|
||||||
|
|
||||||
|
activator=CFPython.WhoIsActivator()
|
||||||
|
activatorname=CFPython.GetName(activator)
|
||||||
|
whoami=CFPython.WhoAmI()
|
||||||
|
|
||||||
|
option=CFPython.GetEventOptions(whoami,1) # 1 is apply event
|
||||||
|
|
||||||
|
if option:
|
||||||
|
inv = CFPython.CheckInventory(activator, option) #Remove any previous disguise
|
||||||
|
if inv:
|
||||||
|
CFPython.RemoveObject(inv)
|
||||||
|
#print "removing tag"
|
||||||
|
|
||||||
|
if not CFPython.IsApplied(whoami): #is the object is being applied
|
||||||
|
tag = CFPython.CreateInvisibleObjectInside(activator, option)
|
||||||
|
CFPython.SetName(tag, option)
|
||||||
|
#print "adding tag"
|
||||||
|
|
Loading…
Reference in New Issue