mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-13 03:13:26 -04:00
Cleaned up transferitemmisc.
This commit is contained in:
@@ -5,14 +5,14 @@ def setup():
|
||||
return
|
||||
|
||||
def run(core, actor, target, commandString):
|
||||
|
||||
parsedMsg = commandString.split(' ', 3)
|
||||
objService = core.objectService
|
||||
containerID = long(parsedMsg[1])
|
||||
container = objService.getObject(containerID)
|
||||
actorContainer = actor.getContainer()
|
||||
|
||||
if container == None: return
|
||||
if container == None:
|
||||
return
|
||||
|
||||
if not 'cell' in container.getTemplate() and container.isFull():
|
||||
actor.sendSystemMessage('@container_error_message:container03', 0)
|
||||
@@ -24,15 +24,19 @@ def run(core, actor, target, commandString):
|
||||
|
||||
if target.getTemplate() == 'object/tangible/item/shared_loot_cash.iff':
|
||||
core.lootService.handleCreditPickUp(actor,target)
|
||||
if target.getGrandparent().getInventoryItemCount()==1:
|
||||
|
||||
if target.getGrandparent().getInventoryItemCount() == 1:
|
||||
core.lootService.setLooted(actor,target.getGrandparent())
|
||||
|
||||
core.objectService.destroyObject(target)
|
||||
|
||||
return
|
||||
|
||||
if target.isLootItem():
|
||||
target.setLootItem(0)
|
||||
actor.sendSystemMessage('You looted ' + target.getObjectName().getStfValue() + ' from corpse.', 0)
|
||||
#actor.sendSystemMessage('container.getInventoryItemCount() %s' % target.getGrandparent().getInventoryItemCount(), 0)
|
||||
|
||||
if target.getGrandparent().getInventoryItemCount()==1:
|
||||
core.lootService.setLooted(actor,target.getGrandparent())
|
||||
|
||||
@@ -40,20 +44,12 @@ def run(core, actor, target, commandString):
|
||||
target.getContainer().transferTo(actor, container, target)
|
||||
core.simulationService.teleport(target, actor.getPosition(), Quaternion(1,0,0,0), containerID)
|
||||
return
|
||||
|
||||
elif target.getContainer().getTemplate() == "object/cell/shared_cell.iff" and core.housingService.getPermissions(actor, target.getContainer()):
|
||||
target.getContainer().transferTo(actor, container, target)
|
||||
return
|
||||
|
||||
elif actorContainer != None and container.getTemplate() == "object/cell/shared_cell.iff":
|
||||
actor.sendSystemMessage("You do not have permission to access that container!", 0)
|
||||
return
|
||||
|
||||
canEquip = core.equipmentService.canEquip(actor, target)
|
||||
|
||||
if canEquip[0] is False and container == actor:
|
||||
actor.sendSystemMessage(canEquip[1], 0)
|
||||
return
|
||||
|
||||
if target and container and target.getContainer():
|
||||
oldContainer = target.getContainer()
|
||||
@@ -62,29 +58,12 @@ def run(core, actor, target, commandString):
|
||||
print 'Error: New container is same as old container.'
|
||||
return;
|
||||
|
||||
replacedObject = None
|
||||
slotName = None
|
||||
replacedObjects = []
|
||||
slotNames = None
|
||||
|
||||
if actor == container:
|
||||
slotNames = container.getSlotNamesForObject(target)
|
||||
|
||||
for slotName in slotNames:
|
||||
object = container.getSlottedObject(slotName)
|
||||
|
||||
if not object in replacedObjects and not object == None:
|
||||
replacedObjects.append(object)
|
||||
|
||||
if object != None:
|
||||
container.transferTo(actor, container, object)
|
||||
|
||||
if oldContainer == actor.getSlottedObject('appearance_inventory'):
|
||||
actor.removeObjectFromAppearanceEquipList(target)
|
||||
core.equipmentService.unequipAppearance(target)
|
||||
|
||||
oldContainer.transferTo(actor, container, target)
|
||||
|
||||
if container == actor.getSlottedObject('appearance_inventory'):
|
||||
actor.addObjectToAppearanceEquipList(target)
|
||||
core.equipmentService.equipAppearance(target)
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user