mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-01 17:12:57 -04:00
who isn't sick of converting the freaking scripts? this negates the need
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.chat;
|
||||
|
||||
public class alozen extends script.base_script
|
||||
{
|
||||
public alozen()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Field Cdr. Alozen");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Field Cdr. Alozen");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.chat;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// OnAttach
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnAttach()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Field Cdr. Alozen" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnInitialize
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnInitialize()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Field Cdr. Alozen" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.chat;
|
||||
|
||||
public class colzet extends script.base_script
|
||||
{
|
||||
public colzet()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Lt. Colzet");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Lt. Colzet");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// colzet.script
|
||||
//
|
||||
// Script to set a few things on Lt. Colzet.
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.chat;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// OnAttach
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnAttach()
|
||||
{
|
||||
// setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Lt. Colzet" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnInitialize
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnInitialize()
|
||||
{
|
||||
// setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Lt. Colzet" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.ai_lib;
|
||||
import script.library.utils;
|
||||
|
||||
public class greeter_moenia_dancer extends script.base_script
|
||||
{
|
||||
public greeter_moenia_dancer()
|
||||
{
|
||||
}
|
||||
public int stopDancing(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
utils.removeScriptVar(self, "isDancing");
|
||||
ai_lib.setMood(self, "calm");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
include library.ai_lib;
|
||||
include library.utils;
|
||||
|
||||
messageHandler stopDancing ()
|
||||
{
|
||||
utils.removeScriptVar(self, "isDancing");
|
||||
ai_lib.setMood (self, "calm");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.chat;
|
||||
|
||||
public class holfheim extends script.base_script
|
||||
{
|
||||
public holfheim()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Under Inquisitor Holfheim");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Under Inquisitor Holfheim");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.chat;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// OnAttach
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnAttach()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Under Inquisitor Holfheim" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnInitialize
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnInitialize()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Under Inquisitor Holfheim" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.chat;
|
||||
|
||||
public class oberhaur extends script.base_script
|
||||
{
|
||||
public oberhaur()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Cdr. Oberhaur");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setAnimationMood(self, "npc_imperial");
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "Cdr. Oberhaur");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// oberhaur.script
|
||||
//
|
||||
// Script to set a few things on Commander Oberhaur.
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.chat;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// OnAttach
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnAttach()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Cdr. Oberhaur" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnInitialize
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnInitialize()
|
||||
{
|
||||
setAnimationMood( self, "npc_imperial" );
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "Cdr. Oberhaur" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.chat;
|
||||
|
||||
public class technician extends script.base_script
|
||||
{
|
||||
public technician()
|
||||
{
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "A Starship Technician");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
setInvulnerable(self, true);
|
||||
setName(self, "A Starship Technician");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// technician.script
|
||||
//
|
||||
// Script to set a few things on Nym's technicians.
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.chat;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// OnAttach
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnAttach()
|
||||
{
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "A Starship Technician" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnInitialize
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnInitialize()
|
||||
{
|
||||
setInvulnerable( self, true );
|
||||
setName( self, "A Starship Technician" );
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package script.space.characters;
|
||||
|
||||
import script.*;
|
||||
import script.base_class.*;
|
||||
import script.combat_engine.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import script.base_script;
|
||||
|
||||
import script.library.sui;
|
||||
|
||||
public class transfer_auth extends script.base_script
|
||||
{
|
||||
public transfer_auth()
|
||||
{
|
||||
}
|
||||
public static final string_id SID_READ = new string_id("space/quest", "read");
|
||||
public static final string_id SID_SYS_NOT_IN_INV = new string_id("space/quest", "not_in_inv");
|
||||
public static final string_id SID_SIGNED = new string_id("space/quest", "signed");
|
||||
public static final String SID_SIGN = "@space/quest:sign";
|
||||
public static final String SID_CLOSE = "@space/quest:close";
|
||||
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
||||
{
|
||||
mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_READ);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
||||
{
|
||||
if (item == menu_info_types.SERVER_MENU1)
|
||||
{
|
||||
displayDialog(self, player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void displayDialog(obj_id self, obj_id player) throws InterruptedException
|
||||
{
|
||||
obj_id inventory = getObjectInSlot(player, "inventory");
|
||||
if (!contains(inventory, self))
|
||||
{
|
||||
sendSystemMessage(player, SID_SYS_NOT_IN_INV);
|
||||
return;
|
||||
}
|
||||
String text = "@space/quest:ta_text";
|
||||
String title = "@space/quest:ta_title";
|
||||
String signed = getStringObjVar(self, "signature");
|
||||
if (signed != null)
|
||||
{
|
||||
text += "\n Signed: " + signed + "\n";
|
||||
}
|
||||
int pid = sui.createSUIPage(sui.SUI_MSGBOX, self, player, "handleDialogInput");
|
||||
sui.setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, text);
|
||||
sui.setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title);
|
||||
sui.msgboxButtonSetup(pid, sui.OK_CANCEL);
|
||||
sui.setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, SID_SIGN);
|
||||
sui.setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, SID_CLOSE);
|
||||
sui.showSUIPage(pid);
|
||||
return;
|
||||
}
|
||||
public int handleDialogInput(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if ((params == null) || (params.isEmpty()))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id player = sui.getPlayerId(params);
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
switch (bp)
|
||||
{
|
||||
case sui.BP_CANCEL:
|
||||
signForm(self, player);
|
||||
return SCRIPT_CONTINUE;
|
||||
case sui.BP_OK:
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public void signForm(obj_id self, obj_id player) throws InterruptedException
|
||||
{
|
||||
sui.inputbox(self, player, "@space/quest:ta_sign", sui.OK_CANCEL, "@space/quest:ta_sign_title", sui.MSG_NORMAL, null, "handleSignedForm", null);
|
||||
}
|
||||
public int handleSignedForm(obj_id self, dictionary params) throws InterruptedException
|
||||
{
|
||||
if ((params == null) || (params.isEmpty()))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id player = sui.getPlayerId(params);
|
||||
int bp = sui.getIntButtonPressed(params);
|
||||
String text = sui.getInputBoxText(params);
|
||||
switch (bp)
|
||||
{
|
||||
case sui.BP_CANCEL:
|
||||
return SCRIPT_CONTINUE;
|
||||
case sui.BP_OK:
|
||||
setObjVar(self, "signature", text);
|
||||
sendSystemMessage(player, SID_SIGNED);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
//------------------------------------------------
|
||||
// transfer_auth.script
|
||||
//
|
||||
// Script for the signable Authorization of Transfer form.
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// Includes
|
||||
//------------------------------------------------
|
||||
|
||||
include library.sui;
|
||||
|
||||
//------------------------------------------------
|
||||
// Constants
|
||||
//------------------------------------------------
|
||||
|
||||
const string_id SID_READ = new string_id("space/quest", "read");
|
||||
const string_id SID_SYS_NOT_IN_INV = new string_id("space/quest", "not_in_inv");
|
||||
const string_id SID_SIGNED = new string_id("space/quest", "signed");
|
||||
const string SID_SIGN = "@space/quest:sign";
|
||||
const string SID_CLOSE = "@space/quest:close";
|
||||
|
||||
//------------------------------------------------
|
||||
// OnObjectMenuRequest
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnObjectMenuRequest( obj_id player, menu_info mi )
|
||||
{
|
||||
mi.addRootMenu( menu_info_types.SERVER_MENU1, SID_READ );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// OnObjectMenuSelect
|
||||
//------------------------------------------------
|
||||
|
||||
trigger OnObjectMenuSelect( obj_id player, int item )
|
||||
{
|
||||
if ( item == menu_info_types.SERVER_MENU1 )
|
||||
{
|
||||
displayDialog( self, player );
|
||||
}
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// displayDialog
|
||||
//------------------------------------------------
|
||||
|
||||
void displayDialog( obj_id self, obj_id player )
|
||||
{
|
||||
// Make sure we are in the player's inventory.
|
||||
obj_id inventory = getObjectInSlot( player, "inventory" );
|
||||
if ( !contains( inventory, self ) )
|
||||
{
|
||||
sendSystemMessage( player, SID_SYS_NOT_IN_INV );
|
||||
return;
|
||||
}
|
||||
|
||||
string text = "@space/quest:ta_text";
|
||||
string title = "@space/quest:ta_title";
|
||||
|
||||
string signed = getStringObjVar( self, "signature" );
|
||||
if ( signed != null )
|
||||
{
|
||||
text += "\n Signed: " + signed + "\n";
|
||||
}
|
||||
|
||||
|
||||
// Create the dialog page.
|
||||
int pid = sui.createSUIPage( sui.SUI_MSGBOX, self, player, "handleDialogInput" );
|
||||
|
||||
// Add elements text.
|
||||
sui.setSUIProperty( pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, text );
|
||||
sui.setSUIProperty (pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title );
|
||||
|
||||
// Add buttons.
|
||||
sui.msgboxButtonSetup( pid, sui.OK_CANCEL );
|
||||
sui.setSUIProperty( pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, SID_SIGN );
|
||||
sui.setSUIProperty( pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, SID_CLOSE );
|
||||
|
||||
// Show dialog.
|
||||
sui.showSUIPage( pid );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// handleDialogInput
|
||||
//------------------------------------------------
|
||||
|
||||
messageHandler handleDialogInput()
|
||||
{
|
||||
if ( (params == null) || (params.isEmpty()) )
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
// Determine which button was pressed.
|
||||
obj_id player = sui.getPlayerId( params );
|
||||
int bp = sui.getIntButtonPressed( params );
|
||||
switch ( bp )
|
||||
{
|
||||
case sui.BP_CANCEL: // "Sign"
|
||||
signForm( self, player );
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
case sui.BP_OK: // "Close"
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// signForm
|
||||
//------------------------------------------------
|
||||
|
||||
void signForm( obj_id self, obj_id player )
|
||||
{
|
||||
sui.inputbox( self, player, "@space/quest:ta_sign", sui.OK_CANCEL, "@space/quest:ta_sign_title", sui.MSG_NORMAL, null, "handleSignedForm", null );
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// handleSignedForm
|
||||
//------------------------------------------------
|
||||
|
||||
messageHandler handleSignedForm()
|
||||
{
|
||||
if ( (params == null) || (params.isEmpty()) )
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
// Determine which button was pressed.
|
||||
obj_id player = sui.getPlayerId( params );
|
||||
int bp = sui.getIntButtonPressed( params );
|
||||
string text = sui.getInputBoxText( params );
|
||||
switch ( bp )
|
||||
{
|
||||
case sui.BP_CANCEL:
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
case sui.BP_OK:
|
||||
// Store what they signed with.
|
||||
setObjVar( self, "signature", text );
|
||||
sendSystemMessage( player, SID_SIGNED );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
Reference in New Issue
Block a user