From 30570705f5d3d5fd91f4d3b01be6dbc2d634908b Mon Sep 17 00:00:00 2001 From: Wefi Date: Sat, 14 Sep 2013 16:49:42 -0500 Subject: [PATCH] Allows clothing items to effect player. --- scripts/commands/transferitemmisc.py | 44 ++++++++++++------- .../wearables/necklace/necklace_s01.py | 9 +++- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/scripts/commands/transferitemmisc.py b/scripts/commands/transferitemmisc.py index d1dedf7b..83f34e8d 100644 --- a/scripts/commands/transferitemmisc.py +++ b/scripts/commands/transferitemmisc.py @@ -1,18 +1,32 @@ import sys - + def setup(): - return - + return + def run(core, actor, target, commandString): - parsedMsg = commandString.split(' ', 3) - objService = core.objectService - containerID = long(parsedMsg[1]) - print str(containerID) - container = objService.getObject(containerID) - if target and container and target.getContainer(): - print 'Misc Test' - oldContainer = target.getContainer() - oldContainer.transferTo(actor, container, target) - - return - \ No newline at end of file + parsedMsg = commandString.split(' ', 3) + objService = core.objectService + containerID = long(parsedMsg[1]) + container = objService.getObject(containerID) + if target and container and target.getContainer(): + oldContainer = target.getContainer() + + if container == oldContainer: + print 'Error: New container is same as old container.' + return; + + oldContainer.transferTo(actor, container, target) + + if actor == container: + if target.getTemplate().find('/wearables/') or target.getTemplate().find('/weapon/'): + path = 'scripts/' + target.getTemplate().rpartition('/')[0] + '/' + module = target.getTemplate().rpartition('/')[2].replace('shared_', '').replace('.iff', '') + core.scriptService.callScript(path, 'equip', module, core, actor, target) + + if actor == oldContainer: + if target.getTemplate().find('/wearables/') or target.getTemplate().find('/weapon/'): + path = 'scripts/' + target.getTemplate().rpartition('/')[0] + '/' + module = target.getTemplate().rpartition('/')[2].replace('shared_', '').replace('.iff', '') + core.scriptService.callScript(path, 'unequip', module, core, actor, target) + + return \ No newline at end of file diff --git a/scripts/object/tangible/wearables/necklace/necklace_s01.py b/scripts/object/tangible/wearables/necklace/necklace_s01.py index ccad8904..767c6be7 100644 --- a/scripts/object/tangible/wearables/necklace/necklace_s01.py +++ b/scripts/object/tangible/wearables/necklace/necklace_s01.py @@ -1,4 +1,11 @@ import sys def setup(core, object): - return \ No newline at end of file + return + +def equip(core, actor, target): + return + +def unequip(core, actor, target): + return +