diff --git a/python/events/README b/python/events/README new file mode 100644 index 000000000..b8646025e --- /dev/null +++ b/python/events/README @@ -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 diff --git a/python/python_born.py b/python/events/python_born.py similarity index 100% rename from python/python_born.py rename to python/events/python_born.py diff --git a/python/python_login.py b/python/events/python_login.py similarity index 100% rename from python/python_login.py rename to python/events/python_login.py diff --git a/python/python_remove.py b/python/events/python_remove.py similarity index 100% rename from python/python_remove.py rename to python/events/python_remove.py diff --git a/python/misc/CFweardisguise.py b/python/misc/CFweardisguise.py new file mode 100644 index 000000000..2bf122c45 --- /dev/null +++ b/python/misc/CFweardisguise.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" +