diff --git a/scripts/commands/dismount.py b/scripts/commands/dismount.py index df9f2733..08aeba54 100644 --- a/scripts/commands/dismount.py +++ b/scripts/commands/dismount.py @@ -4,13 +4,15 @@ def setup(): return def run(core, actor, target, commandString): - if actor.canMount(target) is False: return - - if not actor.isMounted(): - actor.setMounted(1) - target.initMount(actor) - else: - target.unmount(actor) + if not target: + return + + if actor.getObjectID() != target.getOwnerId(): + return + + + if core.mountService.isMounted(actor) is True: + core.mountService.dismount(actor, target) return diff --git a/scripts/commands/mount.py b/scripts/commands/mount.py index 14a0f3e4..40b6e080 100644 --- a/scripts/commands/mount.py +++ b/scripts/commands/mount.py @@ -4,13 +4,13 @@ def setup(): return def run(core, actor, target, commandString): - if actor.canMount(target) is False: return - - if not actor.isMounted(): - actor.setMounted(1) - target.initMount(actor) - else: - target.unmount(actor) - + if not target: + return + + if actor.getObjectID() != target.getOwnerId(): + return + + if core.mountService.isMounted(actor) is False: + core.mountService.mount(actor, target) + return - diff --git a/scripts/commands/spatialchatinternal.py b/scripts/commands/spatialchatinternal.py index 451f6318..3a588dac 100644 --- a/scripts/commands/spatialchatinternal.py +++ b/scripts/commands/spatialchatinternal.py @@ -9,6 +9,7 @@ def run(core, actor, target, commandString): chatMsg = parsedMsg[5] chatType = int(parsedMsg[1]) moodId = int(parsedMsg[2]) - chatService.handleSpatialChat(actor, target, chatMsg, chatType, moodId) + languageId = int(parsedMsg[4]) + chatService.spatialChat(actor, target, chatMsg, chatType, moodId, languageId, None) return \ No newline at end of file diff --git a/scripts/conversation/junk_dealer.py b/scripts/conversation/junk_dealer.py new file mode 100644 index 00000000..7c146b0f --- /dev/null +++ b/scripts/conversation/junk_dealer.py @@ -0,0 +1,572 @@ +from resources.common import ConversationOption +from resources.common import OutOfBand +from resources.common import ProsePackage +from resources.common import RadialOptions +from services.sui import SUIWindow +from services.sui.SUIWindow import Trigger +from java.util import Vector +import sys + +sellItemListRef = 0 +buyItemListRef = 0 +coreRef = 0 +junkDealerRef = 0 + +def startConversation(core, actor, npc): + #core.lootService.prepInv(actor) + global coreRef + global junkDealerRef + global sellItemListRef + sellItemListRef = core.lootService.getSellableInventoryItems(actor) + coreRef = core + junkDealerRef = npc + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_bef51e38') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_54fab04f') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + prose3 = ProsePackage('conversation/junk_dealer_generic', 's_48') + outOfBand3 = OutOfBand() + outOfBand3.addProsePackage(prose3) + prose4 = ProsePackage('conversation/junk_dealer_generic', 's_3aa18b2d') + outOfBand4 = OutOfBand() + outOfBand4.addProsePackage(prose4) + option1 = ConversationOption(outOfBand2, 0) + option2 = ConversationOption(outOfBand3, 1) + option3 = ConversationOption(outOfBand4, 1) + + options = Vector() + options.add(option1) + options.add(option2) + options.add(option3) + + if len(core.lootService.getBuyHistory(actor,npc))!= 0: + prose5 = ProsePackage('conversation/junk_dealer_generic', 's_43') + outOfBand5 = OutOfBand() + outOfBand5.addProsePackage(prose5) + option4 = ConversationOption(outOfBand5, 1) + options.add(option4) + + convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen) + return + +def handleFirstScreen(core, actor, npc, selection): + + convSvc = core.conversationService + + if selection == 0: + # sell items + + prose = ProsePackage('conversation/junk_dealer_generic', 's_84a67771') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + sellItemListRef = core.lootService.getSellableInventoryItems(actor) + + if len(sellItemListRef) == 0: + actor.sendSystemMessage('@loot_dealer:no_items', 1) + startConversation(coreRef,actor,junkDealerRef) + return # no point + + window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) + window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:sell_title') + window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:sell_prompt') + + for item in sellItemListRef: + window.addListBoxMenuItem(item.getCustomName(), 0); + + window.setProperty('btnOther:visible', 'True') + window.setProperty('btnCancel:visible', 'True') + window.setProperty('btnOk:visible', 'True') + window.setProperty('btnOther:Text', '@loot_dealer:examine') + window.setProperty('btnCancel:Text', '@cancel') + window.setProperty('btnOk:Text', '@loot_dealer:btn_sell') + returnList = Vector() + returnList.add('List.lstList:SelectedRow') + + window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, sellWindowCallBack) + window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, sellWindowCallBack) + window.addHandler(2, '', Trigger.TRIGGER_UPDATE, returnList, sellWindowCallBack) + core.suiService.openSUIWindow(window); + + return + + if selection == 1: + # mark items + window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) + window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:junk_no_sell_title') + window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:junk_no_sell_desc') + + sellItemListRef = core.lootService.getSellableInventoryItems(actor) + + for item in sellItemListRef: + nameString = item.getCustomName() + nameString = 'TestJunkItem' + if item.isNoSell(): + nameString = '[*No Sell*]' + item.getCustomName() + window.addListBoxMenuItem(nameString, 0) + else: + nameString = '[Sellable]' + item.getCustomName() + window.addListBoxMenuItem(nameString, 0) + + window.setProperty('btnOther:visible', 'True') + window.setProperty('btnCancel:visible', 'True') + window.setProperty('btnOk:visible', 'True') + window.setProperty('btnOther:Text', '@loot_dealer:examine') + window.setProperty('btnCancel:Text', '@cancel') + window.setProperty('btnOk:Text', '@loot_dealer:junk_no_sell_button') + returnList = Vector() + returnList.add('List.lstList:SelectedRow') + + #window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, noSellWindowCallBack) + #window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, noSellWindowCallBack) + window.addHandler(0, '',9, returnList, noSellWindowCallBack) + window.addHandler(1, '',10, returnList, noSellWindowCallBack) + window.addHandler(2, '',11, returnList, noSellWindowCallBack) + core.suiService.openSUIWindow(window); + return + + if selection == 2: + lootKitScreen1(core, actor, npc) + + + if selection == 3: + # buy back + + buyHistory = coreRef.lootService.getBuyHistory(actor,npc) + if len(buyHistory) == 0: + actor.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 1) + startConversation(coreRef,actor,npc) + return + + prose = ProsePackage('conversation/junk_dealer_generic', 's_44') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + window = core.suiService.createSUIWindow('Script.listBox', actor, npc, 0) + window.setProperty('bg.caption.lblTitle:Text', '@loot_dealer:buy_back_title') + window.setProperty('Prompt.lblPrompt:Text', '@loot_dealer:buy_back_prompt') + + buyHistory = core.lootService.getBuyHistory(actor,junkDealerRef) + if buyHistory==None: + return + + + + for item in buyHistory: + junkDealerPrice = item.getJunkDealerPrice() + if junkDealerPrice == 0: + junkDealerPrice = 20 + nameString = '[%s' % junkDealerPrice + ']' + item.getCustomName() #% + window.addListBoxMenuItem(nameString, 0) + + window.setProperty('btnOther:visible', 'True') + window.setProperty('btnCancel:visible', 'True') + window.setProperty('btnOk:visible', 'True') + window.setProperty('btnOther:Text', '@loot_dealer:examine') + window.setProperty('btnCancel:Text', '@cancel') + window.setProperty('btnOk:Text', '@loot_dealer:btn_buy_back') + returnList = Vector() + returnList.add('List.lstList:SelectedRow') + + window.addHandler(0, '', Trigger.TRIGGER_OK, returnList, buyBackWindowCallBack) + window.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList, buyBackWindowCallBack) + window.addHandler(2, '', Trigger.TRIGGER_UPDATE, returnList, buyBackWindowCallBack) + core.suiService.openSUIWindow(window); + + return + +def handleRespecScreen(core, actor, npc, selection): + + if selection == 0: + core.skillService.sendRespecWindow(actor) + + core.conversationService.handleEndConversation(actor, npc) + + return + + +def handleResetScreen(core, actor, npc, selection): + + if selection == 0: + core.skillService.resetExpertise(actor) + + core.conversationService.handleEndConversation(actor, npc) + + return + +def endConversation(core, actor, npc): + core.conversationService.sendStopConversation(actor, npc, 'conversation/junk_dealer_generic', 's_4bd9d15e') + return + + +def sellWindowCallBack(owner, window, eventType, returnList): + + sellItemListRef = coreRef.lootService.getSellableInventoryItems(owner) + + #sell + if eventType == 0: + + sellItem = sellItemListRef.get(int(returnList.get(0))) + + #if len(sellItemListRef): + #owner.sendSystemMessage('@junk_dealer:no_items', 1) + #return + + if sellItem == None: + owner.sendSystemMessage('@junk_dealer:no_items', 1) + return + + inventory = owner.getSlottedObject('inventory') + + + junkDealerPrice = sellItem.getJunkDealerPrice() + if junkDealerPrice == 0: + junkDealerPrice = 20 + owner.setCashCredits(owner.getCashCredits()+junkDealerPrice) + + # add item to 10-item junk dealer history + coreRef.lootService.addToBuyHistory(owner,junkDealerRef,sellItem) + + owner.sendSystemMessage(OutOfBand.ProsePackage("@junk_dealer:prose_sold_junk", "TT", sellItem.getCustomName(),junkDealerPrice), 0) + + inventory.remove(sellItem) + + coreRef.suiService.closeSUIWindow(owner,window.getWindowId()) + handleFirstScreen(coreRef, owner, junkDealerRef, 0) + return + + #cancel + if eventType == 1: + owner.sendSystemMessage("cancel ", 1) + coreRef.suiService.closeSUIWindow(owner,window.getWindowId()) + startConversation(coreRef,owner,junkDealerRef) + return + + #examine + if eventType == 2: + owner.sendSystemMessage("examine ", 1) + #coreRef.suiService.closeSUIWindow(window,window.getWindowId()) + #startConversation(coreRef,owner,junkDealerRef) + #owner.sendSystemMessage('Examine', 0) + return + + return + +def noSellWindowCallBack(owner, window, eventType, returnList): + + if returnList.get(0) == 0: + startConversation(coreRef,owner,junkDealerRef) + return + + #toggle + if eventType == 0: + owner.sendSystemMessage('Toggle', 0) + toggleItem = sellItemListRef.get(int(returnList.get(0))) + if toggleItem.isNoSell(): + toggleItem.setNoSell(0) + else: + toggleItem.setNoSell(1) + + #core.suiService.closeSUIWindow(window) + handleFirstScreen(coreRef, owner, junkDealerRef, 1) + return + + #cancel + if eventType == 1: + owner.sendSystemMessage('Cancle', 0) + sellItem = returnList.get(0) + startConversation(coreRef,owner,junkDealerRef) + return + + #examine + if eventType == 2: + owner.sendSystemMessage('Ex', 0) + sellItem = returnList.get(0) + startConversation(coreRef,owner,junkDealerRef) + owner.sendSystemMessage('Examine', 0) + return + +def buyBackWindowCallBack(owner, window, eventType, returnList): + + convSvc = coreRef.conversationService + + if returnList.get(0) == 0: + startConversation(coreRef,owner,junkDealerRef) + return + + #buy + if eventType == 0: + index = int(returnList.get(0)) + buyHistory = coreRef.lootService.getBuyHistory(owner,junkDealerRef) + if len(buyHistory) == 0: + owner.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 1) + startConversation(coreRef,owner,junkDealerRef) + return + + buyBackItem = buyHistory.get(index) + + if buyBackItem == None: + owner.sendSystemMessage('@loot_dealer:no_buy_back_items_found', 0) + startConversation(coreRef,owner,junkDealerRef) + return + + if owner.getInventoryItemCount() >= 80: + prose = ProsePackage('conversation/junk_dealer_generic', 's_47') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(owner, junkDealerRef, outOfBand) + return + + junkDealerPrice = buyBackItem.getJunkDealerPrice() + if junkDealerPrice == 0: + junkDealerPrice = 20 + owner.setCashCredits(owner.getCashCredits()+junkDealerPrice) + + if owner.getCashCredits()>=junkDealerPrice: + owner.setCashCredits(owner.getCashCredits()-junkDealerPrice) + inventory = owner.getSlottedObject('inventory') + inventory.add(buyBackItem) + owner.sendSystemMessage('You buy back ' + buyBackItem.getCustomName() + ' for %s' % junkDealerPrice + ' credits.', 0) + # remove from junk dealer history + coreRef.lootService.removeBoughtBackItemFromHistory(owner,junkDealerRef,buyBackItem) + else: + owner.sendSystemMessage('@loot_dealer:prose_no_buy_back', 0) + + coreRef.suiService.closeSUIWindow(owner,window.getWindowId()); + handleFirstScreen(coreRef, owner, junkDealerRef, 3) + return + + #cancel + if eventType == 1: + owner.sendSystemMessage('Cancel', 0) + sellItem = returnList.get(0) + startConversation(coreRef,owner,junkDealerRef) + return + + #examine + if eventType == 2: + owner.sendSystemMessage('Ex', 0) + sellItem = returnList.get(0) + startConversation(coreRef,owner,junkDealerRef) + owner.sendSystemMessage('Examine', 0) + return + +def handleLootScreenSelection1(core, actor, npc, selection): + + convSvc = core.conversationService + if selection == 0: + lootKitScreen1(core, actor, npc) + + return + +def handleLootScreenSelection2(core, actor, npc, selection): + + convSvc = core.conversationService + if selection == 0: + lootKitScreen2(core, actor, npc) + + return + +def handleLootScreenSelection3(core, actor, npc, selection): + + convSvc = core.conversationService + if selection == 0: + lootKitScreen3(core, actor, npc) + + return + +def handleLootScreenSelection4(core, actor, npc, selection): + + convSvc = core.conversationService + if selection == 0: + lootKitScreen4(core, actor, npc) + + return + +def handleLootScreenSelection5(core, actor, npc, selection): + + convSvc = core.conversationService + if selection == 0: + lootKitScreen5a(core, actor, npc) + + if selection == 1: + lootKitScreen5b(core, actor, npc) + + return + +def handleLootScreenSelection6(core, actor, npc, selection): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_14efaaa2') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + if selection == 0: + template = 'object/tangible/loot/collectible/kits/shared_orange_rug_kit.iff' + addLootKit(core, actor, npc,template) + + if selection == 1: + template = 'object/tangible/loot/collectible/kits/shared_blue_rug_kit.iff' + addLootKit(core, actor, npc,template) + + if selection == 2: + template = 'object/tangible/loot/collectible/kits/shared_gong_kit.iff' + addLootKit(core, actor, npc,template) + + if selection == 3: + template = 'object/tangible/loot/collectible/kits/shared_light_table_kit.iff' + addLootKit(core, actor, npc,template) + + if selection == 4: + template = 'object/tangible/loot/collectible/kits/shared_sculpture_kit.iff' + addLootKit(core, actor, npc,template) + + return + +def addLootKit(core, actor, npc,template): + + kit = core.objectService.createObject(template, actor.getPlanet()) + inventory = actor.getSlottedObject('inventory') + inventory.add(kit) + return + +def lootKitScreen1(core, actor, npc): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_d9e6b751') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_6d53d062') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + + option1 = ConversationOption(outOfBand2, 0) + + options = Vector() + options.add(option1) + + convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection2) + + return + +def lootKitScreen2(core, actor, npc): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_e29f48dc') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_324b9b0f') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + + option1 = ConversationOption(outOfBand2, 0) + + options = Vector() + options.add(option1) + + convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection3) + + return + +def lootKitScreen3(core, actor, npc): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_12fe83a6') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_e1a103e5') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + + option1 = ConversationOption(outOfBand2, 0) + + options = Vector() + options.add(option1) + + convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection4) + + return + +def lootKitScreen4(core, actor, npc): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_4d65752') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_d347bee3') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + prose3 = ProsePackage('conversation/junk_dealer_generic', 's_b60b73f8') + outOfBand3 = OutOfBand() + outOfBand3.addProsePackage(prose3) + + option1 = ConversationOption(outOfBand2, 0) + option2 = ConversationOption(outOfBand3, 0) + + options = Vector() + options.add(option1) + options.add(option2) + + convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection5) + + return + +def lootKitScreen5a(core, actor, npc): + + convSvc = core.conversationService + prose = ProsePackage('conversation/junk_dealer_generic', 's_3fc7eb45') + outOfBand = OutOfBand() + outOfBand.addProsePackage(prose) + convSvc.sendConversationMessage(actor, npc, outOfBand) + + prose2 = ProsePackage('conversation/junk_dealer_generic', 's_ee977dee') + outOfBand2 = OutOfBand() + outOfBand2.addProsePackage(prose2) + prose3 = ProsePackage('conversation/junk_dealer_generic', 's_8f39769') + outOfBand3 = OutOfBand() + outOfBand3.addProsePackage(prose3) + prose4 = ProsePackage('conversation/junk_dealer_generic', 's_fe657cdd') + outOfBand4 = OutOfBand() + outOfBand4.addProsePackage(prose4) + prose5 = ProsePackage('conversation/junk_dealer_generic', 's_9ede4b84') + outOfBand5 = OutOfBand() + outOfBand5.addProsePackage(prose5) + prose6 = ProsePackage('conversation/junk_dealer_generic', 's_87c5851b') + outOfBand6 = OutOfBand() + outOfBand6.addProsePackage(prose6) + + option1 = ConversationOption(outOfBand2, 0) + option2 = ConversationOption(outOfBand3, 0) + option3 = ConversationOption(outOfBand4, 0) + option4 = ConversationOption(outOfBand5, 0) + option5 = ConversationOption(outOfBand6, 0) + + options = Vector() + options.add(option1) + options.add(option2) + options.add(option3) + options.add(option4) + options.add(option5) + + convSvc.sendConversationOptions(actor, npc, options, handleLootScreenSelection6) + + return + +def lootKitScreen5b(core, actor, npc): + + startConversation(core,actor,npc) + return \ No newline at end of file diff --git a/scripts/houses/player_house_generic_small_style_02.py b/scripts/houses/player_house_generic_small_style_02.py new file mode 100644 index 00000000..4df4319c --- /dev/null +++ b/scripts/houses/player_house_generic_small_style_02.py @@ -0,0 +1,19 @@ +import sys +from services.housing import HouseTemplate +from engine.resources.scene import Point3D + +def setup(core): + houseTemplate = HouseTemplate("object/tangible/deed/player_house_deed/shared_generic_house_small_style_02_deed.iff", "object/building/player/shared_player_house_generic_small_style_02.iff", 2) + + houseTemplate.addBuildingSign("object/tangible/sign/player/shared_house_address.iff", Point3D(1, 2, 3)) + houseTemplate.addPlaceablePlanet("tatooine") + houseTemplate.addPlaceablePlanet("corellia") + houseTemplate.addPlaceablePlanet("naboo") + houseTemplate.addPlaceablePlanet("talus") + houseTemplate.addPlaceablePlanet("rori") + houseTemplate.addPlaceablePlanet("dantooine") + houseTemplate.addPlaceablePlanet("lok") + houseTemplate.setDefaultItemLimit(200) + + core.housingService.addHousingTemplate(houseTemplate) + return \ No newline at end of file diff --git a/scripts/loot/lootItems/armor/composite_armor_bicep_left.py b/scripts/loot/lootItems/armor/composite_armor_bicep_left.py index 01dae7ed..d5089e38 100644 --- a/scripts/loot/lootItems/armor/composite_armor_bicep_left.py +++ b/scripts/loot/lootItems/armor/composite_armor_bicep_left.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Left Bicep' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_bicep_right.py b/scripts/loot/lootItems/armor/composite_armor_bicep_right.py index d0520ca7..5e04243e 100644 --- a/scripts/loot/lootItems/armor/composite_armor_bicep_right.py +++ b/scripts/loot/lootItems/armor/composite_armor_bicep_right.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Right Bicep' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_boots.py b/scripts/loot/lootItems/armor/composite_armor_boots.py index f82eba8c..f996bfa7 100644 --- a/scripts/loot/lootItems/armor/composite_armor_boots.py +++ b/scripts/loot/lootItems/armor/composite_armor_boots.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Boots' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_bracer_left.py b/scripts/loot/lootItems/armor/composite_armor_bracer_left.py index 9c5bfb48..7d805114 100644 --- a/scripts/loot/lootItems/armor/composite_armor_bracer_left.py +++ b/scripts/loot/lootItems/armor/composite_armor_bracer_left.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Bracer Left' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_bracer_right.py b/scripts/loot/lootItems/armor/composite_armor_bracer_right.py index 2c177745..deb22a6c 100644 --- a/scripts/loot/lootItems/armor/composite_armor_bracer_right.py +++ b/scripts/loot/lootItems/armor/composite_armor_bracer_right.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Bracer Right' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_chestplate.py b/scripts/loot/lootItems/armor/composite_armor_chestplate.py index 9d5687b1..b569da42 100644 --- a/scripts/loot/lootItems/armor/composite_armor_chestplate.py +++ b/scripts/loot/lootItems/armor/composite_armor_chestplate.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Chestplate' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_gloves.py b/scripts/loot/lootItems/armor/composite_armor_gloves.py index c99e4081..acd4a1cf 100644 --- a/scripts/loot/lootItems/armor/composite_armor_gloves.py +++ b/scripts/loot/lootItems/armor/composite_armor_gloves.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Gloves' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_helmet.py b/scripts/loot/lootItems/armor/composite_armor_helmet.py index e29f9e11..d5fe36de 100644 --- a/scripts/loot/lootItems/armor/composite_armor_helmet.py +++ b/scripts/loot/lootItems/armor/composite_armor_helmet.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Helmet' def customItemStackCount(): diff --git a/scripts/loot/lootItems/armor/composite_armor_leggings.py b/scripts/loot/lootItems/armor/composite_armor_leggings.py index 9111c640..a48864a4 100644 --- a/scripts/loot/lootItems/armor/composite_armor_leggings.py +++ b/scripts/loot/lootItems/armor/composite_armor_leggings.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Composite Armor Leggings' def customItemStackCount(): diff --git a/scripts/loot/lootItems/clothes/tusken_raider_bandolier.py b/scripts/loot/lootItems/clothes/tusken_raider_bandolier.py index 41e4b5b6..163a87ea 100644 --- a/scripts/loot/lootItems/clothes/tusken_raider_bandolier.py +++ b/scripts/loot/lootItems/clothes/tusken_raider_bandolier.py @@ -5,4 +5,4 @@ def itemTemplate(): def customItemName(): - return '' + return 'Tusken Raider Bandolier' diff --git a/scripts/loot/lootItems/clothes/tusken_raider_boots.py b/scripts/loot/lootItems/clothes/tusken_raider_boots.py index c6eaa937..81cb35af 100644 --- a/scripts/loot/lootItems/clothes/tusken_raider_boots.py +++ b/scripts/loot/lootItems/clothes/tusken_raider_boots.py @@ -5,4 +5,4 @@ def itemTemplate(): def customItemName(): - return '' + return 'Tusken Raider Boots' diff --git a/scripts/loot/lootItems/clothes/tusken_raider_dress.py b/scripts/loot/lootItems/clothes/tusken_raider_dress.py index 35cec848..c697642b 100644 --- a/scripts/loot/lootItems/clothes/tusken_raider_dress.py +++ b/scripts/loot/lootItems/clothes/tusken_raider_dress.py @@ -5,4 +5,4 @@ def itemTemplate(): def customItemName(): - return '' + return 'Tusken Raider Dress' diff --git a/scripts/loot/lootItems/clothes/tusken_raider_gloves.py b/scripts/loot/lootItems/clothes/tusken_raider_gloves.py index 690f9471..a942a1d3 100644 --- a/scripts/loot/lootItems/clothes/tusken_raider_gloves.py +++ b/scripts/loot/lootItems/clothes/tusken_raider_gloves.py @@ -5,4 +5,4 @@ def itemTemplate(): def customItemName(): - return '' + return 'Tusken Raider Gloves' diff --git a/scripts/loot/lootItems/clothes/tusken_raider_helmet.py b/scripts/loot/lootItems/clothes/tusken_raider_helmet.py index 5187c38b..d4e539d4 100644 --- a/scripts/loot/lootItems/clothes/tusken_raider_helmet.py +++ b/scripts/loot/lootItems/clothes/tusken_raider_helmet.py @@ -5,4 +5,4 @@ def itemTemplate(): def customItemName(): - return '' + return 'Tusken Raider Helmet' diff --git a/scripts/loot/lootItems/junk/antenna.py b/scripts/loot/lootItems/creatureloot/antenna.py similarity index 70% rename from scripts/loot/lootItems/junk/antenna.py rename to scripts/loot/lootItems/creatureloot/antenna.py index 64a11ec4..62113b2d 100644 --- a/scripts/loot/lootItems/junk/antenna.py +++ b/scripts/loot/lootItems/creatureloot/antenna.py @@ -2,3 +2,7 @@ def itemTemplate(): return ['object/tangible/loot/creature_loot/generic/shared_generic_antennae.iff'] + +def customItemName(): + + return 'Antenna' diff --git a/scripts/loot/lootItems/junk/brain.py b/scripts/loot/lootItems/creatureloot/brain.py similarity index 100% rename from scripts/loot/lootItems/junk/brain.py rename to scripts/loot/lootItems/creatureloot/brain.py diff --git a/scripts/loot/lootItems/junk/eye.py b/scripts/loot/lootItems/creatureloot/eye.py similarity index 71% rename from scripts/loot/lootItems/junk/eye.py rename to scripts/loot/lootItems/creatureloot/eye.py index 45a5a41e..076ce324 100644 --- a/scripts/loot/lootItems/junk/eye.py +++ b/scripts/loot/lootItems/creatureloot/eye.py @@ -2,3 +2,7 @@ def itemTemplate(): return ['object/tangible/loot/creature_loot/generic/shared_generic_eye.iff'] + +def customItemName(): + + return 'Eye' diff --git a/scripts/loot/lootItems/junk/gland.py b/scripts/loot/lootItems/creatureloot/gland.py similarity index 100% rename from scripts/loot/lootItems/junk/gland.py rename to scripts/loot/lootItems/creatureloot/gland.py diff --git a/scripts/loot/lootItems/junk/heart.py b/scripts/loot/lootItems/creatureloot/heart.py similarity index 71% rename from scripts/loot/lootItems/junk/heart.py rename to scripts/loot/lootItems/creatureloot/heart.py index 15268f40..8232f7a7 100644 --- a/scripts/loot/lootItems/junk/heart.py +++ b/scripts/loot/lootItems/creatureloot/heart.py @@ -2,3 +2,7 @@ def itemTemplate(): return ['object/tangible/loot/creature_loot/generic/shared_generic_heart.iff'] + +def customItemName(): + + return 'Heart' diff --git a/scripts/loot/lootItems/junk/stomach.py b/scripts/loot/lootItems/creatureloot/stomach.py similarity index 70% rename from scripts/loot/lootItems/junk/stomach.py rename to scripts/loot/lootItems/creatureloot/stomach.py index e4ead448..47042a7d 100644 --- a/scripts/loot/lootItems/junk/stomach.py +++ b/scripts/loot/lootItems/creatureloot/stomach.py @@ -2,3 +2,7 @@ def itemTemplate(): return ['object/tangible/loot/creature_loot/generic/shared_generic_stomach.iff'] + +def customItemName(): + + return 'Stomach' diff --git a/scripts/loot/lootItems/junk/armor_repair_device.py b/scripts/loot/lootItems/junk/armor_repair_device.py index 65252c39..079cd72a 100644 --- a/scripts/loot/lootItems/junk/armor_repair_device.py +++ b/scripts/loot/lootItems/junk/armor_repair_device.py @@ -2,3 +2,20 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_armor_repair_device_generic.iff'] + +def customItemName(): + + return 'Armor Repair Device' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 28 + +def junkType(): + + return 0 + diff --git a/scripts/loot/lootItems/junk/chassis_blueprint.py b/scripts/loot/lootItems/junk/chassis_blueprint.py index 98b2e26f..2848f501 100644 --- a/scripts/loot/lootItems/junk/chassis_blueprint.py +++ b/scripts/loot/lootItems/junk/chassis_blueprint.py @@ -5,4 +5,16 @@ def itemTemplate(): def customItemName(): - return 'Chassis Blueprint' \ No newline at end of file + return 'Chassis Blueprint' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 21 + +def junkType(): + + return 0 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/comlink.py b/scripts/loot/lootItems/junk/comlink.py index ac3ff538..afc926dd 100644 --- a/scripts/loot/lootItems/junk/comlink.py +++ b/scripts/loot/lootItems/junk/comlink.py @@ -5,4 +5,16 @@ def itemTemplate(): def customItemName(): - return 'Comlink' \ No newline at end of file + return 'Comlink' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 15 + +def junkType(): + + return 0 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/damaged_datapad.py b/scripts/loot/lootItems/junk/damaged_datapad.py index d1773502..8bb43fba 100644 --- a/scripts/loot/lootItems/junk/damaged_datapad.py +++ b/scripts/loot/lootItems/junk/damaged_datapad.py @@ -6,4 +6,16 @@ def itemTemplate(): def customItemName(): return 'Damaged Datapad' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 8 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/ear_jewel.py b/scripts/loot/lootItems/junk/ear_jewel.py index 02a39e85..6093adae 100644 --- a/scripts/loot/lootItems/junk/ear_jewel.py +++ b/scripts/loot/lootItems/junk/ear_jewel.py @@ -2,3 +2,7 @@ def itemTemplate(): return ['/object/tangible/loot/npc_loot/shared_jewelry_ear_s02.iff'] + +def customItemName(): + + return 'Ear jewel' \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/explosive_dud.py b/scripts/loot/lootItems/junk/explosive_dud.py index d2983ddc..2d0291da 100644 --- a/scripts/loot/lootItems/junk/explosive_dud.py +++ b/scripts/loot/lootItems/junk/explosive_dud.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_firework_dud_s1.iff'] + +def customItemName(): + + return 'Explosive Dud' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 10 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/hyperdrive_unit.py b/scripts/loot/lootItems/junk/hyperdrive_unit.py index 099c821a..8ce2372d 100644 --- a/scripts/loot/lootItems/junk/hyperdrive_unit.py +++ b/scripts/loot/lootItems/junk/hyperdrive_unit.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/misc/shared_hyperdrive_part_s01.iff'] + +def customItemName(): + + return 'Hyperdrive Unit' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 34 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/id_chip.py b/scripts/loot/lootItems/junk/id_chip.py index b8d8ee89..38cb1161 100644 --- a/scripts/loot/lootItems/junk/id_chip.py +++ b/scripts/loot/lootItems/junk/id_chip.py @@ -6,3 +6,15 @@ def itemTemplate(): def customItemName(): return 'ID Chip' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 14 + +def junkType(): + + return 0 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/impulse_detector.py b/scripts/loot/lootItems/junk/impulse_detector.py index f100ded7..6da7301b 100644 --- a/scripts/loot/lootItems/junk/impulse_detector.py +++ b/scripts/loot/lootItems/junk/impulse_detector.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_impulse_detector_01_generic.iff'] + +def customItemName(): + + return 'Impulse Detector' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 17 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/laser_trap.py b/scripts/loot/lootItems/junk/laser_trap.py index 0ea4640f..fd8840b9 100644 --- a/scripts/loot/lootItems/junk/laser_trap.py +++ b/scripts/loot/lootItems/junk/laser_trap.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_laser_trap_generic.iff'] + +def customItemName(): + + return 'Laser Trap' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 22 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/launcher_tube.py b/scripts/loot/lootItems/junk/launcher_tube.py index d3535342..8f6d60a2 100644 --- a/scripts/loot/lootItems/junk/launcher_tube.py +++ b/scripts/loot/lootItems/junk/launcher_tube.py @@ -5,4 +5,16 @@ def itemTemplate(): def customItemName(): - return 'Launcher Tube' \ No newline at end of file + return 'Launcher Tube' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 16 + +def junkType(): + + return 0 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/ledger.py b/scripts/loot/lootItems/junk/ledger.py index 84481094..ba93e09b 100644 --- a/scripts/loot/lootItems/junk/ledger.py +++ b/scripts/loot/lootItems/junk/ledger.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_ledger_generic.iff'] + +def customItemName(): + + return 'Ledger' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 13 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/magseal_detector.py b/scripts/loot/lootItems/junk/magseal_detector.py index 30890aa6..e98ebf36 100644 --- a/scripts/loot/lootItems/junk/magseal_detector.py +++ b/scripts/loot/lootItems/junk/magseal_detector.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_magseal_detector_generic.iff'] + +def customItemName(): + + return 'MagSeal Detector' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 15 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/medical_console.py b/scripts/loot/lootItems/junk/medical_console.py index aba84602..d393fe32 100644 --- a/scripts/loot/lootItems/junk/medical_console.py +++ b/scripts/loot/lootItems/junk/medical_console.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_medical_console_generic.iff'] + +def customItemName(): + + return 'Medical Console' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 24 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/medical_device.py b/scripts/loot/lootItems/junk/medical_device.py index 4f198f3a..8511594b 100644 --- a/scripts/loot/lootItems/junk/medical_device.py +++ b/scripts/loot/lootItems/junk/medical_device.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_medical_device_generic.iff'] + +def customItemName(): + + return 'Medical Device' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 17 + +def junkType(): + + return 0 \ No newline at end of file diff --git a/scripts/loot/lootItems/junk/motor.py b/scripts/loot/lootItems/junk/motor.py index 0fde31c1..0e72d464 100644 --- a/scripts/loot/lootItems/junk/motor.py +++ b/scripts/loot/lootItems/junk/motor.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_small_motor_generic.iff'] + +def customItemName(): + + return 'Motor' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 13 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/power_output_analyzer.py b/scripts/loot/lootItems/junk/power_output_analyzer.py index 39af3121..16114969 100644 --- a/scripts/loot/lootItems/junk/power_output_analyzer.py +++ b/scripts/loot/lootItems/junk/power_output_analyzer.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_power_output_analyzer_generic.iff'] + +def customItemName(): + + return 'Power Output Analyzer' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 21 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/red_wiring.py b/scripts/loot/lootItems/junk/red_wiring.py index b4682a7b..fbefb228 100644 --- a/scripts/loot/lootItems/junk/red_wiring.py +++ b/scripts/loot/lootItems/junk/red_wiring.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_red_wiring_generic.iff'] + +def customItemName(): + + return 'Red Wiring' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 12 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/shield_module.py b/scripts/loot/lootItems/junk/shield_module.py index 4ba2a8cf..db0fb690 100644 --- a/scripts/loot/lootItems/junk/shield_module.py +++ b/scripts/loot/lootItems/junk/shield_module.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_shield_module_generic.iff'] + +def customItemName(): + + return 'Shield Module' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 20 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/software_module.py b/scripts/loot/lootItems/junk/software_module.py index 98b0759d..58cc91ef 100644 --- a/scripts/loot/lootItems/junk/software_module.py +++ b/scripts/loot/lootItems/junk/software_module.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_software_module_generic.iff'] + +def customItemName(): + + return 'Software Module' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 12 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/survival_gear.py b/scripts/loot/lootItems/junk/survival_gear.py index e4cfba46..efdaebfb 100644 --- a/scripts/loot/lootItems/junk/survival_gear.py +++ b/scripts/loot/lootItems/junk/survival_gear.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_survival_equipment_generic.iff'] + +def customItemName(): + + return 'Survival Gear' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 11 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/underpowered_survey_pad.py b/scripts/loot/lootItems/junk/underpowered_survey_pad.py index 9caf9857..27fac34c 100644 --- a/scripts/loot/lootItems/junk/underpowered_survey_pad.py +++ b/scripts/loot/lootItems/junk/underpowered_survey_pad.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_survey_pad_adv_generic.iff'] + +def customItemName(): + + return 'Underpowered Survey Pad' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 13 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/unidentified_serum_vial.py b/scripts/loot/lootItems/junk/unidentified_serum_vial.py index 06a69fac..d9b5590e 100644 --- a/scripts/loot/lootItems/junk/unidentified_serum_vial.py +++ b/scripts/loot/lootItems/junk/unidentified_serum_vial.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_serum_vial_generic.iff'] + +def customItemName(): + + return 'Unidentified Serum Vial' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 14 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/used_notebook.py b/scripts/loot/lootItems/junk/used_notebook.py index bb42f7fd..6d117330 100644 --- a/scripts/loot/lootItems/junk/used_notebook.py +++ b/scripts/loot/lootItems/junk/used_notebook.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_notebook_generic.iff'] + +def customItemName(): + + return 'Used Notebook' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 12 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/weak_droid_battery.py b/scripts/loot/lootItems/junk/weak_droid_battery.py index 426a9373..8647f305 100644 --- a/scripts/loot/lootItems/junk/weak_droid_battery.py +++ b/scripts/loot/lootItems/junk/weak_droid_battery.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/generic/shared_battery_useable_generic.iff'] + +def customItemName(): + + return 'Weak Droid Battery' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 9 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/junk/worklight_generic.py b/scripts/loot/lootItems/junk/worklight_generic.py index 395beead..3b3bed9a 100644 --- a/scripts/loot/lootItems/junk/worklight_generic.py +++ b/scripts/loot/lootItems/junk/worklight_generic.py @@ -2,3 +2,19 @@ def itemTemplate(): return ['object/tangible/loot/npc_loot/shared_worklight_generic.iff'] + +def customItemName(): + + return 'Generic Worklight' + +def stackable(): + + return 1 + +def junkDealerPrice(): + + return 10 + +def junkType(): + + return 0 diff --git a/scripts/loot/lootItems/weapons/gaderiffi_baton.py b/scripts/loot/lootItems/weapons/gaderiffi_baton.py index 0977f314..f0aa09e9 100644 --- a/scripts/loot/lootItems/weapons/gaderiffi_baton.py +++ b/scripts/loot/lootItems/weapons/gaderiffi_baton.py @@ -5,7 +5,7 @@ def itemTemplate(): def customItemName(): - return '' + return 'Gaderiffi Baton' def customItemStackCount(): diff --git a/scripts/object/building/player/player_house_generic_small_style_01.py b/scripts/object/building/player/player_house_generic_small_style_01.py index 6e0ae61d..aa9723bd 100644 --- a/scripts/object/building/player/player_house_generic_small_style_01.py +++ b/scripts/object/building/player/player_house_generic_small_style_01.py @@ -6,6 +6,6 @@ def setup(core, object): object.setAttachment("structureSign", sign) structureterminal = core.objectService.createChildObject(object, 'object/tangible/terminal/shared_terminal_player_structure.iff', -5, 0.74, -1.81, 0.707107, -0.707107, 1) - #structureterminal.setAttachment('radial_filename', 'structure_management_terminal') + #structureterminal.setAttachment('radial_filename', 'structure/structure_management_terminal') structureterminal.setAttachment('housing_parentstruct', object) return \ No newline at end of file diff --git a/scripts/object/building/player/player_house_generic_small_style_02.py b/scripts/object/building/player/player_house_generic_small_style_02.py index ccad8904..d301f713 100644 --- a/scripts/object/building/player/player_house_generic_small_style_02.py +++ b/scripts/object/building/player/player_house_generic_small_style_02.py @@ -1,4 +1,11 @@ import sys def setup(core, object): + sign = core.objectService.createChildObject(object, 'object/tangible/sign/player/shared_house_address.iff', -1.9, 2.86, 8.35, -1, 0, -1) + print(sign) + object.setAttachment("structureSign", sign) + + structureterminal = core.objectService.createChildObject(object, 'object/tangible/terminal/shared_terminal_player_structure.iff', 6.5, 0.5, -3.8, 0.707108, -0.707108, 3) + #structureterminal.setAttachment('radial_filename', 'structure_management_terminal') + structureterminal.setAttachment('housing_parentstruct', object) return \ No newline at end of file diff --git a/scripts/object/creature/player/bothan_female.py b/scripts/object/creature/player/bothan_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/bothan_female.py +++ b/scripts/object/creature/player/bothan_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/bothan_male.py b/scripts/object/creature/player/bothan_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/bothan_male.py +++ b/scripts/object/creature/player/bothan_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/human_female.py b/scripts/object/creature/player/human_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/human_female.py +++ b/scripts/object/creature/player/human_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/human_male.py b/scripts/object/creature/player/human_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/human_male.py +++ b/scripts/object/creature/player/human_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/ithorian_female.py b/scripts/object/creature/player/ithorian_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/ithorian_female.py +++ b/scripts/object/creature/player/ithorian_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/ithorian_male.py b/scripts/object/creature/player/ithorian_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/ithorian_male.py +++ b/scripts/object/creature/player/ithorian_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/moncal_female.py b/scripts/object/creature/player/moncal_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/moncal_female.py +++ b/scripts/object/creature/player/moncal_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/moncal_male.py b/scripts/object/creature/player/moncal_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/moncal_male.py +++ b/scripts/object/creature/player/moncal_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/rodian_female.py b/scripts/object/creature/player/rodian_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/rodian_female.py +++ b/scripts/object/creature/player/rodian_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/rodian_male.py b/scripts/object/creature/player/rodian_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/rodian_male.py +++ b/scripts/object/creature/player/rodian_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/sullustan_female.py b/scripts/object/creature/player/sullustan_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/sullustan_female.py +++ b/scripts/object/creature/player/sullustan_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/sullustan_male.py b/scripts/object/creature/player/sullustan_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/sullustan_male.py +++ b/scripts/object/creature/player/sullustan_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/trandoshan_female.py b/scripts/object/creature/player/trandoshan_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/trandoshan_female.py +++ b/scripts/object/creature/player/trandoshan_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/trandoshan_male.py b/scripts/object/creature/player/trandoshan_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/trandoshan_male.py +++ b/scripts/object/creature/player/trandoshan_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/twilek_female.py b/scripts/object/creature/player/twilek_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/twilek_female.py +++ b/scripts/object/creature/player/twilek_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/twilek_male.py b/scripts/object/creature/player/twilek_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/twilek_male.py +++ b/scripts/object/creature/player/twilek_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/wookiee_female.py b/scripts/object/creature/player/wookiee_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/wookiee_female.py +++ b/scripts/object/creature/player/wookiee_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/wookiee_male.py b/scripts/object/creature/player/wookiee_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/wookiee_male.py +++ b/scripts/object/creature/player/wookiee_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/zabrak_female.py b/scripts/object/creature/player/zabrak_female.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/zabrak_female.py +++ b/scripts/object/creature/player/zabrak_female.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/creature/player/zabrak_male.py b/scripts/object/creature/player/zabrak_male.py index b80d569c..a77a99e7 100644 --- a/scripts/object/creature/player/zabrak_male.py +++ b/scripts/object/creature/player/zabrak_male.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'player') + object.setAttachment('radial_filename', 'creature/player') return \ No newline at end of file diff --git a/scripts/object/installation/generators/power_generator_fusion_style_1.py b/scripts/object/installation/generators/power_generator_fusion_style_1.py index be7d0439..3b0b69aa 100644 --- a/scripts/object/installation/generators/power_generator_fusion_style_1.py +++ b/scripts/object/installation/generators/power_generator_fusion_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'generator') + object.setAttachment('radial_filename', 'structure/generator') object.setHarvester_type(5) object.setMaintenanceCost(30) object.setGenerator(1) diff --git a/scripts/object/installation/generators/power_generator_geothermal_style_1.py b/scripts/object/installation/generators/power_generator_geothermal_style_1.py index be7d0439..3b0b69aa 100644 --- a/scripts/object/installation/generators/power_generator_geothermal_style_1.py +++ b/scripts/object/installation/generators/power_generator_geothermal_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'generator') + object.setAttachment('radial_filename', 'structure/generator') object.setHarvester_type(5) object.setMaintenanceCost(30) object.setGenerator(1) diff --git a/scripts/object/installation/generators/power_generator_photo_bio_style_1.py b/scripts/object/installation/generators/power_generator_photo_bio_style_1.py index be7d0439..3b0b69aa 100644 --- a/scripts/object/installation/generators/power_generator_photo_bio_style_1.py +++ b/scripts/object/installation/generators/power_generator_photo_bio_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'generator') + object.setAttachment('radial_filename', 'structure/generator') object.setHarvester_type(5) object.setMaintenanceCost(30) object.setGenerator(1) diff --git a/scripts/object/installation/generators/power_generator_solar_style_1.py b/scripts/object/installation/generators/power_generator_solar_style_1.py index be7d0439..3b0b69aa 100644 --- a/scripts/object/installation/generators/power_generator_solar_style_1.py +++ b/scripts/object/installation/generators/power_generator_solar_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'generator') + object.setAttachment('radial_filename', 'structure/generator') object.setHarvester_type(5) object.setMaintenanceCost(30) object.setGenerator(1) diff --git a/scripts/object/installation/generators/power_generator_wind_style_1.py b/scripts/object/installation/generators/power_generator_wind_style_1.py index b82445bb..0c7bc05c 100644 --- a/scripts/object/installation/generators/power_generator_wind_style_1.py +++ b/scripts/object/installation/generators/power_generator_wind_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'generator') + object.setAttachment('radial_filename', 'structure/generator') object.setHarvester_type(5) object.setMaintenanceCost(20) object.setGenerator(1) diff --git a/scripts/object/installation/mining_gas/mining_gas_harvester_style_1.py b/scripts/object/installation/mining_gas/mining_gas_harvester_style_1.py index e90b9514..6b49d930 100644 --- a/scripts/object/installation/mining_gas/mining_gas_harvester_style_1.py +++ b/scripts/object/installation/mining_gas/mining_gas_harvester_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(3) object.setPowerCost(25); object.setMaintenanceCost(16); diff --git a/scripts/object/installation/mining_gas/mining_gas_harvester_style_2.py b/scripts/object/installation/mining_gas/mining_gas_harvester_style_2.py index f90bf1bf..7a6f2b77 100644 --- a/scripts/object/installation/mining_gas/mining_gas_harvester_style_2.py +++ b/scripts/object/installation/mining_gas/mining_gas_harvester_style_2.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(3) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/installation/mining_gas/mining_gas_harvester_style_3.py b/scripts/object/installation/mining_gas/mining_gas_harvester_style_3.py index 5b0bb40b..36a2c41e 100644 --- a/scripts/object/installation/mining_gas/mining_gas_harvester_style_3.py +++ b/scripts/object/installation/mining_gas/mining_gas_harvester_style_3.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(3) object.setPowerCost(75); object.setMaintenanceCost(90); diff --git a/scripts/object/installation/mining_gas/mining_gas_harvester_style_4.py b/scripts/object/installation/mining_gas/mining_gas_harvester_style_4.py index 145b1356..93f4bfec 100644 --- a/scripts/object/installation/mining_gas/mining_gas_harvester_style_4.py +++ b/scripts/object/installation/mining_gas/mining_gas_harvester_style_4.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(3) object.setPowerCost(100); object.setMaintenanceCost(120); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_1.py b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_1.py index 25f6673f..f8ad23ca 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_1.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(1) object.setPowerCost(25); object.setMaintenanceCost(16); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_2.py b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_2.py index 1fc10f74..346183c1 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_2.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_2.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(1) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_3.py b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_3.py index dab15cfd..c1ad33db 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_3.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_3.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(1) object.setPowerCost(75); object.setMaintenanceCost(90); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_4.py b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_4.py index b848b851..a394e5ce 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_4.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_harvester_style_4.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(1) object.setPowerCost(100); object.setMaintenanceCost(120); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester.py b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester.py index 3e112037..3905b4c0 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(4) object.setPowerCost(25); object.setMaintenanceCost(16); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_elite.py b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_elite.py index 7577292f..ae69d03d 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_elite.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(4) object.setPowerCost(100); object.setMaintenanceCost(120); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_heavy.py b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_heavy.py index 1fcc5436..499bd036 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_heavy.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(4) object.setPowerCost(75); object.setMaintenanceCost(90); diff --git a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_medium.py b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_medium.py index 41919756..4962e477 100644 --- a/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_medium.py +++ b/scripts/object/installation/mining_liquid/mining_liquid_moisture_harvester_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(4) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/installation/mining_ore/mining_ore_harvester_elite.py b/scripts/object/installation/mining_ore/mining_ore_harvester_elite.py index 05c3be8a..daafe847 100644 --- a/scripts/object/installation/mining_ore/mining_ore_harvester_elite.py +++ b/scripts/object/installation/mining_ore/mining_ore_harvester_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(0) object.setPowerCost(100); object.setMaintenanceCost(120); diff --git a/scripts/object/installation/mining_ore/mining_ore_harvester_heavy.py b/scripts/object/installation/mining_ore/mining_ore_harvester_heavy.py index 5dfeb966..02cad7c2 100644 --- a/scripts/object/installation/mining_ore/mining_ore_harvester_heavy.py +++ b/scripts/object/installation/mining_ore/mining_ore_harvester_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(0) object.setPowerCost(75); object.setMaintenanceCost(90); diff --git a/scripts/object/installation/mining_ore/mining_ore_harvester_style_1.py b/scripts/object/installation/mining_ore/mining_ore_harvester_style_1.py index 2973a685..7a6fdae5 100644 --- a/scripts/object/installation/mining_ore/mining_ore_harvester_style_1.py +++ b/scripts/object/installation/mining_ore/mining_ore_harvester_style_1.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(0) object.setPowerCost(25); object.setMaintenanceCost(16); diff --git a/scripts/object/installation/mining_ore/mining_ore_harvester_style_2.py b/scripts/object/installation/mining_ore/mining_ore_harvester_style_2.py index e6cfc1b1..76358940 100644 --- a/scripts/object/installation/mining_ore/mining_ore_harvester_style_2.py +++ b/scripts/object/installation/mining_ore/mining_ore_harvester_style_2.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(0) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/installation/mining_organic/mining_organic_flora_farm.py b/scripts/object/installation/mining_organic/mining_organic_flora_farm.py index ace61f59..714ccd97 100644 --- a/scripts/object/installation/mining_organic/mining_organic_flora_farm.py +++ b/scripts/object/installation/mining_organic/mining_organic_flora_farm.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(2) object.setPowerCost(25); object.setMaintenanceCost(16); diff --git a/scripts/object/installation/mining_organic/mining_organic_flora_farm_elite.py b/scripts/object/installation/mining_organic/mining_organic_flora_farm_elite.py index 53ef7fa9..71580f57 100644 --- a/scripts/object/installation/mining_organic/mining_organic_flora_farm_elite.py +++ b/scripts/object/installation/mining_organic/mining_organic_flora_farm_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(2) object.setPowerCost(100); object.setMaintenanceCost(120); diff --git a/scripts/object/installation/mining_organic/mining_organic_flora_farm_heavy.py b/scripts/object/installation/mining_organic/mining_organic_flora_farm_heavy.py index 08daa7ee..dbd32ee3 100644 --- a/scripts/object/installation/mining_organic/mining_organic_flora_farm_heavy.py +++ b/scripts/object/installation/mining_organic/mining_organic_flora_farm_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(2) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/installation/mining_organic/mining_organic_flora_farm_medium.py b/scripts/object/installation/mining_organic/mining_organic_flora_farm_medium.py index 08daa7ee..dbd32ee3 100644 --- a/scripts/object/installation/mining_organic/mining_organic_flora_farm_medium.py +++ b/scripts/object/installation/mining_organic/mining_organic_flora_farm_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvester') + object.setAttachment('radial_filename', 'structure/harvester') object.setHarvester_type(2) object.setPowerCost(60); object.setMaintenanceCost(60); diff --git a/scripts/object/intangible/vehicle/speederbike_swoop_pcd.py b/scripts/object/intangible/vehicle/speederbike_swoop_pcd.py index ace4cdfc..d7c3f4a1 100644 --- a/scripts/object/intangible/vehicle/speederbike_swoop_pcd.py +++ b/scripts/object/intangible/vehicle/speederbike_swoop_pcd.py @@ -1,15 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'vehicle_pcd') - return - -def use(core, actor, object): - if object and actor.getAttachment('activeVehicleID') == None: - swoop = core.objectService.createObject('object/mobile/vehicle/shared_speederbike_swoop.iff', 0, actor.getPlanet(), actor.getPosition(), actor.getOrientation()) - - swoop.setOwnerId(actor.getObjectID()) - actor.setAttachment('activeVehicleID', swoop.getObjectID()) - - core.simulationService.add(swoop, swoop.getPosition().x, swoop.getPosition().z, True) + object.setAttachment('radial_filename', 'datapad/vehicle_pcd') return \ No newline at end of file diff --git a/scripts/object/mobile/respec_seller_f_1.py b/scripts/object/mobile/respec_seller_f_1.py index fce43dfc..c7327815 100644 --- a/scripts/object/mobile/respec_seller_f_1.py +++ b/scripts/object/mobile/respec_seller_f_1.py @@ -2,6 +2,6 @@ import sys from resources.datatables import Options def setup(core, object): - object.setAttachment('radial_filename', 'conversation') + object.setAttachment('radial_filename', 'object/conversation') object.setAttachment('conversationFile', 'respec') return \ No newline at end of file diff --git a/scripts/object/mobile/vehicle/speederbike_swoop.py b/scripts/object/mobile/vehicle/speederbike_swoop.py index 4626c764..0f6896cd 100644 --- a/scripts/object/mobile/vehicle/speederbike_swoop.py +++ b/scripts/object/mobile/vehicle/speederbike_swoop.py @@ -1,16 +1,6 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'vehicle') - return - -def use(core, actor, object): - vehicle = actor.getContainer() - - if vehicle: - if vehicle.getObjectID() == object.getObjectID(): - vehicle.remove(actor) - else: - vehicle.add(actor) - + object.setAttachment('radial_filename', 'creature/vehicle') + object.setAttachment('passengers', 0) return \ No newline at end of file diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed.py index d6d7b4a8..bc69c878 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_1.iff') object.setStructureTemplate('object/installation/mining_organic/shared_mining_organic_flora_farm.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_elite.py b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_elite.py index 66784568..3bda16b3 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_elite.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_organic/shared_mining_organic_flora_farm_elite.iff') object.setLotRequirement(3) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.py b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.py index 097a35ea..419f60f5 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_organic/shared_mining_organic_flora_farm_heavy.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_medium.py b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_medium.py index 70ea50f2..9eb27e8b 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_medium.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_flora_deed_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_2.iff') object.setStructureTemplate('object/installation/mining_organic/shared_mining_organic_flora_farm_medium.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed.py index a11974a2..5a4a2404 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_1.iff') object.setStructureTemplate('object/installation/mining_gas/shared_mining_gas_harvester_style_1.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_elite.py b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_elite.py index 814daa8a..f560acdf 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_elite.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_gas/shared_mining_gas_harvester_style_4.iff') object.setLotRequirement(3) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_heavy.py b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_heavy.py index 2111f7bf..c9bbd64b 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_heavy.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_gas/shared_mining_gas_harvester_style_3.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_medium.py b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_medium.py index 401da10e..10a7007a 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_medium.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_gas_deed_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_2.iff') object.setStructureTemplate('object/installation/mining_gas/shared_mining_gas_harvester_style_2.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed.py index 9bce9e66..b0455145 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_1.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_harvester_style_1.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_elite.py b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_elite.py index 15cbfa5d..723f3eab 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_elite.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_harvester_style_4.iff') object.setLotRequirement(3) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_heavy.py b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_heavy.py index ae4c3c71..773e722d 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_heavy.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_harvester_style_3.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_medium.py b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_medium.py index 4de7136b..1f40b563 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_medium.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_liquid_deed_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_2.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_harvester_style_2.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed.py index 6540aa1d..0241a524 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_1.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_moisture_harvester.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_elite.py b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_elite.py index 21dc0cfc..e008e004 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_elite.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_moisture_harvester_elite.iff') object.setLotRequirement(3) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_heavy.py b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_heavy.py index afeb3a4b..e9206a11 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_heavy.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_heavy.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_moisture_harvester_heavy.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_medium.py b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_medium.py index 7e9a5efe..2d1b24d2 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_medium.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_moisture_deed_medium.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_2.iff') object.setStructureTemplate('object/installation/mining_liquid/shared_mining_liquid_moisture_harvester_medium.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_ore_deed_elite.py b/scripts/object/tangible/deed/harvester_deed/harvester_ore_deed_elite.py index 5e0dde67..b8f86d6e 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_ore_deed_elite.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_ore_deed_elite.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_ore/shared_mining_ore_harvester_elite.iff') object.setLotRequirement(3) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_ore_heavy_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_ore_heavy_deed.py index 7f765aa8..28978e9c 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_ore_heavy_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_ore_heavy_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_heavy.iff') object.setStructureTemplate('object/installation/mining_ore/shared_mining_ore_harvester_heavy.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_ore_s1_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_ore_s1_deed.py index d2edcd91..ca897eb7 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_ore_s1_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_ore_s1_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_1.iff') object.setStructureTemplate('object/installation/mining_ore/shared_mining_ore_harvester_style_1.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/harvester_deed/harvester_ore_s2_deed.py b/scripts/object/tangible/deed/harvester_deed/harvester_ore_s2_deed.py index 34c6d56c..97ca86a7 100644 --- a/scripts/object/tangible/deed/harvester_deed/harvester_ore_s2_deed.py +++ b/scripts/object/tangible/deed/harvester_deed/harvester_ore_s2_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'harvesterDeed') + object.setAttachment('radial_filename', 'deeds/harvesterDeed') object.setConstructorTemplate('object/installation/mining_ore/construction/shared_construction_mining_ore_harvester_style_2.iff') object.setStructureTemplate('object/installation/mining_ore/shared_mining_ore_harvester_style_2.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/player_house_deed/generic_house_small_deed.py b/scripts/object/tangible/deed/player_house_deed/generic_house_small_deed.py index 5dbae10f..f59934aa 100644 --- a/scripts/object/tangible/deed/player_house_deed/generic_house_small_deed.py +++ b/scripts/object/tangible/deed/player_house_deed/generic_house_small_deed.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'structureDeed') + object.setAttachment('radial_filename', 'deeds/structureDeed') object.setConstructorTemplate('object/building/player/construction/shared_construction_player_house_corellia_small_style_01.iff') object.setStructureTemplate('object/tangible/deed/player_house_deed/shared_generic_house_small_deed.iff') object.setLotRequirement(1) diff --git a/scripts/object/tangible/deed/vehicle_deed/speederbike_swoop_deed.py b/scripts/object/tangible/deed/vehicle_deed/speederbike_swoop_deed.py index 4b0e320f..48f0518e 100644 --- a/scripts/object/tangible/deed/vehicle_deed/speederbike_swoop_deed.py +++ b/scripts/object/tangible/deed/vehicle_deed/speederbike_swoop_deed.py @@ -1,24 +1,9 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'vehicleDeed') + object.setAttachment('radial_filename', 'deeds/vehicleDeed') return def use(core, actor, object): - datapad = actor.getSlottedObject('datapad') - pcd = core.objectService.createObject('object/intangible/vehicle/shared_speederbike_swoop_pcd.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) - - if datapad and pcd: - - datapad.add(pcd) - core.objectService.destroyObject(object) - - vehicleId = actor.getAttachment('activeVehicleID') - - if vehicleId == None: - vehicle = core.objectService.createObject('object/mobile/vehicle/shared_speederbike_swoop.iff', actor.getPlanet(), actor.getPosition().x, actor.getPosition().z,actor.getPosition().y) - vehicle.setOwnerId(actor.getObjectID()) - core.simulationService.add(vehicle, vehicle.getPosition().x, vehicle.getPosition().z, True) - actor.setAttachment('activeVehicleID', vehicle.getObjectID()) - + core.mountService.generateVehicle(actor, object, 'object/mobile/vehicle/shared_speederbike_swoop.iff', 'object/intangible/vehicle/shared_speederbike_swoop_pcd.iff') return \ No newline at end of file diff --git a/scripts/object/tangible/holiday/life_day/main_lifeday_tree.py b/scripts/object/tangible/holiday/life_day/main_lifeday_tree.py index ed6e638b..f98db1aa 100644 --- a/scripts/object/tangible/holiday/life_day/main_lifeday_tree.py +++ b/scripts/object/tangible/holiday/life_day/main_lifeday_tree.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'main_lifeday_tree') + object.setAttachment('radial_filename', 'holidays/lifeday/main_lifeday_tree') return diff --git a/scripts/object/tangible/item/rare_loot_chest_1.py b/scripts/object/tangible/item/rare_loot_chest_1.py index 33b2b963..4b7795de 100644 --- a/scripts/object/tangible/item/rare_loot_chest_1.py +++ b/scripts/object/tangible/item/rare_loot_chest_1.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'lootchest') + object.setAttachment('radial_filename', 'item/lootchest') return \ No newline at end of file diff --git a/scripts/object/tangible/item/rare_loot_chest_2.py b/scripts/object/tangible/item/rare_loot_chest_2.py index 33b2b963..4b7795de 100644 --- a/scripts/object/tangible/item/rare_loot_chest_2.py +++ b/scripts/object/tangible/item/rare_loot_chest_2.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'lootchest') + object.setAttachment('radial_filename', 'item/lootchest') return \ No newline at end of file diff --git a/scripts/object/tangible/item/rare_loot_chest_3.py b/scripts/object/tangible/item/rare_loot_chest_3.py index 33b2b963..4b7795de 100644 --- a/scripts/object/tangible/item/rare_loot_chest_3.py +++ b/scripts/object/tangible/item/rare_loot_chest_3.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'lootchest') + object.setAttachment('radial_filename', 'item/lootchest') return \ No newline at end of file diff --git a/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_other_01_01.py b/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_other_01_01.py index 3e649d7b..6f7c8887 100644 --- a/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_other_01_01.py +++ b/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_other_01_01.py @@ -6,5 +6,5 @@ def setup(core, object): object.setCustomName('Life Day Gift Box For A Friend') object.setIntAttribute('volume', 1) object.setIntAttribute('tier', 2) - object.setAttachment('radial_filename', 'lifeday_gift') + object.setAttachment('radial_filename', 'holidays/lifeday/lifeday_gift') return \ No newline at end of file diff --git a/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_self_01_01.py b/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_self_01_01.py index aef17bd8..273b89dc 100644 --- a/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_self_01_01.py +++ b/scripts/object/tangible/loot/creature_loot/collections/item_lifeday_gift_self_01_01.py @@ -7,5 +7,5 @@ def setup(core, object): object.setIntAttribute('volume', 1) object.setIntAttribute('no_trade', 1) object.setIntAttribute('tier', 2) - object.setAttachment('radial_filename', 'lifeday_gift') + object.setAttachment('radial_filename', 'holidays/lifeday/lifeday_gift') return \ No newline at end of file diff --git a/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py b/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py index 15085ba3..786a488c 100644 --- a/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py +++ b/scripts/object/tangible/loot/generic_usable/stim_syringe_generic.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'usable') + object.setAttachment('radial_filename', 'object/usable') return \ No newline at end of file diff --git a/scripts/object/tangible/quest/heroic/heroic_exar_kun_entrance.py b/scripts/object/tangible/quest/heroic/heroic_exar_kun_entrance.py index 79b40d1f..7ca08004 100644 --- a/scripts/object/tangible/quest/heroic/heroic_exar_kun_entrance.py +++ b/scripts/object/tangible/quest/heroic/heroic_exar_kun_entrance.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'exar_kun_brazier') + object.setAttachment('radial_filename', 'instances/exar_kun/exar_kun_brazier') return def use(core, actor, object): diff --git a/scripts/object/tangible/survey_tool/survey_tool_all.py b/scripts/object/tangible/survey_tool/survey_tool_all.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_all.py +++ b/scripts/object/tangible/survey_tool/survey_tool_all.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_gas.py b/scripts/object/tangible/survey_tool/survey_tool_gas.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_gas.py +++ b/scripts/object/tangible/survey_tool/survey_tool_gas.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_geo_thermal.py b/scripts/object/tangible/survey_tool/survey_tool_geo_thermal.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_geo_thermal.py +++ b/scripts/object/tangible/survey_tool/survey_tool_geo_thermal.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_inorganic.py b/scripts/object/tangible/survey_tool/survey_tool_inorganic.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_inorganic.py +++ b/scripts/object/tangible/survey_tool/survey_tool_inorganic.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_liquid.py b/scripts/object/tangible/survey_tool/survey_tool_liquid.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_liquid.py +++ b/scripts/object/tangible/survey_tool/survey_tool_liquid.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_lumber.py b/scripts/object/tangible/survey_tool/survey_tool_lumber.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_lumber.py +++ b/scripts/object/tangible/survey_tool/survey_tool_lumber.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_mineral.py b/scripts/object/tangible/survey_tool/survey_tool_mineral.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_mineral.py +++ b/scripts/object/tangible/survey_tool/survey_tool_mineral.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_moisture.py b/scripts/object/tangible/survey_tool/survey_tool_moisture.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_moisture.py +++ b/scripts/object/tangible/survey_tool/survey_tool_moisture.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_organic.py b/scripts/object/tangible/survey_tool/survey_tool_organic.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_organic.py +++ b/scripts/object/tangible/survey_tool/survey_tool_organic.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_solar.py b/scripts/object/tangible/survey_tool/survey_tool_solar.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_solar.py +++ b/scripts/object/tangible/survey_tool/survey_tool_solar.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/survey_tool/survey_tool_wind.py b/scripts/object/tangible/survey_tool/survey_tool_wind.py index 3e0e6490..fa89b86c 100644 --- a/scripts/object/tangible/survey_tool/survey_tool_wind.py +++ b/scripts/object/tangible/survey_tool/survey_tool_wind.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'survey_tool') + object.setAttachment('radial_filename', 'item/survey_tool') return \ No newline at end of file diff --git a/scripts/object/tangible/terminal/terminal_character_builder.py b/scripts/object/tangible/terminal/terminal_character_builder.py index d95cbb4c..306a13df 100644 --- a/scripts/object/tangible/terminal/terminal_character_builder.py +++ b/scripts/object/tangible/terminal/terminal_character_builder.py @@ -1,7 +1,7 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'usable') + object.setAttachment('radial_filename', 'object/usable') return def use(core, owner, target): diff --git a/scripts/object/tangible/terminal/terminal_player_structure.py b/scripts/object/tangible/terminal/terminal_player_structure.py index 839210a3..dd5b18cd 100644 --- a/scripts/object/tangible/terminal/terminal_player_structure.py +++ b/scripts/object/tangible/terminal/terminal_player_structure.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'structure_management_terminal') + object.setAttachment('radial_filename', 'structure/structure_management_terminal') return \ No newline at end of file diff --git a/scripts/object/tangible/terminal/terminal_player_structure_new.py b/scripts/object/tangible/terminal/terminal_player_structure_new.py index 839210a3..dd5b18cd 100644 --- a/scripts/object/tangible/terminal/terminal_player_structure_new.py +++ b/scripts/object/tangible/terminal/terminal_player_structure_new.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'structure_management_terminal') + object.setAttachment('radial_filename', 'structure/structure_management_terminal') return \ No newline at end of file diff --git a/scripts/object/tangible/terminal/terminal_player_structure_nosnap.py b/scripts/object/tangible/terminal/terminal_player_structure_nosnap.py index 839210a3..dd5b18cd 100644 --- a/scripts/object/tangible/terminal/terminal_player_structure_nosnap.py +++ b/scripts/object/tangible/terminal/terminal_player_structure_nosnap.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'structure_management_terminal') + object.setAttachment('radial_filename', 'structure/structure_management_terminal') return \ No newline at end of file diff --git a/scripts/object/tangible/terminal/terminal_player_structure_nosnap_mini.py b/scripts/object/tangible/terminal/terminal_player_structure_nosnap_mini.py index 839210a3..dd5b18cd 100644 --- a/scripts/object/tangible/terminal/terminal_player_structure_nosnap_mini.py +++ b/scripts/object/tangible/terminal/terminal_player_structure_nosnap_mini.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'structure_management_terminal') + object.setAttachment('radial_filename', 'structure/structure_management_terminal') return \ No newline at end of file diff --git a/scripts/object/tangible/travel/travel_ticket/base/base_travel_ticket.py b/scripts/object/tangible/travel/travel_ticket/base/base_travel_ticket.py index 77e1b16d..446e9f9f 100644 --- a/scripts/object/tangible/travel/travel_ticket/base/base_travel_ticket.py +++ b/scripts/object/tangible/travel/travel_ticket/base/base_travel_ticket.py @@ -1,5 +1,5 @@ import sys def setup(core, object): - object.setAttachment('radial_filename', 'travel_ticket') + object.setAttachment('radial_filename', 'item/travel_ticket') return \ No newline at end of file diff --git a/scripts/radial/player.py b/scripts/radial/creature/player.py similarity index 100% rename from scripts/radial/player.py rename to scripts/radial/creature/player.py diff --git a/scripts/radial/creature/vehicle.py b/scripts/radial/creature/vehicle.py new file mode 100644 index 00000000..5935709d --- /dev/null +++ b/scripts/radial/creature/vehicle.py @@ -0,0 +1,31 @@ +from resources.common import RadialOptions +import sys + +def createRadial(core, owner, target, radials): + master = core.objectService.getObject(target.getOwnerId()) + + radials.add(RadialOptions(0, 7, 1, '')) + if core.mountService.canMount(owner, target): + radials.add(RadialOptions(1, 40, 3, '@pet/pet_menu:menu_enter_exit')) + radials.add(RadialOptions(0, 21, 1, '')) + if target.getOwnerId() == owner.getObjectID(): + radials.add(RadialOptions(0, 60, 3, '@pet/pet_menu:menu_store')) + if core.mountService.canRepair(owner, target): + radials.add(RadialOptions(0, 114, 3, '@pet/pet_menu:menu_repair_vehicle')) + return + +def handleSelection(core, owner, target, option): + mntSvc = core.mountService + + if target: + if option == 21: + if mntSvc.isMounted(owner): + mntSvc.mount(owner, target) + else: + mntSvc.unmount(owner, target) + elif option == 60: + mntSvc.store(owner, target) + elif option == 114: + mntSvc.repair(owner, target) + return + diff --git a/scripts/radial/datapad/vehicle_pcd.py b/scripts/radial/datapad/vehicle_pcd.py new file mode 100644 index 00000000..fc880185 --- /dev/null +++ b/scripts/radial/datapad/vehicle_pcd.py @@ -0,0 +1,21 @@ +from resources.common import RadialOptions +import sys + +def createRadial(core, owner, target, radials): + #if not core.mountService.getMount(target): + # radials.add(RadialOptions(0, 21, 3, '@pet_menu:menu_call')) + #else: + # radials.add(RadialOptions(0, 21, 3, '@pet_menu:menu_store')) + radials.add(RadialOptions(0, 61, 1, '')) + radials.add(RadialOptions(0, 7, 1, '')) + radials.add(RadialOptions(0, 15, 1, '')) + return + +def handleSelection(core, owner, target, option): + if option == 61 and target: + core.mountService.call(owner, target) + elif option == 15 and target: + core.mountService.destroy(owner, target) + + return + \ No newline at end of file diff --git a/scripts/radial/deed.py b/scripts/radial/deeds/deed.py similarity index 100% rename from scripts/radial/deed.py rename to scripts/radial/deeds/deed.py diff --git a/scripts/radial/harvesterDeed.py b/scripts/radial/deeds/harvesterDeed.py similarity index 100% rename from scripts/radial/harvesterDeed.py rename to scripts/radial/deeds/harvesterDeed.py diff --git a/scripts/radial/structureDeed.py b/scripts/radial/deeds/structureDeed.py similarity index 100% rename from scripts/radial/structureDeed.py rename to scripts/radial/deeds/structureDeed.py diff --git a/scripts/radial/vehicleDeed.py b/scripts/radial/deeds/vehicleDeed.py similarity index 86% rename from scripts/radial/vehicleDeed.py rename to scripts/radial/deeds/vehicleDeed.py index 633eb6db..033462ad 100644 --- a/scripts/radial/vehicleDeed.py +++ b/scripts/radial/deeds/vehicleDeed.py @@ -4,7 +4,7 @@ import sys def createRadial(core, owner, target, radials): radials.add(RadialOptions(0, 7, 1, '')) radials.add(RadialOptions(0, 15, 1, '')) - radials.add(RadialOptions(0, 61, 1, '')) + radials.add(RadialOptions(0, 61, 3, '@pet_menu:menu_generate')) return def handleSelection(core, owner, target, option): diff --git a/scripts/radial/appearance.py b/scripts/radial/equipment/appearance.py similarity index 100% rename from scripts/radial/appearance.py rename to scripts/radial/equipment/appearance.py diff --git a/scripts/radial/wearable.py b/scripts/radial/equipment/wearable.py similarity index 100% rename from scripts/radial/wearable.py rename to scripts/radial/equipment/wearable.py diff --git a/scripts/radial/lifeday_gift.py b/scripts/radial/holidays/lifeday_gift.py similarity index 100% rename from scripts/radial/lifeday_gift.py rename to scripts/radial/holidays/lifeday_gift.py diff --git a/scripts/radial/main_lifeday_tree.py b/scripts/radial/holidays/main_lifeday_tree.py similarity index 100% rename from scripts/radial/main_lifeday_tree.py rename to scripts/radial/holidays/main_lifeday_tree.py diff --git a/scripts/radial/exar_kun_brazier.py b/scripts/radial/instances/exar_kun/exar_kun_brazier.py similarity index 100% rename from scripts/radial/exar_kun_brazier.py rename to scripts/radial/instances/exar_kun/exar_kun_brazier.py diff --git a/scripts/radial/collection.py b/scripts/radial/item/collection.py similarity index 100% rename from scripts/radial/collection.py rename to scripts/radial/item/collection.py diff --git a/scripts/radial/item.py b/scripts/radial/item/item.py similarity index 100% rename from scripts/radial/item.py rename to scripts/radial/item/item.py diff --git a/scripts/radial/lootchest.py b/scripts/radial/item/lootchest.py similarity index 100% rename from scripts/radial/lootchest.py rename to scripts/radial/item/lootchest.py diff --git a/scripts/radial/resourceContainer.py b/scripts/radial/item/resourceContainer.py similarity index 100% rename from scripts/radial/resourceContainer.py rename to scripts/radial/item/resourceContainer.py diff --git a/scripts/radial/survey_tool.py b/scripts/radial/item/survey_tool.py similarity index 100% rename from scripts/radial/survey_tool.py rename to scripts/radial/item/survey_tool.py diff --git a/scripts/radial/travel_ticket.py b/scripts/radial/item/travel_ticket.py similarity index 100% rename from scripts/radial/travel_ticket.py rename to scripts/radial/item/travel_ticket.py diff --git a/scripts/radial/tunable.py b/scripts/radial/item/tunable.py similarity index 100% rename from scripts/radial/tunable.py rename to scripts/radial/item/tunable.py diff --git a/scripts/radial/conversation.py b/scripts/radial/object/conversation.py similarity index 100% rename from scripts/radial/conversation.py rename to scripts/radial/object/conversation.py diff --git a/scripts/radial/usable.py b/scripts/radial/object/usable.py similarity index 100% rename from scripts/radial/usable.py rename to scripts/radial/object/usable.py diff --git a/scripts/radial/generator.py b/scripts/radial/structure/generator.py similarity index 100% rename from scripts/radial/generator.py rename to scripts/radial/structure/generator.py diff --git a/scripts/radial/harvester.py b/scripts/radial/structure/harvester.py similarity index 100% rename from scripts/radial/harvester.py rename to scripts/radial/structure/harvester.py diff --git a/scripts/radial/harvesterHopper.py b/scripts/radial/structure/harvesterHopper.py similarity index 100% rename from scripts/radial/harvesterHopper.py rename to scripts/radial/structure/harvesterHopper.py diff --git a/scripts/radial/moveable.py b/scripts/radial/structure/moveable.py similarity index 100% rename from scripts/radial/moveable.py rename to scripts/radial/structure/moveable.py diff --git a/scripts/radial/structure_management_terminal.py b/scripts/radial/structure/structure_management_terminal.py similarity index 100% rename from scripts/radial/structure_management_terminal.py rename to scripts/radial/structure/structure_management_terminal.py diff --git a/scripts/radial/vehicle.py b/scripts/radial/vehicle.py deleted file mode 100644 index 9c5a8e96..00000000 --- a/scripts/radial/vehicle.py +++ /dev/null @@ -1,29 +0,0 @@ -from resources.common import RadialOptions - -import sys - -def createRadial(core, owner, target, radials): - radials.add(RadialOptions(0, 7, 1, '')) - - if owner.canMount(target): - radials.add(RadialOptions(0, 208, 1, '@pet/pet_menu:menu_enter_exit')) - - if target.getOwnerId() == owner.getObjectID(): - radials.add(RadialOptions(0, 60, 3, '@pet/pet_menu:menu_store')) - - return - -def handleSelection(core, owner, target, option): - if target: - if option == 208: - if not owner.isMounted(): - owner.setMounted(1) - target.initMount(owner) - else: - target.unmount(owner) - - if option == 60: - if owner.isMounted(): target.unmount(owner) - core.objectService.destroyObject(target) - owner.setAttachment('activeVehicleID', None) - return \ No newline at end of file diff --git a/scripts/radial/vehicle_pcd.py b/scripts/radial/vehicle_pcd.py deleted file mode 100644 index 5f09ba10..00000000 --- a/scripts/radial/vehicle_pcd.py +++ /dev/null @@ -1,27 +0,0 @@ -from resources.common import RadialOptions -import sys - -def createRadial(core, owner, target, radials): - radials.add(RadialOptions(0, 62, 1, '')) - radials.add(RadialOptions(0, 7, 1, '')) - return - -def handleSelection(core, owner, target, option): - - if option == 61 and target: - core.objectService.useObject(owner, target) - - if option == 62 and target: - - vehicleId = long(owner.getAttachment('activeVehicleID')) - - if vehicleId != None: - vehicleObject = core.objectService.getObject(vehicleId) - - if owner.isMounted(): vehicleObject.unmount(owner) - - core.objectService.destroyObject(vehicleId) - owner.setAttachment('activeVehicleID', None) - - return - \ No newline at end of file diff --git a/scripts/staticNPCs/junk_dealer.py b/scripts/staticNPCs/junk_dealer.py new file mode 100644 index 00000000..d2965171 --- /dev/null +++ b/scripts/staticNPCs/junk_dealer.py @@ -0,0 +1,6 @@ + + + + +object = stcSvc.spawnObject('object/mobile/shared_respec_seller_f_1.iff', 'tatooine', long(0), float(3533.14), float(5), float(-4788.86), float(-0.3327), float(0.9288)) +object.setOptionsBitmask(264) \ No newline at end of file diff --git a/scripts/static_spawns/tatooine.py b/scripts/static_spawns/tatooine.py index 7944d2f3..c059c589 100644 --- a/scripts/static_spawns/tatooine.py +++ b/scripts/static_spawns/tatooine.py @@ -11,7 +11,12 @@ def addPlanetSpawns(core, planet): stcSvc.spawnObject('object/tangible/terminal/shared_terminal_character_builder.iff', 'tatooine', long(0), float(3525), float(4), float(-4801), float(0.70), float(0.71)) #object = stcSvc.spawnObject('object/mobile/shared_respec_seller_f_1.iff', 'tatooine', long(0), float(3533.14), float(5), float(-4788.86), float(-0.3327), float(0.9288)) #object.setOptionsBitmask(264) - + + junkdealer = stcSvc.spawnObject('object/mobile/shared_junk_dealer_m_01.iff', 'tatooine', long(0), float(3525), float(4), float(-4804), float(0.70), float(0.71)) + junkdealer.setOptionsBitmask(264) + junkdealer.setCustomName('a Junk Dealer') + junkdealer.setAttachment('radial_filename', 'conversation'); + junkdealer.setAttachment('conversationFile','junk_dealer') return diff --git a/src/main/NGECore.java b/src/main/NGECore.java index 51e235bb..88784bcf 100644 --- a/src/main/NGECore.java +++ b/src/main/NGECore.java @@ -85,6 +85,7 @@ import services.LoginService; import services.map.MapService; import services.object.ObjectService; import services.object.UpdateService; +import services.pet.MountService; import services.resources.HarvesterService; import services.resources.ResourceService; import services.retro.RetroService; @@ -181,6 +182,7 @@ public class NGECore { public HousingService housingService; public LootService lootService; public HarvesterService harvesterService; + public MountService mountService; // Login Server @@ -302,6 +304,7 @@ public class NGECore { housingService = new HousingService(this); lootService = new LootService(this); harvesterService = new HarvesterService(this); + mountService = new MountService(this); if (config.keyExists("JYTHONCONSOLE.PORT")) { int jythonPort = config.getInt("JYTHONCONSOLE.PORT"); @@ -356,6 +359,7 @@ public class NGECore { //zoneDispatch.addService(missionService); zoneDispatch.addService(bazaarService); zoneDispatch.addService(lootService); + zoneDispatch.addService(mountService); if (optionsConfigLoaded && options.getInt("LOAD.RESOURCE.SYSTEM") == 1) { zoneDispatch.addService(surveyService); diff --git a/src/protocol/swg/objectControllerObjects/SpatialChat.java b/src/protocol/swg/objectControllerObjects/SpatialChat.java index 1d2ac34e..bf86de8f 100644 --- a/src/protocol/swg/objectControllerObjects/SpatialChat.java +++ b/src/protocol/swg/objectControllerObjects/SpatialChat.java @@ -26,12 +26,12 @@ import java.nio.ByteOrder; import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ObjControllerMessage; +import resources.common.OutOfBand; @SuppressWarnings("unused") - public class SpatialChat extends ObjControllerObject { - private long audienceId; + private long destinationId; private long sourceId; private long targetId; private String chatMessage; @@ -40,15 +40,19 @@ public class SpatialChat extends ObjControllerObject { private short balloonType = 1; private short chatType; private short moodId; + private byte languageId = 1; + private OutOfBand outOfBand; - public SpatialChat(long sourceId, long targetId, String chatMessage, short chatType, short moodId) { + public SpatialChat(long destinationId, long sourceId, long targetId, String chatMessage, short chatType, short moodId, int languageId, OutOfBand outOfBand) { try { - this.audienceId = sourceId; + this.destinationId = destinationId; this.sourceId = sourceId; this.targetId = targetId; this.chatMessage = chatMessage; this.chatType = chatType; this.moodId = moodId; + this.languageId = (byte) languageId; + this.outOfBand = ((outOfBand == null) ? new OutOfBand() : outOfBand); /*String[] chatMessageParse = chatMessage.split(" ", 6); @@ -62,19 +66,20 @@ public class SpatialChat extends ObjControllerObject { } } - public void setDestinationId(long audienceId) { - this.audienceId = audienceId; + public void setDestinationId(long destinationId) { + this.destinationId = destinationId; } - + public void deserialize(IoBuffer data) { } public IoBuffer serialize() { - IoBuffer result = IoBuffer.allocate(55 + chatMessage.length() * 2).order(ByteOrder.LITTLE_ENDIAN); - + outOfBand.setHeaderBytes(2); + IoBuffer outOfBandBuffer = outOfBand.serialize(); + IoBuffer result = IoBuffer.allocate(51 + (chatMessage.length() * 2) + outOfBandBuffer.array().length).order(ByteOrder.LITTLE_ENDIAN); result.putInt(ObjControllerMessage.SPACIAL_CHAT); - result.putLong(audienceId); + result.putLong(destinationId); result.putInt(0); result.putLong(sourceId); result.putLong(targetId); @@ -83,11 +88,9 @@ public class SpatialChat extends ObjControllerObject { result.putShort((short) 0x32); result.putShort(chatType); result.putShort(moodId); - result.put((byte) 1); - + result.put(languageId); result.putInt(0); - result.putInt(0); - + result.put(outOfBandBuffer.array()); return result.flip(); } diff --git a/src/resources/datatables/Posture.java b/src/resources/datatables/Posture.java index 312337f1..f319ea46 100644 --- a/src/resources/datatables/Posture.java +++ b/src/resources/datatables/Posture.java @@ -1,21 +1,23 @@ package resources.datatables; public class Posture { + // Posture.iff - public static final int Invalid = -1; - public static final int Upright = 0; - public static final int Crouched = 1; - public static final int Prone = 2; - public static final int Sneaking = 3; - public static final int Blocking = 4; - public static final int Climbing = 5; - public static final int Flying = 6; - public static final int LyingDown = 7; - public static final int Sitting = 8; - public static final int SkillAnimating = 9; - public static final int DrivingVehicle = 10; - public static final int RidingCreature = 11; - public static final int KnockedDown = 12; - public static final int Incapacitated = 13; - public static final int Dead = 14; + public static final byte Invalid = -1; + public static final byte Upright = 0; + public static final byte Crouched = 1; + public static final byte Prone = 2; + public static final byte Sneaking = 3; + public static final byte Blocking = 4; + public static final byte Climbing = 5; + public static final byte Flying = 6; + public static final byte LyingDown = 7; + public static final byte Sitting = 8; + public static final byte SkillAnimating = 9; + public static final byte DrivingVehicle = 10; + public static final byte RidingCreature = 11; + public static final byte KnockedDown = 12; + public static final byte Incapacitated = 13; + public static final byte Dead = 14; + } diff --git a/src/resources/datatables/State.java b/src/resources/datatables/State.java new file mode 100644 index 00000000..dafd0c64 --- /dev/null +++ b/src/resources/datatables/State.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package resources.datatables; + +public class State { + + public static long Invalid = 0x00L; + public static long Cover = 0x1L; + public static long Combat = 0x2L; + public static long Peace = 0x4L; + public static long Aiming = 0x8L; + public static long Alert = 0x10L; + public static long Berserk = 0x20L; + public static long FeignDeath = 0x40L; + public static long CombatAttitudeEvasive = 0x80L; + public static long CombatAttitudeNormal = 0x100L; + public static long CombatAttitudeAggressive = 0x200L; + public static long Tumbling = 0x400L; + public static long Rallied = 0x800L; + public static long Stunned = 0x1000L; + public static long Blinded = 0x2000L; + public static long Dizzy = 0x4000L; + public static long Intimidated = 0x8000L; + public static long Immobilized = 0x10000L; + public static long Frozen = 0x20000L; + public static long Swimming = 0x40000L; + public static long SittingOnChair = 0x80000L; + public static long Crafting = 0x100000L; + public static long GlowingJedi = 0x200000L; + public static long MaskScent = 0x400000L; + public static long Poisoned = 0x800000L; + public static long Bleeding = 0x1000000L; + public static long Diseased = 0x2000000L; + public static long OnFire = 0x4000000L; + public static long RidingMount = 0x8000000L; + public static long MountedCreature = 0x10000000L; + public static long PilotingShip = 0x20000000L; + public static long ShipOperations = 0x40000000L; + public static long ShipGunner = 0x80000000L; + public static long ShipInterior = 0x100000000L; + public static long PilotingPobShip = 0x200000000L; + public static long PerformingDeathBlow = 0x400000000L; + public static long Disguised = 0x800000000L; + public static long ElectricBurned = 0x1000000000L; + public static long ColdBurned = 0x2000000000L; + public static long AcidBurned = 0x4000000000L; + public static long EnergyBurned = 0x8000000000L; + public static long KineticBurned = 0x10000000000L; + +} diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index d781ed7f..7680d9bd 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -35,7 +35,6 @@ import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ObjControllerMessage; import protocol.swg.PlayMusicMessage; -import protocol.swg.UpdateContainmentMessage; import protocol.swg.UpdatePostureMessage; import protocol.swg.UpdatePVPStatusMessage; import protocol.swg.chat.ChatSystemMessage; @@ -52,7 +51,6 @@ import main.NGECore; import engine.clients.Client; import resources.common.Cooldown; import resources.common.OutOfBand; -import resources.datatables.Options; import resources.objects.Buff; import resources.objects.DamageOverTime; import resources.objects.SWGList; @@ -69,7 +67,7 @@ import resources.objects.player.PlayerObject; import resources.objects.tangible.TangibleObject; import services.command.BaseSWGCommand; -@Entity(version=8) +@Entity(version=9) public class CreatureObject extends TangibleObject implements IPersistent { @NotPersistent @@ -131,7 +129,9 @@ public class CreatureObject extends TangibleObject implements IPersistent { private boolean performanceType = false; private boolean acceptBandflourishes = true; private boolean groupDance = true; + @NotPersistent private CreatureObject performanceWatchee; + @NotPersistent private CreatureObject performanceListenee; @NotPersistent private Vector performanceAudience = new Vector(); @@ -187,10 +187,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { private TangibleObject conversingNpc; @NotPersistent private ConcurrentHashMap cooldowns = new ConcurrentHashMap(); - - public boolean mounted = false; @NotPersistent - public CreatureObject mountedVehicle; + private long tefTime = System.currentTimeMillis(); public CreatureObject(long objectID, Planet planet, Point3D position, Quaternion orientation, String Template) { super(objectID, planet, Template, position, orientation); @@ -372,7 +370,6 @@ public class CreatureObject extends TangibleObject implements IPersistent { } public void setPosture(byte posture) { - synchronized(objectMutex) { if (this.posture == 0x09) { stopPerformance(); @@ -391,16 +388,13 @@ public class CreatureObject extends TangibleObject implements IPersistent { } public void startPerformance() { - - getClient().getSession().write(messageBuilder.buildStartPerformance(true)); - + setStationary(true); } public void stopPerformance() { - String type = ""; + synchronized(objectMutex) { - // Some reason this prevents the animation for playing an instrument when stopping (unless that's what "" does) setCurrentAnimation(getCurrentAnimation()); @@ -408,17 +402,16 @@ public class CreatureObject extends TangibleObject implements IPersistent { setPerformanceId(0,true); type = (performanceType) ? "dance" : "music"; + if (entertainerExperience != null) { entertainerExperience.cancel(true); entertainerExperience = null; } } - sendSystemMessage("@performance:" + type + "_stop_self",(byte)0); + sendSystemMessage("@performance:" + type + "_stop_self",(byte)0); stopAudience(); - - getClient().getSession().write(messageBuilder.buildStartPerformance(false)); - + setStationary(false); } public void stopAudience() { @@ -473,7 +466,13 @@ public class CreatureObject extends TangibleObject implements IPersistent { } notifyObservers(messageBuilder.buildFactionDelta(faction), true); - //updatePvpStatus(); + + + CreatureObject companion = NGECore.getInstance().mountService.getCompanion(this); + + if (companion != null) { + companion.setFaction(faction); + } } @Override @@ -483,7 +482,12 @@ public class CreatureObject extends TangibleObject implements IPersistent { } notifyObservers(messageBuilder.buildFactionStatusDelta(factionStatus), true); - //updatePvpStatus(); + + CreatureObject companion = NGECore.getInstance().mountService.getCompanion(this); + + if (companion != null) { + companion.setFactionStatus(factionStatus); + } } public float getHeight() { @@ -531,7 +535,25 @@ public class CreatureObject extends TangibleObject implements IPersistent { notifyObservers(stateDelta, true); } - + + public void setState(long state, boolean add) { + synchronized(objectMutex) { + if (state != 0) { + if (add) { + stateBitmask = (stateBitmask | state); + } else { + stateBitmask = (stateBitmask & ~state); + } + } + } + } + + public boolean getState(long state) { + synchronized(objectMutex) { + return ((stateBitmask & state) == state); + } + } + public long getOwnerId() { synchronized(objectMutex) { return ownerId; @@ -542,6 +564,9 @@ public class CreatureObject extends TangibleObject implements IPersistent { synchronized(objectMutex) { this.ownerId = ownerId; } + + setStringAttribute("owner", NGECore.getInstance().objectService.getObject(ownerId).getCustomName()); + notifyObservers(messageBuilder.buildOwnerIdDelta(ownerId), true); } @@ -1721,6 +1746,8 @@ public class CreatureObject extends TangibleObject implements IPersistent { synchronized(objectMutex) { this.stationary = stationary; } + + notifyObservers(messageBuilder.buildStartPerformance(stationary), true); } public TangibleObject getConversingNpc() { @@ -1788,73 +1815,19 @@ public class CreatureObject extends TangibleObject implements IPersistent { return (PlayerObject) this.getSlottedObject("ghost"); } - public boolean isMounted() { - return mounted; - } - - public void setMounted(boolean mounted) { - this.mounted = mounted; - } - - public CreatureObject getMountedVehicle() { - return mountedVehicle; - } - - public void setMountedVehicle(CreatureObject mountedVehicle) { - this.mountedVehicle = mountedVehicle; - } + //public float getCooldown(String cooldownGroup) { + //return ((float) getCooldown(cooldownGroup) / (float) 1000); + //} - public boolean canMount(CreatureObject vehicle) - { - if(vehicle.getOwnerId() == this.getObjectId()) return true; - return false; - } - - public void mount(CreatureObject owner) { - boolean remove = false; - synchronized(objectMutex) - { - if ((this.getOptionsBitmask() & Options.MOUNT) == Options.MOUNT) - { - remove = true; - _add(owner); - UpdateContainmentMessage updateContainmentMessage = new UpdateContainmentMessage(owner.getObjectID(), this.getObjectID(), 4); - notifyObservers(updateContainmentMessage, true); - } - } - - if(remove) NGECore.getInstance().simulationService.remove(owner, owner.getWorldPosition().x, owner.getWorldPosition().z, false); - } - - public void unmount(CreatureObject owner) { - boolean add = false; + public long getTefTime() { synchronized(objectMutex) { - if ((this.getOptionsBitmask() & Options.MOUNT) == Options.MOUNT){ - add = true; - _remove(owner); - UpdateContainmentMessage updateContainmentMessage = new UpdateContainmentMessage(owner.getObjectID(), 0, -1); - notifyObservers(updateContainmentMessage, true); - } - } - if(add) { - owner.setMounted(false); - owner.setMountedVehicle(null); - owner.setStateBitmask(0); - owner.setPosture((byte) 0); - NGECore.getInstance().simulationService.add(owner, getWorldPosition().x, getWorldPosition().z, false); - NGECore.getInstance().simulationService.teleport(owner, getWorldPosition(), getOrientation(), 0); + return (((tefTime - System.currentTimeMillis()) > 0) ? (tefTime - System.currentTimeMillis()) : 0); } } - public void initMount(CreatureObject owner) { + public void setTefTime(long tefTime) { synchronized(objectMutex) { - setStateBitmask(0x10000000); - owner.setMountedVehicle(this); - - this.mount(owner); - - owner.setStateBitmask(0x8000000); - this.setPosture((byte)10); + this.tefTime = tefTime + System.currentTimeMillis(); } } diff --git a/src/resources/objects/player/PlayerObject.java b/src/resources/objects/player/PlayerObject.java index a24ca702..bcbc3b21 100644 --- a/src/resources/objects/player/PlayerObject.java +++ b/src/resources/objects/player/PlayerObject.java @@ -44,7 +44,7 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=12) +@Persistent(version=13) public class PlayerObject extends IntangibleObject { // PLAY 3 @@ -144,6 +144,9 @@ public class PlayerObject extends IntangibleObject { private List chatChannels = new ArrayList(); + @NotPersistent + private boolean callingCompanion = false; + public PlayerObject() { super(); messageBuilder = new PlayerMessageBuilder(this); @@ -875,7 +878,8 @@ public class PlayerObject extends IntangibleObject { } public void removeChannel(int roomId) { - chatChannels.remove(roomId); + if (chatChannels.contains(roomId)) + chatChannels.remove(roomId); } public boolean isMemberOfChannel(int roomId) { @@ -886,4 +890,13 @@ public class PlayerObject extends IntangibleObject { System.out.println("Not a Member of the channel!"); return false; } + + public boolean isCallingCompanion() { + return callingCompanion; + } + + public void setCallingCompanion(boolean callingCompanion) { + this.callingCompanion = callingCompanion; + } + } diff --git a/src/resources/objects/resource/GalacticResource.java b/src/resources/objects/resource/GalacticResource.java index 643e1444..9f23a171 100644 --- a/src/resources/objects/resource/GalacticResource.java +++ b/src/resources/objects/resource/GalacticResource.java @@ -152,7 +152,7 @@ public class GalacticResource extends SWGObject implements IPersistent { this.name = name; this.fileName = fileName; this.category = category; - this.type = type; + //this.type = type; long range = 1234567L; Random r = new Random(); this.id = (long)(r.nextDouble()*range); diff --git a/src/resources/objects/tangible/TangibleMessageBuilder.java b/src/resources/objects/tangible/TangibleMessageBuilder.java index f18dd482..ec017af4 100644 --- a/src/resources/objects/tangible/TangibleMessageBuilder.java +++ b/src/resources/objects/tangible/TangibleMessageBuilder.java @@ -51,7 +51,7 @@ public class TangibleMessageBuilder extends ObjectMessageBuilder { buffer.put(getUnicodeString(object.getCustomName())); buffer.putInt(object.getVolume()); buffer.putInt(0); - buffer.putInt(0); // faction vars + buffer.putInt(tangible.getFactionStatus()); // faction vars if(tangible.getCustomization() == null || tangible.getCustomization().length <= 0) buffer.putShort((short) 0); @@ -67,7 +67,7 @@ public class TangibleMessageBuilder extends ObjectMessageBuilder { if(tangible.getOptionsBitmask() == 0) tangible.setOptionsBitmask(0x100); buffer.putInt(tangible.getOptionsBitmask()); - buffer.putInt(0); // number of item uses + buffer.putInt(tangible.getUses()); // number of item uses buffer.putInt(tangible.getConditionDamage()); buffer.putInt(tangible.getMaxDamage()); buffer.put((byte) (tangible.isStaticObject() ? 1 : 0)); diff --git a/src/resources/objects/tangible/TangibleObject.java b/src/resources/objects/tangible/TangibleObject.java index 80240884..4efc2c4c 100644 --- a/src/resources/objects/tangible/TangibleObject.java +++ b/src/resources/objects/tangible/TangibleObject.java @@ -39,6 +39,7 @@ import protocol.swg.UpdatePVPStatusMessage; import protocol.swg.objectControllerObjects.ShowFlyText; import resources.common.OutOfBand; import resources.common.RGB; +import resources.datatables.Options; import resources.objects.creature.CreatureObject; import resources.objects.loot.LootGroup; import resources.visitors.IDManagerVisitor; @@ -53,7 +54,7 @@ import engine.resources.scene.Planet; import engine.resources.scene.Point3D; import engine.resources.scene.Quaternion; -@Persistent(version=9) +@Persistent(version=11) public class TangibleObject extends SWGObject { // TODO: Thread safety @@ -65,6 +66,7 @@ public class TangibleObject extends SWGObject { private List componentCustomizations = new ArrayList(); private Map customizationVariables = new HashMap(); protected int optionsBitmask = 0; + private int uses = 0; private int maxDamage = 1000; private boolean staticObject = true; protected String faction = ""; // Says you're "Imperial Special Forces" if it's 0 for some reason @@ -89,6 +91,13 @@ public class TangibleObject extends SWGObject { @NotPersistent private boolean lootItem = false; + private boolean stackable = false; + private int stackCount = 1; + private boolean noSell = false; + private byte junkType = -1; + private int junkDealerPrice = 0; + + private String serialNumber; @NotPersistent @@ -125,6 +134,15 @@ public class TangibleObject extends SWGObject { public void setIncapTimer(int incapTimer) { this.incapTimer = incapTimer; } + + public int getUses() { + return uses; + } + + public void setUses(int uses) { + this.uses = uses; + setIntAttribute("uses", uses); + } public synchronized int getConditionDamage() { return conditionDamage; @@ -259,6 +277,14 @@ public class TangibleObject extends SWGObject { } } + + if (getClient() != null) { + CreatureObject companion = NGECore.getInstance().mountService.getCompanion((CreatureObject) this); + + if (companion != null) { + companion.updatePvpStatus(); + } + } } public void setCustomizationVariable(String type, byte value) @@ -499,6 +525,46 @@ public class TangibleObject extends SWGObject { this.lootItem = lootItem; } + public boolean isStackable() { + return stackable; + } + + public void setStackable(boolean stackable) { + this.stackable = stackable; + } + + public int getStackCount() { + return stackCount; + } + + public void setStackCount(int stackCount) { + this.stackCount = stackCount; + } + + public boolean isNoSell() { + return noSell; + } + + public void setNoSell(boolean noSell) { + this.noSell = noSell; + } + + public byte getJunkType() { + return junkType; + } + + public void setJunkType(byte junkType) { + this.junkType = junkType; + } + + public int getJunkDealerPrice() { + return junkDealerPrice; + } + + public void setJunkDealerPrice(int junkDealerPrice) { + this.junkDealerPrice = junkDealerPrice; + } + public boolean isCreditRelieved() { return creditRelieved; } @@ -514,6 +580,7 @@ public class TangibleObject extends SWGObject { public void setSerialNumber(String serialNumber) { setStringAttribute("serial_number", serialNumber); + setOptions(Options.SERIAL, true); } public void sendDelta3(Client destination) { diff --git a/src/services/DevService.java b/src/services/DevService.java index ffcc207d..bae0eb8f 100644 --- a/src/services/DevService.java +++ b/src/services/DevService.java @@ -1225,6 +1225,13 @@ public class DevService implements INetworkDispatch { deed.setBMR(15); deed.setAttributes(); inventory.add(deed); + + templateString="object/tangible/deed/player_house_deed/shared_generic_house_small_style_02_deed.iff"; + deed = (Player_House_Deed)core.objectService.createObject(templateString, planet); + deed.setBMR(15); + deed.setAttributes(); + inventory.add(deed); + case 125: TangibleObject genericCraftingTool = (TangibleObject) core.objectService.createObject("object/tangible/crafting/station/shared_generic_tool.iff", planet); genericCraftingTool.setCustomName("Generic Crafting Tool"); diff --git a/src/services/LootService.java b/src/services/LootService.java index ca40b77f..c9157d18 100644 --- a/src/services/LootService.java +++ b/src/services/LootService.java @@ -29,14 +29,12 @@ import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Random; import java.util.Vector; - -import protocol.swg.PlayClientEffectObjectMessage; import protocol.swg.PlayClientEffectObjectTransformMessage; import resources.objects.creature.CreatureObject; import resources.objects.group.GroupObject; @@ -45,9 +43,7 @@ import resources.objects.loot.LootRollSession; import resources.objects.tangible.TangibleObject; import resources.objects.weapon.WeaponObject; import main.NGECore; -import engine.clientdata.ClientFileManager; -import engine.clientdata.visitors.CrcStringTableVisitor; -import engine.resources.common.CRC; +import engine.resources.container.Traverser; import engine.resources.objects.SWGObject; import engine.resources.scene.Planet; import engine.resources.scene.Point3D; @@ -62,6 +58,7 @@ import engine.resources.service.INetworkRemoteEvent; public class LootService implements INetworkDispatch { private NGECore core; + private static int prepInvCnt = 0; public LootService(NGECore core) { this.core = core; @@ -87,7 +84,7 @@ public class LootService implements INetworkDispatch { return; SWGObject lootedObjectInventory = lootedObject.getSlottedObject("inventory"); core.simulationService.openContainer(requester, lootedObjectInventory); - setLooted(lootedObject); + setLooted(requester,lootedObject); } } @@ -245,6 +242,7 @@ public class LootService implements INetworkDispatch { } } + @SuppressWarnings("unused") private void handleLootPoolItems(String itemName,LootRollSession lootRollSession){ List subfolders = new ArrayList(); // Consider all sub-folders @@ -283,6 +281,9 @@ public class LootService implements INetworkDispatch { int stackCount = 1; int biolink = 0; int requiredCL = 1; + int stackable = -1; + int junkDealerPrice = 0; + byte junkType = -1; String requiredProfession = ""; String requiredFaction = ""; Vector customizationAttributes = null; @@ -330,7 +331,15 @@ public class LootService implements INetworkDispatch { if(core.scriptService.getMethod(itemPath,"","requiredFaction")!=null) requiredFaction = (String)core.scriptService.fetchString(itemPath,"requiredFaction"); - + if(core.scriptService.getMethod(itemPath,"","stackable")!=null) + stackable = (Integer)core.scriptService.fetchInteger(itemPath,"stackable"); + + if(core.scriptService.getMethod(itemPath,"","junkDealerPrice")!=null) + junkDealerPrice = (Integer)core.scriptService.fetchInteger(itemPath,"junkDealerPrice"); + + if(core.scriptService.getMethod(itemPath,"","junkType")!=null) + junkType = (byte)core.scriptService.fetchInteger(itemPath,"junkType"); + System.out.println("itemTemplate " + itemTemplate); TangibleObject droppedItem = createDroppedItem(itemTemplate,lootRollSession.getSessionPlanet()); @@ -340,6 +349,21 @@ public class LootService implements INetworkDispatch { if (customName!=null) handleCustomDropName(droppedItem, customName); + + if (stackable!=-1){ + if(stackable==1) + droppedItem.setStackable(true); + else + droppedItem.setStackable(false); + } + + if (junkDealerPrice!=0){ + droppedItem.setJunkDealerPrice(junkDealerPrice); + } + + if (junkType!=-1){ + droppedItem.setJunkType(junkType); + } if (itemStats!=null){ if (itemStats.size()%3!=0){ @@ -368,6 +392,7 @@ public class LootService implements INetworkDispatch { droppedItem.setStringAttribute("required_faction", requiredFaction); } + lootRollSession.addDroppedItem(droppedItem); } @@ -774,13 +799,199 @@ public class LootService implements INetworkDispatch { return 42%42; } - public void setLooted(TangibleObject lootedObject){ + public void setLooted(TangibleObject lootedObject,TangibleObject requester){ lootedObject.setLooted(true); float y = -5.0F; float qz= 1.06535322E9F; Point3D effectorPosition = new Point3D(0,y,0); Quaternion effectorOrientation = new Quaternion(0,0,0,qz); PlayClientEffectObjectTransformMessage lmsg = new PlayClientEffectObjectTransformMessage("",lootedObject.getObjectID(),"",effectorPosition,effectorOrientation); + //((CreatureObject) requester).getClient().getSession().write(lmsg.serialize()); + } + + + // ********* Junk-dealer related ********* + + public Vector getSellableInventoryItems(CreatureObject actor){ + TangibleObject playerInventory = (TangibleObject) actor.getSlottedObject("inventory"); + final Vector sellableItems = new Vector(); + playerInventory.viewChildren(actor, false, false, new Traverser() { + @Override + public void process(SWGObject obj) { + String itemTemplate = obj.getTemplate(); + TangibleObject tano = (TangibleObject) obj; + if (tano.getCustomName()!=null){ + if (itemTemplate.contains("loot/")){ + sellableItems.add(obj); + } + } + } + }); + return sellableItems; + } + + public void addToSoldHistory(CreatureObject actor, TangibleObject item){ + + } + + public boolean haveBusinessHistory(CreatureObject actor, CreatureObject dealer){ + return true; + } + + @SuppressWarnings("unchecked") + public Vector getBuyHistory(CreatureObject actor, CreatureObject dealer){ + LinkedHashMap businessHistory = (LinkedHashMap )dealer.getAttachment("BusinessHistory"); + if (businessHistory==null){ + businessHistory = new LinkedHashMap(); + dealer.setAttachment("BusinessHistory",businessHistory); + } + + TangibleObject[] actorsBuyHistory = businessHistory.get(actor.getObjectID()); + if (actorsBuyHistory==null) + return new Vector(); + + Vector actorHistory = new Vector(); + for (TangibleObject item : actorsBuyHistory){ + if (item!=null) + actorHistory.add(item); + } + return actorHistory; + } + + @SuppressWarnings("unchecked") + public boolean addToBuyHistory(CreatureObject actor, CreatureObject dealer, TangibleObject item){ + LinkedHashMap businessHistory = (LinkedHashMap )dealer.getAttachment("BusinessHistory"); + if (businessHistory==null){ + businessHistory = new LinkedHashMap(); + dealer.setAttachment("BusinessHistory",businessHistory); + } + + TangibleObject[] actorsBuyHistory = businessHistory.get(actor.getObjectID()); + if (actorsBuyHistory==null){ + actorsBuyHistory = new TangibleObject[10]; + actorsBuyHistory[0] = item; + } else { + // Check Array for zeros + int lastObject=0; + for (int i=0;i>shift right and add + for (int i = 8; i >= 0; i--) { + actorsBuyHistory[i+1] = actorsBuyHistory[i]; + } + actorsBuyHistory[0] = item; + } else { + actorsBuyHistory[lastObject+1] = item; + } + } + businessHistory.put(actor.getObjectID(),actorsBuyHistory); + dealer.setAttachment("BusinessHistory",businessHistory); + //printArrayElements(actorsBuyHistory); + return true; + } + + @SuppressWarnings("unchecked") + public boolean removeBoughtBackItemFromHistory(CreatureObject actor, CreatureObject dealer, TangibleObject item){ + if (item==null) + return false; // Player has hit the button without selecting an item + LinkedHashMap businessHistory = (LinkedHashMap )dealer.getAttachment("BusinessHistory"); + if (businessHistory==null){ + return false; // something went seriously wrong. At this point the dealer should have a history + } + TangibleObject[] actorsBuyHistory = businessHistory.get(actor.getObjectID()); + if (actorsBuyHistory==null) + return false; // Player has no history entry + // Find the element index + int index = -1; + for (int i=0;i<10;i++){ + if (actorsBuyHistory[i]!=null){ + if (item.getObjectID()==actorsBuyHistory[i].getObjectID()){ + index = i; + } + } + } + + if (index==-1) + return false; + + // Shift everything to the right of the found index to the left + for (int i = index; i < 9; i++) { + actorsBuyHistory[i] = actorsBuyHistory[i+1]; // 0 1 2 3 4 5 6 7 8 9 + } + if (index!=-1) + actorsBuyHistory[9]=null; + + businessHistory.put(actor.getObjectID(),actorsBuyHistory); + dealer.setAttachment("BusinessHistory",businessHistory); + //printArrayElements(actorsBuyHistory); + return true; + } + + + // util method + @SuppressWarnings("unused") + private void printArrayElements(TangibleObject[] array){ + System.out.print("Array ["); + for (int i=0;i0) + return; + prepInvCnt++; + SWGObject playerInventory = player.getSlottedObject("inventory"); + TangibleObject item1 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_impulse_detector_01_generic.iff", player.getPlanet()); + item1.setCustomName("Impulse Detector"); + playerInventory.add(item1); + + TangibleObject item2 = (TangibleObject)core.objectService.createObject("object/tangible/loot/misc/shared_damaged_datapad.iff", player.getPlanet()); + item2.setCustomName("Damaged Datapad"); + playerInventory.add(item2); + + TangibleObject item3 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_software_module_generic.iff", player.getPlanet()); + item3.setCustomName("Software Module"); + playerInventory.add(item3); + + TangibleObject item4 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_survival_equipment_generic.iff", player.getPlanet()); + item4.setCustomName("Survival Gear"); + playerInventory.add(item4); + + TangibleObject item5 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_shield_module_generic.iff", player.getPlanet()); + item5.setCustomName("Shield Module"); + playerInventory.add(item5); + + TangibleObject item6 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_firework_generic.iff", player.getPlanet()); + item6.setCustomName("Explosive Dud"); + playerInventory.add(item6); + + TangibleObject item7 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_launcher_tube_generic.iff", player.getPlanet()); + item7.setCustomName("Launcher Tube"); + playerInventory.add(item7); + + TangibleObject item8 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_red_wiring_generic.iff", player.getPlanet()); + item8.setCustomName("Red Wiring"); + playerInventory.add(item8); + + TangibleObject item9 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_laser_trap_generic.iff", player.getPlanet()); + item9.setCustomName("Laser Trap"); + playerInventory.add(item9); + + TangibleObject item10 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_comlink_civilian_generic.iff", player.getPlanet()); + item10.setCustomName("Comlink"); + playerInventory.add(item10); + + TangibleObject item11 = (TangibleObject)core.objectService.createObject("object/tangible/loot/npc_loot/shared_armor_repair_device_generic.iff", player.getPlanet()); + item11.setCustomName("Armor Repair Device"); + playerInventory.add(item11); } diff --git a/src/services/PlayerService.java b/src/services/PlayerService.java index 68f07722..ea075dc5 100644 --- a/src/services/PlayerService.java +++ b/src/services/PlayerService.java @@ -449,6 +449,7 @@ public class PlayerService implements INetworkDispatch { } + @SuppressWarnings("unchecked") public void sendCloningWindow(CreatureObject creature, final boolean pvpDeath) { //if(creature.getPosture() != 14) @@ -603,7 +604,7 @@ public class PlayerService implements INetworkDispatch { //core.equipmentService.unequip(creature, equipment); //} - for (Buff buff : creature.getBuffList()) { + for (Buff buff : creature.getBuffList().get().toArray(new Buff[] { })) { if (buff.isRemoveOnRespec()) { core.buffService.removeBuffFromCreature(creature, buff); } diff --git a/src/services/SimulationService.java b/src/services/SimulationService.java index ac70aa31..0b941eb6 100644 --- a/src/services/SimulationService.java +++ b/src/services/SimulationService.java @@ -80,6 +80,8 @@ import resources.objects.player.PlayerObject; import resources.objects.tangible.TangibleObject; import resources.common.*; import resources.common.collidables.AbstractCollidable; +import resources.datatables.DisplayType; +import resources.datatables.Options; import resources.datatables.PlayerFlags; import resources.datatables.Posture; import services.ai.LairActor; @@ -220,7 +222,7 @@ public class SimulationService implements INetworkDispatch { object.setIsInQuadtree(true); boolean success = quadTrees.get(object.getPlanet().getName()).put(x, y, object); if(success) { - Vector childObjects = (Vector) object.getAttachment("childObjects"); + @SuppressWarnings("unchecked") Vector childObjects = (Vector) object.getAttachment("childObjects"); if(childObjects != null) { addChildObjects(object, childObjects); object.setAttachment("childObjects", null); @@ -334,8 +336,9 @@ public class SimulationService implements INetworkDispatch { CreatureObject object = (CreatureObject) client.getParent(); - if (object.mounted) - object=object.getMountedVehicle(); + if (core.mountService.isMounted(object)) { + object = (CreatureObject) object.getContainer(); + } Point3D newPos; Point3D oldPos; @@ -369,7 +372,7 @@ public class SimulationService implements INetworkDispatch { List newAwareObjects = get(object.getPlanet(), newPos.x, newPos.z, 512); ArrayList oldAwareObjects = new ArrayList(object.getAwareObjects()); - Collection updateAwareObjects = CollectionUtils.intersection(oldAwareObjects, newAwareObjects); + @SuppressWarnings("unchecked") Collection updateAwareObjects = CollectionUtils.intersection(oldAwareObjects, newAwareObjects); object.notifyObservers(utm, false); for(int i = 0; i < oldAwareObjects.size(); i++) { @@ -433,8 +436,14 @@ public class SimulationService implements INetworkDispatch { System.out.println("NULL Object"); return; } + CreatureObject object = (CreatureObject) client.getParent(); + if (core.mountService.isMounted(object)) { + object.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_mount"), DisplayType.Broadcast); + core.mountService.dismount(object, (CreatureObject) object.getContainer()); + } + Point3D newPos = new Point3D(dataTransform.getXPosition(), dataTransform.getYPosition(), dataTransform.getZPosition()); if(Float.isNaN(newPos.x) || Float.isNaN(newPos.y) || Float.isNaN(newPos.z)) return; @@ -556,7 +565,7 @@ public class SimulationService implements INetworkDispatch { List newAwareObjects = get(object.getPlanet(), newPosition.x, newPosition.z, 512); ArrayList oldAwareObjects = new ArrayList(object.getAwareObjects()); - Collection updateAwareObjects = CollectionUtils.intersection(oldAwareObjects, newAwareObjects); + @SuppressWarnings("unchecked") Collection updateAwareObjects = CollectionUtils.intersection(oldAwareObjects, newAwareObjects); object.notifyObservers(utm, false); for(int i = 0; i < oldAwareObjects.size(); i++) { @@ -748,6 +757,7 @@ public class SimulationService implements INetworkDispatch { return; final CreatureObject object = (CreatureObject) client.getParent(); + SWGObject container = object.getContainer(); PlayerObject ghost = (PlayerObject) object.getSlottedObject("ghost"); if(object.getAttachment("proposer") != null) @@ -765,14 +775,12 @@ public class SimulationService implements INetworkDispatch { } } - if(object.getAttachment("activeVehicleID") != null) - { - if(object.isMounted()) object.getMountedVehicle().unmount(object); - long vehicleID = ((java.math.BigInteger) object.getAttachment("activeVehicleID")).longValue(); - core.objectService.destroyObject(vehicleID); - object.setAttachment("activeVehicleID", null); + if (core.mountService.isMounted(object)) { + core.mountService.dismount(object, (CreatureObject) container); } + core.mountService.storeAll(object); + /* object.createTransaction(core.getCreatureODB().getEnvironment()); core.getCreatureODB().put(object, Long.class, CreatureObject.class, object.getTransaction()); diff --git a/src/services/chat/ChatService.java b/src/services/chat/ChatService.java index fbdf4cf6..cc620d77 100644 --- a/src/services/chat/ChatService.java +++ b/src/services/chat/ChatService.java @@ -37,6 +37,8 @@ import org.apache.mina.core.session.IoSession; import com.sleepycat.je.Transaction; import com.sleepycat.persist.EntityCursor; +import engine.clientdata.ClientFileManager; +import engine.clientdata.visitors.DatatableVisitor; import engine.clients.Client; import engine.resources.config.Config; import engine.resources.config.DefaultConfig; @@ -107,49 +109,49 @@ public class ChatService implements INetworkDispatch { } - public void handleSpatialChat(SWGObject speaker, SWGObject target, String chatMessage, short chatType, short moodId) { - + /* + * This gets used by NPCs as well (random shouts, mustafar miners, etc). + */ + public void spatialChat(SWGObject speaker, SWGObject target, String chatMessage, short chatType, short moodId, int languageId, OutOfBand outOfBand) { long targetId; - if(target == null) + if (target == null) { targetId = 0; - else + } else { targetId = target.getObjectID(); + } - //System.out.println(chatMessage); - //System.out.println(chatType); - //System.out.println(moodId); - - SpatialChat spatialChat = new SpatialChat(speaker.getObjectID(), targetId, chatMessage, chatType, moodId); - ObjControllerMessage objControllerMessage = new ObjControllerMessage(0x0B, spatialChat); + ObjControllerMessage objControllerMessage = new ObjControllerMessage(0x0B, new SpatialChat(speaker.getObjectId(), speaker.getObjectID(), targetId, chatMessage, chatType, moodId, languageId, outOfBand)); Client speakerClient = speaker.getClient(); - if(speakerClient == null || speakerClient.getSession() == null) + if (speakerClient == null || speakerClient.getSession() == null) { return; - + } + speakerClient.getSession().write(objControllerMessage.serialize()); - if(speaker.getObservers().isEmpty()) + if (speaker.getObservers().isEmpty()) { return; + } HashSet observers = new HashSet(speaker.getObservers()); Point3D position = speaker.getPosition(); - for(Client client : observers) { + for (Client client : observers) { float distance = client.getParent().getPosition().getDistance2D(position); - if(client != null && client.getSession() != null && distance <= 80) { - - if(((PlayerObject)client.getParent().getSlottedObject("ghost")).getIgnoreList().contains(speaker.getCustomName().toLowerCase().split(" ")[0])) + if (client != null && client.getSession() != null && distance <= 80) { + if (((PlayerObject) client.getParent().getSlottedObject("ghost")).getIgnoreList().contains(speaker.getCustomName().toLowerCase().split(" ")[0])) { continue; + } - spatialChat.setDestinationId(client.getParent().getObjectID()); - ObjControllerMessage objControllerMessage2 = new ObjControllerMessage(0x0B, spatialChat); - client.getSession().write(objControllerMessage2.serialize()); + String message = chatMessage; + SpatialChat spatialChat = new SpatialChat(client.getParent().getObjectId(), speaker.getObjectID(), targetId, message, chatType, moodId, languageId, outOfBand); + objControllerMessage = new ObjControllerMessage(0x0B, spatialChat); + client.getSession().write(objControllerMessage.serialize()); } } - } public void handleEmote(SWGObject speaker, SWGObject target, short emoteId) { @@ -968,6 +970,8 @@ public class ChatService implements INetworkDispatch { roomPlayer.getClient().getSession().write(leaveRoom.serialize()); } }); + + ((PlayerObject) player.getSlottedObject("ghost")).removeChannel(roomId); } public void sendChatRoomMessage(CreatureObject sender, int roomId, int msgId, String message) { @@ -1001,4 +1005,38 @@ public class ChatService implements INetworkDispatch { public ConcurrentHashMap getChatRooms() { return chatRooms; } + + /* + * Language interpretation. + * Converts messages into a language if the receiver can't comprehend it + */ + public String interpret(String message, int languageId, CreatureObject receiver) { + try { + DatatableVisitor visitor = ClientFileManager.loadFile("datatables/game_language/game_language.iff", DatatableVisitor.class); + + if (visitor.getObject(0, 0) == null) { + return message; + } + + String comprehendSkillMod = (String) visitor.getObject(languageId, 1); + + if (receiver.getSkillModBase(comprehendSkillMod) > 0) { + return message; + } + + for (int l = 3; l < 29; l++) { + String letter = ((String) visitor.getObject(0, l)); + String replacement = ((String) visitor.getObject(languageId, l)); + + if (replacement.length() > 0) { + message = message.replace(letter, replacement); + } + } + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + + return message; + } + } diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 063c8b9c..8e85c53e 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -41,6 +41,7 @@ import protocol.swg.objectControllerObjects.CombatSpam; import protocol.swg.objectControllerObjects.CommandEnqueueRemove; import protocol.swg.objectControllerObjects.StartTask; import resources.common.FileUtilities; +import resources.datatables.Options; import resources.datatables.Elemental; import resources.datatables.Posture; import resources.datatables.WeaponType; @@ -281,6 +282,11 @@ public class CombatService implements INetworkDispatch { private void applyDamage(CreatureObject attacker, TangibleObject target, int damage) { target.setConditionDamage(target.getConditionDamage() + damage); + + if (target.getOption(Options.MOUNT)) { + core.mountService.damage((CreatureObject) target); + } + DamageTaken event = events.new DamageTaken(); event.attacker = attacker; event.damage = damage; diff --git a/src/services/object/ObjectService.java b/src/services/object/ObjectService.java index 77314980..c571bd5d 100644 --- a/src/services/object/ObjectService.java +++ b/src/services/object/ObjectService.java @@ -121,6 +121,8 @@ import resources.objects.tangible.TangibleObject; import resources.objects.tool.SurveyTool; import resources.objects.waypoint.WaypointObject; import resources.objects.weapon.WeaponObject; +import services.command.BaseSWGCommand; +import services.command.CombatCommand; import services.bazaar.AuctionItem; import services.chat.ChatRoom; @@ -732,21 +734,69 @@ public class ObjectService implements INetworkDispatch { } public void useObject(CreatureObject creature, SWGObject object) { - if (object == null) { + if (creature == null || object == null) { return; } - if(object.getStringAttribute("proc_name") != null) - { - if(object.getAttachment("tempUseCount") != null) - { - int useCount = (int)object.getAttachment("tempUseCount"); // Seefo: Placeholder until delta for stack count/use count + int reuse_time; + + try { + reuse_time = object.getIntAttribute("reuse_time"); + } catch (NumberFormatException e) { + reuse_time = 0; + } + + if (reuse_time > 0) { + try { + DatatableVisitor visitor = ClientFileManager.loadFile("datatables/timer/template_command_mapping.iff", DatatableVisitor.class); - if((useCount - 1) == 0) destroyObject(object); - else object.setAttachment("tempUseCount", useCount--); + for (int i = 0; i < visitor.getRowCount(); i++) { + if (visitor.getObject(i, 0) != null && ((String) (visitor.getObject(i, 0))).equalsIgnoreCase(object.getTemplate())) { + String commandName = (String) visitor.getObject(i, 1); + String cooldownGroup = (String) visitor.getObject(i, 2); + String animation = (String) visitor.getObject(i, 3); + + if (commandName.length() > 0) { + BaseSWGCommand command = core.commandService.getCommandByName(commandName); + + if (command instanceof CombatCommand && animation.length() > 0) { + ((CombatCommand) command).setDefaultAnimations(new String[] { animation }); + } + + if (core.commandService.callCommand(creature, object, command, 0, "")) { + core.commandService.removeCommand(creature, 0, command); + return; + } + } else if (cooldownGroup.length() > 0) { + if (creature.hasCooldown(cooldownGroup)) { + return; + } + + creature.addCooldown(cooldownGroup, object.getIntAttribute("reuse_time")); + } + + break; + } + } + } catch (Exception e) { + e.printStackTrace(); } + } + + if (object instanceof TangibleObject) { + TangibleObject item = (TangibleObject) object; + int uses = item.getUses(); - // Seefo: We need to add cool downs for buff items + if (uses > 0) { + item.setUses(uses--); + + if (item.getUses() == 0) { + destroyObject(object); + } + } + } + + if (object.getStringAttribute("proc_name") != null) { core.buffService.addBuffToCreature(creature, object.getStringAttribute("proc_name").replace("@ui_buff:", ""), creature); } @@ -992,6 +1042,7 @@ public class ObjectService implements INetworkDispatch { * @param position The position as an offset to the parent object. * @param orientation The orientation as an offset to the parent object. */ + @SuppressWarnings("unchecked") public SWGObject createChildObject(SWGObject parent, String template, Point3D position, Quaternion orientation, int cellNumber) { if(cellNumber == -1) { @@ -1226,13 +1277,13 @@ public class ObjectService implements INetworkDispatch { return count.get(); } - public void persistObject(IPersistent object, Class keyClass, Class valueClass, ObjectDatabase odb) { + public void persistObject(IPersistent object, Class keyClass, Class valueClass, ObjectDatabase odb) { object.createTransaction(odb.getEnvironment()); core.getAuctionODB().put(object, keyClass, valueClass, object.getTransaction()); object.getTransaction().commitSync(); } - public void deletePersistentObject(IPersistent object, Class keyClass, Class valueClass, ObjectDatabase odb, Object key) { + public void deletePersistentObject(IPersistent object, Class keyClass, Class valueClass, ObjectDatabase odb, Object key) { object.createTransaction(odb.getEnvironment()); core.getAuctionODB().delete(key, keyClass, valueClass, object.getTransaction()); object.getTransaction().commitSync(); diff --git a/src/services/pet/MountService.java b/src/services/pet/MountService.java new file mode 100644 index 00000000..b8f09734 --- /dev/null +++ b/src/services/pet/MountService.java @@ -0,0 +1,773 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package services.pet; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.LongAdder; + +import protocol.swg.UpdateContainmentMessage; +import main.NGECore; +import resources.common.OutOfBand; +import resources.datatables.DisplayType; +import resources.datatables.Options; +import resources.datatables.Posture; +import resources.datatables.StateStatus; +import resources.objects.building.BuildingObject; +import resources.objects.creature.CreatureObject; +import resources.objects.player.PlayerObject; +import engine.resources.container.Traverser; +import engine.resources.objects.SWGObject; +import engine.resources.service.INetworkDispatch; +import engine.resources.service.INetworkRemoteEvent; + +public class MountService implements INetworkDispatch { + + private NGECore core; + + public MountService(NGECore core) { + this.core = core; + } + + // Creature mounts are considered pets as well + // Pet abilities and petId is in PLAY9 + + // The functions for vehicles, mounts and pets are similar, but not the same + // Hence the multiple services. + + public void generateVehicle(CreatureObject actor, SWGObject deed, String vehicleTemplate, String pcdTemplate) { + if (actor == null || vehicleTemplate == null || pcdTemplate == null) { + return; + } + + if (actor.getSlottedObject("ghost") == null) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:failed_to_call_vehicle"), DisplayType.Broadcast); + return; + } + + SWGObject datapad = actor.getSlottedObject("datapad"); + + if (datapad == null) { + return; + } + + // Unsure if these are the right attributes. It doesn't generate the vehicle if the datapad has max # of vehicles. + //if (datapad.getIntAttribute("data_size") >= datapad.getIntAttribute("datapad_slots")) { + //actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:has_max_vehicle"), DisplayType.Broadcast); + //return; + //} + + if (actor.getTefTime() > 0){ + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:prose_cant_generate_yet", actor.getTefTime()), DisplayType.Broadcast); + return; + } + + SWGObject pcd = core.objectService.createObject(pcdTemplate, actor.getPlanet()); + + if (pcd == null) { + return; + } + + if (pcd.getSlottedObject("inventory") == null) { + pcd.add(core.objectService.createObject("object/tangible/inventory/shared_character_inventory.iff", pcd.getPlanet())); + } + + CreatureObject vehicle = (CreatureObject) core.objectService.createObject(vehicleTemplate, actor.getPlanet()); + + if (vehicle == null) { + return; + } + + vehicle.setOptions(Options.MOUNT | Options.ATTACKABLE, true); + + vehicle.setOwnerId(actor.getObjectID()); + + pcd.setAttachment("companionId", vehicle.getObjectID()); + + pcd.getSlottedObject("inventory").add(vehicle); + + datapad.add(pcd); + + if (deed != null) { + core.objectService.destroyObject(deed); + } + + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:device_added"), DisplayType.Broadcast); + + call(actor, pcd); + } + + public void generateMount(CreatureObject actor, SWGObject deed, String vehicleTemplate, String pcdTemplate) { + return; // NOT IMPLEMENTED + } + + public void call(CreatureObject actor, SWGObject pcd) { + if (actor == null) { + return; + } + + if (pcd == null) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call"), DisplayType.Broadcast); + return; + } + + if (isMounted(actor)) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cannot_call_another_rideable"), DisplayType.Broadcast); + return; + } + + if (actor.getCombatFlag() == 1) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cannot_call_in_combat"), DisplayType.Broadcast); + return; + } + + if (actor.getContainer() != null) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cannot_call_indoors"), DisplayType.Broadcast); + return; + } + + if (actor.getPosture() == Posture.Dead) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cannot_call_while_dead"), DisplayType.Broadcast); + return; + } + + if (pcd.getSlottedObject("inventory") == null) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call"), DisplayType.Broadcast); + return; + } + + if (pcd.getStringAttribute("required_faction") != null && pcd.getStringAttribute("required_faction").length() > 0) { + if (!actor.getFaction().equals(pcd.getStringAttribute("required_faction"))) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:officer_faction"), DisplayType.Broadcast); + return; + } + } + + PlayerObject player = (PlayerObject) actor.getSlottedObject("ghost"); + + if (player == null) { + return; + } + + CreatureObject mount = (CreatureObject) core.objectService.getObject((Long) pcd.getAttachment("companionId")); + + if (mount == null) { + // Somehow the vehicle object has got lost + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call"), DisplayType.Broadcast); + return; + } + + mount.setFaction(actor.getFaction()); + mount.setFactionStatus(actor.getFactionStatus()); + + if (pcd.getTemplate().contains("vehicle")) { + callVehicle(actor, pcd, player, mount); + } else { + callMount(actor, pcd, player, mount); + } + } + + private void callVehicle(CreatureObject actor, SWGObject pcd, PlayerObject player, CreatureObject mount) { + if ((mount.getLevel() - actor.getLevel()) > 5) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call_level"), DisplayType.Broadcast); + return; + } + + // FIXME Movement skillmod should always be used instead of CREO4 speed vars directly. Movement skillmod should NEVER be 0 unless rooted. Currently it is, which is wrong. + //if (actor.getSkillModBase("movement") == 0) { + //actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call_vehicle_rooted"), DisplayType.Broadcast); + //return; + //} + + if (actor.getPlanet().getName().contains("kashyyyk") && !actor.getPlanet().getName().contains("_main")) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:vehicle_restricted_scene"), DisplayType.Broadcast); + //mount_restricted_scene for creature mounts + return; + } + + if (player.isCallingCompanion()) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_call_1sec"), DisplayType.Broadcast); + return; + } + + storeAll(actor); + + player.setCallingCompanion(true); + + if (actor.getTefTime() > 0) { + actor.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:call_vehicle_delay", actor.getTefTime()), DisplayType.Broadcast); + } + + try { + while (actor.getTefTime() > 0) { + Thread.sleep(3000); + } + } catch (InterruptedException e) { + e.printStackTrace(); + } + + SWGObject datapad = actor.getSlottedObject("datapad"); + + if (datapad == null) { + return; + } + + datapad.viewChildren(actor, false, false, new Traverser() { + + public void process(SWGObject pcd) { + if (pcd.getAttachment("companionId") != null && mount.getObjectID() == ((Long) pcd.getAttachment("companionId"))) { + if (pcd.getSlottedObject("inventory") != null) { + LongAdder adder = new LongAdder(); + pcd.getSlottedObject("inventory").viewChildren(actor, false, false, (obj) -> adder.increment()); + + if (adder.intValue() == 1) { + pcd.getSlottedObject("inventory").remove(mount); + mount.setPosition(actor.getPosition().clone()); + mount.setOrientation(actor.getOrientation().clone()); + mount.setPlanet(actor.getPlanet()); + core.simulationService.add(mount, actor.getWorldPosition().x, actor.getWorldPosition().z, false); + } + } + } + } + + }); + + player.setCallingCompanion(false); + } + + private void callMount(CreatureObject actor, SWGObject pcd, PlayerObject player, CreatureObject mount) { + return; // NOT IMPLEMENTED + } + + public void damage(CreatureObject mount) { + // alter components to progressively reduce the painting. + //stfs + //customization_fading_veh + //customization_gone_veh + + if (mount == null) { + return; + } + + CreatureObject owner = (CreatureObject) core.objectService.getObject(mount.getOwnerId()); + + if (!mount.getTemplate().contains("vehicle")) { + dismount(owner, mount); + store(owner, mount); + mount.setConditionDamage(0); + return; + } + + if (mount.getConditionDamage() >= mount.getMaxDamage()) { + disable(mount); + } + } + + public void disable(CreatureObject mount) { + mount.setOptions(Options.DISABLED, true); + + mount.viewChildren(mount, false, false, new Traverser() { + + public void process(SWGObject object) { + if (object == null || !(object instanceof CreatureObject)) { + return; + } + + CreatureObject rider = (CreatureObject) object; + + dismount(rider, mount); + + rider.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:veh_disabled"), DisplayType.Broadcast); + } + + }); + } + + public boolean canRepair(CreatureObject actor, CreatureObject mount) { + if (actor == null || mount == null) { + return false; + } + + if (!mount.getOption(Options.MOUNT)) { + return false; + } + + if (!mount.getTemplate().contains("vehicle")) { + return false; + } + + if (mount.getOwnerId() != actor.getObjectID()) { + return false; + } + + if (mount.getOption(Options.DISABLED)) { + return false; + } + + if (mount.getConditionDamage() == 0) { + return false; + } + + List surroundings = core.simulationService.get(mount.getPlanet(), mount.getPosition().x, mount.getPosition().z, 32); + + for (SWGObject object : surroundings) { + if (object instanceof BuildingObject) { + if (object.getTemplate().contains("garage")) { + return true; + } + } + } + + return false; + } + + public void repair(CreatureObject repairer, CreatureObject mount) { + if (repairer == null || mount == null) { + return; + } + + if (!mount.getOption(Options.MOUNT)) { + return; + } + + if (core.objectService.getObject(mount.getOwnerId()) != repairer) { + return; + } + + if (mount.getOption(Options.DISABLED)) { + repairer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cannot_repair_disabled"), DisplayType.Broadcast); + return; + } + + if (mount.getConditionDamage() == 0) { + repairer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:undamaged_vehicle"), DisplayType.Broadcast); + return; + } + + // This should produce an SUI window regarding cost and cost might be determined differently. + // But at the moment it's not important. + + if (!canRepair(repairer, mount)) { + repairer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:repair_unrecognized_garages"), DisplayType.Broadcast); + return; + } + + int cost = mount.getConditionDamage(); + + if (repairer.getCashCredits() < cost) { + repairer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:repair_failed_due_to_funds"), DisplayType.Broadcast); + return; + } + + mount.setConditionDamage(0); + + mount.setOptions(Options.DISABLED, false); + + repairer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:repaired_to_max"), DisplayType.Broadcast); + } + + public void mount(CreatureObject rider, CreatureObject mount) { + if (rider == null) { + return; + } + + if (mount == null) { + return; + } + + // FIXME like above, movement skillmod should be used instead of creo4 vars and never be 0, otherwise it thinks we are always rooted + //if (rider.getSkillModBase("movement") == 0) { + //rider.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_mount_rooted"), DisplayType.Broadcast); + //return; + //} + + if (mount.getOption(Options.DISABLED)) { + rider.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_mount_veh_disabled"), DisplayType.Broadcast); + return; + } + + if (!mount.getOption(Options.MOUNT)) { + return; + } + + if (!canMount(rider, mount)) { + rider.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_mount"), DisplayType.Broadcast); + return; + } + + if (rider.isInStealth()) { + rider.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:no_mount_stealth"), DisplayType.Broadcast); + return; + } + + rider.setStateBitmask(rider.getStateBitmask() | 0x8000000); + rider.setPosture((mount.getTemplate().contains("vehicle")) ? Posture.DrivingVehicle : Posture.RidingCreature); + + synchronized(mount.getMutex()) { + mount._add(rider); + } + + mount.setStateBitmask(mount.getStateBitmask() | 0x10000000); + //mount.setState(State.MountedCreature, true); + mount.notifyObservers(new UpdateContainmentMessage(rider.getObjectID(), mount.getObjectID(), 4), true); + //rider.setState(State.RidingMount, true); + core.simulationService.remove(rider, rider.getWorldPosition().x, rider.getWorldPosition().z, false); + } + + public CreatureObject getMount(SWGObject pcd) { + if (pcd == null) { + return null; + } + + if (pcd.getAttachment("companionId") == null) { + return null; + } + + CreatureObject mount = (CreatureObject) core.objectService.getObject((Long) pcd.getAttachment("companionId")); + + if (mount == null) { + return null; + } + + if (mount.getContainer() != null) { + return null; + } + + return mount; + } + + public CreatureObject getCompanion(CreatureObject actor) { + if (actor == null) { + return null; + } + + if (isMounted(actor)) { + return (CreatureObject) actor.getContainer(); + } + + SWGObject datapad = actor.getSlottedObject("datapad"); + + if (datapad == null) { + return null; + } + + final List companions = new ArrayList(); + + datapad.viewChildren(actor, false, false, new Traverser() { + + public void process(SWGObject pcd) { + if (pcd.getAttachment("companionId") != null) { + if (pcd.getSlottedObject("inventory") != null) { + LongAdder adder = new LongAdder(); + pcd.getSlottedObject("inventory").viewChildren(actor, false, false, (obj) -> adder.increment()); + + if (adder.intValue() == 0) { + CreatureObject companion = (CreatureObject) core.objectService.getObject((Long) pcd.getAttachment("companionId")); + companions.add(companion); + } + } + } + } + + }); + + if (companions.size() > 0) { + return companions.get(0); + } else { + return null; + } + } + + public boolean isMounted(CreatureObject rider) { + if (rider.getContainer() == null) { + return false; + } + + if (!(rider.getContainer() instanceof CreatureObject)) { + return false; + } + + CreatureObject mount = (CreatureObject) rider.getContainer(); + + if (!mount.getOption(Options.MOUNT)) { + return false; + } + + if (mount.getSlottedObject("rider") != rider) { + return false; + } + + return true; + } + + public boolean isMounted(SWGObject actor, CreatureObject mount) { + return actor.getContainer() == mount; + } + + public boolean canMount(CreatureObject rider, CreatureObject mount) { + if (mount == null) { + return false; + } + + if (!mount.getOption(Options.MOUNT)) { + return false; + } + + if (isMounted(rider)) { + return false; + } + + if (rider.getObjectID() == mount.getOwnerId()) { + return true; + } + + // It's a potential passenger + + // See if there's driver first + if (mount.getSlottedObject("rider") == null) { + return false; + } + + int passengers = 0; + + if (mount.getAttachment("passengers") != null){ + passengers = (Integer) mount.getAttachment("passengers"); + } + + int passengerSlot = 0; + + for (int i = 1; i <= passengers; i++) { + if (mount.getSlottedObject("rider" + i) == null) { + passengerSlot = i; + break; + } + } + + if (passengerSlot == 0) { + return false; + } + + CreatureObject owner = (CreatureObject) NGECore.getInstance().objectService.getObject(mount.getOwnerId()); + + if (owner == null) { + return false; + } + + if (owner.isAttackableBy(rider)) { + return false; + } + + if (rider.getGroupId() == 0 || rider.getGroupId() != owner.getGroupId()) { + return false; + } + + return true; + } + + public void dismount(CreatureObject rider, CreatureObject mount) { + if (rider == null || mount == null) { + return; + } + + if (!isMounted(rider)) { + return; + } + + if (!mount.getOption(Options.MOUNT)) { + return; + } + + if (rider.getObjectID() == mount.getOwnerId()) { + CreatureObject owner = rider; + + mount.viewChildren(owner, false, false, new Traverser() { + + public void process(SWGObject passenger) { + if (passenger != owner) { + mount._remove(passenger); + mount.notifyObservers(new UpdateContainmentMessage(passenger.getObjectID(), 0, -1), false); + + if (passenger instanceof CreatureObject) { + ((CreatureObject) passenger).setState(StateStatus.RidingMount, false); + ((CreatureObject) passenger).setPosture(Posture.Upright); + } + + core.simulationService.add(passenger, mount.getWorldPosition().x, mount.getWorldPosition().z, false); + core.simulationService.teleport(passenger, mount.getWorldPosition(), mount.getOrientation(), 0); + } + } + + }); + } + + mount._remove(rider); + mount.notifyObservers(new UpdateContainmentMessage(rider.getObjectID(), 0, -1), false); + + if (rider.getObjectID() == mount.getOwnerId()) { + mount.setState(StateStatus.MountedCreature, false); + } + + core.simulationService.add(rider, mount.getWorldPosition().x, mount.getWorldPosition().z, false); + core.simulationService.teleport(rider, mount.getWorldPosition(), mount.getOrientation(), 0); + + if (!mount.getTemplate().contains("vehicle") && rider.getObjectID() == mount.getOwnerId()) { + store(rider, mount); + } + } + + /* + * They seem to have been stored in the inventory of the pcd object. + * Judging by the fact pcds have inventories and many other things don't. + */ + public void store(CreatureObject storer, CreatureObject mount) { + if (mount.getContainer() != null) { + return; + } + + if (mount.getOwnerId() == 0) { + return; + } + + CreatureObject owner = (CreatureObject) core.objectService.getObject(mount.getOwnerId()); + + if (owner == null || storer == null || owner != storer) { + return; + } + + PlayerObject player = (PlayerObject) owner.getSlottedObject("ghost"); + + if (player.isCallingCompanion()) { + storer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:cant_store_1sec"), DisplayType.Broadcast); + return; + } + + if (isMounted(owner, mount)) { + storer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:must_dismount"), DisplayType.Broadcast); + return; + } + + if (owner.getTefTime() > 0) { + owner.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:prose_cant_store_yet", owner.getTefTime()), DisplayType.Broadcast); + return; + } + + SWGObject datapad = owner.getSlottedObject("datapad"); + + if (datapad == null) { + return; + } + + datapad.viewChildren(owner, false, false, new Traverser() { + + public void process(SWGObject pcd) { + if (pcd.getAttachment("companionId") != null && mount.getObjectID() == ((Long) pcd.getAttachment("companionId"))) { + if (pcd.getSlottedObject("inventory") != null) { + LongAdder adder = new LongAdder(); + pcd.getSlottedObject("inventory").viewChildren(owner, false, false, (obj) -> adder.increment()); + + if (adder.intValue() == 0) { + core.simulationService.remove(mount, mount.getWorldPosition().x, mount.getWorldPosition().z, true); + pcd.getSlottedObject("inventory").add(mount); + } + } + } + } + + }); + } + + public void storeAll(CreatureObject actor) { + if (actor == null) { + return; + } + + while (getCompanion(actor) != null) { + SWGObject mount = getCompanion(actor); + + SWGObject datapad = actor.getSlottedObject("datapad"); + + if (datapad == null) { + return; + } + + datapad.viewChildren(actor, false, false, new Traverser() { + + public void process(SWGObject pcd) { + if (pcd.getAttachment("companionId") != null && mount.getObjectID() == ((Long) pcd.getAttachment("companionId"))) { + if (pcd.getSlottedObject("inventory") != null) { + LongAdder adder = new LongAdder(); + pcd.getSlottedObject("inventory").viewChildren(actor, false, false, (obj) -> adder.increment()); + + if (adder.intValue() == 0) { + core.simulationService.remove(mount, mount.getWorldPosition().x, mount.getWorldPosition().z, true); + pcd.getSlottedObject("inventory").add(mount); + } + } + } + } + + }); + } + } + + public void destroy(CreatureObject destroyer, SWGObject pcd) { + if (destroyer == null || pcd == null || pcd.getGrandparent() == null) { + return; + } + + if (destroyer.getObjectID() != pcd.getGrandparent().getObjectID()) { + return; + } + + if (pcd.getAttachment("companionId") == null) { + return; + } + + CreatureObject mount = (CreatureObject) core.objectService.getObject((Long) pcd.getAttachment("companionId")); + + dismount(destroyer, mount); + + store(destroyer, mount); + + String type = mount.getTemplate(); + + core.objectService.destroyObject(mount); + core.objectService.destroyObject(pcd); + + if (type.contains("vehicle")) { + destroyer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:vehicle_released"), DisplayType.Broadcast); + } else { + destroyer.sendSystemMessage(OutOfBand.ProsePackage("@pet_menu:pet_released"), DisplayType.Broadcast); + } + } + + public void insertOpcodes(Map arg0, Map arg1) { + + } + + public void shutdown() { + + } + +}