Added Captain Panaka Script

Added Captain Panaka to Kaadara,
Altered Showpos to use the more accurate Spawnobject constructor
This commit is contained in:
tacef
2014-08-01 19:14:17 +02:00
parent 1982668827
commit 517ab4468f
3 changed files with 51 additions and 8 deletions
+9 -5
View File
@@ -16,7 +16,7 @@ def setup():
def run(core, actor, target, commandString):
playerObject = actor.getSlottedObject('ghost')
if not playerObject:
return
@@ -151,10 +151,14 @@ def run(core, actor, target, commandString):
print ('Position.y : %s' % pos.y, 0)
actor.sendSystemMessage('Position.z : %s' % pos.z, 0)
print ('Position.z : %s' % pos.z, 0)
actor.sendSystemMessage('Orientation.w : %s' % ori.w, 0)
print ('Orientation.x : %s' % ori.w, 0)
actor.sendSystemMessage('Orientation.x : %s' % ori.x, 0)
print ('Orientation.w : %s' % ori.x, 0)
actor.sendSystemMessage('Orientation.y : %s' % ori.y, 0)
print ('Orientation.y : %s' % ori.y, 0)
actor.sendSystemMessage('Orientation.w : %s' % ori.w, 0)
print ('Orientation.w : %s' % ori.w, 0)
actor.sendSystemMessage('Orientation.z : %s' % ori.z, 0)
print ('Orientation.z : %s' % ori.z, 0)
if (actor.getContainer()):
building_id = actor.getGrandparent().getObjectID()
cid = actor.getContainer().getCellNumber()
@@ -164,9 +168,9 @@ def run(core, actor, target, commandString):
print('Cell ID : %s' % cid, 0)
print('Building ID : %s' % building_id, 0)
if cellid == 0:
str = "<OBJECTNAME> = stcSvc.spawnObject('<MOBILENAME>', '" + planetName + "', long(%s" % cellid + "), float(%.4f" % pos.x + "), float(%.4f" % pos.y + "), float(%.4f" % pos.z + "), float(%.4f" % ori.y + "), float(%.4f" % ori.w + "))"
str = "<OBJECTNAME> = stcSvc.spawnObject('<MOBILENAME>', '" + planetName + "', long(%s" % cellid + "), float(%.4f" % pos.x + "), float(%.4f" % pos.y + "), float(%.4f" % pos.z + "), float(%.4f" % ori.w + "), float(%.4f" % ori.x + "), float(%.4f" % ori.y + "), float(%.4f" % ori.z + "))"
elif cellid != 0:
str = "\tbuilding = core.objectService.getObject(long(%s" % building_id + "))\n\t<OBJECTNAME> = stcSvc.spawnObject('<MOBILENAME>', '" + planetName + "', building.getCellByCellNumber(long(%s" % cellid + ")), float(%.4f" % pos.x + "), float(%.4f" % pos.y + "), float(%.4f" % pos.z + "), float(%.4f" % ori.y + "), float(%.4f" % ori.w + "))"
str = "\tbuilding = core.objectService.getObject(long(%s" % building_id + "))\n\t<OBJECTNAME> = stcSvc.spawnObject('<MOBILENAME>', '" + planetName + "', building.getCellByCellNumber(long(%s" % cellid + ")), float(%.4f" % pos.x + "), float(%.4f" % pos.y + "), float(%.4f" % pos.z + "), float(%.4f" % ori.w + "), float(%.4f" % ori.x + "), float(%.4f" % ori.y + "), float(%.4f" % ori.z + "))"
toolkit = Toolkit.getDefaultToolkit()
clipboard = toolkit.getSystemClipboard()
clipboard.setContents(StringSelection(str), None)
@@ -0,0 +1,33 @@
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobileTemplate.setCustomName('Captain Panaka')
mobileTemplate.setLevel(1)
mobileTemplate.setDifficulty(Difficulty.NORMAL)
mobileTemplate.setSocialGroup("township")
mobileTemplate.setOptionsBitmask(Options.INVULNERABLE)
templates = Vector()
templates.add('object/mobile/shared_panaka.iff')
mobileTemplate.setTemplates(templates)
weaponTemplates = Vector()
weapontemplate = WeaponTemplate('object/weapon/melee/unarmed/shared_unarmed_default.iff', WeaponType.UNARMED, 1.0, 6, 'kinetic')
weaponTemplates.add(weapontemplate)
mobileTemplate.setWeaponTemplateVector(weaponTemplates)
attacks = Vector()
mobileTemplate.setDefaultAttack('creatureMeleeAttack')
mobileTemplate.setAttacks(attacks)
core.spawnService.addMobileTemplate('panaka', mobileTemplate)
return
+9 -3
View File
@@ -1,12 +1,18 @@
import sys
from resources.datatables import Options
from resources.datatables import StateStatus
def addPlanetSpawns(core, planet):
stcSvc = core.staticService
objSvc = core.objectService
#junkdealer will be added as soon as i find coords
stcSvc.spawnObject('junkdealer', 'naboo', long(0), float(5093.8560), float(-191.7385), float(6710.1772), float(0.7283), float(-0.6853))
stcSvc.spawnObject('junkdealer', 'naboo', long(0), float(5060.5347), float(-191.7385), float(6710.0000), float(0.6257), float(0.7800))
#Legacy NPC's
panaka = stcSvc.spawnObject('panaka', 'naboo', long(0), float(5196.5986), float(-192.0000), float(6712.7124), float(0.9984), float(0.0572))
return