who isn't sick of converting the freaking scripts? this negates the need

This commit is contained in:
DarthArgus
2015-11-24 09:27:45 -06:00
parent 2e64106bc8
commit bbee2d328c
11077 changed files with 2604347 additions and 3425075 deletions
@@ -0,0 +1,48 @@
package script.player.cmd;
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.firework;
public class misc extends script.base_script
{
public misc()
{
}
public static final string_id SID_LAUNCH_FIREWORKS_INDOORS = new string_id("firework", "launch_fireworks_indoors");
public int cmdLaunchFirework(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
{
if (!isIdValid(target))
{
return SCRIPT_CONTINUE;
}
if (!hasObjVar(target, firework.VAR_FIREWORK_BASE))
{
return SCRIPT_CONTINUE;
}
location here = getLocation(self);
if (isIdValid(here.cell))
{
sendSystemMessage(self, SID_LAUNCH_FIREWORKS_INDOORS);
return SCRIPT_CONTINUE;
}
if (params == null || params.equals(""))
{
firework.launch(self, target);
}
else
{
if (params.equalsIgnoreCase("show"))
{
firework.launchShow(self, target);
}
}
return SCRIPT_CONTINUE;
}
}
@@ -1,41 +0,0 @@
/***** INCLUDES ********************************************************/
include library.firework;
/***** INCLUDES ********************************************************/
/***** CONSTANTS *******************************************************/
const string_id SID_LAUNCH_FIREWORKS_INDOORS = new string_id("firework", "launch_fireworks_indoors");
/***** COMMANDHANDLERS**************************************************/
commandHandler cmdLaunchFirework()
{
if ( !isIdValid(target) )
return SCRIPT_CONTINUE;
if (!hasObjVar(target, firework.VAR_FIREWORK_BASE))
return SCRIPT_CONTINUE;
location here = getLocation(self);
if ( isIdValid(here.cell) )
{
sendSystemMessage(self, SID_LAUNCH_FIREWORKS_INDOORS);
return SCRIPT_CONTINUE;
}
if ( params == null || params.equals("") )
{
firework.launch(self, target);
}
else
{
if ( params.equalsIgnoreCase("show") )
{
//sendSystemMessageTestingOnly(self, "Firework show functionality is not implemented... YET!");
firework.launchShow(self, target);
}
}
return SCRIPT_CONTINUE;
}
@@ -0,0 +1,99 @@
package script.player.cmd;
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.utils;
import script.library.factions;
import script.library.planetary_map;
public class register extends script.base_script
{
public register()
{
}
public static final string_id SID_CANNOT_REGISTER_BAD_LOC = new string_id("register", "cannot_register_bad_loc");
public static final string_id SID_CANNOT_REGISTER_NO_SUPPORT = new string_id("register", "cannot_register_no_support");
public static final string_id SID_CANNOT_REGISTER_NOT_NEUTRAL = new string_id("register", "cannot_register_not_neutral");
public static final string_id SID_CANNOT_REGISTER_WRONG_FACTION = new string_id("register", "cannot_register_wrong_faction");
public static final string_id SID_CANNOT_REGISTER_ALREADY_REG = new string_id("register", "cannot_register_already_reg");
public static final string_id SID_SUCCESS_REGISTER = new string_id("register", "success_register");
public static final string_id SID_CANNOT_REGISTER_LACK_SKILL = new string_id("register", "cannot_register_lack_skill");
public int cmdRegisterWithLocation(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException
{
obj_id updateTarget = null;
obj_id topMost = getTopMostContainer(self);
if (!isIdValid(topMost) || topMost == self)
{
obj_id camp = utils.getObjIdScriptVar(self, "camp.current");
if (isIdValid(camp))
{
if (hasSkill(self, "social_dancer_novice") || hasSkill(self, "social_musician_novice") || hasSkill(self, "science_doctor_novice"))
{
updateTarget = camp;
}
}
}
else
{
map_location maploc = getPlanetaryMapLocation(topMost);
if (maploc == null)
{
sendSystemMessage(self, SID_CANNOT_REGISTER_BAD_LOC);
return SCRIPT_CONTINUE;
}
if (!maploc.isActive() && !maploc.isInactive())
{
sendSystemMessage(self, SID_CANNOT_REGISTER_NO_SUPPORT);
return SCRIPT_CONTINUE;
}
if (hasObjVar(topMost, "healing.canhealwound"))
{
if (hasSkill(self, "science_doctor_novice"))
{
updateTarget = topMost;
}
}
if (hasObjVar(topMost, "healing.canhealshock"))
{
if (hasSkill(self, "class_entertainer_phase1_novice"))
{
updateTarget = topMost;
}
}
}
if (isIdValid(updateTarget))
{
Vector registrants = utils.getResizeableObjIdBatchScriptVar(updateTarget, "registrants");
if (registrants != null && registrants.size() > 0)
{
if (utils.getElementPositionInArray(registrants, self) > -1)
{
sendSystemMessage(self, SID_CANNOT_REGISTER_ALREADY_REG);
return SCRIPT_CONTINUE;
}
}
if (planetary_map.updateFacilityActive(updateTarget, true))
{
if (!hasScript(updateTarget, "planet_map.active_registered"))
{
attachScript(updateTarget, "planet_map.active_registered");
}
registrants = utils.addElement(registrants, self);
utils.setBatchScriptVar(updateTarget, "registrants", registrants);
sendSystemMessage(self, SID_SUCCESS_REGISTER);
utils.setScriptVar(self, "registerWithLocation", updateTarget);
}
}
else
{
sendSystemMessage(self, SID_CANNOT_REGISTER_LACK_SKILL);
}
return SCRIPT_CONTINUE;
}
}
@@ -1,115 +0,0 @@
/***** INCLUDES ********************************************************/
include library.utils;
include library.factions;
include library.planetary_map;
/***** INCLUDES ********************************************************/
/***** CONSTANTS *******************************************************/
const string_id SID_CANNOT_REGISTER_BAD_LOC = new string_id("register", "cannot_register_bad_loc");
const string_id SID_CANNOT_REGISTER_NO_SUPPORT = new string_id("register", "cannot_register_no_support");
const string_id SID_CANNOT_REGISTER_NOT_NEUTRAL = new string_id("register", "cannot_register_not_neutral");
const string_id SID_CANNOT_REGISTER_WRONG_FACTION = new string_id("register", "cannot_register_wrong_faction");
const string_id SID_CANNOT_REGISTER_ALREADY_REG = new string_id("register", "cannot_register_already_reg");
const string_id SID_SUCCESS_REGISTER = new string_id("register", "success_register");
const string_id SID_CANNOT_REGISTER_LACK_SKILL = new string_id("register", "cannot_register_lack_skill");
/***** COMMANDHANDLERS**************************************************/
commandHandler cmdRegisterWithLocation()
{
obj_id updateTarget = null;
obj_id topMost = getTopMostContainer(self);
if ( !isIdValid(topMost) || topMost == self )
{
//check for existence of a camp!
obj_id camp = utils.getObjIdScriptVar(self, "camp.current");
if ( isIdValid(camp) )
{
if ( hasSkill(self, "social_dancer_novice") || hasSkill(self, "social_musician_novice") ||
hasSkill(self, "science_doctor_novice") )
{
updateTarget = camp;
}
}
}
else
{
map_location maploc = getPlanetaryMapLocation(topMost);
if ( maploc == null )
{
sendSystemMessage(self, SID_CANNOT_REGISTER_BAD_LOC);
return SCRIPT_CONTINUE;
}
if ( !maploc.isActive() && !maploc.isInactive() )
{
sendSystemMessage(self, SID_CANNOT_REGISTER_NO_SUPPORT);
return SCRIPT_CONTINUE;
}
if ( hasObjVar(topMost, "healing.canhealwound") )
{
//its a hospital
if ( hasSkill(self, "science_doctor_novice") )
updateTarget = topMost;
}
if ( hasObjVar(topMost, "healing.canhealshock") )
{
//its a cantina
if ( hasSkill(self, "class_entertainer_phase1_novice"))
updateTarget = topMost;
}
}
if ( isIdValid(updateTarget) )
{
/*string tFac = factions.getFaction(updateTarget);
string myFac = factions.getFaction(self);
//debugSpeakMsg(self,"tfac = " + tFac + " myfac = " + myFac);
if ( tFac != null && !tFac.equals("") )
{
if ( myFac == null || myFac.equals("") )
{
sendSystemMessage(self, SID_CANNOT_REGISTER_NOT_NEUTRAL);
return SCRIPT_CONTINUE;
}
else if ( factions.areFactionsOpposed(tFac, myFac) )
{
sendSystemMessage(self, SID_CANNOT_REGISTER_WRONG_FACTION);
return SCRIPT_CONTINUE;
}
} ABANDON ALL HOPE AS YE OLDE BULLSHIT IS ABOVE THIS LINE!
*/
resizeable obj_id[] registrants = utils.getResizeableObjIdBatchScriptVar(updateTarget, "registrants");
if ( registrants != null && registrants.length > 0 )
{
if ( utils.getElementPositionInArray(registrants, self) > -1 )
{
sendSystemMessage(self, SID_CANNOT_REGISTER_ALREADY_REG);
return SCRIPT_CONTINUE;
}
}
if ( planetary_map.updateFacilityActive(updateTarget, true) )
{
if ( !hasScript(updateTarget, "planet_map.active_registered") )
attachScript(updateTarget, "planet_map.active_registered");
registrants = utils.addElement(registrants, self);
utils.setBatchScriptVar(updateTarget, "registrants", registrants);
sendSystemMessage(self, SID_SUCCESS_REGISTER);
utils.setScriptVar(self, "registerWithLocation", updateTarget);
}
}
else
{
sendSystemMessage(self, SID_CANNOT_REGISTER_LACK_SKILL);
}
return SCRIPT_CONTINUE;
}