include library.utils; include library.pet_lib; trigger OnAttach() { createBantha( self ); createLandSpeeder( self ); messageTo( self, "handleDetachMakePet", null, 5, false ); return SCRIPT_CONTINUE; } messageHandler handleDetachMakePet() { detachScript( self, "e3demo.makepet" ); return SCRIPT_CONTINUE; } void createBantha( obj_id self ) { string controlTemplate = "object/intangible/pet/bantha_hue.iff"; obj_id datapad = utils.getPlayerDatapad( self ); obj_id petControlDevice = createObject( controlTemplate, datapad, ""); setObjVar( petControlDevice, "pet.creatureName", "bantha_e3" ); attachScript( petControlDevice, "ai.pet_control_device" ); setName( petControlDevice, "(bantha)" ); int petType = pet_lib.PET_TYPE_NON_AGGRO; setObjVar( petControlDevice, "ai.pet.type", petType ); setObjVar( petControlDevice, "ai.pet.trainedMount", 1 ); } void createLandSpeeder( obj_id self ) { obj_id datapad = utils.getPlayerDatapad(self); string controlTemplate = "object/intangible/vehicle/landspeeder_x34_pcd.iff"; obj_id petControlDevice = createObject(controlTemplate, datapad, ""); setObjVar(petControlDevice, "pet.crafted", true); setObjVar(petControlDevice, "vehicle_attribs.object_ref", "x34"); attachScript(petControlDevice, "systems.vehicle_system.vehicle_control_device"); setObjVar( petControlDevice, "ai.pet.trainedMount", 1 ); setName( petControlDevice, "(x34)" ); }