mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
228 lines
4.9 KiB
Plaintext
228 lines
4.9 KiB
Plaintext
include library.space_crafting;
|
|
include library.space_utils;
|
|
include library.utils;
|
|
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
|
|
return SCRIPT_CONTINUE;
|
|
|
|
}
|
|
|
|
trigger OnGetAttributes( obj_id player, string[] names, string[] attribs )
|
|
{
|
|
int idx = utils.getValidAttributeIndex(names);
|
|
if (idx == -1)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
// check to see if the component has any values that need displaying
|
|
|
|
if (hasObjVar(self, "ship_chassis.mass"))
|
|
{
|
|
|
|
float value = getFloatObjVar(self, "ship_chassis.mass");
|
|
names[idx] = "chassisMassMax";
|
|
attribs[idx] = Float.toString(value);
|
|
idx++;
|
|
}
|
|
if (hasObjVar(self, "ship_chassis.hp"))
|
|
{
|
|
|
|
float value = getFloatObjVar(self, "ship_chassis.hp");
|
|
names[idx] = "hitPointsMax";
|
|
attribs[idx] = Float.toString(value);
|
|
idx++;
|
|
}
|
|
if (hasObjVar(self, "shiptype"))
|
|
{
|
|
names[idx] = "pilotSkillRequired";
|
|
attribs[idx] = getSkillRequiredForShip(self);
|
|
idx++;
|
|
}
|
|
|
|
// Note to tell player to go to a Chassis Dealer to assemble their ship chassis.
|
|
names[idx] = "ship_assembly_n";
|
|
|
|
string text = " \\#pcontrast2 " + "$@obj_attr_n:ship_assembly_d$" + " \\# ";
|
|
attribs[idx] = text;
|
|
idx++;
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
string getSkillRequiredForShip(obj_id deed)
|
|
{
|
|
string type = getStringObjVar(deed, "shiptype");
|
|
|
|
if (type == null)
|
|
{
|
|
return "";
|
|
}
|
|
|
|
else if (type.equals("z95"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_novice";
|
|
}
|
|
else if (type.equals("xwing"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_starships_03";
|
|
}
|
|
else if (type.equals("hutt_light_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_novice";
|
|
}
|
|
else if (type.equals("hutt_light_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_novice";
|
|
}
|
|
else if (type.equals("tiefighter"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_01";
|
|
}
|
|
else if (type.equals("tieinterceptor"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_03";
|
|
}
|
|
else if (type.equals("tieadvanced"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_04";
|
|
}
|
|
else if (type.equals("tieaggressor"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_04";
|
|
}
|
|
else if (type.equals("tiebomber"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_03";
|
|
}
|
|
else if (type.equals("tieoppressor"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_master";
|
|
}
|
|
else if (type.equals("awing"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_starships_04";
|
|
}
|
|
else if (type.equals("bwing"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_master";
|
|
}
|
|
else if (type.equals("ywing"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_starships_01";
|
|
}
|
|
else if (type.equals("firespray"))
|
|
{
|
|
return "@space_crafting_n:all_master";
|
|
}
|
|
else if (type.equals("yt1300"))
|
|
{
|
|
return "@skl_n:pilot_neutral_master";
|
|
}
|
|
else if (type.equals("decimator"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_master";
|
|
}
|
|
else if (type.equals("ykl37r"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_master";
|
|
}
|
|
else if (type.equals("hutt_heavy_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("hutt_heavy_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("hutt_medium_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_01";
|
|
}
|
|
else if (type.equals("hutt_medium_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_01";
|
|
}
|
|
else if (type.equals("tie_in"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_starships_02";
|
|
}
|
|
else if (type.equals("tie_light_duty"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_novice";
|
|
}
|
|
else if (type.equals("ywing_longprobe"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_starships_02";
|
|
}
|
|
else if (type.equals("blacksun_light_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("blacksun_light_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("blacksun_light_s03"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("blacksun_light_s04"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_02";
|
|
}
|
|
else if (type.equals("blacksun_heavy_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_04";
|
|
}
|
|
else if (type.equals("blacksun_heavy_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_04";
|
|
}
|
|
else if (type.equals("blacksun_heavy_s03"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_04";
|
|
}
|
|
else if (type.equals("blacksun_heavy_s04"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_04";
|
|
}
|
|
else if (type.equals("blacksun_medium_s01"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_03";
|
|
}
|
|
else if (type.equals("blacksun_medium_s02"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_03";
|
|
}
|
|
else if (type.equals("blacksun_medium_s03"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_03";
|
|
}
|
|
else if (type.equals("blacksun_medium_s04"))
|
|
{
|
|
return "@skl_n:pilot_neutral_starships_03";
|
|
}
|
|
else if (type.equals("hutt_turret_ship"))
|
|
{
|
|
return "@skl_n:pilot_neutral_master";
|
|
}
|
|
else if (type.equals("gunship_neutral"))
|
|
{
|
|
return "@skl_n:pilot_neutral_master";
|
|
}
|
|
else if (type.equals("gunship_imperial"))
|
|
{
|
|
return "@skl_n:pilot_imperial_navy_master";
|
|
}
|
|
else if (type.equals("gunship_rebel"))
|
|
{
|
|
return "@skl_n:pilot_rebel_navy_master";
|
|
}
|
|
return "";
|
|
}
|
|
|