Merge branch 'master' of github.com:Ragora/T2-BoL

This commit is contained in:
Robert MacGregor 2015-08-30 02:46:11 -04:00
commit 18bdb659df
287 changed files with 108557 additions and 107608 deletions

View file

@ -90,8 +90,8 @@ exec("scripts/CreditsGui.cs");
exec("serverControl.cs"); exec("serverControl.cs");
//Init Shared & Client scripts //Init Shared & Client scripts
exec("scripts/modScripts/shared/initialise.cs"); exec("scripts/modscripts/shared/initialize.cs");
exec("scripts/modScripts/client/initialise.cs"); exec("scripts/modscripts/client/initialize.cs");
if (isDemo()) if (isDemo())
exec("scripts/DemoEndGui.cs"); exec("scripts/DemoEndGui.cs");
exec("scripts/ChatGui.cs"); exec("scripts/ChatGui.cs");

View file

@ -1,416 +0,0 @@
$Data::Ammo1836101295_0_AlphaSector = "100";
$Data::Ammo1836101295_0_Earth = "100";
$Data::Ammo1836101295_1_AlphaSector = "15";
$Data::Ammo1836101295_1_Earth = "15";
$Data::Ammo2003098_1_Earth = "15";
$Data::Ammo2003098_1_rpg_new = "17";
$Data::Ammo2003098_2_Earth = "100";
$Data::Ammo2003098_2_rpg_new = "100";
$Data::Ammo427694980_1_AlphaSector = "15";
$Data::Ammo427694980_1_Earth = "12";
$Data::Ammo427694980_2_AlphaSector = "100";
$Data::Ammo427694980_2_Earth = "0";
$Data::Armor1836101295_AlphaSector = "Light";
$Data::Armor1836101295_Earth = "Light";
$Data::Armor2003098_Earth = "LIGHT";
$Data::Armor2003098_rpg_new = "LIGHT";
$Data::Armor427694980_AlphaSector = "LIGHT";
$Data::Armor427694980_Earth = "LIGHT";
$Data::Caps = 3;
$Data::Caps0 = 0;
$Data::Caps1682851961 = 0;
$Data::Caps1836101295 = 0;
$Data::Caps2003098 = 5;
$Data::Caps2485526 = 0;
$Data::Caps3738647 = 0;
$Data::Caps427694980 = 2;
$Data::Caps960691562 = 0;
$Data::ClanCount = 3;
$Data::ClanDesc0 = "We do what we must because we can.";
$Data::ClanDesc1 = "A test..";
$Data::ClanID1836101295 = "0";
$Data::ClanID2003098 = "2";
$Data::ClanID427694980 = "1";
$Data::ClanLeader0 = "DarkDragonDX";
$Data::ClanLeader1 = "Dark Dragon DX";
$Data::ClanLeader2 = "DarkDragonDX";
$Data::ClanLeaderGUID0 = "1836101295";
$Data::ClanLeaderGUID1 = "427694980";
$Data::ClanLeaderGUID2 = "2003098";
$Data::ClanMember0_0 = "1836101295";
$Data::ClanMember1_0 = "427694980";
$Data::ClanMember2_0 = "2003098";
$Data::ClanName0 = "Draakan Militia";
$Data::ClanName1 = "Draakan Militia";
$Data::ClanName2 = "Alpha Viper";
$Data::ClanTag0 = "|-{DRK}-|";
$Data::ClanTag1 = "|-{DRK}-|";
$Data::ClanTag2 = "-|{VPR}|-";
$Data::Client0 = "427694980";
$Data::ClientCount = 4;
$Data::ClientGUID1 = "2003098";
$Data::ClientGUID2 = "2485526";
$Data::ClientGUID3 = "0";
$Data::ClientName0 = "Dark Dragon DX";
$Data::ClientName1 = "DarkDragonDX";
$Data::ClientName2 = "Dayuppy";
$Data::ClientName3 = "DarkDragonDX";
$Data::DamageFlash1836101295_AlphaSector = "0";
$Data::DamageFlash1836101295_Earth = "0";
$Data::DamageFlash2003098_Earth = "0";
$Data::DamageFlash2003098_rpg_new = "0";
$Data::DamageFlash427694980_AlphaSector = "0";
$Data::DamageFlash427694980_Earth = "0";
$Data::Deaths = 10262;
$Data::Deaths0 = 0;
$Data::Deaths1682851961 = 4;
$Data::Deaths1836101295 = 16;
$Data::Deaths2003098 = 276;
$Data::Deaths2139104 = 1;
$Data::Deaths2450675 = 3;
$Data::Deaths2485526 = 4;
$Data::Deaths2544511 = 1;
$Data::Deaths3119044 = 5;
$Data::Deaths3392146 = 38;
$Data::Deaths3637691 = 4;
$Data::Deaths3738647 = 11;
$Data::Deaths3819266 = 9;
$Data::Deaths427694980 = 12;
$Data::Deaths960691562 = 1;
$Data::EMail::Contents0_1 = "Welcome to T2Bol, try not to die.";
$Data::EMail::Contents2003098_1 = "Welcome to T2Bol, try not to die.";
$Data::EMail::Contents2485526_1 = "Welcome to T2Bol, try not to die.";
$Data::Email::Contents427694980_ = "Hey.. does it work?";
$Data::Email::Contents427694980_1 = "blah";
$Data::EMail::Contents427694980_10 = "blah";
$Data::EMail::Contents427694980_11 = "blah";
$Data::EMail::Contents427694980_12 = "blah";
$Data::EMail::Contents427694980_13 = "Noticed this is working.. holy shit. Test Test Test Test Test Test Test Test Test";
$Data::EMail::Contents427694980_14 = "ddddddddddddddddddddddddddddddddddddddddd";
$Data::EMail::Contents427694980_15 = "ddddddddddddddddddddddddddddddddddddddddd";
$Data::EMail::Contents427694980_16 = "ddddddddddddddddddddddddddddddddddddddd\tdddddd";
$Data::EMail::Contents427694980_17 = "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq\tqt";
$Data::EMail::Contents427694980_18 = "LOLOLOLOLODFUYSFDSFSDFSDFSDFSDFFFDLOLS";
$Data::Email::Contents427694980_2 = "blah";
$Data::Email::Contents427694980_3 = "blah";
$Data::Email::Contents427694980_4 = "blah";
$Data::Email::Contents427694980_5 = "blah";
$Data::Email::Contents427694980_6 = "blah";
$Data::Email::Contents427694980_7 = "blah";
$Data::Email::Contents427694980_8 = "blah";
$Data::Email::Contents427694980_9 = "blah";
$Data::EMail::Contents_ = "Hey, this is awesome, right?";
$Data::EMail::Contents_1 = "Wootage Test. Fantastic email system ya\t got here.";
$Data::EMail::Contents_2 = "Works?";
$Data::EMail::Contents_3 = "Free stuff! o-o";
$Data::EMail::Count = 4;
$Data::EMail::Count0 = 1;
$Data::EMail::Count2003098 = 1;
$Data::EMail::Count2485526 = 1;
$Data::Email::Count427694980 = 19;
$Data::EMail::Date0_1 = "Saturday, July 28, 2012 @ 08:32 PM";
$Data::EMail::Date2003098_1 = "Monday, March 29, 2010 @ 03:42 PM";
$Data::EMail::Date2485526_1 = "Tuesday, October 26, 2010 @ 03:25 AM";
$Data::Email::Date427694980_ = "Wednesday, March 24, 2010 amt 12:43 AM";
$Data::Email::Date427694980_1 = "Wednesday, March 24, 2010 pmt 10:33 PM";
$Data::EMail::Date427694980_10 = "Wednesday, March 24, 2010 @ 10:50 PM";
$Data::EMail::Date427694980_11 = "Wednesday, March 24, 2010 @ 10:55 PM";
$Data::EMail::Date427694980_12 = "Wednesday, March 24, 2010 @ 10:55 PM";
$Data::EMail::Date427694980_13 = "Wednesday, March 24, 2010 @ 10:56 PM";
$Data::EMail::Date427694980_14 = "Wednesday, March 24, 2010 @ 11:03 PM";
$Data::EMail::Date427694980_15 = "Wednesday, March 24, 2010 @ 11:04 PM";
$Data::EMail::Date427694980_16 = "Wednesday, March 24, 2010 @ 11:10 PM";
$Data::EMail::Date427694980_17 = "Wednesday, March 24, 2010 @ 11:13 PM";
$Data::EMail::Date427694980_18 = "Wednesday, March 24, 2010 @ 11:14 PM";
$Data::Email::Date427694980_2 = "Wednesday, March 24, 2010 pmt 10:33 PM";
$Data::Email::Date427694980_3 = "Wednesday, March 24, 2010 @ 10:46 PM";
$Data::Email::Date427694980_4 = "Wednesday, March 24, 2010 @ 10:46 PM";
$Data::Email::Date427694980_5 = "Wednesday, March 24, 2010 @ 10:47 PM";
$Data::Email::Date427694980_6 = "Wednesday, March 24, 2010 @ 10:47 PM";
$Data::Email::Date427694980_7 = "Wednesday, March 24, 2010 @ 10:47 PM";
$Data::Email::Date427694980_8 = "Wednesday, March 24, 2010 @ 10:47 PM";
$Data::Email::Date427694980_9 = "Wednesday, March 24, 2010 @ 10:50 PM";
$Data::EMail::Date_ = "Tuesday, October 26, 2010 @ 03:30 AM";
$Data::EMail::Date_1 = "Tuesday, October 26, 2010 @ 03:33 AM";
$Data::EMail::Date_2 = "Tuesday, October 26, 2010 @ 04:01 AM";
$Data::EMail::Date_3 = "Thursday, August 02, 2012 @ 10:08 PM";
$Data::EMail::Sender0_1 = "The Comittee";
$Data::EMail::Sender2003098_1 = "The Comittee";
$Data::EMail::Sender2485526_1 = "The Comittee";
$Data::Email::Sender427694980_ = "\x10\c7DRK\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_1 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_10 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_11 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_12 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_13 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_14 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_15 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_16 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_17 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender427694980_18 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_2 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_3 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_4 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_5 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_6 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_7 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_8 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::Email::Sender427694980_9 = "\x10\c7|-{DRK}-|\c6Dark Dragon DX\x11";
$Data::EMail::Sender_ = "DarkDragonDX";
$Data::EMail::Sender_1 = "Dayuppy";
$Data::EMail::Sender_2 = "\x10\c7-|{VPR}|-\c6DarkDragonDX\x11";
$Data::EMail::Sender_3 = "\x10\c7-|{VPR}|-\c6DarkDragonDX\x11";
$Data::EMail::Title0_1 = "Welcome";
$Data::EMail::Title2003098_1 = "Welcome";
$Data::EMail::Title2485526_1 = "Welcome";
$Data::Email::Title427694980_ = "Test";
$Data::EMail::Title_ = "Hey";
$Data::EMail::Title_1 = "Woot";
$Data::EMail::Title_2 = "Test";
$Data::EMail::Title_3 = "Paws";
$Data::EMailCount427694980 = 10;
$Data::Energy1836101295_AlphaSector = "34.2759";
$Data::Energy1836101295_Earth = "60";
$Data::Energy2003098_Earth = "60";
$Data::Energy2003098_rpg_new = "46.552";
$Data::Energy427694980_AlphaSector = "60";
$Data::Energy427694980_Earth = "60";
$Data::FlagReturns = 42;
$Data::FlagReturns0 = 0;
$Data::FlagReturns1682851961 = 0;
$Data::FlagReturns1836101295 = 0;
$Data::FlagReturns2003098 = 5;
$Data::FlagReturns2485526 = 0;
$Data::FlagReturns3738647 = 0;
$Data::FlagReturns427694980 = 0;
$Data::FlagReturns960691562 = 0;
$Data::Headshots = 0;
$Data::Headshots0 = 0;
$Data::Headshots1682851961 = 0;
$Data::Headshots1836101295 = 0;
$Data::Headshots2003098 = 0;
$Data::Headshots2485526 = 0;
$Data::Headshots3738647 = 0;
$Data::Headshots427694980 = 0;
$Data::Headshots960691562 = 0;
$Data::Health1836101295_AlphaSector = "0";
$Data::Health1836101295_Earth = "0.0139489";
$Data::Health2003098_Earth = "0.499071";
$Data::Health2003098_rpg_new = "0.617923";
$Data::Health427694980_AlphaSector = "0";
$Data::Health427694980_Earth = "0.645";
$Data::Hits = 133656;
$Data::Hits0 = 0;
$Data::Hits1682851961 = 1122;
$Data::Hits1836101295 = 652;
$Data::Hits2003098 = 4572;
$Data::Hits2139104 = 23;
$Data::Hits2450675 = 30;
$Data::Hits2485526 = 327;
$Data::Hits2544511 = 227;
$Data::Hits2886178 = 13;
$Data::Hits3119044 = 271;
$Data::Hits3392146 = 395;
$Data::Hits3637691 = 112;
$Data::Hits3738647 = 75;
$Data::Hits3819266 = 63;
$Data::Hits427694980 = 867;
$Data::Hits960691562 = 33;
$Data::IsInClan1836101295 = 1;
$Data::IsInClan2003098 = 1;
$Data::IsInClan427694980 = 1;
$Data::IsRegistered = 1;
$Data::IsRegistered0 = 1;
$Data::IsRegistered1682851961 = 1;
$Data::IsRegistered1836101295 = 1;
$Data::IsRegistered2003098 = 1;
$Data::IsRegistered2485526 = 1;
$Data::IsRegistered3738647 = 1;
$Data::IsRegistered427694980 = 1;
$Data::IsRegistered960691562 = 1;
$Data::IsRPGReady0 = 1;
$Data::IsRPGReady1836101295 = 1;
$Data::IsRPGReady2003098 = 1;
$Data::IsRPGReady2485526 = 1;
$Data::IsRPGReady427694980 = 1;
$Data::Kills = 9706;
$Data::Kills0 = 0;
$Data::Kills1682851961 = 30;
$Data::Kills1836101295 = 54;
$Data::Kills2003098 = 636;
$Data::Kills2139104 = 1;
$Data::Kills2450675 = 1;
$Data::Kills2485526 = 18;
$Data::Kills2544511 = 13;
$Data::Kills3119044 = 84;
$Data::Kills3392146 = 32;
$Data::Kills3637691 = 12;
$Data::Kills3738647 = 5;
$Data::Kills3819266 = 5;
$Data::Kills427694980 = 76;
$Data::Kills960691562 = 13;
$Data::Lost = 0;
$Data::Lost0 = 0;
$Data::Lost1682851961 = 0;
$Data::Lost1836101295 = 1;
$Data::Lost2003098 = 0;
$Data::Lost2485526 = 0;
$Data::Lost3738647 = 0;
$Data::Lost427694980 = 0;
$Data::Lost960691562 = 0;
$Data::Misses = 0;
$Data::Misses0 = 0;
$Data::Misses1682851961 = 0;
$Data::Misses1836101295 = 0;
$Data::Misses2003098 = 0;
$Data::Misses2485526 = 0;
$Data::Misses3738647 = 0;
$Data::Misses427694980 = 0;
$Data::Misses960691562 = 0;
$Data::Money0_Earth = 0;
$Data::Money1836101295_AlphaSector = "800";
$Data::Money2003098_Earth = "0";
$Data::Money2485526_Earth = 0;
$Data::Money427694980_Earth = "0";
$Data::Pack1836101295_AlphaSector = "EnergyPack";
$Data::Pack1836101295_Earth = "MiningTool";
$Data::Pack2003098_Earth = "MiningTool";
$Data::Pack427694980_Earth = "MiningTool";
$Data::Race0 = "Draakan";
$Data::Race1836101295 = "Draakan";
$Data::Race2003098 = "Draakan";
$Data::Race2485526 = "Draakan";
$Data::Race427694980 = "Draakan";
$Data::RepairKits1836101295_AlphaSector = "1";
$Data::RepairKits1836101295_Earth = "1";
$Data::RepairKits2003098_Earth = "0";
$Data::RepairKits2003098_rpg_new = "0";
$Data::RepairKits427694980_AlphaSector = "1";
$Data::RepairKits427694980_Earth = "0";
$Data::Rounds1682851961_SlapDashSV = 3;
$Data::Rounds1836101295_SlapDashSV = 1;
$Data::Rounds2003098_KatabaticSV = 6;
$Data::Rounds2003098_SlapDashSV = 6;
$Data::Rounds2485526_SlapDashSV = 3;
$Data::Rounds2544511_SlapDashSV = 3;
$Data::Rounds3119044_SlapDashSV = 3;
$Data::Rounds3392146_SlapDashSV = 1;
$Data::Rounds3637691_SlapDashSV = 4;
$Data::Rounds427694980_KatabaticSV = 1;
$Data::Rounds427694980_SlapdashSV = 2;
$Data::Rounds960691562_KatabaticSV = 1;
$Data::Rounds960691562_SlapDashSV = 2;
$Data::Rounds_KatabaticSV = 5;
$Data::Rounds_SlapDashSV = 1;
$Data::Sex0 = "A";
$Data::Sex1836101295 = "A";
$Data::Sex2003098 = "A";
$Data::Sex2485526 = "A";
$Data::Sex427694980 = "A";
$Data::Shots = 167489;
$Data::Shots0 = 0;
$Data::Shots1682851961 = 1744;
$Data::Shots1836101295 = 780;
$Data::Shots2003098 = 5964;
$Data::Shots2139104 = 24;
$Data::Shots2450675 = 36;
$Data::Shots2485526 = 450;
$Data::Shots2544511 = 293;
$Data::Shots2886178 = 15;
$Data::Shots3119044 = 471;
$Data::Shots3392146 = 476;
$Data::Shots3637691 = 161;
$Data::Shots3738647 = 99;
$Data::Shots3819266 = 63;
$Data::Shots427694980 = 1258;
$Data::Shots960691562 = 37;
$Data::ShouldApply = 0;
$Data::ShouldApply1836101295 = 0;
$Data::ShouldApply1836101295_AlphaSector = 1;
$Data::ShouldApply1836101295_Earth = 1;
$Data::ShouldApply2003098 = 0;
$Data::ShouldApply2003098_Earth = 1;
$Data::ShouldApply2003098_rpg_new = 1;
$Data::ShouldApply2485526 = 0;
$Data::ShouldApply2886178 = 0;
$Data::ShouldApply3119044 = 0;
$Data::ShouldApply3392146 = 0;
$Data::ShouldApply3434461 = 0;
$Data::ShouldApply427694980 = 0;
$Data::ShouldApply427694980_AlphaSector = 1;
$Data::ShouldApply427694980_Earth = 1;
$Data::Steel0_Earth = 0;
$Data::Steel1836101295_AlphaSector = "0.182";
$Data::Steel1836101295_Earth = "0.044";
$Data::Steel2485526_Earth = 0;
$Data::Suicides = 1205;
$Data::Suicides0 = 0;
$Data::Suicides1682851961 = 0;
$Data::Suicides1836101295 = 1;
$Data::Suicides2003098 = 27;
$Data::Suicides2450675 = 2;
$Data::Suicides2485526 = 1;
$Data::Suicides3119044 = 3;
$Data::Suicides3392146 = 9;
$Data::Suicides3738647 = 1;
$Data::Suicides427694980 = 8;
$Data::Suicides960691562 = 0;
$Data::Transform1836101295_AlphaSector = "-309.232 334.187 309.913 0 0 1 0.667341";
$Data::Transform1836101295_Earth = "-370.341 851.922 68.7601 0 0 1 1.14368";
$Data::Transform2003098_Earth = "-1060.18 469.128 92.4371 0 0 -0.99993 0.0256617";
$Data::Transform2003098_rpg_new = "-32.9661 334.381 93.2455 0 0 1 3.65726";
$Data::Transform427694980_AlphaSector = "82.863 -653.983 186.762 0 0 -1 0.916839";
$Data::Transform427694980_Earth = "-1023.9 512.742 92.3865 0 0 1 2.39569";
$Data::Velocity1836101295_AlphaSector = "15.4637 13.9548 3.02164";
$Data::Velocity1836101295_Earth = "0 0 0";
$Data::Velocity2003098_Earth = "0 0 0";
$Data::Velocity2003098_rpg_new = "12.4202 -23.2183 1.94154";
$Data::Velocity427694980_AlphaSector = "0.82034 0.175601 -33.5394";
$Data::Velocity427694980_Earth = "0 0 0";
$Data::WasInVehicle1836101295_AlphaSector = 0;
$Data::WasInVehicle1836101295_Earth = 0;
$Data::WasInVehicle2003098_Earth = 0;
$Data::WasInVehicle2003098_rpg_new = 0;
$Data::WasInVehicle427694980_AlphaSector = 0;
$Data::WasInVehicle427694980_Earth = 0;
$Data::Weapon1836101295_0_AlphaSector = "Chaingun";
$Data::Weapon1836101295_0_Earth = "Chaingun";
$Data::Weapon1836101295_1_AlphaSector = "Disc";
$Data::Weapon1836101295_1_Earth = "Disc";
$Data::Weapon1836101295_2_AlphaSector = "ShockLance";
$Data::Weapon1836101295_2_Earth = "ShockLance";
$Data::Weapon1836101295_3_AlphaSector = "TargetingLaser";
$Data::Weapon1836101295_3_Earth = "TargetingLaser";
$Data::Weapon1836101295_4_AlphaSector = "TargetingLaser";
$Data::Weapon2003098_0_Earth = "Blaster";
$Data::Weapon2003098_0_rpg_new = "Blaster";
$Data::Weapon2003098_1_Earth = "Disc";
$Data::Weapon2003098_1_rpg_new = "Disc";
$Data::Weapon2003098_2_Earth = "Chaingun";
$Data::Weapon2003098_2_rpg_new = "Chaingun";
$Data::Weapon2003098_3_Earth = "TargetingLaser";
$Data::Weapon2003098_4_Earth = "TargetingLaser";
$Data::Weapon2003098_4_rpg_new = "TargetingLaser";
$Data::Weapon427694980_0_AlphaSector = "Blaster";
$Data::Weapon427694980_0_Earth = "Blaster";
$Data::Weapon427694980_1_AlphaSector = "Disc";
$Data::Weapon427694980_1_Earth = "Disc";
$Data::Weapon427694980_2_AlphaSector = "Chaingun";
$Data::Weapon427694980_2_Earth = "Chaingun";
$Data::Weapon427694980_4_AlphaSector = "TargetingLaser";
$Data::Weapon427694980_4_Earth = "TargetingLaser";
$Data::Whiteout1836101295_AlphaSector = "0";
$Data::Whiteout1836101295_Earth = "0";
$Data::Whiteout2003098_Earth = "0";
$Data::Whiteout2003098_rpg_new = "0";
$Data::Whiteout427694980_AlphaSector = "0";
$Data::Whiteout427694980_Earth = "0";
$Data::Won = 0;
$Data::Won0 = 0;
$Data::Won1682851961 = 0;
$Data::Won1836101295 = 0;
$Data::Won2003098 = 0;
$Data::Won2485526 = 0;
$Data::Won3738647 = 0;
$Data::Won427694980 = 0;
$Data::Won960691562 = 0;

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Clan Management.cs // Clan Management.cs
// The clan management system for BoL RPg Mod. // The clan management system for BoL RPg Mod.
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//============================================================================== //==============================================================================
// Entry Point (called when the client first clicks it) // Entry Point (called when the client first clicks it)

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// EMail.cs // EMail.cs
// An E-Mail client for the Birth of Legend RPG Mod. // An E-Mail client for the Birth of Legend RPG Mod.
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//============================================================================== //==============================================================================
// Entry Point (called when the client first clicks it) // Entry Point (called when the client first clicks it)

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Save.cs // Save.cs
// The PDA Save function for BoL RPG mod. // The PDA Save function for BoL RPG mod.
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//============================================================================== //==============================================================================
// Entry Point (called when the client first clicks it) // Entry Point (called when the client first clicks it)

46
doc/races.txt Normal file
View file

@ -0,0 +1,46 @@
Intelligence - Determines how well you operate with sophisicated entities such as computer systems
Strength - Determines how much you may attempt to carry on you in any given moment.
Dexterity - Determines how well you can work with your hands. Affects the quality of produces items
and how long it may take to produce said items. Could possibly work in conjunction with intelligence
(perhaps for forming sophisicated items -- computer parts used in bots?)
Robot (not playable)---
- Least starting intelligence
+ Friendly with all; dependent upon owner
Draakan----
+ Increased Manueverability
+ Flame Breath
+ Able to regen health from raw flesh
- Notably less HP overall
+ Pounce/Maul ability (not in BoL)
- Least technologically advanced
- Generally Considered beasts
- Least starting intelligence (just above robots)
* Friendly with Humans, BioDerms -- enemies are Criollos
Human----
- Very low in Numbers (well, spread out)
+ Very well advanced in technology
+ Decent starting intelligence
+ Decent starting strength
* Friendly with Draakans -- enemies are BioDerms and Criollos
BioDerm----
+ Numbers (can clone)
+ Decently technologically advanced (scavenged from Humans)
+ Most starting strength-- results in a notable health increase?
- Mostly artificially supported; predigested food and such.
- Lack of vehicles supplied by the race (they rely on foot assaults)
* Friendly with Draakans and Criollos -- enemies are Humans
Criollos----
+ Most advanced in technology
+ Most starting intelligence
* Friendly with BioDerms -- enemies are Draakans and Humans

14
doc/versions.txt Normal file
View file

@ -0,0 +1,14 @@
Versioning scheme goes as such:
Major.Minor.Revision
Changes in the major portion means that any client/servers that do not have matching major versions
will immediately be determined as incompatible and will be asked to upgrade (or downgrade in some events)
Changes in minor are generally feature implementations that do not affect overall compatability between newer
and older versions of the modification.
Changes in revision indicate quick bugfixes that are released as small patches for the modification rather
than an entirely new download.
1.0:

42
prefs/Bot Profiles.conf Normal file
View file

@ -0,0 +1,42 @@
-- Human
[Bot]
Name = Commander Jackson;
Skill = 0.95;
Offense = true;
voicePitch = 0.90;
Race = Human;
Skin = Beagle;
Voice = Male4;
Sex = Male;
[Bot]
Name = Cynthia Fisher;
Skill = 0.92;
Offense = false;
voicePitch = 0.94;
Race = Human;
Skin = SWolf;
Voice = Fem3;
Sex = Female;
-- Draakan
[Bot]
Name = Nyoka;
Skill = 1;
Offense = true;
voicePitch = 0.98;
Race = Draakan;
Skin = Gecko;
Voice = Derm2;
Sex = Female;
[Bot]
Name = Kiaro;
Skill = 99;
Offense = true;
voicePitch = 0.98;
Race = Draakan;
Skin = Gecko;
Voice = Derm2;
Sex = Male;

14
prefs/WebServer.conf Normal file
View file

@ -0,0 +1,14 @@
[Generic]
Enabled=true;
Host=0.0.0.0;
Root= ;
Port=27000;
StartWorkers=32;
[StatusCodes]
404=none;
403=none;
[MINE]
Test=none;

View file

@ -717,7 +717,8 @@ function JoinGame(%address)
echo("Joining Server " @ %address); echo("Joining Server " @ %address);
%playerPref = $pref::Player[$pref::Player::Current]; %playerPref = $pref::Player[$pref::Player::Current];
%playerName = getField( %playerPref, 0 ); %playerName = getField( %playerPref, 0 );
%playerRaceGender = strReplace(getField( %playerPref, 1 ),"Type A","A"); %playerRaceGender = getField( %playerPref, 1 );
error(%playerPref, 1);
%playerSkin = getField( %playerPref, 2 ); %playerSkin = getField( %playerPref, 2 );
%playerVoice = getField( %playerPref, 3 ); %playerVoice = getField( %playerPref, 3 );
%playerVoicePitch = getField( %playerPref, 4 ); %playerVoicePitch = getField( %playerPref, 4 );
@ -1817,10 +1818,9 @@ function GMW_RaceGenderPopup::fillList( %this )
%this.add( "Human Male", 0 ); %this.add( "Human Male", 0 );
%this.add( "Human Female", 1 ); %this.add( "Human Female", 1 );
%this.add( "Bioderm", 2 ); %this.add( "Bioderm", 2 );
%this.add( "Draakan Type A", 3 ); %this.add( "Draakan Male", 3 );
%this.add( "Draakan Type B", 4 ); %this.add( "Draakan Female", 4 );
%this.add( "Draakan Type C", 5 ); %this.add( "Criollos", 5 );
%this.add( "Criollos", 6 );
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -1928,7 +1928,7 @@ function GMW_SkinPopup::fillList( %this, %raceGender )
%pattern = ".lfemale.png"; %pattern = ".lfemale.png";
case 2: // Bioderm case 2: // Bioderm
%pattern = ".lbioderm.png"; %pattern = ".lbioderm.png";
case 3 or 4 or 5 or 6: //Draakan & Criollos case 3 or 4 or 5: //Draakan & Criollos
%pattern = ".lbioderm.png"; %pattern = ".lbioderm.png";
} }
@ -2032,19 +2032,15 @@ function GMW_VoicePopup::fillList( %this, %raceGender )
for ( %i = 0; %i < $DermVoiceCount; %i++ ) for ( %i = 0; %i < $DermVoiceCount; %i++ )
%this.add( $DermVoiceName[%i], %i ); %this.add( $DermVoiceName[%i], %i );
case 3: // Draakan Type A case 3: // Male Draakan
for ( %i = 0; %i < $DermVoiceCount; %i++ ) for ( %i = 0; %i < $DermVoiceCount; %i++ )
%this.add( $DermVoiceName[%i], %i ); %this.add( $DermVoiceName[%i], %i );
case 4: // Draakan Type B case 4: // Female Draakan
for ( %i = 0; %i < $DermVoiceCount; %i++ ) for ( %i = 0; %i < $DermVoiceCount; %i++ )
%this.add( $DermVoiceName[%i], %i ); %this.add( $DermVoiceName[%i], %i );
case 5: // Draakan Type C case 5: // Criollos
for ( %i = 0; %i < $DermVoiceCount; %i++ )
%this.add( $DermVoiceName[%i], %i );
case 6: // Criollos
for ( %i = 0; %i < $DermVoiceCount; %i++ ) for ( %i = 0; %i < $DermVoiceCount; %i++ )
%this.add( $DermVoiceName[%i], %i ); %this.add( $DermVoiceName[%i], %i );
} }
@ -2062,7 +2058,6 @@ function GMW_VoicePopup::onSelect( %this, %id, %text )
case 3: %base = "Derm"; case 3: %base = "Derm";
case 4: %base = "Derm"; case 4: %base = "Derm";
case 5: %base = "Derm"; case 5: %base = "Derm";
case 6: %base = "Derm";
} }
$pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 3, %base @ ( %id + 1 ) ); $pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 3, %base @ ( %id + 1 ) );
@ -2095,7 +2090,6 @@ function GMW_VoicePopup::test( %this )
case 3: %base = "Derm"; case 3: %base = "Derm";
case 4: %base = "Derm"; case 4: %base = "Derm";
case 5: %base = "Derm"; case 5: %base = "Derm";
case 6: %base = "Derm";
} }
GMW_VoiceTestBtn.setActive( false ); GMW_VoiceTestBtn.setActive( false );

View file

@ -1605,12 +1605,18 @@ $RemapCount++;
$RemapName[$RemapCount] = "Interact / Use"; $RemapName[$RemapCount] = "Interact / Use";
$RemapCmd[$RemapCount] = "InteractWithObject"; $RemapCmd[$RemapCount] = "InteractWithObject";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "Icrease Frequency"; $RemapName[$RemapCount] = "Increase Frequency";
$RemapCmd[$RemapCount] = "IcreaseRadioFrequency"; $RemapCmd[$RemapCount] = "IncreaseRadioFrequency";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "Decrease Frequency"; $RemapName[$RemapCount] = "Decrease Frequency";
$RemapCmd[$RemapCount] = "DecreaseRadioFrequency"; $RemapCmd[$RemapCount] = "DecreaseRadioFrequency";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "Increase Voice";
$RemapCmd[$RemapCount] = "IncreaseVoiceRange";
$RemapCount++;
$RemapName[$RemapCount] = "Decrease Voice";
$RemapCmd[$RemapCount] = "DecreaseVoiceRange";
$RemapCount++;
if ( !isDemo() ) if ( !isDemo() )
{ {
$RemapName[$RemapCount] = "Start Demo Record"; $RemapName[$RemapCount] = "Start Demo Record";

View file

@ -12,7 +12,9 @@
//exec the AI scripts //exec the AI scripts
exec("scripts/aiRPG.cs"); exec("scripts/aiRPG.cs");
$RequiresClient[RPG] = true; // exec a bunch of dependencies
exec("scripts/modScripts/server/RPG/initialise.cs");
$InvBanList[RPG, "C4Charge"] = 1; $InvBanList[RPG, "C4Charge"] = 1;
//-- tracking --- //-- tracking ---
@ -23,15 +25,30 @@ function RPGGame::initGameVars(%game)
package RPGGame package RPGGame
{ {
function blah(){} //Eh.. function notifyMatchStart(%time){}
function notifyMatchEnd(%time){}
// FIXME: I have no idea where to find this serverCmd so here's quick hack
function serverCmdResetControlObject(%client)
{
parent::serverCmdResetControlObject(%client);
if ($CurrentMissionType $= "RPG" && isObject(%client.player) && %client.player.getState() $= "move")
%client.setControlObject(%client.player);
}
}; };
function RPGGame::timeLimitReached(%game){}
function RPGGame::scoreLimitReached(%game){}
function RPGGame::gameOver(%game){}
function RPGGame::checkTimeLimit(%game, %forced){}
function RPGGame::leaveMissionArea(%game, %playerData, %player){}
function RPGGame::enterMissionArea(%game, %playerData, %player){}
function RPGGame::setUpTeams(%game) function RPGGame::setUpTeams(%game)
{ {
defaultGame::setUpTeams(%game); defaultGame::setUpTeams(%game);
%game.numTeams = 1; %game.numTeams = 1;
setSensorGroupCount(4); setSensorGroupCount(4);
$TeamDamage = true; //Allow team Damage $TeamDamage = true; //Allow team Damage
} }
function RPGGame::getTeamSkin(%game, %team) function RPGGame::getTeamSkin(%game, %team)
@ -134,32 +151,11 @@ function RPGGame::showStalemateTargets(%game)
%game.stalemateSchedule = %game.schedule(%game.stalemateDurationMS, hideStalemateTargets); %game.stalemateSchedule = %game.schedule(%game.stalemateDurationMS, hideStalemateTargets);
} }
function RPGGame::timeLimitReached(%game)
{
logEcho("game over (timelimit)");
%game.gameOver();
cycleMissions();
}
function RPGGame::scoreLimitReached(%game)
{
logEcho("game over (scorelimit)");
%game.gameOver();
cycleMissions();
}
function RPGGame::gameOver(%game)
{
//call the default
DefaultGame::gameOver(%game);
messageAll('MsgClearObjHud', "");
}
function RPGGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc) function RPGGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc)
{ {
if(%clVictim.headshot && %damageType == $DamageType::Laser && %clVictim.team != %clAttacker.team) if(%clVictim.headshot && %damageType == $DamageType::Laser && %clVictim.team != %clAttacker.team)
{ {
%clAttacker.scoreHeadshot++; %clAttacker.scoreHeadshot++;
if (%game.SCORE_PER_HEADSHOT != 0) if (%game.SCORE_PER_HEADSHOT != 0)
{ {
messageClient(%clAttacker, 'msgHeadshot', '\c0You received a %1 point bonus for a successful headshot.', %game.SCORE_PER_HEADSHOT); messageClient(%clAttacker, 'msgHeadshot', '\c0You received a %1 point bonus for a successful headshot.', %game.SCORE_PER_HEADSHOT);
@ -205,12 +201,15 @@ function RPGGame::clientMissionDropReady(%game, %client)
DefaultGame::clientMissionDropReady(%game, %client); DefaultGame::clientMissionDropReady(%game, %client);
//Force client Spawn since we're ready now //Force client Spawn since we're ready now
schedule(1000,0,"forceClientSpawn",%client,true); %client.schedule(100,"spawn");
//%client.setControlObject(%client.player);
%client.setControlObject(%client.player);
commandToClient(%client,'bottomPrint',"Try not to die.",3); commandToClient(%client,'bottomPrint',"Try not to die.",3);
//Since this is an RPG gamemode, be sure some things are correct. (May have been a mission switch from CTF or some other gamemode) // FIXME: Always assigns radio access for now
%client.hasRadio = 1;
%client.radioFrequency = 1;
// Since this is an RPG gamemode, be sure some things are correct. (May have been a mission switch from CTF or some other gamemode)
commandToClient(%client,'SetScoreText',"PDA - Personal Data Assistant"); commandToClient(%client,'SetScoreText',"PDA - Personal Data Assistant");
//Make sure the data hud is working. //Make sure the data hud is working.
messageClient(%client,'MsgSPCurrentObjective1',"",'Location: Unknown.'); messageClient(%client,'MsgSPCurrentObjective1',"",'Location: Unknown.');
@ -219,9 +218,9 @@ function RPGGame::clientMissionDropReady(%game, %client)
function RPGGame::assignClientTeam(%game, %client, %respawn) function RPGGame::assignClientTeam(%game, %client, %respawn)
{ {
DefaultGame::assignClientTeam(%game, %client, %respawn); DefaultGame::assignClientTeam(%game, %client, %respawn);
// if player's team is not on top of objective hud, switch lines // if player's team is not on top of objective hud, switch lines
messageClient(%client, 'MsgCheckTeamLines', "", %client.team); messageClient(%client, 'MsgCheckTeamLines', "", %client.team);
} }
function RPGGame::applyConcussion(%game, %player) function RPGGame::applyConcussion(%game, %player)
@ -234,493 +233,92 @@ function RPGGame::vehicleDestroyed(%game, %vehicle, %destroyer)
function RPGGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) function RPGGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
{ {
defaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); defaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
commandToClient(%clVictim,'HandleScriptedCommand',2); commandToClient(%clVictim,'HandleScriptedCommand',2);
//commandToClient(%clVictim,'alxPlayMusic',"T2BOL/Music/TribesHymn.mp3"); //Add a little music that becomes audible if the player idles in death for a bit.. //No, play this epic audio:
//No, play this epic audio: schedule(2000,0,"messageClient",%clVictim,'MsgDeath',"~wfx/Lose.wav");
schedule(2000,0,"messageClient",%clVictim,'MsgDeath',"~wfx/Lose.wav"); forceScoreScreenOpen(%clVictim,"DEATH");
forceScoreScreenOpen(%clVictim,"DEATH"); $Data::ShouldApply[%clVictim.GUID] = false;
$Data::ShouldApply[%clVictim.GUID] = false;
if (%clVictim.isAIControlled()) if (%clVictim.isAIControlled())
%clVictim.drop(); %clVictim.drop();
} }
//...very very messy PDA code below!!
function RPGGame::updateScoreHud(%game, %client, %tag) //This is just here for when the PDA is first opened.
{
if (%client.PDAPage $= "")
{
messageClient( %client, 'ClearHud', "", 'scoreScreen', 0 );
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Main Page');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Please select a command.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Command List:");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tSLFSTS\t1>-Self Statistics</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tEMAIL\t1>-Electronic Mail</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tINVENTORY\t1>-View Inventory</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tCLNMG\t1>-Clan Management</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tSAVE\t1>-Save Game</a>");
%client.PDAPage = "MAIN";
}
}
function RPGGame::createPlayer(%game, %client, %spawnLoc, %respawn) function RPGGame::createPlayer(%game, %client, %spawnLoc, %respawn)
{ {
DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn);
commandToClient(%client,'HandleScriptedCommand',9,formatTimeString("HHnn") SPC "Hrs."); %client.observerMode = "";
commandToClient(%client, 'setHudMode', 'Standard');
%client.setControlObject(%client.player);
} }
function RPGGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5) function RPGGame::startMatch(%game)
{ {
messageClient( %client, 'ClearHud', "", 'scoreScreen', 0 ); echo("START MATCH");
//the match has been started, clear the team rank array, and repopulate it...
for (%i = 0; %i < 32; %i++)
%game.clearTeamRankArray(%i);
//Special handles here.. //used in BountyGame, prolly in a few others as well...
if (getSubStr(%arg1,0,5) $= "EMAIL" && getSubStr(%arg1,5,1) !$= "" && isNumber(getSubStr(%arg1,5,1))) $matchStarted = true;
{
%id = getSubStr(%arg1,5,strLen(%arg1));
%client.email = %id;
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:left><a:gamelink\tDELETE\t1>Delete E-Mail</a> "@$Data::EMail::Date[%client.GUID,%i]@"<just:right><a:gamelink\tREPLY\t1>Reply</a>");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>From %1:',$Data::EMail::Sender[%client.GUID,%i]);
%index++;
%count = getSubStrOccurance($Data::EMail::Content[%client.GUID,%id],"\t");
echo(%count);
if (%count != 0) %game.clearDeployableMaxes();
for (%i = 0; %i < %count; %i++)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>%1',getField($Data::EMail::Contents[%client.GUID,%id],%i));
%index++;
}
else
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>%1',$Data::EMail::Contents[%client.GUID,%id]);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tEMAIL\t1>Back To Listing</a>");
return;
}
else if (getSubStr(%arg1,0,7) $= "EMAILID" && isNumber(getSubStr(%arg1,7,strLen(%arg1))))
{
%id = getSubStr(%arg1,7,strLen(%arg1));
%guid = $Data::Client[%id];
%count = $Data::EMail::Count[%guid];
%name = $Data::ClientName[%id];
%clid = plNameToCid(%name);
if (checkEmails(%guid,%client.emailTitle))
return;
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>E-Mail sent to %1.',%name);
messageClient( %client, 'SetLineHud', "", 'scoreScreen', 1, '<just:center><a:gamelink\tEMAIL\t1>Back to Listing</a>');
$Data::EMail::Title[%guid,%count] = %client.emailTitle;
$Data::EMail::Sender[%guid,%count] = %client.namebase;
$Data::EMail::Contents[%guid,%count] = %client.emailCont;
$Data::EMail::Date[%guid,%count] = formatTimeString("DD, MM dd, yy @ hh:nn A");
$Data::EMail::Count[%guid]++;
if (IsObject(%clid))
messageClient(%clid,'msgClient','\c3Received an E-Mail from %1. ~wfx/misc/warning_beep.wav',%client.namebase);
return;
}
switch$ (%arg1) $missionStartTime = getSimTime();
{ %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000);
case "CLOSE":
closeScoreScreen(%client);
case "BACK": //Resets you to the main menu
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Main Page<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Please select a command.");
%index = 0; // schedule first timeLimit check for 20 seconds
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Command List:"); if(%game.class !$= "SiegeGame")
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tSLFSTS\t1>-Self Statistics</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tEMAIL\t1>-Electronic Mail</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tINVENTORY\t1>-View Inventory</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tCLNMG\t1>-Clan Management</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tSAVE\t1>-Save Game</a>");
%client.PDAPage = "MAIN";
case "CLNSTP":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Clan Management<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing clan setup.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Clan Name: %1 <a:input\tClanN\tClan Name\tClan Name>[Change]</a>',%client.clanN);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Clan Tag: %1 <a:input\tClanT\tClan Tag\tClan Tag>[Change]</a>',%client.clanT);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Short Description: %1 <a:input\tDesc\tShort Description\tDescription>[Change]</a>',%client.description);
%index++;
if (%client.clanN !$= "" && %client.clanT !$= "")
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCLNFN>Done</a>');
%index++;
%client.PDAPage = "CLNSTP";
case "EMAIL":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing E-Mails in sequential order.");
%index = 0;
%count = $Data::EMail::Count[%client.GUID];
for (%i = 0; %i <= %count; %i++)
{
if ($Data::EMail::Title[%client.GUID,%i] !$= "")
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tEMAIL%1\t1>%2 - %3</a>',%i,$Data::EMail::Sender[%client.GUID,%i],$Data::EMail::Title[%client.GUID,%i]);
%index++;
}
}
if (%index == 0)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>There are no E-Mails to show.");
%index++;
}
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tEMAILSEND\t1>[Compose an E-Mail]</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
%index++;
case "EMAILSEND":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>New E-Mail");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Title: %1 <a:input\temailTitle\tTitle\tE-Mail Title>[Change]</a>',%client.emailTitle);
%index++;
%count = getSubStrOccurance(%client.emailCont,"\t");
if (%count != 0)
for (%i = 0; %i < %count; %i++)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Contents: %1 <a:input\temailCont\tContents\tContents>[Change]</a>',%client.emailCont);
}
else
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Contents: %1 <a:input\temailCont\tContents\tContents>[Change]</a>',%client.emailCont);
%index++;
if (%client.emailTitle !$= "" && %client.emailcont !$= "")
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tRECPT>Select Receptiant</a>');
case "RECPT":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Select Receptiant");
%count = $Data::ClientCount;
%index = 0;
for (%i = 0; %i < %count; %i++)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tEMAILID%1\t1>%2</a>',%i,$Data::ClientName[%i]);
%index++;
}
case "CLNFN":
if ($Data::IsInClan[%client.GUID])
{
%ID = $Data::ClanID[%client.GUID];
if ($Data::ClanLeaderGUID[%ID] == %client.GUID)
{
$Data::ClanName[%ID] = %client.clanN;
$Data::ClanTag[%ID] = %client.clanT;
$Data::ClanDesc[%ID] = %client.description;
forceScoreScreenOpen(%client,"CLNMG");
}
}
else
{
$Data::IsInCLan[%client.GUID] = true;
if ($Data::ClanCount $= "")
$Data::ClanCount = 0;
$Data::ClanName[$Data::ClanCount] = %client.clanN;
$Data::ClanTag[$Data::ClanCount] = %client.clanT;
$Data::ClanDesc[$Data::ClanCount] = %client.desc;
$Data::ClanLeader[$Data::ClanCount] = %client.namebase;
$Data::ClanLeaderGUID[$Data::ClanCount] = %client.GUID;
$Data::ClanMember[$Data::ClanCount, 0] = %client.GUID;
$Data::ClanID[%client.GUID] = $Data::ClanCount;
$Data::ClanCount++;
setName(%client,"\cp\c7" @ %client.clanT @ "\c6" @ %client.namebase @ "\co");
saveGame();
forceScoreScreenOpen(%client,"CLNMG");
}
%client.PDAPage = "MAIN";
case "CLNMG":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Clan Management<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing clan management.");
%index = 0;
if (!$Data::IsInClan[%client.GUID])
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>You are not in a clan. Try creating a <a:gamelink\tCLNSTP>[New Clan]</a>.');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Or view the <a:gamelink\tCLNLST>[List]</a> of clans.');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
}
else
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Clan Name: %1',$Data::ClanName[$Data::ClanID[%client.GUID]]);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Clan Tag: %1', $Data::ClanTag[$Data::ClanID[%client.GUID]]);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Short Description: %1',%client.description);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCLNMBR>[View]</a> member list.');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCLNLST>[View]</a> other clans.');
if ($Data::IsInClan[%client.GUID] && $Data::ClanLeaderGUID[$Data::ClanID[%client.GUID]] == %client.GUID)
{
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCLNSTP>[Edit]</a> Clan.');
}
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
}
%client.PDAPage = "CLNMG";
case "CLNMBR":
%client.PDAPage = "CLNMBR";
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Clan Management<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing member list.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Name: %1',%client.namebase);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tBACK\t1>Back To Previous Page</a>');
%index++;
case "SLFSTS": //Self Statistics
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Self Statistics<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing your stats.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Name: %1',%client.namebase);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Race: %1',%client.race);
%index++;
if (%client.money $= "")
%client.money = 0; //You got zilch.
%trans = %client.player.getTransform();
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Cash: $%1',%client.money);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>GPS Coordinates: %1 %2 %3',getWord(%trans,0),getWord(%trans,1),getWord(%trans,2));
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tSLFSTS\t1>Refresh</a>');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
%client.PDAPage = "SLFSTS";
case "INVENTORY": //View Inventory
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Show Inventory<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing your inventory.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, 'Minerals--');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, 'Steel: %1 units.', %client.units["Steel"]);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
%client.PDAPage = "INVENTORY";
case "DEATH":
if (isObject(%client.player) && %client.player.getState() $= "Move")
return;
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Death<just:right>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>You have died.");
messageClient( %client, 'SetLineHud', "", 'scoreScreen', 0, "<just:center><a:gamelink\tRESPAWN\t1>Respawn</a>");
%client.PDAPage = "DEATH";
case "DELETE":
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Electronic Mail<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>E-Mail deleted.");
messageClient( %client, 'SetLineHud', "", 'scoreScreen', 0, '<just:center><a:gamelink\tEMAIL\t1>Back to Listing</a>');
$Data::EMail::Title[%client.GUID,%client.email] = "";
case "SAVE":
saveGame();
closeScoreScreen(%client);
messageClient(%client,'msgSaveSuccess',"\c3Game successfully saved.");
case "RESPAWN":
if (isObject(%client.player) && %client.player.getState() $= "Move")
return;
%client.PDAPage = "MAIN";
forceClientSpawn(%client);
case "SLFSTS": //Self Statistics
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Self Statistics<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Showing your stats.");
%index = 0;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Name: %1',%client.namebase);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Race: %1',%client.race);
%index++;
if (%client.race $= "Draakan")
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Type: %1',%client.sex);
else
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Sex: %1',%client.sex);
%index++;
if (%client.money $= "")
%client.money = 0; //You got zilch.
%trans = %client.player.getTransform();
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Cash: $%1',%client.money);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>GPS Coordinates: %1 %2 %3',getWord(%trans,0),getWord(%trans,1),getWord(%trans,2));
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tSLFSTS\t1>Refresh</a>');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\tBACK\t1>Back To Main Menu</a>");
%client.PDAPage = "SLFSTS";
default: //If something fails, return to the main menu.
serverCmdProcessGameLink(%client,"BACK");
}
}
function checkEmails(%guid,%title)
{
for (%i = 0; %i < $Data::EMail::Count[%GUID]; %i++)
{
if ($Data::EMail::Title[%guid,%i] $= %title)
return true;
}
return false;
}
function plnametocid(%name)
{
%count = ClientGroup.getCount(); //counts total clients
for(%i = 0; %i < %count; %i++) //loops till all clients are accounted for
{
%obj = ClientGroup.getObject(%i); //gets the clientid based on the ordering hes in on the list
%nametest=%obj.namebase; //pointless step but i didnt feel like removing it....
%nametest=strlwr(%nametest); //make name lowercase
%name=strlwr(%name); //same as above, for the other name
if(strstr(%nametest,%name) != -1) //is all of name test used in name
return %obj; //if so return the clientid and stop the function
}
return 0; //if none fits return 0 and end function
}
function RPGGame::onEnterTrigger(%game, %name, %data, %obj, %colObj)
{
switch$(%obj.type)
{
case "Transport": if (%obj.targetTransform $= "") return;
%Colobj.setTransform(%obj.targetTransform);
if (%Colobj.Usewhiteout) %Obj.setWhiteout(0.8);
case "Territory": if (%obj.race $= "") return;
%obj.client.isOnTerritory[%Colobj.race] = true;
setClientTeam(%Colobj.client,getRaceTeam(%Obj.race));
if (%obj.location $= "")
{
messageClient(%Colobj.client,'MsgSPCurrentObjective1',"",'Location: %1.', %obj.race SPC "Territory");
messageClient(%colObj.client,'msgEnteredRaceTerritory','\c3You have entered %1 territory.',%obj.race);
}
else
{
messageClient(%colObj.client,'msgEnteredRaceTerritory','\c3You have entered %1.',%obj.location);
messageClient(%Colobj.client,'MsgSPCurrentObjective1',"",'Location: %1.', %obj.location);
}
case "Damage": //Will add lots o' vars onto it..
%obj.damage[%colobj] = true;
%colObj.isinLava = true;
}
if (%Colobj.message $= "" && %Colobj.type !$= "Territory")
messageClient(%Colobj.client,'MsgTrigger',%obj.message);
}
function RPGGame::onLeaveTrigger(%game, %name, %data, %obj, %colObj)
{
switch$(%obj.type)
{
case "Territory": if (%obj.race $= "") return;
if (%obj.location $= "")
messageClient(%Colobj.client,'MsgExitedRaceTerritory',"\c3You have exited "@%obj.race@" territory. Your sensor data is now undetectable.");
else
messageClient(%Colobj.client,'MsgExitedRaceTerritory',"\c3You have exited "@%obj.location@".");
%Colobj.client.isOnTerritory[%obj.race] = false;
messageClient(%colObj.client,'MsgSPCurrentObjective1',"",'Location: Unknown.');
setClientTeam(%Colobj.client,0); //Not on the sensor, I think
case "Damage":
%obj.damage[%obj] = false;
%colObj.isInLava = true;
}
}
function RPGGame::onTickTrigger(%game, %name, %data, %obj)
{
switch(%obj.type)
{
case "Damage":
for (%i = 0; %i < MissionCleanup.getCount(); %i++)
{ {
%objT = MissionCleanup.getObject(%i); %game.timeCheck = %game.schedule(20000, "checkTimeLimit");
if (%objt.getClassName() $= "Player" && %objt.getState() $= "move") }
//schedule the end of match countdown
EndCountdown($Host::TimeLimit * 60 * 1000);
//reset everyone's score and add them to the team rank array
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%cl = ClientGroup.getObject(%i);
%game.resetScore(%cl);
%game.populateTeamRankArray(%cl);
}
// set all clients control to their player
%count = ClientGroup.getCount();
for( %i = 0; %i < %count; %i++ )
{
%cl = ClientGroup.getObject(%i);
// Siege game will set the clock differently
if(%game.class !$= "SiegeGame")
messageClient(%cl, 'MsgSystemClock', "", $Host::TimeLimit, %curTimeLeftMS);
if( !$Host::TournamentMode && %cl.matchStartReady && %cl.camera.mode $= "pre-game")
{ {
if (%obj.damage[%objT] && %objT.isInLava) commandToClient(%cl, 'setHudMode', 'Standard');
%objT.damage(0, %objT.getPosition(), %obj.damage, %obj,damageType); %cl.setControlObject( %cl.player );
}
else
{
if( %cl.matchStartReady )
{
if(%cl.camera.mode $= "pre-game")
{
%cl.observerMode = "";
commandToClient(%cl, 'setHudMode', 'Standard');
if(isObject(%cl.player))
%cl.setControlObject( %cl.player );
else
echo("can't set control for client: " @ %cl @ ", no player object found!");
}
else
%cl.observerMode = "observerFly";
}
} }
} }
}
// on with the show this is it!
AISystemEnabled( true );
} }
function serverCmdShowHud(%client, %tag)
{
%tagName = getWord(%tag, 1);
%tag = getWord(%tag, 0);
if (%tag $= 'scoreScreen')
serverCmdProcessGameLink(%client,%client.PDAPage);
messageClient(%client, 'OpenHud', "", %tag);
switch$ (%tagname)
{
case "vehicleHud":
vehicleHud::updateHud(1,%client,%tag);
case "scoreScreen":
updateScoreHudThread(%client, %tag);
}
}

View file

@ -358,98 +358,98 @@ function SVGame::PlayerHelp(%game) //Is called after 2 minutes in each round; te
function SVGame::SpawnAI(%game,%val) function SVGame::SpawnAI(%game,%val)
{ {
if (%val && !$Host::ProgressiveMode) if (%val && !$Host::ProgressiveMode)
return; return;
if (Game.rounds == 90) if (Game.rounds == 90)
{ {
messageAll('msgAll',"\c3The Godbot is here! ~wfx/misc/red_alert.wav"); messageAll('msgAll',"\c3The Godbot is here! ~wfx/misc/red_alert.wav");
for (%i = 0; %i < 6; %i++) for (%i = 0; %i < 6; %i++)
{ {
%bot = aiConnectByName("Godbot",2); %bot = aiConnectByName("Godbot",2);
%bot.setSkillLevel(1); %bot.setSkillLevel(1);
%bot.player.clearInventory(); %bot.player.clearInventory();
%bot.player.setArmor("TR2Heavy"); %bot.player.setArmor("TR2Heavy");
%bot.player.setInventory("TR2EnergyPack",1,true); %bot.player.setInventory("TR2EnergyPack",1,true);
%bot.player.setInventory("Disc",1,true); %bot.player.setInventory("Disc",1,true);
%bot.player.setInventory("DiscAmmo",900,true); %bot.player.setInventory("DiscAmmo",900,true);
// %bot.player.setInventory("Chaingun",1,true); // %bot.player.setInventory("Chaingun",1,true);
//%bot.player.setInventory("ChaingunAmmo",999,true); //%bot.player.setInventory("ChaingunAmmo",999,true);
%bot.player.setInventory("GrenadeLauncher",1,true); %bot.player.setInventory("GrenadeLauncher",1,true);
%bot.player.setInventory("GrenadeLauncherAmmo",999,true); %bot.player.setInventory("GrenadeLauncherAmmo",999,true);
%bot.player.setInventory("Shocklance",1,true); %bot.player.setInventory("Shocklance",1,true);
%bot.player.setInventory("Mortar",1,true); %bot.player.setInventory("Mortar",1,true);
%bot.player.setInventory("MortarAmmo",999,true); %bot.player.setInventory("MortarAmmo",999,true);
%bot.player.use("Disc"); %bot.player.use("Disc");
%game.botCount = 5; %game.botCount = 5;
hideClient(%bot); hideClient(%bot);
} }
return; return;
} }
%playerCount = clientGroup.getCount() - 1; %playerCount = clientGroup.getCount() - 1;
for (%i = 0; %i < 2 + Game.rounds+1; %i++) for (%i = 0; %i < 2 + Game.rounds+1; %i++)
{ {
%bot = aiConnectByIndex(getRandom(0,$BotProfile::Count),2); //Choose random b0ts by Index %bot = aiConnectByIndex(getRandom(0,$BotProfile::Count),2); //Choose random b0ts by Index
//Alright -- this'll make the game a bit harder -- depending on the rounds, the bots will have random armors. //Alright -- this'll make the game a bit harder -- depending on the rounds, the bots will have random armors.
%chance = getRandom(1,5 + Game.rounds); %chance = getRandom(1,5 + Game.rounds);
%bot.player.clearInventory(); %bot.player.clearInventory();
if (%chance > 6) //Medium Armor if (%chance > 6) //Medium Armor
{ {
%bot.player.setArmor("Medium"); %bot.player.setArmor("Medium");
// %bot.player.setInventory("Chaingun",1,1); // %bot.player.setInventory("Chaingun",1,1);
//%bot.player.setInventory("ChaingunAmmo",500,1); //%bot.player.setInventory("ChaingunAmmo",500,1);
%bot.player.setInventory("GrenadeLauncher",1,1); %bot.player.setInventory("GrenadeLauncher",1,1);
%bot.player.setInventory("GrenadeLauncherAmmo",999,1); %bot.player.setInventory("GrenadeLauncherAmmo",999,1);
%bot.player.setInventory("Disc",1,1); %bot.player.setInventory("Disc",1,1);
%bot.player.setInventory("DiscAmmo",30,1); %bot.player.setInventory("DiscAmmo",30,1);
%bot.player.setInventory("Shoklance",1,1); %bot.player.setInventory("Shoklance",1,1);
%bot.player.setInventory("MissileLauncher",1,1); %bot.player.setInventory("MissileLauncher",1,1);
%bot.player.setInventory("MissileLauncherAmmo",50); %bot.player.setInventory("MissileLauncherAmmo",50);
%bot.player.use("Chaingun"); %bot.player.use("Chaingun");
} }
else if (%chance > 10) //JUGGY else if (%chance > 10) //JUGGY
{ {
%bot.player.setArmor("Heavy"); %bot.player.setArmor("Heavy");
%bot.player.setInventory("GrenadeLauncher",1,1); %bot.player.setInventory("GrenadeLauncher",1,1);
%bot.player.setInventory("GrenadeLauncherAmmo",999,1); %bot.player.setInventory("GrenadeLauncherAmmo",999,1);
// %bot.player.setInventory("Chaingun",1,1); // %bot.player.setInventory("Chaingun",1,1);
// %bot.player.setInventory("ChaingunAmmo",500,1); // %bot.player.setInventory("ChaingunAmmo",500,1);
%bot.player.setInventory("Disc",1,1); %bot.player.setInventory("Disc",1,1);
%bot.player.setInventory("DiscAmmo",30,1); %bot.player.setInventory("DiscAmmo",30,1);
%bot.player.setInventory("Shoklance",1,1); %bot.player.setInventory("Shoklance",1,1);
%bot.player.use("Chaingun"); %bot.player.use("Chaingun");
} }
else //Light else //Light
{ {
%bot.player.setArmor("Light"); %bot.player.setArmor("Light");
%bot.player.setInventory("GrenadeLauncher",1,1); %bot.player.setInventory("GrenadeLauncher",1,1);
%bot.player.setInventory("GrenadeLauncherAmmo",999,1); %bot.player.setInventory("GrenadeLauncherAmmo",999,1);
// %bot.player.setInventory("Chaingun",1,1); // %bot.player.setInventory("Chaingun",1,1);
// %bot.player.setInventory("ChaingunAmmo",500,1); // %bot.player.setInventory("ChaingunAmmo",500,1);
%bot.player.setInventory("Disc",1,1); %bot.player.setInventory("Disc",1,1);
%bot.player.setInventory("DiscAmmo",30,1); %bot.player.setInventory("DiscAmmo",30,1);
%bot.player.setInventory("Shoklance",1,1); %bot.player.setInventory("Shoklance",1,1);
%bot.player.use("Chaingun"); %bot.player.use("Chaingun");
} }
hideClient(%bot); hideClient(%bot);
%random = getRandom(0,%playerCount); %random = getRandom(0,%playerCount);
// %client = clientGroup.getObject(%random); // %client = clientGroup.getObject(%random);
// %bot.stepEscort(%client.player); // %bot.stepEscort(%client.player);
%bot.player.setInventory("AmmoPack",1,1); %bot.player.setInventory("AmmoPack",1,1);
setTeam(%bot,2); setTeam(%bot,2);
%bot.setSkillLevel(99); %bot.setSkillLevel(99);
// %bot.stepEngage(clientGroup.getObject(%random)); // %bot.stepEngage(clientGroup.getObject(%random));
} }
if ($Host::ProgressiveMode && %val) if ($Host::ProgressiveMode && %val)
{ {
%game.rounds++; //So we increment every time -- I should put a limit to the bots.. %game.rounds++; //So we increment every time -- I should put a limit to the bots..
Game.BotWave = Game.schedule(180000,"SpawnAI",true); Game.BotWave = Game.schedule(180000,"SpawnAI",true);
} }
messageAll('MsgSPCurrentObjective2',"",'Number of bots: %1',Game.botCount); messageAll('MsgSPCurrentObjective2',"",'Number of bots: %1',Game.botCount);
} }
function SVGame::allowsProtectedStatics(%game) function SVGame::allowsProtectedStatics(%game)

View file

@ -2,7 +2,7 @@
$VoteMessage["VoteAdminPlayer"] = "Admin Player"; $VoteMessage["VoteAdminPlayer"] = "Admin Player";
$VoteMessage["VoteKickPlayer"] = "Kick Player"; $VoteMessage["VoteKickPlayer"] = "Kick Player";
$VoteMessage["VoteLockServer"] = "Lock Server"; $VoteMessage["VoteLockServer"] = "Lock Server";
$VoteMessage["VoteGlobal"] = "Global Chat"; $VoteMessage["VoteGlobal"] = "global Chat";
$VoteMessage["VoteProgressiveMode"] = "Toggle Progressive Mode"; $VoteMessage["VoteProgressiveMode"] = "Toggle Progressive Mode";
$VoteMessage["BanPlayer"] = "Ban Player"; $VoteMessage["BanPlayer"] = "Ban Player";
$VoteMessage["VoteChangeMission"] = "change the mission to"; $VoteMessage["VoteChangeMission"] = "change the mission to";

View file

@ -1,30 +1,42 @@
// #autoload // #autoload
// #name = GUIML Workaround // #name = GUIML Workaround
// #version = 2.0 // #version = 3.0
// #date = March 1st, 2010 // #date = November 22nd, 2012
// #category = Fix // #category = Fix
// #author = Dark Dragon DX // #author = Robert MacGregor
// #warrior = DarkDragonDX // #warrior = DarkDragonDX
// #email = DarkDragonDX@Hotmail.com // #email = DarkDragonDX@Hotmail.com
// #description = Adds a failSafe for the <a:command> tag. Mainly for players that use mods with interactive GUIML elements. // #description = Repairs broken functionality with certain GUIML elements after the T2 mission editor has been initialised. And in some cases, where they misbehave for no known reason.
package GUIMLPackage // Separate Package just to ensure the code is "injected" at the right time
package GUIMLInjection
{ {
// Takes care of opening the F2 menu on certain server/client combinations not working properly
function ScoreScreen::onWake(%this)
{
parent::onWake(%this);
if (!isActivePackage(GUIMLWorkaround))
activatePackage(GUIMLWorkaround);
}
// Takes care of if we just launch the editor but never use the F2 menu; clicking a link in say a server desc
function toggleEditor(%make) function toggleEditor(%make)
{ {
parent::toggleEditor(%make); //Call parent function parent::toggleEditor(%make);
if (!isActivePackage(GUIMLWorkaround)) if (!isActivePackage(GUIMLWorkaround))
activatePackage(GUIMLWorkaround); activatePackage(GUIMLWorkaround);
} }
}; };
activatePackage(GUIMLPackage); activatePackage(GUIMLInjection);
//Seperate package to activate our new code //Seperate package to activate our new code
package GUIMLWorkaround package GUIMLWorkaround
{ {
function GuiMLTextCtrl::onURL(%this, %url) function GuiMLTextCtrl::onURL(%this, %url)
{ {
//parent::onURL(%this, %url); if (getField(%url,0) $= "wwwlink")
commandToServer('ProcessGameLink',getField(%url,1)); parent::onURL(%this, getField(%url, 1)); // Opens a web browser window as it should
else
commandToServer('ProcessGameLink',getField(%url, 1), getField(%url, 2), getField(%url, 3), getField(%url, 4), getField(%url, 5));
} }
}; };

View file

@ -1,102 +1,104 @@
// Standard Construction Bologna // Standard Construction Bologna
// Missing all sorts of things, will probably need updated later on. // Missing all sorts of things, will probably need updated later on.
$MiniClV = "S4e5"; $MiniClV = "S5";
// Construction // Construction
package tcKeyBinding { package tcKeyBinding {
function OptionsDlg::onWake( %this ) { function OptionsDlg::onWake( %this ) {
if(!$tcKeyBinding) { if(!$tcKeyBinding) {
$RemapName[$RemapCount] = "[C]:Select LS Beam"; $RemapName[$RemapCount] = "[C]:Select LS Beam";
$RemapCmd[$RemapCount] = "quickPackLightSupportBeam"; $RemapCmd[$RemapCount] = "quickPackLightSupportBeam";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Select Walkway"; $RemapName[$RemapCount] = "[C]:Select Walkway";
$RemapCmd[$RemapCount] = "quickPackLightWalkway"; $RemapCmd[$RemapCount] = "quickPackLightWalkway";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Select MS Beam"; $RemapName[$RemapCount] = "[C]:Select MS Beam";
$RemapCmd[$RemapCount] = "quickPackMediumSupportBeam"; $RemapCmd[$RemapCount] = "quickPackMediumSupportBeam";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Select Floor"; $RemapName[$RemapCount] = "[C]:Select Floor";
$RemapCmd[$RemapCount] = "quickPackMediumFloor"; $RemapCmd[$RemapCount] = "quickPackMediumFloor";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Pack Setting: Fwd"; $RemapName[$RemapCount] = "[C]:Pack Setting: Fwd";
$RemapCmd[$RemapCount] = "cyclePackFwd"; $RemapCmd[$RemapCount] = "cyclePackFwd";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Pack Setting: Back"; $RemapName[$RemapCount] = "[C]:Pack Setting: Back";
$RemapCmd[$RemapCount] = "cyclePackBack"; $RemapCmd[$RemapCount] = "cyclePackBack";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Pack Setting: FFwd"; $RemapName[$RemapCount] = "[C]:Pack Setting: FFwd";
$RemapCmd[$RemapCount] = "cyclePackFFwd"; $RemapCmd[$RemapCount] = "cyclePackFFwd";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Pack Setting: FBack"; $RemapName[$RemapCount] = "[C]:Pack Setting: FBack";
$RemapCmd[$RemapCount] = "cyclePackFBack"; $RemapCmd[$RemapCount] = "cyclePackFBack";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Sit Down"; $RemapName[$RemapCount] = "[C]:Emote: Sit Down";
$RemapCmd[$RemapCount] = "emoteSitDown"; $RemapCmd[$RemapCount] = "emoteSitDown";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Squat"; $RemapName[$RemapCount] = "[C]:Emote: Squat";
$RemapCmd[$RemapCount] = "emoteSquat"; $RemapCmd[$RemapCount] = "emoteSquat";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Jig"; $RemapName[$RemapCount] = "[C]:Emote: Jig";
$RemapCmd[$RemapCount] = "emoteJig"; $RemapCmd[$RemapCount] = "emoteJig";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Lie Down"; $RemapName[$RemapCount] = "[C]:Emote: Lie Down";
$RemapCmd[$RemapCount] = "emoteLieDown"; $RemapCmd[$RemapCount] = "emoteLieDown";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Heart Attack"; $RemapName[$RemapCount] = "[C]:Emote: Heart Attack";
$RemapCmd[$RemapCount] = "emoteHeartAttack"; $RemapCmd[$RemapCount] = "emoteHeartAttack";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[C]:Emote: Sucker Punch"; $RemapName[$RemapCount] = "[C]:Emote: Sucker Punch";
$RemapCmd[$RemapCount] = "emoteSuckerPunched"; $RemapCmd[$RemapCount] = "emoteSuckerPunched";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[#]:Hover"; $RemapName[$RemapCount] = "[#]:Hover";
$RemapCmd[$RemapCount] = "ToggleHoverPack"; $RemapCmd[$RemapCount] = "ToggleHoverPack";
$RemapCount++; $RemapCount++;
//Metallic //Metallic
$RemapName[$RemapCount] = "[M]:Buy Favs"; $RemapName[$RemapCount] = "[M]:Buy Favs";
$RemapCmd[$RemapCount] = "MetallicBuyFavs"; $RemapCmd[$RemapCount] = "MetallicBuyFavs";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:Move Down"; $RemapName[$RemapCount] = "[M]:Move Down";
$RemapCmd[$RemapCount] = "MetallicMoveDown"; $RemapCmd[$RemapCount] = "MetallicMoveDown";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:GetSize"; $RemapName[$RemapCount] = "[M]:GetSize";
$RemapCmd[$RemapCount] = "MetallicGetSize"; $RemapCmd[$RemapCount] = "MetallicGetSize";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:Copy last setsize"; $RemapName[$RemapCount] = "[M]:Copy last setsize";
$RemapCmd[$RemapCount] = "Metallicsizecopy"; $RemapCmd[$RemapCount] = "Metallicsizecopy";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:Setsize original"; $RemapName[$RemapCount] = "[M]:Setsize original";
$RemapCmd[$RemapCount] = "Metallicsizeoriginal"; $RemapCmd[$RemapCount] = "Metallicsizeoriginal";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:Setsize undo"; $RemapName[$RemapCount] = "[M]:Setsize undo";
$RemapCmd[$RemapCount] = "Metallicsizeundo"; $RemapCmd[$RemapCount] = "Metallicsizeundo";
$RemapCount++; $RemapCount++;
$RemapName[$RemapCount] = "[M]:Undo"; $RemapName[$RemapCount] = "[M]:Undo";
$RemapCmd[$RemapCount] = "Metallicundo"; $RemapCmd[$RemapCount] = "Metallicundo";
$RemapCount++; $RemapCount++;
$quickPackExtrasBind = true; $quickPackExtrasBind = true;
$tcKeyBinding = true; $tcKeyBinding = true;
} }
//End metallic // End metallic
// End Construction // End Construction
parent::onWake(%this); parent::onWake(%this);
} }
function doScreenShot(%val)
{ function doScreenShot(%val)
%temp = panoramaGui.beaconsVisible; {
panoramaGui.beaconsVisible = false; %temp = panoramaGui.beaconsVisible;
if(!%val) { panoramaGui.beaconsVisible = false;
if(!$pref::showHudOnShots) if(!%val) {
HideHudHACK(0); if(!$pref::showHudOnShots)
%suffix = formatTimeString(".M-d-y.hhnnss"); HideHudHACK(0);
screenShot("screen" @ %suffix @ ".png"); %suffix = formatTimeString(".M-d-y.hhnnss");
HideHudHACK(1); screenShot("screen" @ %suffix @ ".png");
} HideHudHACK(1);
panoramaGui.beaconsVisible = %temp; }
} panoramaGui.beaconsVisible = %temp;
function MessageVector::pushBackLine(%this, %text, %tag) }
{
%line = (%params = strlwr(%text)); function MessageVector::pushBackLine(%this, %text, %tag)
while (%line !$= "") { {
%params = nextToken(%params,line,"<"); %line = (%params = strlwr(%text));
while (%line !$= "") {
%params = nextToken(%params,line,"<");
// This tag is probably unrelated to the exploit -- just skip it // This tag is probably unrelated to the exploit -- just skip it
if ((strstr(%line,"t2server") == -1) && (strstr(%line,"tribe") == -1)) continue; if ((strstr(%line,"t2server") == -1) && (strstr(%line,"tribe") == -1)) continue;
@ -106,15 +108,18 @@ while (%line !$= "") {
parent::pushBackLine(%this, %text, %tag); parent::pushBackLine(%this, %text, %tag);
} }
function MessageHud_Edit::eval(%this) function MessageHud_Edit::eval(%this)
{ {
%this.setValue(collapseEscape(%this.getValue())); %this.setValue(collapseEscape(%this.getValue()));
parent::eval(%this); parent::eval(%this);
} }
function GuiMessageVectorCtrl::onAdd(%this) function GuiMessageVectorCtrl::onAdd(%this)
{ {
%this.allowedMatches[0] = "http"; %this.allowedMatches[0] = "http";
} }
function LobbyMessageVector::urlClickCallback(%this, %url) function LobbyMessageVector::urlClickCallback(%this, %url)
{ {
MessageBoxOK( "Link Clicked", "<font:Univers Condensed Bold:22>Ctrl+V has been set to:<font:Univers Condensed:22>\n"@%url ); MessageBoxOK( "Link Clicked", "<font:Univers Condensed Bold:22>Ctrl+V has been set to:<font:Univers Condensed:22>\n"@%url );
@ -235,22 +240,26 @@ function Metallicundo(%val) {
if (%val) if (%val)
commandToServer('Metallic',"undo"); commandToServer('Metallic',"undo");
} }
function ToggleHoverPack(%val) { function ToggleHoverPack(%val) {
if (%val) if (%val)
commandToServer('activateHoverPack'); commandToServer('activateHoverPack');
} }
function clientCmdsetBlackOut(%fadeTOBlackBool, %timeMS){ function clientCmdsetBlackOut(%fadeTOBlackBool, %timeMS){
serverconnection.setBlackOut(%fadeTOBlackBool, %timeMS); serverconnection.setBlackOut(%fadeTOBlackBool, %timeMS);
} }
function runClientUpdateCheck(%version) { function runClientUpdateCheck(%version) {
%script = "/MCTC/"@%version@"/"; %script = "/MCTC/"@%version@"/";
%server = "direct.the-construct.net:80"; %server = "www.the-construct.net:80";
if (!isObject(MCTCbite)) if (!isObject(MCTCbite))
%bite = new HTTPObject(MCTCbite){}; %bite = new HTTPObject(MCTCbite){};
else %bite = MCTCbite; else %bite = MCTCbite;
%bite.get(%server, %script); %bite.get(%server, %script);
return; return;
} }
function MCTCbite::onLine(%this, %line) { function MCTCbite::onLine(%this, %line) {
%eof = (strstr(firstWord(%line),"#EOF") != -1); %eof = (strstr(firstWord(%line),"#EOF") != -1);
if (getword(%line,0) $= "#rgrrgr") {MCTCbite.disconnect(); return;} if (getword(%line,0) $= "#rgrrgr") {MCTCbite.disconnect(); return;}
@ -280,9 +289,9 @@ function MCTCbite::onLine(%this, %line) {
} }
// // Structural Infinity Client // // Structural Infinity Client
// Version: Beta 0.9 TCMC // Version: Beta 0.92 TCMC
// Written by Electricutioner // Written by Electricutioner & Krash
// 5/24/2010 // 6/21/2013
// Structural Infinity enabled clients are able to see over 1024 // Structural Infinity enabled clients are able to see over 1024
// objects. Don't sweat the details, little monkey. // objects. Don't sweat the details, little monkey.
@ -304,7 +313,7 @@ function MCTCbite::onLine(%this, %line) {
// //
// By editing this file, you agree to abide by the terms of the LGPL. // By editing this file, you agree to abide by the terms of the LGPL.
$StructuralInfinity::Info::ClientVersion = 0.91; $StructuralInfinity::Info::ClientVersion = 0.92;
$StructuralInfinity::AutoUpdate::UpdateFile = "client"; $StructuralInfinity::AutoUpdate::UpdateFile = "client";
$StructuralInfinity::Notification::Transform = 1; $StructuralInfinity::Notification::Transform = 1;
@ -375,16 +384,29 @@ function clientCmdStructInfNotify(%obj, %type, %payload)
%datablock = ServerConnection.getObject(getWord(%payload, 10) + 1); %datablock = ServerConnection.getObject(getWord(%payload, 10) + 1);
if (!isObject(%datablock)) if (!isObject(%datablock))
return;
%type = getSubStr(%datablock.getClassName(), 0, strLen(%datablock.getClassName()) - 4);
%this = new (%type)()
{ {
datablock = %datablock; if (isFile("shapes/"@%datablock))
scale = %scale; {
serverPointer = %obj; %this = new TSStatic()
}; {
shapeName = %datablock;
scale = %scale;
serverPointer = %obj;
};
} else return;
}
else
{
%type = getSubStr(%datablock.getClassName(), 0, strLen(%datablock.getClassName()) - 4);
%this = new (%type)()
{
datablock = %datablock;
scale = %scale;
serverPointer = %obj;
};
}
%this.setTransform(%trans); %this.setTransform(%trans);
SIPieces.add(%this); SIPieces.add(%this);
@ -530,6 +552,14 @@ function clientCmdStructInfVersionAnnounce(%version, %friendlyTagColor)
if (%version >= 0.5) // payload compression added in server 0.5 if (%version >= 0.5) // payload compression added in server 0.5
$StructuralInfinity::Status::PayloadCompression = 1; $StructuralInfinity::Status::PayloadCompression = 1;
if (%version > 0.7) // TCP RPC channel added after server v0.7
{
if (isObject(StructuralInfinityRPC)) StructuralInfinityRPC.delete();
%RPC = new TCPObject(StructuralInfinityRPC);
%RPC.connect(ServerConnection.getAddress());
echo("Attempting to connect to SI RPC channel...");
}
// get the allied team IFF color from the server // get the allied team IFF color from the server
$StructuralInfinity::HealthTeam = %friendlyTagColor; $StructuralInfinity::HealthTeam = %friendlyTagColor;
SI_initHealthUI(); // build the health UI SI_initHealthUI(); // build the health UI
@ -963,6 +993,22 @@ function SI_setHealthPercentage(%percent)
$StructuralInfinity::HealthUI.extent = mFloor(%percent * 48) SPC 10; $StructuralInfinity::HealthUI.extent = mFloor(%percent * 48) SPC 10;
} }
// receive RPC notifications from the TPC server and pass them into the notification system
function StructuralInfinityRPC::onLine(%this, %line)
{
%line = nextToken(%line, obj, "\t");
%payload = collapseEscape(nextToken(%line, type, "\t"));
clientCmdStructInfNotify(%obj, %type, %payload);
}
function StructuralInfinityRPC::onConnected(%this)
{
// we successfully connected, so could reconnect if we lose connection, maybe... later
echo("SI RPC channel successfully connected.");
%this.connected = true;
}
package StructuralInfinityClient package StructuralInfinityClient
{ {
// cleanup any client virtual ghosts when leaving a server // cleanup any client virtual ghosts when leaving a server
@ -975,6 +1021,7 @@ package StructuralInfinityClient
parent::CreateServer(%mission, %missionType); parent::CreateServer(%mission, %missionType);
if (!isActivePackage(t2csri_server)) exec("t2csri/serverGlue.cs"); if (!isActivePackage(t2csri_server)) exec("t2csri/serverGlue.cs");
} }
function clientCmdMissionEnd(%seq) function clientCmdMissionEnd(%seq)
{ {
if (isObject(SIPieces)) if (isObject(SIPieces))
@ -986,6 +1033,7 @@ package StructuralInfinityClient
} }
Parent::clientCmdMissionEnd(%seq); Parent::clientCmdMissionEnd(%seq);
} }
function DisconnectedCleanup() function DisconnectedCleanup()
{ {
if (isObject(SIPieces)) if (isObject(SIPieces))
@ -996,6 +1044,13 @@ package StructuralInfinityClient
} }
SIPieces.delete(); SIPieces.delete();
} }
if (isObject(StructuralInfinityRPC))
{
StructuralInfinityRPC.disconnect();
StructuralInfinityRPC.delete();
}
deleteVariables("$StructuralInfinity::SpatialHashMap*"); deleteVariables("$StructuralInfinity::SpatialHashMap*");
deleteVariables("$StructuralInfinity::ClientIndexMap*"); deleteVariables("$StructuralInfinity::ClientIndexMap*");
$StructuralInfinity::Status::Active = 0; $StructuralInfinity::Status::Active = 0;
@ -1041,6 +1096,7 @@ package StructuralInfinityClient
} }
} }
}; };
if ($Game::argv1 !$= "-dedicated" && !isObject(ServerGroup) && !isActivePackage(StructuralInfinityClient)) if ($Game::argv1 !$= "-dedicated" && !isObject(ServerGroup) && !isActivePackage(StructuralInfinityClient))
{ {
activatePackage(StructuralInfinityClient); activatePackage(StructuralInfinityClient);
@ -1049,4 +1105,3 @@ if ($Game::argv1 !$= "-dedicated" && !isObject(ServerGroup) && !isActivePackage(
} }
echo("#EOF");

722
scripts/camera.cs Normal file
View file

@ -0,0 +1,722 @@
$Camera::movementSpeed = 40;
datablock CameraData(Observer)
{
mode = "observerStatic";
firstPersonOnly = true;
};
datablock CameraData(CommanderCamera)
{
mode = "observerStatic";
firstPersonOnly = true;
};
function CommanderCamera::onTrigger( %data, %obj, %trigger, %state )
{
// no need to do anything here.
}
function Observer::onTrigger(%data,%obj,%trigger,%state)
{
// state = 0 means that a trigger key was released
if (%state == 0)
return;
//first, give the game the opportunity to prevent the observer action
if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state))
return;
//now observer functions if you press the "throw"
if (%trigger >= 4)
return;
//trigger types: 0:fire 1:altTrigger 2:jump 3:jet 4:throw
%client = %obj.getControllingClient();
if (%client == 0)
return;
switch$ (%obj.mode)
{
case "justJoined":
if (isDemo())
clearCenterPrint(%client);
//press FIRE
if (%trigger == 0)
{
// clear intro message
clearBottomPrint( %client );
//spawn the player
commandToClient(%client, 'setHudMode', 'Standard');
Game.assignClientTeam(%client);
Game.spawnPlayer( %client, $MatchStarted );
if( $MatchStarted )
{
%client.camera.setFlyMode();
%client.setControlObject( %client.player );
}
else
{
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
%client.setControlObject( %client.camera );
}
}
//press JET
else if (%trigger == 3)
{
//cycle throw the static observer spawn points
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
}
//press JUMP
else if (%trigger == 2)
{
//switch the observer mode to observing clients
if (isObject(%client.observeFlyClient))
serverCmdObserveClient(%client, %client.observeFlyClient);
else
serverCmdObserveClient(%client, -1);
displayObserverHud(%client, %client.observeClient);
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
}
case "playerDeath":
// Attached to a dead player - spawn regardless of trigger type
if(!%client.waitRespawn && getSimTime() > %client.suicideRespawnTime)
{
commandToClient(%client, 'setHudMode', 'Standard');
Game.spawnPlayer( %client, true );
%client.camera.setFlyMode();
%client.setControlObject(%client.player);
}
case "PreviewMode":
if (%trigger == 0)
{
commandToClient(%client, 'setHudMode', 'Standard');
if( %client.lastTeam )
Game.clientJoinTeam( %client, %client.lastTeam );
else
{
Game.assignClientTeam( %client, true );
// Spawn the player:
Game.spawnPlayer( %client, false );
}
%client.camera.setFlyMode();
%client.setControlObject( %client.player );
}
case "toggleCameraFly":
// this is the default camera mode
case "observerFly":
// Free-flying observer camera
if (%trigger == 0)
{
if( !$Host::TournamentMode && $MatchStarted )
{
// reset observer params
clearBottomPrint(%client);
commandToClient(%client, 'setHudMode', 'Standard');
if( %client.lastTeam !$= "" && %client.lastTeam != 0 && Game.numTeams > 1)
{
Game.clientJoinTeam( %client, %client.lastTeam, $MatchStarted );
%client.camera.setFlyMode();
%client.setControlObject( %client.player );
}
else
{
Game.assignClientTeam( %client );
// Spawn the player:
Game.spawnPlayer( %client, true );
%client.camera.setFlyMode();
%client.setControlObject( %client.player );
ClearBottomPrint( %client );
}
}
else if( !$Host::TournamentMode )
{
clearBottomPrint(%client);
Game.assignClientTeam( %client );
// Spawn the player:
Game.spawnPlayer( %client, false );
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
%client.setControlObject( %client.camera );
}
}
//press JET
else if (%trigger == 3)
{
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
}
//press JUMP
else if (%trigger == 2)
{
//switch the observer mode to observing clients
if (isObject(%client.observeFlyClient))
serverCmdObserveClient(%client, %client.observeFlyClient);
else
serverCmdObserveClient(%client, -1);
observerFollowUpdate( %client, %client.observeClient, false );
displayObserverHud(%client, %client.observeClient);
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
}
case "observerStatic":
// Non-moving observer camera
%next = (%trigger == 3 ? true : false);
%markerObj = Game.pickObserverSpawn(%client, %next);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
case "observerStaticNoNext":
// Non-moving, non-cycling observer camera
case "observerTimeout":
// Player didn't respawn quickly enough
if (%trigger == 0)
{
clearBottomPrint(%client);
commandToClient(%client, 'setHudMode', 'Standard');
if( %client.lastTeam )
Game.clientJoinTeam( %client, %client.lastTeam, true );
else
{
Game.assignClientTeam( %client );
// Spawn the player:
Game.spawnPlayer( %client, true );
}
%client.camera.setFlyMode();
%client.setControlObject( %client.player );
}
//press JET
else if (%trigger == 3)
{
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
}
//press JUMP
else if (%trigger == 2)
{
//switch the observer mode to observing clients
if (isObject(%client.observeFlyClient))
serverCmdObserveClient(%client, %client.observeFlyClient);
else
serverCmdObserveClient(%client, -1);
// update the observer list for this client
observerFollowUpdate( %client, %client.observeClient, false );
displayObserverHud(%client, %client.observeClient);
messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name);
}
case "observerFollow":
// Observer attached to a moving object (assume player for now...)
//press FIRE - cycle to next client
if (%trigger == 0)
{
%nextClient = findNextObserveClient(%client);
%prevObsClient = %client.observeClient;
if (%nextClient > 0 && %nextClient != %client.observeClient)
{
// update the observer list for this client
observerFollowUpdate( %client, %nextClient, true );
//set the new object
%transform = %nextClient.player.getTransform();
if( !%nextClient.isMounted() )
{
%obj.setOrbitMode(%nextClient.player, %transform, 0.5, 4.5, 4.5);
%client.observeClient = %nextClient;
}
else
{
%mount = %nextClient.player.getObjectMount();
if( %mount.getDataBlock().observeParameters $= "" )
%params = %transform;
else
%params = %mount.getDataBlock().observeParameters;
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
%client.observeClient = %nextClient;
}
//send the message(s)
displayObserverHud(%client, %nextClient);
messageClient(%nextClient, 'Observer', '\c1%1 is now observing you.', %client.name);
messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
}
}
//press JET - cycle to prev client
else if (%trigger == 3)
{
%prevClient = findPrevObserveClient(%client);
%prevObsClient = %client.observeClient;
if (%prevClient > 0 && %prevClient != %client.observeClient)
{
// update the observer list for this client
observerFollowUpdate( %client, %prevClient, true );
//set the new object
%transform = %prevClient.player.getTransform();
if( !%prevClient.isMounted() )
{
%obj.setOrbitMode(%prevClient.player, %transform, 0.5, 4.5, 4.5);
%client.observeClient = %prevClient;
}
else
{
%mount = %prevClient.player.getObjectMount();
if( %mount.getDataBlock().observeParameters $= "" )
%params = %transform;
else
%params = %mount.getDataBlock().observeParameters;
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
%client.observeClient = %prevClient;
}
//send the message(s)
displayObserverHud(%client, %prevClient);
messageClient(%prevClient, 'Observer', '\c1%1 is now observing you.', %client.name);
messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
}
}
//press JUMP
else if (%trigger == 2)
{
// update the observer list for this client
observerFollowUpdate( %client, -1, false );
//toggle back to observer fly mode
%obj.mode = "observerFly";
%obj.setFlyMode();
updateObserverFlyHud(%client);
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
}
case "pre-game":
if(!$Host::TournamentMode || $CountdownStarted)
return;
if(%client.notReady)
{
%client.notReady = "";
MessageAll( 0, '\c1%1 is READY.', %client.name );
if(%client.notReadyCount < 3)
centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3);
else
centerprint( %client, "\nWaiting for match start", 0, 3);
}
else
{
%client.notReadyCount++;
if(%client.notReadyCount < 4)
{
%client.notReady = true;
MessageAll( 0, '\c1%1 is not READY.', %client.name );
centerprint( %client, "\nPress FIRE when ready.", 0, 3 );
}
return;
}
CheckTourneyMatchStart();
}
}
function Observer::setMode(%data, %obj, %mode, %targetObj)
{
if(%mode $= "")
return;
%client = %obj.getControllingClient();
switch$ (%mode) {
case "justJoined":
commandToClient(%client, 'setHudMode', 'Observer');
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
case "pre-game":
commandToClient(%client, 'setHudMode', 'Observer');
%obj.setOrbitMode( %targetObj, %targetObj.getTransform(), 0.5, 4.5, 4.5);
case "observerFly":
// Free-flying observer camera
commandToClient(%client, 'setHudMode', 'Observer');
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
case "observerStatic" or "observerStaticNoNext":
// Non-moving observer camera
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
case "observerFollow":
// Observer attached to a moving object (assume player for now...)
%transform = %targetObj.getTransform();
if( !%targetObj.isMounted() )
%obj.setOrbitMode(%targetObj, %transform, 0.5, 4.5, 4.5);
else
{
%mount = %targetObj.getObjectMount();
if( %mount.getDataBlock().observeParameters $= "" )
%params = %transform;
else
%params = %mount.getDataBlock().observeParameters;
%obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
}
case "observerTimeout":
commandToClient(%client, 'setHudMode', 'Observer');
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
}
%obj.mode = %mode;
}
function findNextObserveClient(%client)
{
%index = -1;
%count = ClientGroup.getCount();
if (%count <= 1)
return -1;
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl == %client.observeClient)
{
%index = %i;
break;
}
}
//now find the next client (note, if not found, %index still == -1)
%index++;
if (%index >= %count)
%index = 0;
%newClient = -1;
for (%i = %index; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl != %client && %cl.player > 0)
{
%newClient = %cl;
break;
}
}
//if we didn't find anyone, search from the beginning again
if (%newClient < 0)
{
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl != %client && %cl.player > 0)
{
%newClient = %cl;
break;
}
}
}
//if we still haven't found anyone (new), give up..
if (%newClient < 0 || %newClient.player == %player)
return -1;
}
function findPrevObserveClient(%client)
{
%index = -1;
%count = ClientGroup.getCount();
if (%count <= 1)
return -1;
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl == %client.observeClient)
{
%index = %i;
break;
}
}
//now find the prev client
%index--;
if (%index < 0)
%index = %count - 1;
%newClient = -1;
for (%i = %index; %i >= 0; %i--)
{
%cl = ClientGroup.getObject(%i);
if (%cl != %client && %cl.player > 0)
{
%newClient = %cl;
break;
}
}
//if we didn't find anyone, search from the end again
if (%newClient < 0)
{
for (%i = %count - 1; %i >= 0; %i--)
{
%cl = ClientGroup.getObject(%i);
if (%cl != %client && %cl.player > 0)
{
%newClient = %cl;
break;
}
}
}
//if we still haven't found anyone (new), give up..
if (%newClient < 0 || %newClient.player == %player)
return -1;
}
function observeClient(%client)
{
if( $testcheats )
{
//pass in -1 to choose any client...
commandToServer('observeClient', %client);
}
}
function serverCmdObserveClient(%client, %target)
{
//clear the observer fly mode var...
%client.observeFlyClient = -1;
//cancel any scheduled update
cancel(%client.obsHudSchedule);
// must be an observer when observing other clients
if( %client.getControlObject() != %client.camera)
return;
//can't observer yourself
if (%client == %target)
return;
%count = ClientGroup.getCount();
//can't go into observer mode if you're the only client
if (%count <= 1)
return;
//make sure the target actually exists
if (%target > 0)
{
%found = false;
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
if (%cl == %target)
{
%found = true;
break;
}
}
if (!%found)
return;
}
else
{
%client.observeClient = -1;
%target = findNextObserveClient(%client);
if (%target <= 0)
return;
}
//send the message
if (%client.camera.mode !$= "observerFollow")
{
if (isObject(%client.player))
%client.player.scriptKill(0);
//messageAllExcept(%client, -1, 'ClientNowObserver', '\c1%1 is now an observer.', %client.name);
//messageClient(%client, 'YouNowObserver', '\c1You are now observing %1.', %target.name);
}
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
%client.setControlObject(%client.camera);
//tag is used if a client who is being observed dies...
%client.observeClient = %target;
}
function observerFollowUpdate( %client, %nextClient, %cycle )
{
%Oclient = %client.observeClient;
if( %Oclient $= "" )
return;
// changed to observer fly...
if( %nextClient == -1 )
{
// find us in their observer list and remove, then reshuffle the list...
for( %i = 0; %i < %Oclient.observeCount; %i++ )
{
if( %Oclient.observers[%i] == %client )
{
%Oclient.observeCount--;
%Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount];
%Oclient.observers[%Oclient.observeCount] = "";
break;
}
}
return; // were done..
}
// changed from observer fly to observer follow...
if( !%cycle && %nextClient != -1 )
{
// if nobody is observing this guy, initialize their observer count...
if( %nextClient.observeCount $= "" )
%nextClient.observeCount = 0;
// add us to their list of observers...
%nextClient.observers[%nextClient.observeCount] = %client;
%nextClient.observeCount++;
return; // were done.
}
if( %nextClient != -1 )
{
// cycling to the next client...
for( %i = 0; %i < %Oclient.observeCount; %i++ )
{
// first remove us from our prev client's list...
if( %Oclient.observers[%i] == %client )
{
%Oclient.observeCount--;
%Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount];
%Oclient.observers[%Oclient.observeCount] = "";
break; // screw you guys, i'm goin home!
}
}
// if nobody is observing this guy, initialize their observer count...
if( %nextClient.observeCount $= "" )
%nextClient.observeCount = 0;
// now add us to the new clients list...
%nextClient.observeCount++;
%nextClient.observers[%nextClient.observeCount - 1] = %client;
}
}
function updateObserverFlyHud(%client)
{
if (!isObject(%client))
return;
//just in case there are two threads going...
cancel(%client.obsHudSchedule);
%client.observeFlyClient = -1;
//make sure the client is supposed to be in observer fly mode...
if (!isObject(%client) || %client.team != 0 || %client.getControlObject() != %client.camera || %client.camera.mode $= "observerFollow")
return;
//get various info about the player's eye
%srcEyeTransform = %client.camera.getTransform();
%srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2);
%srcEyeVector = MatrixMulVector("0 0 0 " @ getWords(%srcEyeTransform, 3, 6), "0 1 0");
%srcEyeVector = VectorNormalize(%srcEyeVector);
//see if there's an enemy near our defense location...
%clientCount = 0;
%count = ClientGroup.getCount();
%viewedClient = -1;
%clientDot = -1;
for(%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
//make sure we find an AI who's alive and not the client
if (%cl != %client && isObject(%cl.player))
{
//make sure the player is within range
%clPos = %cl.player.getWorldBoxCenter();
%distance = VectorDist(%clPos, %srcEyePoint);
if (%distance <= 30)
{
//create the vector from the client to the client
%clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint));
//see if the dot product is greater than our current, and greater than 0.6
%dot = VectorDot(%clVector, %srcEyeVector);
if (%dot > 0.6 && %dot > %clientDot)
{
//make sure we're not looking through walls...
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType;
%losResult = containerRayCast(%srcEyePoint, %clPos, %mask);
%losObject = GetWord(%losResult, 0);
if (!isObject(%losObject))
{
%viewedClient = %cl;
%clientDot = %dot;
}
}
}
}
}
if (isObject(%viewedClient))
displayObserverHud(%client, 0, %viewedClient);
else
displayObserverHud(%client, 0);
%client.observeFlyClient = %viewedClient;
//schedule the next...
%client.obsHudSchedule = schedule(500, %client, updateObserverFlyHud, %client);
}

View file

@ -388,7 +388,7 @@ function DefaultGame::playerSpawned(%game, %player)
function DefaultGame::equip(%game, %player) function DefaultGame::equip(%game, %player)
{ {
for(%i =0; %i<$InventoryHudCount; %i++) for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon(); %player.client.clearBackpackIcon();
//%player.setArmor("Light"); //%player.setArmor("Light");

View file

@ -1194,6 +1194,10 @@ function serverCmdShowHud(%client, %tag)
%tagName = getWord(%tag, 1); %tagName = getWord(%tag, 1);
%tag = getWord(%tag, 0); %tag = getWord(%tag, 0);
messageClient(%client, 'OpenHud', "", %tag); messageClient(%client, 'OpenHud', "", %tag);
if (%tag $= 'scoreScreen')
serverCmdProcessGameLink(%client,%client.PDAPage);
switch$ (%tag) switch$ (%tag)
{ {
case 'inventoryScreen': case 'inventoryScreen':

View file

@ -68,8 +68,8 @@ function serverCmdThrowWeapon(%client,%data)
// %data = ItemDataBlock[%item]; // %data = ItemDataBlock[%item];
//Don't let Draakans drop flame breath //Don't let Draakans drop flame breath
if (%client.getControlObject().getMountedImage(0).getName() $= "FlamerImage" && %client.race $= "Draakan") if (!isObject(%client) || (%client.getControlObject().getMountedImage(0).getName() $= "FlamerImage" && %client.race $= "Draakan"))
return; return;
%client.getControlObject().throwWeapon(); %client.getControlObject().throwWeapon();
} }

View file

@ -261,22 +261,7 @@ function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %
return; return;
if ($CurrentMissionType $= "RPG") if ($CurrentMissionType $= "RPG")
{ radioChatMessageTeam(%sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
if (!%sender.hasRadio)
{
messageClient(%sender,'msgNoRadio',"\c3You must have a radio.");
return;
}
%count = ClientGroup.getCount();
for ( %i = 0; %i < %count; %i++ )
{
%obj = ClientGroup.getObject( %i );
if ( %obj.team == %sender.team )
messageClient(%obj,'msgClient',"\c3"@%sender.namebase@" (1): "@%a2@" ~wfx/misc/static.wav");
//chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}
else else
{ {
%count = ClientGroup.getCount(); %count = ClientGroup.getCount();
@ -311,19 +296,7 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
} }
if ($CurrentMissionType $= "RPG" && !$Host::GlobalChat) if ($CurrentMissionType $= "RPG" && !$Host::GlobalChat)
{ rangedChatMessageAll(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %c8, %a9, %a10);
%count = MissionCleanup.getCount();
for (%i = 0; %i < %count; %i++)
{
%obj = MissionCleanup.getObject(%i);
if (%obj.getClassName() $= "Player")
{
%dist = vectorDist(%sender.player.getPosition(),%obj.getPosition());
if (%dist < 200)
chatMessageClient( %obj.client, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, addTaggedString("(Radius - 200)" SPC getTaggedString(%a1)), %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}
}
else else
{ {
%count = ClientGroup.getCount(); %count = ClientGroup.getCount();

View file

@ -1,2 +0,0 @@
These scripts are the internal functioning of the T2BoL mod. It is recommended you don't touch these and just use the BASIC API
to make your changes to the game.

View file

@ -1,81 +0,0 @@
//------------------------------------------------------------------------------
// Application SDK for the PDA. (to make my life easier)
// Trigger code for RPG Gamemode
// Copyright (c) 2012 The DarkDragonDX
//==============================================================================
function RPGGame::onEnterTrigger(%game, %name, %data, %obj, %colObj)
{
switch$(%obj.type)
{
case "Transport": if (%obj.targetTransform $= "") return;
%Colobj.setTransform(%obj.targetTransform);
if (%Colobj.Usewhiteout)
%Obj.setWhiteout(0.8);
break;
case "Territory":
if (%obj.race $= "")
return;
%obj.client.isOnTerritory[%Colobj.race] = true;
setClientTeam(%Colobj.client,getRaceTeam(%Obj.race));
if (%obj.location $= "")
{
messageClient(%Colobj.client,'MsgSPCurrentObjective1',"",'Location: %1.', %obj.race SPC "Territory");
messageClient(%colObj.client,'msgEnteredRaceTerritory','\c3You have entered %1 territory.',%obj.race);
}
else
{
messageClient(%colObj.client,'msgEnteredRaceTerritory','\c3You have entered %1.',%obj.location);
messageClient(%Colobj.client,'MsgSPCurrentObjective1',"",'Location: %1.', %obj.location);
}
break;
case "Damage": //Will add lots o' vars onto it..
%obj.damage[%colobj] = true;
%colObj.isinLava = true;
break;
}
if (%Colobj.message $= "" && %Colobj.type !$= "Territory")
messageClient(%Colobj.client,'MsgTrigger',%obj.message);
return true;
}
function RPGGame::onLeaveTrigger(%game, %name, %data, %obj, %colObj)
{
switch$(%obj.type)
{
case "Territory":
if (%obj.race $= "")
return;
if (%obj.location $= "")
messageClient(%Colobj.client,'MsgExitedRaceTerritory',"\c3You have exited "@%obj.race@" territory. Your sensor data is now undetectable.");
else
messageClient(%Colobj.client,'MsgExitedRaceTerritory',"\c3You have exited "@%obj.location@".");
%Colobj.client.isOnTerritory[%obj.race] = false;
messageClient(%colObj.client,'MsgSPCurrentObjective1',"",'Location: Unknown.');
setClientTeam(%Colobj.client,0); //Not on the sensor, I think
break;
case "Damage":
%obj.damage[%obj] = false;
%colObj.isInLava = true;
break;
}
return true;
}
function RPGGame::onTickTrigger(%game, %name, %data, %obj)
{
switch(%obj.type)
{
case "Damage":
for (%i = 0; %i < MissionCleanup.getCount(); %i++)
{
%objT = MissionCleanup.getObject(%i);
if (%objt.getClassName() $= "Player" && %objt.getState() $= "move")
if (%obj.damage[%objT] && %objT.isInLava)
%objT.damage(0, %objT.getPosition(), %obj.damage, %obj,damageType);
break;
}
}
return true;
}

View file

@ -1,15 +0,0 @@
//------------------------------------------------------------------------------
// Server Scripts Init
//==============================================================================
exec("scripts/modScripts/server/propData.cs");
exec("scripts/modScripts/server/mining.cs");
exec("scripts/modScripts/server/propertyOwning.cs");
exec("scripts/modScripts/server/looting.cs");
exec("scripts/modScripts/server/serverFunctions.cs");
exec("scripts/modScripts/server/bloodHuman.cs");
exec("scripts/modScripts/server/bloodBioderm.cs");
exec("scripts/modScripts/server/dataImport.cs");
exec("scripts/modScripts/server/serverNetworking.cs");
exec("scripts/modScripts/server/HTTPServer.cs");
exec("scripts/modScripts/server/TorqueExServer.cs");

View file

@ -1,11 +0,0 @@
//------------------------------------------------------------------------------
// initialise.cs
// Shared Functions for T2Bol
// Copyright (c) 2012 The DarkDragonDX
//==============================================================================
exec("scripts/modScripts/shared/Array.cs");
exec("scripts/modScripts/shared/stringProcessing.cs");
exec("scripts/modScripts/shared/fileProcessing.cs");
exec("scripts/modScripts/shared/basicDataStorage.cs");

View file

@ -0,0 +1 @@
//------------------------------------------------------------------------------ // ActivePlayers.cs // .cs code listing currently active players // Copyright (c) 2012 Robert MacGregor //------------------------------------------------------------------------------ // Function that returns raw HTML formatting for the web browser on the client end to read function ActivePlayers::contents(%this) { %data = "<head><title>T2BoL Webserver Testing | Active Players</title></head><body>" @ "<center>" @ "<font size=\x225\x22>Currently Active Players</font>" @ "<hr></br></br>" @ "<table border=\x225\x22 width=\x22500\x22>"; %data = %data @ "<tr><td><center>Name</center></td>"; %data = %data @ "<td><center>Species</center></td>"; %data = %data @ "<td><center>Gender</center></td></tr>"; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %client = ClientGroup.getObject(%i); %data = %data @ "<tr><td><center>" @ %client.namebase @ "</center></td>"; %data = %data @ "<td><center>" @ %client.race @ "</center></td>"; %data = %data @ "<td><center>" @ %client.sex @ "</center></td></tr>"; } //"<tr>" @ //"<td><center><a href=\x22ActivePlayers.cs\x22>Active Players</a></center></td>" @ //"</tr>" @ %data = %data @ "</table>" @ "</body>"; return %data; }

View file

@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
// Index.cs
// Home page for the BoL inbuilt web server
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------
// Function that returns raw HTML formatting for the web browser on the client end to read
function Index::contents(%this)
{
%data = "<head><title>T2BoL Webserver Testing</title></head><body>" @
"<center>" @
"<font size=\x225\x22>Welcome! This is the testing index page!</font>" @
"<hr></br></br>" @
"<table border=\x225\x22 width=\x22200\x22>" @
"<tr>" @
"<td><center><a href=\x22ActivePlayers.cs\x22>Active Players</a></center></td>" @
"</tr>" @
"</table>" @
"</body>";
return %data;
}

View file

@ -1,24 +1,9 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// HTTPServer.cs // HTTPServer.cs
// An experimental HTTP Server written in Torque! // An experimental HTTP Server written in Torque!
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// --
// BoL Specific Code -- automatically load the server if enabled
if (!IsObject(HTTPServerPrefs))
new ScriptObject(HTTPServerPrefs) { class = "BasicDataParser"; };
HTTPServerPrefs.empty();
HTTPServerPrefs.load("prefs/WebServer.conf");
%generic = HTTPServerPrefs.get("Generic",0);
if(%generic.element("Enabled") $= "true")
{
new ScriptObject(WebServer) { class = "HTTPServer"; };
WebServer.listen(%generic.element("Host"),%generic.element("Port"),%generic.element("StartWorkers"));
}
// --
// Replicate Code for Servers // Replicate Code for Servers
$HTTPServer::ServerReplicate = "function *UNIQUESOCKET*::onConnectRequest(%this, %address, %socket)\n" @ $HTTPServer::ServerReplicate = "function *UNIQUESOCKET*::onConnectRequest(%this, %address, %socket)\n" @
"{\n" @ "{\n" @
@ -37,7 +22,6 @@ $HTTPServer::ClientReplicate = "function *UNIQUESOCKET*::onLine(%this, %line)\n"
"%this.send(%packet.statusCode);\n" @ "%this.send(%packet.statusCode);\n" @
"for (%i = 0; %i < %packet.headerCount; %i++)\n" @ "for (%i = 0; %i < %packet.headerCount; %i++)\n" @
"{\n" @ "{\n" @
"echo(%packet.headers[%packet.headerName[%i]]);\n" @
"%this.send(%packet.headers[%packet.headerName[%i]]);\n" @ "%this.send(%packet.headers[%packet.headerName[%i]]);\n" @
"}\n" @ "}\n" @
"%this.send(\"\\n\");\n" @ "%this.send(\"\\n\");\n" @
@ -189,7 +173,6 @@ function HTTPServer::connectionCreated(%this, %address, %socket)
function HTTPServer::onClientConnect(%this, %address, %socket) function HTTPServer::onClientConnect(%this, %address, %socket)
{ {
echo("Received connection from " @ %address @ ". ID:" @ %socket); echo("Received connection from " @ %address @ ". ID:" @ %socket);
//%socket.disconnect();
return true; return true;
} }
function HTTPServer::onClientRejected(%this, %socket, %reason) // %reason is always zero as of now. function HTTPServer::onClientRejected(%this, %socket, %reason) // %reason is always zero as of now.
@ -204,7 +187,6 @@ function HTTPServer::onClientDisconnect(%this, %socket)
} }
function HTTPServer::onLine(%this, %socket, %line) function HTTPServer::onLine(%this, %socket, %line)
{ {
logEcho(%socket SPC "says: " @ %line);
%reqType = getWord(%line, 0); %reqType = getWord(%line, 0);
if (%reqType $= "GET") if (%reqType $= "GET")
{ {
@ -235,30 +217,21 @@ function HTTPServer::onLine(%this, %socket, %line)
%packet.setStatusCode(403); %packet.setStatusCode(403);
%data = %forbiddenData; %data = %forbiddenData;
} }
else else if (getFileExtensionFromString(%socket.request) $= "cs")
{ {
%packet.setStatusCode(200); %packet.setStatusCode(200);
%file = new FileObject();
%file.openForRead(%socket.request);
%data = "";
while (!%file.isEOF())
{
%line = %file.readLine();
echo(%line);
if (strStr(%socket.request,".html") == -1) // FIXME: INSECURE and gay
{ exec(%socket.request);
%line = strReplace(%line,">","&#62;"); %class = strReplace(getFileNameFromString(%socket.request), ".cs", ""); // FIXME: Crappy
%line = strReplace(%line,"<","&#60;"); %instance = new ScriptObject() { class = %class; };
%line = strReplace(%line," ","&nbsp;"); %data = %instance.contents();
%line = strReplace(%line,"\t","&nbsp;&nbsp;&nbsp;&nbsp;"); %instance.delete();
%data = %data @ %line @ "<br>\n"; }
} else
else {
%data = %data @ %line @ "\n"; %packet.setStatusCode(403);
} %data = %forbiddenData;
%file.close();
%file.delete();
} }
// Check the file type // Check the file type
@ -347,3 +320,17 @@ function generateString(%length, %alpha)
%result = %result @ getSubStr(%alpha, getRandom(0, %len), 1); %result = %result @ getSubStr(%alpha, getRandom(0, %len), 1);
return %result; return %result;
} }
// --
// BoL Specific Code -- automatically load the server if enabled
if (!IsObject(HTTPServerPrefs))
new ScriptObject(HTTPServerPrefs) { class = "BasicDataParser"; };
HTTPServerPrefs.empty();
HTTPServerPrefs.load("prefs/WebServer.conf");
%generic = HTTPServerPrefs.get("Generic",0);
if(%generic.element("Enabled") $= "true")
{
new ScriptObject(WebServer) { class = "HTTPServer"; };
WebServer.listen(%generic.element("Host"),%generic.element("Port"),%generic.element("StartWorkers"));
}
// --

View file

@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// BoLFunctions.cs
// T2BoL Specific Functions
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------
function GameConnection::saveState(%this)
{
if ($CurrentMissionType !$= "RPG")
{
error("Not running the BoL gamemode.");
return false;
}
return true;
}
function GameConnection::loadState(%this, %file)
{
if ($CurrentMissionType !$= "RPG")
{
error("Not running the BoL gamemode.");
return false;
}
return true;
}
function AIConnection::saveState(%this)
{
if ($CurrentMissionType !$= "RPG")
{
error("Not running the BoL gamemode.");
return false;
}
return true;
}
function AIConnection::loadState(%this, %file)
{
if ($CurrentMissionType !$= "RPG")
{
error("Not running the BoL gamemode.");
return false;
}
return true;
}

View file

@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// GameTriggers.cs
// Trigger code for RPG Gamemode
// Copyright (c) 2012 Robert MacGregor
//==============================================================================
$BOL::Triggers::Territory = 0;
$BOL::Triggers::Damage = 1;
$BOL::Triggers::TeleportStart = 2;
$PDA::Triggers::TeleportEnd = 3;
function RPGGame::onEnterTrigger(%game, %name, %data, %obj, %colObj)
{
switch (%obj.Type)
{
case $BOL::Triggers::Territory:
echo("LOL");
return;
}
}
function RPGGame::onLeaveTrigger(%game, %name, %data, %obj, %colObj)
{
return true;
}
function RPGGame::onTickTrigger(%game, %name, %data, %obj)
{
return true;
}

View file

@ -0,0 +1,63 @@
//--$BOL::PDA::Page::Interact----------------------------------------------------------------------------
// Interact.cs
// Functions for object interaction in T2BoL
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------
$BOL::Interact::Type::General = 0; // Generic; jus makes conversation
$BOL::Interact::Range = 50; // In Meters
function serverCmdInteractWithObject(%client)
{
if (!IsObject(%client.player) || %client.player.getState() !$= "Move")
{
messageClient(%client, 'MsgClient', "\c3Sorry, you appear to be dead.");
return false;
}
%player = %client.player;
%pos = getWords(%player.getEyeTransform(), 0, 2);
%vec = %player.getMuzzleVector($WeaponSlot);
%targetpos=vectoradd(%pos,vectorscale(%vec,5000));
%object = getWord(containerRayCast(%pos,%targetpos,$TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType,%player),0);
echo(%object);
if (!isObject(%object) || !%object.isInteractive)
return false;
%client.pdaPage = $BOL::PDA::Page::Interacted;
serverCmdShowHud(%client, 'scoreScreen');
return true;
}
function Player::interactListUpdate(%this)
{
if (!isObject(%this.interactList))
%this.interactList = Array.create();
// We don't want to run multiple threads ...
cancel(%this.interactListUpdateThread);
// We also don't need dead people or bots to be doing this either
if ((%this.getState() !$= "Move" && %this.getState() !$= "Mounted") || %this.client.isAIControlled())
return;
%found = Array.create(); // This takes up one objID per call, but objID's go up to 2^32, so this shouldn't matter as it helps make cleaner code here
%found_anything = false;
InitContainerRadiusSearch(%this.getWorldBoxCenter(), $BOL::Interact::Range, $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType);
while ((%target = containerSearchNext()) != 0)
{
//if (!calcExplosionCoverage(%this.getWorldBoxCenter(), %target,$TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType))
// continue;
%found.setElement(%found.count(), %target);
if(isObject(%target) && %target !$= %this && !%this.interactList.hasElementValue(%target))
%this.interactList.setElement(%this.interactList.count(), %target);
}
// Remove any non-found elements from the interact list
for (%i = %this.interactList.count(); %i > -1; %i--)
if (!%found.hasElementValue(%this.interactList.element(%i)))
%this.interactList.removeElement(%i);
%found.delete();
%this.interactListUpdateThread = %this.schedule(100, "interactListUpdate");
}

View file

@ -0,0 +1,268 @@
//------------------------------------------------------------------------------
// PDA.cs
// PDA code for T2BoL
// Copyright (c) 2012 Robert MacGregor
//==============================================================================
// 0-100
$BOL::PDA::Page::Main = 0;
$BOL::PDA::Page::Applications = 1;
$BOL::PDA::Page::Close = 2; // Not even necessarily a page but it's used to signal the client wants to close
$BOL::PDA::Page::Stats = 3;
$BOL::PDA::Page::Save = 4;
$BOL::PDA::Page::FactionManagement = 5;
$BOL::PDA::Page::Radio = 6;
$BOL::PDA::Page::Voice = 7;
$BOL::PDA::Function::Increment = 1;
$BOL::PDA::Function::Decrement = 2;
$BOL::PDA::Page::EMail = 8;
$BOL::PDA::Page::Inbox = 9;
$BOL::PDA::Page::Outbox = 10;
$BOL::PDA::Page::Compose = 11;
$BOL::PDA::Page::Wiki = 12;
// 101-201
$BOL::PDA::Page::Interact = 101;
$BOL::PDA::Page::Interacted = 102;
$BOL::PDA::Page::Hack = 103;
$BOL::PDA::Page::Information = 104;
function RPGGame::updateScoreHud(%game, %client, %tag)
{
if (%client.PDAPage == $BOL::PDA::Page::Main || %client.PDAPage == $BOL::PDA::Page::Interact)
Game.processGameLink(%client, %client.PDAPage);
}
function RPGGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5)
{
%index = 0;
if (%arg1 != $BOL::PDA::Page::Close)
%client.PDAPage = %arg1;
messageClient( %client, 'ClearHud', "", 'scoreScreen', 0 );
switch(%arg1)
{
//------------------------------------------------------------------------------
// PDA Applications
//------------------------------------------------------------------------------
case $BOL::PDA::Page::Applications:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Applications | Main');
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>| <a:gamelink\t" @ $BOL::PDA::Page::Wiki @ "\t1>Wiki</a> | <color:FF0000>Applications<color:66EEEE> | <a:gamelink\t" @ $BOL::PDA::Page::EMail @ "\t0>E-Mail</a> | <just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Command List:");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Stats @ "\t1>- Self Diagnosis</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Interact @ "\t0>- Interact with Object</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Radio @ "\t0>- Radio</a>");
%index++;
if (!$Host::GlobalChat)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Voice @ "\t0>- Voice Settings</a>");
%index++;
}
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::FactionManagement @ "\t1>- Faction Management</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Save @ "\t1>- Save State</a>");
return;
case $BOL::PDA::Page::Stats:
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>Automated Self Diagnosis Systems v1.2<just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Copyright (c) 3030 S.G.S. Corporation');
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Subject Name: " @ %client.namebase);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Subject Species: " @ %client.race);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Subject Condition: " @ 100 - mfloor(100*%client.player.getDamageLevel()) @ "%");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Stats @ "\t1>REFRESH</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
case $BOL::PDA::Page::Radio:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Applications | Radio');
if (!%client.hasRadio)
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>-- You do not have a radio to manage --");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
}
switch (%arg2)
{
case $BOL::PDA::Function::Increment:
ServerCmdIncreaseRadioFrequency(%client, true);
case $BOL::PDA::Function::Decrement:
ServerCmdDecreaseRadioFrequency(%client, true);
}
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Radio Status: Normal");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Current Frequency: " @ %client.radioFrequency @ "MHz");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Radio @ "\t" @ $BOL::PDA::Function::Increment @ ">[Increment Frequency</a> - <a:gamelink\t" @ $BOL::PDA::Page::Radio @ "\t" @ $BOL::PDA::Function::Decrement @ ">Decrement Frequency]</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
case $BOL::PDA::Page::Voice:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Applications | Voice Settings');
switch (%arg2)
{
case $BOL::PDA::Function::Increment:
serverCmdIncreaseVoiceRange(%client, true);
case $BOL::PDA::Function::Decrement:
serverCmdDecreaseVoiceRange(%client, true);
}
%voice = %client.voiceMode;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Voice Status: Normal");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Current Voice: \x22" @ $BOL::Voice::Display[%voice] @ "\x22 (" @ $BOL::Voice::Range[%voice] @ " meters)");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Voice @ "\t" @ $BOL::PDA::Function::Increment @ ">[Increment Range</a> - <a:gamelink\t" @ $BOL::PDA::Page::Voice @ "\t" @ $BOL::PDA::Function::Decrement @ ">Decrement Range]</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
case $BOL::PDA::Page::Interact:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Applications | Interact with Object');
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>-- Objects within Range --");
%index++;
%client_team = getTargetSensorGroup(%client.target);
%object_count = %client.player.interactList.count();
if (%object_count > 0)
for (%i = 0; %i < %object_count; %i++)
{
%object = %client.player.interactList.element(%i);
if (isObject(%object))
{
%object_target = %object.target;
if (%object_target != -1)
{
%object_team = getTargetSensorGroup(%object_target);
%object_friendly = %client_team == %object_team;
%object_friend_text = %object_friendly ? "Friendly" : "Enemy";
%display = %object_friend_text SPC %object.getClassName() SPC "\x22" @ getTaggedString(getTargetName(%object_target)) @ "\x22";
}
else
%display = "Unknown" SPC %object.getClassName() SPC "(" @ %object @ ")";
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>" @ %display);
%index++;
}
}
else
{
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>There are no objects in range.");
%index++;
}
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
case $BOL::PDA::Page::FactionManagement:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Applications | Faction Management');
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications@ "\t1>RETURN TO MAIN</a>");
return;
case $BOL::PDA::Page::Save:
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Save State<just:right><a:gamelink\tCLOSE\t1>Close</a>');
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Save function is not supported as of now!");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Applications @ "\t1>RETURN TO MAIN</a>");
return;
//------------------------------------------------------------------------------
// PDA E-Mail System
//------------------------------------------------------------------------------
case $BOL::PDA::Page::Inbox:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>E-Mail | Your Inbox');
return;
case $BOL::PDA::Page::Outbox:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>E-Mail | Your Outbox');
return;
case $BOL::PDA::Page::Compose:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>E-Mail | Compose a New Mail');
return;
//------------------------------------------------------------------------------
// Interaction Commands
//------------------------------------------------------------------------------
case $BOL::PDA::Page::Interact:
return;
//------------------------------------------------------------------------------
// Handle for Normal PDA functions
//------------------------------------------------------------------------------
case $BOL::PDA::Page::Main:
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>| <a:gamelink\t" @ $BOL::PDA::Page::Wiki @ "\t1>Wiki</a> | <a:gamelink\t" @ $BOL::PDA::Page::Applications @ "\t1>Applications</a> | <a:gamelink\t" @ $BOL::PDA::Page::EMail @ "\t1>E-Mail</a> | <just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Welcome to the PDA');
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Welcome to the PDA, this is where you will accomplish some daily tasks.");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Click any of the text in the subheader to begin exploring your PDA.");
return;
case $BOL::PDA::Page::EMail:
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>E-Mail | Main');
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>| <a:gamelink\t" @ $BOL::PDA::Page::Wiki @ "\t1>Wiki</a> | <a:gamelink\t" @ $BOL::PDA::Page::Applications @ "\t1>Applications</a> | <color:FF0000>E-Mail<color:66EEEE> | <just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>E-Mail Functions:");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center> - <a:gamelink\t" @ $BOL::PDA::Page::Inbox @ "\t1>Your Inbox (?)</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center> - <a:gamelink\t" @ $BOL::PDA::Page::Outbox @ "\t1>Your Outbox (?)</a>");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center> - <a:gamelink\t" @ $BOL::PDA::Page::Compose @ "\t1>Compose a New Mail</a>");
return;
case $BOL::PDA::Page::Close:
serverCmdHideHud(%client, 'scoreScreen');
commandToClient(%client, 'DisplayHuds');
return;
case $BOL::PDA::Page::Wiki:
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>| <color:FF0000>Wiki<color:66EEEE> | <a:gamelink\t" @ $BOL::PDA::Page::Applications @ "\t1>Applications</a> | <a:gamelink\t" @ $BOL::PDA::Page::EMail @ "\t1>E-Mail</a> | <just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Wiki | Main');
return;
default: // In case something stupid happens
messageClient( %client, 'SetScoreHudHeader', "", "<just:center>| Information | <a:gamelink\t" @ $BOL::PDA::Page::Applications @ "\t1>Applications</a> | <a:gamelink\t" @ $BOL::PDA::Page::EMail @ "\t1>E-Mail</a> | <a:gamelink\t" @ $BOL::PDA::Page::Wiki @ "\t1>Wiki</a> | <just:right><a:gamelink\t" @ $BOL::PDA::Page::Close @ "\t1>Close</a>");
messageClient( %client, 'SetScoreHudSubheader', "", '<just:center>Error | Main');
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>-- An ERROR has occurred in the PDA Subsystem code --");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>-- Please report this error to DarkDragonDX --");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Unknown PDA page: " @ %arg1);
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, " ");
%index++;
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center><a:gamelink\t" @ $BOL::PDA::Page::Main @ "\t1>-- RETURN TO MAIN --</a>");
return;
}
}

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// PDAApplication.cs // PDAApplication.cs
// Application SDK for the PDA. (to make my life easier) // Application SDK for the PDA. (to make my life easier)
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//============================================================================== //==============================================================================
function PDAApplication::main(%this, %client) function PDAApplication::main(%this, %client)

View file

@ -0,0 +1 @@
//------------------------------------------------------------------------------ // radioChat.cs // Functions for radio voice in T2BoL // Copyright (c) 2012 Robert MacGregor //------------------------------------------------------------------------------ $BOL::Radio::Max = 10; $BOL::Radio::Min = 1; $BOL::Radio::Units = "MHz"; function ServerCmdIncreaseRadioFrequency(%client, %noDisplay) { if (!%client.hasRadio) { messageClient(%client, 'msgClient', "\c3You have no radio to tune."); return; } else if ($CurrentMissionType !$= "RPG") { messageClient(%client, 'msgClient', "\c3Server is not running the RPG gamemode currently."); return; } if (%client.radioFrequency == 0) %client.radioFrequency = 1; if (%client.radioFrequency >= $BOL::Radio::Max) %client.radioFrequency = $BOL::Radio::Min; else %client.radioFrequency++; if (!%noDisplay) messageClient(%client, 'msgClient',"\c3You tune your radio to " @ %client.radioFrequency @ $BOL::Radio::Units @ "."); } function ServerCmdDecreaseRadioFrequency(%client, %noDisplay) { if (!%client.hasRadio) { messageClient(%client, 'msgClient', "\c3You have no radio to tune."); return; } if (%client.radioFrequency == 0) %client.radioFrequency = 1; if (%client.radioFrequency <= $BOL::Radio::Min) %client.radioFrequency = $BOL::Radio::Max; else %client.radioFrequency--; if (!%noDisplay) messageClient(%client, 'msgClient',"\c3You tune your radio to " @ %client.radioFrequency @ $BOL::Radio::Units @ "."); } function radioBroadcast( %text, %frequency ) { %units = $BOL::Radio::Units; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %client = ClientGroup.getObject( %i ); if ( %client.hasRadio && %client.radioFrequency == %frequency ) messageClient(%client,'msgClient',"\c3(" @ %frequency @ %units @ "): " @ %text @ "~wfx/misc/static.wav"); } } function radioChatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ) { if (!%sender.hasRadio) { messageClient(%sender,'msgNoRadio',"\c3You must have a radio."); return; } %frequency = %sender.radioFrequency; if (%frequency < $BOL::Radio::Min || %frequency > $BOL::Radio::Max) { %sender.radioFrequency = $BOL::Radio::Min; messageClient(%sender,'msgClient',"\c3Your radio appears to be in dire need of retuning."); return; } %units = $BOL::Radio::Units; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %client = ClientGroup.getObject(%i); if ( %client.hasRadio && %client.radioFrequency == %sender.radioFrequency ) messageClient(%client,'msgClient',"\c3"@ %sender.namebase@ " (" @ %frequency @ %units @ "): "@%a2@" ~wfx/misc/static.wav"); } }

View file

@ -0,0 +1,98 @@
//------------------------------------------------------------------------------
// rangedVoice.cs
// Functions for ranged voice in T2BoL
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------
$BOL::Voice::Whisper = 0;
$BOL::Voice::Range[0] = 15;
$BOL::Voice::Display[0] = "Whispering";
$BOL::Voice::Speak = 1;
$BOL::voice::Range[1] = 25;
$BOL::Voice::Display[1] = "Speaking";
$BOL::Voice::Yell = 2;
$BOL::Voice::Range[2] = 50;
$BOL::Voice::Display[2] = "Yelling";
$BOL::Voice::Scream = 3;
$BOL::Voice::Range[3] = 100;
$BOL::Voice::Display[3] = "Screaming";
$BOL::Voice::Total = 4;
function serverCmdIncreaseVoiceRange(%client, %noDisplay)
{
if ($CurrentMissionType $= "RPG" && $Host::GlobalChat)
{
messageClient(%client, 'msgClient', "\c3Server has global chat enabled.");
return;
}
else if ($CurrentMissionType !$= "RPG")
{
messageClient(%client, 'msgClient', "\c3Server is not running the RPG gamemode currently.");
return;
}
if (%client.voiceMode >= $BOL::Voice::Total-1)
%client.voiceMode = 0;
else
%client.voiceMode++;
%display = $BOL::Voice::Display[%client.voiceMode];
%range = $BOL::Voice::Range[%client.voiceMode];
if (!%noDisplay)
messageClient(%client, 'msgClient',"\c3Voice mode set to \"" @ %display @ "\" (" @ %range @ "m)");
}
function serverCmdDecreaseVoiceRange(%client, %noDisplay)
{
if ($CurrentMissionType $= "RPG" && $Host::GlobalChat)
{
messageClient(%client, 'msgClient', "\c3Server has global chat enabled.");
return;
}
else if ($CurrentMissionType !$= "RPG")
{
messageClient(%client, 'msgClient', "\c3Server is not running the RPG gamemode currently.");
return;
}
if (%client.voiceMode <= 0)
%client.voiceMode = $BOL::Voice::Total-1;
else
%client.voiceMode--;
%display = $BOL::Voice::Display[%client.voiceMode];
%range = $BOL::Voice::Range[%client.voiceMode];
if (!%noDisplay)
messageClient(%client, 'msgClient',"\c3Voice mode set to \"" @ %display @ "\" (" @ %range @ "m)");
}
function rangedchatMessageAll(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
{
%mode = %sender.voiceMode;
if (%mode < 0 || %mode >= $BOL::Voice::Total)
{
%sender.voiceMode = 0;
%mode = 0;
messageClient(%sender,'msgClient',"\c3Your throat feels agitated.");
}
%voicedist = $BOL::Voice::Range[%sender.voiceMode];
%display = $BOL::Voice::Display[%sender.voiceMode];
%count = MissionCleanup.getCount();
for (%i = 0; %i < %count; %i++)
{
%obj = MissionCleanup.getObject(%i);
if (%obj.getClassName() $= "Player")
{
%dist = vectorDist(%sender.player.getPosition(),%obj.getPosition());
if (%dist <= %voicedist)
{
%string = addTaggedString("(" @ %display @ " - " @ %voicedist @ "m) " @ getTaggedString(%a1));
chatMessageClient( %obj.client, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %string, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}
}
}

View file

@ -0,0 +1,302 @@
//------------------------------------------------------------------------------
// scripts/modScripts/server/dataImport.cs
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------
function gameConnection::writeSaveFile(%this)
{
//Compile Main Variable List
%mission = $CurrentMission;
%player = %this.player;
%transform = %player.getTransform();
%velocity = %player.getVelocity();
%damage = %player.getDamageLevel();
%race = %this.race;
%armor = %this.armor;
%energy = %player.getEnergyLevel();
%whiteout = %player.getWhiteout();
%damageFlash = %player.getDamageFlash();
%cash = %this.cash;
%hasRadio = %this.hasRadio;
%underStandsHuman = %this.underStandsHuman;
%underStandsBioderm = %this.underStandsBioderm;
%underStandsDraakan = %this.underStandsDraakan;
%underStandsCriollos = %this.underStandsCriollos;
%time = formatTimeString("hh:nn A");
%date = formatTimeString("mm/dd/yy");
%file = "data/game/saves/" @ %mission @ "/" @ %this.guid @ ".txt";
%fileObj = new fileObject();
%fileObj.openForWrite(%file);
%fileObj.writeLine(";Saved by" SPC %this.nameBase SPC "on" SPC %date SPC "at" SPC %time);
%fileObj.writeLine("");
//Todo: Make this writing method more efficient ...
%fileObj.writeLine("[Character]");
%fileObj.writeLine("transform = \x22" @ %transform @ "\x22;");
%fileObj.writeLine("velocity = \x22" @ %velocity @ "\x22;");
%fileObj.writeLine("damage = \x22" @ %damage @ "\x22;");
%fileObj.writeLine("race = \x22" @ %race @ "\x22;");
%fileObj.writeLine("armor = \x22" @ %armor @ "\x22;");
%fileObj.writeLine("energy = \x22" @ %energy @ "\x22;");
%fileObj.writeLine("whiteOut = \x22" @ %whiteout @ "\x22;");
%fileObj.writeLine("damageFlash = \x22" @ %damageFlash @ "\x22;");
%fileObj.writeLine("cash = \x22" @ %cash @ "\x22;");
%fileObj.writeLine("hasRadio = \x22" @ %hasRadio @ "\x22;");
%fileObj.writeLine("underStandsHuman = \x22" @ %underStandsHuman @ "\x22;");
%fileObj.writeLine("underStandsBioderm = \x22" @ %underStandsBioderm @ "\x22;");
%fileObj.writeLine("underStandsDraakan = \x22" @ %underStandsDraakan @ "\x22;");
%fileObj.writeLine("underStandsCriollos = \x22" @ %underStandsCriollos @ "\x22;");
%fileObj.writeLine("");
//Compile Inventory List
%slotCount = %player.weaponSlotCount;
%healthKits = %player.invRepairKit;
%fileObj.writeLine("[Inventory]");
%fileObj.writeLine("slotCount = \x22" @ %slotCount @ "\x22;");
for (%i = 0; %i < %slotCount; %i++)
{
%weaponName = %player.weaponSlot[%i];
%weaponAmmo = eval("%weaponAmmo = %player.inv" @ %weaponName @ "Ammo" @ ";");
%fileObj.writeLine("slot" @ %i SPC "= \x22" @ %weaponName @ "\x22;");
%fileObj.writeLine("slot" @ %i @ "Ammo" SPC "= \x22" @ %weaponAmmo @ "\x22;");
}
%fileObj.writeLine("healthKits = \x22" @ %healthKits @ "\x22;");
%fileObj.detach();
logEcho(" -- Save File Written for Player:" SPC %this.namebase SPC "--");
return true;
}
function gameConnection::applySaveFile(%this)
{
//Compile Main Variable List
%mission = $CurrentMission;
%file = "data/game/saves/" @ %mission @ "/" @ %this.guid @ ".txt";
if (!isFile(%file))
return false;
%transform = getBlockData(%file,"Character",1,"transform");
%velocity = getBlockData(%file,"Character",1,"velocity");
%damage = getBlockData(%file,"Character",1,"damage");
%race = getBlockData(%file,"Character",1,"race");
%armor = getBlockData(%file,"Character",1,"armor");
%energy = getBlockData(%file,"Character",1,"energyLevel");
%whiteout = getBlockData(%file,"Character",1,"whiteOut");
%damageFlash = getBlockData(%file,"Character",1,"damageFlash");
%cash = getBlockData(%file,"Character",1,"cash");
%hasRadio = getBlockData(%file,"Character",1,"hasRadio");
%underStandsHuman = getBlockData(%file,"Character",1,"underStandsHuman");
%underStandsBioderm = getBlockData(%file,"Character",1,"underStandsBioderm");
%underStandsDraakan = getBlockData(%file,"Character",1,"underStandsDraakan");
%underStandsCriollos = getBlockData(%file,"Character",1,"underStandsCriollos");
%player = %this.player;
%player.setTransform(%transform);
%player.setVelocity(%velocity);
%player.applyDamage(%damage);
%player.setArmor(%armor);
%player.setEnergyLevel(%energy);
%player.setWhiteout(%whiteOut);
%player.setDamageFlash(%damageFlash);
%this.cash = %cash;
%this.underStandsHuman = %underStandsHuman;
%this.underStandsBioderm = %underStandsBioderm;
%this.underStandsDraakan = %underStandsDraakan;
%this.underStandsCriollos = %underStandsCriollos;
return true;
for (%i = 0; %i < %slotCount; %i++)
{
%weaponName = %player.weaponSlot[%i];
%weaponAmmo = eval("%weaponAmmo = %player.inv" @ %weaponName @ "Ammo" @ ";");
%fileObj.writeLine("slot" @ %i SPC "= \x22" @ %weaponName @ "\x22;");
%fileObj.writeLine("slot" @ %i @ "Ammo" SPC "= \x22" @ %weaponAmmo @ "\x22;");
}
%fileObj.writeLine("healthKits = \x22" @ %healthKits @ "\x22;");
return;
}
// Generic Import Functions
function importGameData()
{
importGems();
importOres();
importCharacters();
return true;
}
// Gem Import Functions
function importGems()
{
if (!IsObject(GemData))
{
new ScriptObject(GemData);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(GemData);
}
else
return true;
%file = "data/game/gems.txt";
%count = getBlockCount(%file,"Gem") + 1;
for (%i = 1; %i < %count; %i++)
{
%name = getBlockData(%file,"Gem",%i,"Name");
%price = getBlockData(%file,"Gem",%i,"Price");
%sellPrice = getBlockData(%file,"Gem",%i,"SellPrice");
GemData.gem[%i] = %name;
GemData.price[%name] = %price;
GemData.sellPrice[%name] = %sellPrice;
warn("Imported gem:" SPC %name);
GemData.gemCount = %count--;
}
// Ore Import Functions
function importOres()
{
if (!IsObject(OreData))
{
new ScriptObject(OreData);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(OreData);
}
else
return true;
%file = "data/game/ores.txt";
%count = getBlockCount(%file,"Ore") + 1;
for (%i = 1; %i < %count; %i++)
{
%name = getBlockData(%file,"Ore",%i,"Name");
%price = getBlockData(%file,"Ore",%i,"Price");
%sellPrice = getBlockData(%file,"Ore",%i,"SellPrice");
OreData.ore[%i] = %name;
OreData.price[%name] = %price;
OreData.sellPrice[%name] = %sellPrice;
warn("Imported ore:" SPC %name);
}
OreData.oreCount = %count--;
}
// Character Import Functions
function spawnCharacter(%name,%trans,%aimPos,%team)
{
%object = "Character" @ %name;
if (!IsObject(%object))
return false;
%Bname = %object.name;
%race = %object.race;
%skin = %object.skin;
%voice = %object.voice;
%voicePitch = %object.voicePitch;
%sex = %object.sex;
%bot = aiConnectByName(%Bname,%team);
%bot.race = %race;
%bot.skin = addTaggedString(%skin);
%bot.voice = %voice;
%bot.voiceTag = addTaggedString(%voice);
%bot.voicePitch = %voicePitch;
%bot.sex = %sex;
setVoice(%bot,%voice, %voicePitch);
setSkin(%bot,%skin);
setSkin(%bot,%skin);
setTeam(%bot, %team);
%bot.player.setArmor("light");
%bot.player.setTransform(%trans);
%bot.aimAt(%aimPos);
warn("Spawned Character:" SPC %name);
}
function importCharacters()
{
%path = "data/game/characters/*.txt";
for( %file = findFirstFile( %path ); %file !$= ""; %file = findNextFile( %path ) )
{
%name = getFileNameFromString(%file);
%pos = strStr(%name,".");
%character = getSubStr(%name,0,%pos);
importCharacter(%character);
}
}
function importCharacter(%character)
{
%prefix = "data/game/characters/";
%file = %prefix @ %character @ ".txt";
%charName = %character;
%character = strReplace("Character" @ %character," ","_");
if (!IsFile(%file))
return false;
if (!IsObject(%character))
{
new scriptObject(%character);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(%character);
}
else
return true;
//Get our variable values ...
%name = getBlockData(%file,"Character",1,"Name");
%race = getBlockData(%file,"Character",1,"Race");
%sex = getBlockData(%file,"Character",1,"Sex");
%skin = getBlockData(%file,"Character",1,"Skin");
%voice = getBlockData(%file,"Character",1,"Voice");
%voicePitch = getBlockData(%file,"Character",1,"VoicePitch");
//Import Message Arrays ... and assign them
%arrayName[0] = "Death";
%arrayName[1] = "Kill";
%arrayName[2] = "Healed";
%arrayCount = 3;
for (%i = 0; %i < %arrayCount; %i++)
{
%arrayVariableName[%i] = %arrayName[%i] @ "MessageArray";
for (%j = 0; %j < 100; %j++)
{
%arrayTest = getArrayData(%file,%arrayName[%i],%j);
if (%arrayTest !$= "}")
{
if (%j == 0)
%arrayData[%i] = %arrayData[%i] @ %arrayTest;
else
%arrayData[%i] = %arrayData[%i] @ "\t" @ %arrayTest;
}
else
break;
}
eval(%character @ "." @ %arrayVariableName[%i] SPC "= \x22" @ %arrayData[%i] @ "\x22;");
}
//Assign the variables now ...
%character.name = %name;
%character.race = %race;
%character.sex = %sex;
%character.skin = %skin;
%character.voice = %voice;
%character.voicePitch = %voicePitch;
warn("Imported Character:" SPC %charname);
}

View file

@ -0,0 +1 @@
//------------------------------------------------------------------------------ // initialise.cs // Code executed by scripts/RPGGame.cs to load up any BoL specific components. // Copyright (c) 2012 Robert MacGregor //============================================================================== exec("scripts/ModScripts/Server/RPG/ClientFunctions.cs"); exec("scripts/ModScripts/Server/RPG/GameTriggers.cs"); exec("scripts/ModScripts/Server/RPG/PDA.cs"); exec("scripts/ModScripts/Server/RPG/RangedVoice.cs"); exec("scripts/ModScripts/Server/RPG/RadioChat.cs"); exec("scripts/ModScripts/Server/RPG/Interact.cs");

View file

@ -2,6 +2,7 @@
// Datablocks // Datablocks
// Note: You can't actually target interiors with beams, // Note: You can't actually target interiors with beams,
// so make an interior and put this box around it. // so make an interior and put this box around it.
// Copyright (c) 2012 Robert MacGregor
// ----------------------------------------------------- // -----------------------------------------------------
datablock StaticShapeData(MiningBox) : StaticShapeDamageProfile { datablock StaticShapeData(MiningBox) : StaticShapeDamageProfile {
className = "MineBox"; className = "MineBox";

View file

@ -1,5 +1,6 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// scripts/modScripts/server/serverNetworking.cs // scripts/modScripts/server/serverNetworking.cs
// Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
if (!IsObject(ServerNetwork)) if (!IsObject(ServerNetwork))

View file

@ -3,7 +3,7 @@
// Needed this type of thing for communication between servers in the game, // Needed this type of thing for communication between servers in the game,
// so after some googling -- this is what I put out. // so after some googling -- this is what I put out.
// forum.blockland.us/index.php?topic=105360 // forum.blockland.us/index.php?topic=105360
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Replicate Code for Servers // Replicate Code for Servers
@ -146,6 +146,7 @@ function TCPServer::connectionCreated(%this, %address, %socket)
// Callbacks -- make these do whatever you please! // Callbacks -- make these do whatever you please!
function TCPServer::onClientConnect(%this, %address, %socket) function TCPServer::onClientConnect(%this, %address, %socket)
{ {
%this.client = %socket;
echo("Received connection from " @ %address @ ". ID:" @ %socket); echo("Received connection from " @ %address @ ". ID:" @ %socket);
return true; return true;
} }
@ -160,10 +161,16 @@ function TCPServer::onClientDisconnect(%this, %socket)
} }
function TCPServer::onLine(%this, %socket, %line) function TCPServer::onLine(%this, %socket, %line)
{ {
messageAll('msgClient',"Telnet: " @ %line);
echo(%socket SPC "says: " @ %line); echo(%socket SPC "says: " @ %line);
return true; return true;
} }
function TCPServer::message(%this, %message)
{
%this.client.send(%message @ "\n");
}
// Lib Functions // Lib Functions
function generateString(%length, %alpha) function generateString(%length, %alpha)
{ {

View file

@ -4,38 +4,6 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// DATABLOCKS // DATABLOCKS
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
//datablock StaticShapeData(DetructableSecurityCamera) : StaticShapeDamageProfile
//{
// className = "SecurityCamera";
// shapeFile = "SecurityCamera.dts";
// maxDamage = 2.0;
// destroyedLevel = 2.0;
// disabledLevel = 2.0;
// mass = 1.2;
// elasticity = 0.1;
// friction = 0.9;
// collideable = 1;
// pickupRadius = 1;
// sticky = false;
// explosion = CameraGrenadeExplosion;
// expDmgRadius = 1.0;
// expDamage = 0.1;
// expImpulse = 200.0;
// dynamicType = $TypeMasks::StaticShapeObjectType;
// deployedObject = true;
// cmdCategory = "Misc";
// cmdIcon = CMDSensorIcon;
// targetNameTag = 'Security';
// targetTypeTag = 'Camera';
// deployAmbientThread = true;
// debrisShapeName = "debris_generic_small.dts";
// debris = SmallShapeDebris;
// heatSignature = 0;
// needsPower = true;
//};
datablock StaticShapeData(DeployedSpine) : StaticShapeDamageProfile { datablock StaticShapeData(DeployedSpine) : StaticShapeDamageProfile {
className = "spine"; className = "spine";
shapeFile = "Pmiscf.dts"; shapeFile = "Pmiscf.dts";

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// torqueExServer.cs // torqueExServer.cs
// Torque Extensions for Servers // Torque Extensions for Servers
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -15,6 +15,7 @@ function setVoice(%client, %voice, %voicepitch)
{ {
freeClientTarget(%client); freeClientTarget(%client);
%client.voice = %voice; %client.voice = %voice;
%client.voicePitch = %voicePitch;
%client.voicetag = addtaggedstring(%voice); %client.voicetag = addtaggedstring(%voice);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch); %client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
@ -47,7 +48,7 @@ function setSkin(%client, %skin)
// Argument %name: The name to change to. // Argument %name: The name to change to.
// Description: Changes the name of the targeted client object. // Description: Changes the name of the targeted client object.
//============================================================================== //==============================================================================
function setName(%client, %name) function setName(%client, %name, %lobbyUpdate)
{ {
freeClientTarget(%client); freeClientTarget(%client);
%client.namebase = %name; %client.namebase = %name;
@ -57,9 +58,12 @@ function setName(%client, %name)
if (IsObject(%client.player)) if (IsObject(%client.player))
%client.player.setTarget(%client.target); %client.player.setTarget(%client.target);
//Update the client in the lobby. // Update the client in the lobby if we wanted to
HideClient(%client); if (%lobbyUpdate)
ShowClient(%client); {
hideClientInLobby(%client);
ShowClientInLobby(%client);
}
return true; return true;
} }
@ -116,10 +120,29 @@ function hideClientInList(%client)
new SimGroup(HiddenClientGroup); new SimGroup(HiddenClientGroup);
ServerGroup.add(HiddenClientGroup); ServerGroup.add(HiddenClientGroup);
} }
if (HiddenClientGroup.isMember(%client))
return false;
$HostGamePlayerCount--;
if (%client.isAIControlled())
$HostGameBotCount--;
HiddenClientGroup.add(%client); HiddenClientGroup.add(%client);
return true; return true;
} }
function listHiddenPlayers()
{
for (%i = 0; %i < HiddenClientGroup.getCount(); %i++)
{
%cl = HiddenClientGroup.getObject(%i);
%status = %cl.isAIControlled() ? "Bot" : "Player";
echo("client: " @ %cl @ " player: " @ %cl.player @ " name: " @ %cl.namebase @ " team: " @ %cl.team @ " status: " @ %status);
}
return true;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: showClientInList // Name: showClientInList
// Argument %client: The client to show. // Argument %client: The client to show.
@ -127,11 +150,46 @@ function hideClientInList(%client)
//============================================================================== //==============================================================================
function showClientInList(%client) function showClientInList(%client)
{ {
if (ClientGroup.isMember(%client))
return false;
$HostGamePlayerCount++;
if (%client.isAIControlled())
$HostGameBotCount++;
ClientGroup.add(%client); ClientGroup.add(%client);
return true; return true;
} }
function ServerCMDCheckHTilt(%client){ return %client; } // CCM-based clients spam fix, for some reason they spam this to the server whenever they strafe. //------------------------------------------------------------------------------
// Name: plnametocid
// Argument %name: The name of a client.
// Description: Returns the client ID of a player whose name closest matches
// %name. (Does not take the hidden group into consideration)
// Note: This code was pulled from construction, the author is unknown to me.
//==============================================================================
function plnametocid(%name)
{
%count = ClientGroup.getCount(); //counts total clients
for(%i = 0; %i < %count; %i++) //loops till all clients are accounted for
{
%obj = ClientGroup.getObject(%i); //gets the clientid based on the ordering hes in on the list
%nametest=%obj.namebase; //pointless step but i didnt feel like removing it....
%nametest=strlwr(%nametest); //make name lowercase
%name=strlwr(%name); //same as above, for the other name
if(strstr(%nametest,%name) != -1) //is all of name test used in name
return %obj; //if so return the clientid and stop the function
}
return 0; //if none fits return 0 and end function
}
function forceSpawn(%client)
{
Game.spawnPlayer( %client, false );
CloseScoreScreen(%client);
return true;
}
function ServerCMDCheckHTilt(%client){ } // CCM-based clients spam fix, for some reason they spam this to the server whenever they strafe.
// TypeMasks // TypeMasks
$TypeMasks::AllObjectType = -1; //Same thing as everything, thanks to Krash123 for telling me this. :) $TypeMasks::AllObjectType = -1; //Same thing as everything, thanks to Krash123 for telling me this. :)
@ -150,6 +208,7 @@ function GameConnection::setName(%this, %name){ return setName(%this, %name); }
function GameConnection::setTeam(%this, %team){ return setTeam(%this, %team); } function GameConnection::setTeam(%this, %team){ return setTeam(%this, %team); }
function GameConnection::hideInLobby(%this){ return hideClientInLobby(%this); } function GameConnection::hideInLobby(%this){ return hideClientInLobby(%this); }
function GameConnection::showInLobby(%this){ return showClientInLobby(%this); } function GameConnection::showInLobby(%this){ return showClientInLobby(%this); }
function Gameconnection::spawn(%this){ return forceSpawn(%this); }
// function GameConnection::hideClientInList(%this){ return hideClientInList(%this); } // function GameConnection::hideClientInList(%this){ return hideClientInList(%this); }
// function GameConnection::showClientInList(%this){ return showClientInList(%this); } // function GameConnection::showClientInList(%this){ return showClientInList(%this); }
@ -201,14 +260,14 @@ function Player::setSkin(%this, %skin)
return setSkin(%this, %skin); return setSkin(%this, %skin);
} }
function Player::setName(%this, %name) function Player::setName(%this, %name, %lobbyUpdate)
{ {
if (!isObject(%this.Client)) if (!isObject(%this.Client))
{ {
%this.Client = new ScriptObject(); %this.Client = new ScriptObject();
%this.Client.Player = %this; %this.Client.Player = %this;
} }
return setName(%this, %name); return setName(%this, %name, %lobbyUpdate);
} }
function Player::setTeam(%this, %team) function Player::setTeam(%this, %team)
@ -220,3 +279,16 @@ function Player::setTeam(%this, %team)
} }
return setTeam(%this, %team); return setTeam(%this, %team);
} }
// This package is used to hook several functions that will induce bugs due to usage of this code
package ExOverrides
{
function fixMe(){}
};
if (!isActivePackage(ExOverrides))
activatePackage(ExOverrides);
else
{
deactivatePackage(ExOverrides);
activatePackage(ExOverrides);
}

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Array.cs // Array.cs
// Array object you can pass around. // Array object you can pass around.
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//============================================================================== //==============================================================================
function ArrayFactory::create(%this, %name) function ArrayFactory::create(%this, %name)
@ -52,6 +52,14 @@ function ArrayObject::removeElement(%this, %index)
return false; return false;
} }
function ArrayObject::hasElementValue(%this, %value)
{
for (%i = 0; %i < %this.elementCount; %i++)
if (%this.Element[%i] == %value)
return true;
return false;
}
function ArrayObject::isElement(%this, %index) function ArrayObject::isElement(%this, %index)
{ {
if (%this.Element[%index] == "") if (%this.Element[%index] == "")

View file

@ -0,0 +1,276 @@
//------------------------------------------------------------------------------
// basicDataStorage.cs
// Originally written for T2BoL mod back in the day, now is being rewritten
// for the original implementation was pretty crappy.
// Requires: Array.cs
// Copyright (c) 2012 Robert MacGregor
//==============================================================================
//------------------------------------------------------------------------------
// Name: BasicDataParser.load
// Argument %file: The file to parse and load into memory.
// Description: This function is the main function of everything; it loads
// %file into memory.
// Return: True if the function succeeded, false if otherwise failed.
//==============================================================================
function BasicDataParser::load(%this, %file)
{
// Make sure we have our values initialised (math doesn't work right on nonexistent variables!)
if (%this.filesLoaded == "")
%this.filesLoaded = 0;
if (%this.blockEntryCount == "")
%this.blockEntryCount = 0;
if (%this.blockInstances == "")
%this.blockInstances = 0;
%currentSeconds = formatTimeString("ss");
// Check to see if the data is valid (returns false if we tried to load a nonexistent file)
if (!isFile(%file))
{
error("basicDataStorage.cs: Attempted to load non-existent file " @ %file @ "!");
return false;
}
// Check to see if this file is already loaded
if (%this.isLoaded(%file))
{
error("basicDataStorage.cs: Attempted to reload data file " @ %file SPC "while it's already in memory! (try unloading or emptying)");
return false;
}
// Add the file entry to memory (for the file check above)
%this.files[%this.filesLoaded] = %file;
%this.fileIndex[%file] = %this.filesLoaded;
%this.filesLoaded++;
// Load the file into memory (function is from fileProcessing.cs)
%fileData = strReplace(stripChars(getFileBuffer(%file),"\t"),"\n","\t");
%lineCount = getFieldCount(%fileData);
%isProcessingBlock = false; // Used to set processing mode
%currentBlock = 0;
%hadError = false;
// Iterate through all lines
for (%i = 0; %i < %lineCount; %i++)
{
%currentLine = getField(%fileData,%i);
// Check to see if this line contains a block definition or not
%openingBlock = strStr(%currentLine, "[");
%closingBlock = strStr(%currentLine, "]");
// If we have a block definition, it should be against left margin
if (%openingBlock == 0 && %closingBlock > 0 && !%isProcessingBlock)
{
%isProcessingBlock = true;
%blockName = getSubStr(%currentLine,%openingBlock+1,%closingBlock-1);
if (%this.blockInstances[%blockName] == "")
{
%this.blockInstances[%blockName] = 0;
%this.blockEntry[%this.blockEntryCount] = %blockName;
%this.blockEntryCount++;
}
// Create the array to store our block data
%currentBlock = Array.create();
%currentBlock.Name = %blockName;
%currentBlock.File = %file;
%this.blocks[%blockName,%this.blockInstances] = %currentBlock;
%this.blockInstances[%blockName]++;
%this.blockInstances++;
continue;
}
// Results in an error
else if (%openingBlock == 0 && %closingBlock > 0 && %isProcessingBlock)
{
error("basicDataStorage.cs: Error loading file "@ %file @ ", block spacing error.");
return false;
}
// If we're processing the actual block
if (%isProcessingBlock)
{
if (%currentLine $="" || %i == %lineCount)
{
%isProcessingBlock = false;
continue;
}
else
{
%eqPos = strStr(%currentLine,"="); // This is safe since the equals sign should be first.
if (%eqPos == -1)
{
error("basicDataStorage.cs: Unable to read entry for block" SPC %currentBlock.Name @ " in file" SPC %file @ "!");
%isProcessingBlock = false;
%hadError = true;
continue;
}
// Note: I got lazy here, just don't have semicolons in your data entries..
%semiPos = strStr(%currentLine,";");
if (%semiPos == -1 || getSubStrOccurance(%currentLine,";") > 1)
{
error("basicDataStorage.cs: Unable to read entry for block" SPC %currentBlock.Name @ " in file" SPC %file @ "!");
%isProcessingBlock = false;
%hadError = true;
continue;
}
%entryName = trim(getSubStr(%currentLine,0,%eqPos-1));
%entryValue = trim(getSubStr(%currentLine,%eqPos+1, mAbs(%eqPos-%semiPos)-1 ));
%currentBlock.setElement(%entryName,%entryValue);
}
}
}
if (!%hadError)
warn("basicDataStorage.cs: Successfully loaded file" SPC %file SPC "in " @ formatTimeString("ss") - %currentSeconds SPC "seconds.");
return !%hadError;
}
//------------------------------------------------------------------------------
// Name: BasicDataParser.unload
// Argument %file: The file of who's entries should be unloaded.
// Description: This function is used to unload data by filename -- useful for
// reloading data from specific files.
// Return: True if the function was successful, false if otherwise failed.
//==============================================================================
function BasicDataParser::unload(%this, %file)
{
if (!%this.isLoaded(%file))
{
error("basicDataStorage.cs: Attempted to unload non-loaded data file " @ %file @ "!");
return false;
}
// Unload any data associated with this file now
%removed = "";
for (%i = 0; %i < %this.blockEntryCount; %i++)
{
%name = %this.blockEntry[%i];
for (%h = 0; %h < %this.blockInstances[%name]; %h++)
if (%this.blocks[%name, %h].File $= %file)
{
%this.blocks[%name, %h].delete();
%this.blocks[%name, %h] = "";
%this.blockEntry[%i] = "";
%removed = trim(%removed SPC %i);
if (%this.blockInstances[%name] == 1)
%this.blockInstances[%name] = "";
else
%this.blockInstances[%name]--;
}
}
// Iterate through our block entries and correct the imbalance
for (%i = 0; %i < getWordCount(%removed); %i++)
{
for (%h = i; %h < %this.blockEntryCount; %h++)
%this.blockEntry[%h-%i] = %this.blockEntry[%h+1];
%this.blockEntryCount--;
}
// Now remove the file entry
for (%i = %this.fileIndex[%file]; %i < %this.filesLoaded; %i++)
if (%i != %this.filesLoaded-1)
{
%this.files[%i] = %this.files[%i+1];
%this.fileIndex[%this.files[%i+1]] = %i;
}
else
{
%this.fileIndex[%file] = "";
%this.files[%i] = "";
}
// Decrement the files loaded count and return true
%this.filesLoaded--;
return true;
}
//------------------------------------------------------------------------------
// Name: BasicDataParser.count
// Argument %block: The bloick entry to count the occurances of
// Return: The occurances of %block in this parser object. If there is no
// such entry of %block anywhere, false (0) is returned.
//==============================================================================
function BasicDataParser::count(%this, %block)
{
// Return zero if the block has no entries even registered
if (%this.blockInstances[%block] == "")
return false;
else
// Return the block Instances otherwise
return %this.blockInstances[%block];
return false; // Shouldn't happen
}
//------------------------------------------------------------------------------
// Name: BasicDataParser.empty
// Description: Empties the entire object of any information it may have
// loaded anytime.
// Return: True is always returned from this function.
//==============================================================================
function BasicDataParser::empty(%this)
{
// Iterate through our block entries and destroy them
for (%i = 0; %i < %this.blockEntryCount; %i++)
{
%name = %this.blockEntry[%i];
for (%h = 0; %h < %this.blockInstances[%name]; %h++)
{
%this.blocks[%name, %h].delete();
%this.blocks[%name, %h] = "";
}
%this.blockInstances[%name] = "";
%this.blockEntry[%i] = "";
}
// Remove the files loaded entries now
for (%i = 0; %i < %this.filesLoaded; %i++)
{
%this.fileIndex[%this.files[%i]] = "";
%this.files[%i] = "";
}
// Reset some variables to 0 and return true
%this.filesLoaded = 0;
%this.blockInstances = 0;
%this.blockEntryCount = 0;
return true;
}
//------------------------------------------------------------------------------
// Name: BasicDataParser.isLoaded
// Argument %file: The file to check the loaded status of.
// Description: Returns if %file is loaded into memory of this object or not.
// Return: A boolean representing the loaded status.
//==============================================================================
function BasicDataParser::isLoaded(%this, %file)
{
// Check to see if this file is already loaded
for (%i = 0; %i < %this.filesLoaded; %i++)
if (%this.files[%i] $= %file)
return true;
return false;
}
//------------------------------------------------------------------------------
// Name: BasicDataParser.get
// Argument %block: The name of the block to return.
// Argument %occurance: The block index we need to return -- if there's
// multiple entries of %block.
// Description: This function is used to retrieve block entries loaded from
// within any of the files this object has parsed.
// Return: An Array (array.cs) containing relevent information to the requested
// block. If there is no such entry of %block, false is returned.
//==============================================================================
function BasicDataParser::get(%this, %block, %occurance)
{
// Check ti see uf thus block has only once entry -- in which case %occurance is ignored
if (%this.count(%block) == 1) return %this.blocks[%block, 0];
// Otherwise we use %occurance to return the specific index
else if (%occurance >= 0 && %occurance <= %this.count(%block)) return %this.blocks[%block, %occurance];
return false;
}

View file

@ -0,0 +1,80 @@
// -----------------------------------------------------
// FileFunctions.cs
// Basic file functions
// Copyright (c) 2012 Robert MacGregor
// -----------------------------------------------------
function getFileBuffer(%file)
{
if (!IsFile(%file))
return -1;
new FileObject(FileBuffer);
FileBuffer.openForRead(%file);
while (!FileBuffer.isEOF())
%buffer = %buffer @ FileBuffer.readLine() @ "\n";
FileBuffer.detach();
return %buffer; //Long string. >.>
}
function getLine(%file, %line)
{
if (!IsFile(%file))
return -1;
new FileObject(FileLine);
FileLine.openForRead(%file);
for (%i = 0; %i < %line; %i++)
%line = FileLine.readLine();
FileLine.detach();
return %line;
}
function getLine(%file, %line)
{
if (!IsFile(%file))
return -1;
new FileObject(FileLine);
FileLine.openForRead(%file);
for (%i = 0; %i < %line; %i++)
%line = FileLine.readLine();
FileLine.detach();
return %line;
}
// Returns an unsorted list of the contents of %dir (including folders)
function getDirectory(%dir)
{
%array = Array.create();
%fileCount = 0;
for( %file = findFirstFile( %dir @ "*.*" ); %file !$= ""; %file = findNextFile( %dir @ "*.*" ) )
{
%file = strReplace(%file, %socket.request, "");
if (strStr(%file, "/") != -1)
{
%dir = getSubStr(%file, 0, strStr(%file, "/")) @ "/";
if (!%dirAdded[%dir])
{
%data = %data @ "<a href=\"" @ strReplace(%dir, " ","%20") @ "\">" @ %dir @ "</a><br>\n";
%dirAdded[%dir] = true;
}
}
else
%data = %data @ "<a href=\"" @ strReplace(%file, " ", "%20") @ "\">" @ %file @ "</a><br>\n";
}
return %array;
}
// -----------------------------------------------------
// Bound Functions
// -----------------------------------------------------
function fileObject::Detach(%this) //Detaches fileObject from file & deletes
{
%this.close();
%this.delete();
return %this;
}

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// stringProcessing.cs // StringFunctions.cs
// String functions // String functions
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 Robert MacGregor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -120,7 +120,7 @@ function stripNonNumericCharacters(%string)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
function getSubStrOccurance(%string,%search) function getSubStrOccurances(%string,%search)
{ {
%len = strLen(%string); %len = strLen(%string);
%srLen = strLen(%search); %srLen = strLen(%search);
@ -150,12 +150,12 @@ function getSubStrPos(%string,%str,%num)
if (%sub $= %str) if (%sub $= %str)
{ {
%subC++;
if (%subC == %num) if (%subC == %num)
break; return %i;
%subC++;
} }
} }
return %pos; return false;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -179,7 +179,7 @@ function getFileNameFromString(%string)
if (strStr(%string, "/") == -1) if (strStr(%string, "/") == -1)
return %string; return %string;
else else
return getSubStr(%string,getSubStrPos(%string,"/",getSubStrOccurance(%string, "/"))+1,strLen(%string)); return getSubStr(%string,getSubStrPos(%string, "/", getSubStrOccurances(%string, "/")-1)+1,strLen(%string));
} }
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
@ -190,7 +190,7 @@ function getFileExtensionFromString(%string)
if (%period == -1) if (%period == -1)
return false; return false;
else else
return getSubStr(%string,getSubStrPos(%string,".",getSubStrOccurance(%string, "."))+1,strLen(%string)); return getSubStr(%file,strStr(%file,".")+1, strLen(%file));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View file

@ -3,7 +3,7 @@
// Shared Functions for T2Bol // Shared Functions for T2Bol
// Copyright (c) 2012 The DarkDragonDX // Copyright (c) 2012 The DarkDragonDX
//============================================================================== //==============================================================================
exec("scripts/modScripts/shared/stringProcessing.cs"); exec("scripts/modScripts/shared/StringFunctions.cs");
exec("scripts/modScripts/shared/fileProcessing.cs"); exec("scripts/modScripts/shared/fileProcessing.cs");
exec("scripts/modScripts/shared/basicDataStorage.cs"); exec("scripts/modScripts/shared/basicDataStorage.cs");

View file

@ -2064,7 +2064,7 @@ datablock PlayerData(LightMaleBiodermArmor) : LightMaleHumanArmor
}; };
//TODO: Balance out the Draakan armors //TODO: Balance out the Draakan armors
datablock PlayerData(LightADraakanArmor) : LightMaleHumanArmor datablock PlayerData(LightMaleDraakanArmor) : LightMaleHumanArmor
{ {
shapeFile = "bioderm_light.dts"; shapeFile = "bioderm_light.dts";
jetEmitter = BiodermArmorJetEmitter; jetEmitter = BiodermArmorJetEmitter;
@ -2109,91 +2109,6 @@ datablock PlayerData(LightADraakanArmor) : LightMaleHumanArmor
waterBreathSound = WaterBreathBiodermSound; waterBreathSound = WaterBreathBiodermSound;
}; };
datablock PlayerData(LightBDraakanArmor) : LightMaleHumanArmor
{
shapeFile = "bioderm_light.dts";
jetEmitter = BiodermArmorJetEmitter;
jetEffect = BiodermArmorJetEffect;
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
max[Flamer] = 1;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
//Foot Prints
decalData = LightBiodermFootprint;
decalOffset = 0.3;
waterBreathSound = WaterBreathBiodermSound;
};
datablock PlayerData(LightCDraakanArmor) : LightMaleHumanArmor
{
shapeFile = "bioderm_light.dts";
jetEmitter = BiodermArmorJetEmitter;
jetEffect = BiodermArmorJetEffect;
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
max[Flamer] = 1;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
//Foot Prints
decalData = LightBiodermFootprint;
decalOffset = 0.3;
waterBreathSound = WaterBreathBiodermSound;
};
datablock PlayerData(LightMaleCriollosArmor) : LightMaleHumanArmor datablock PlayerData(LightMaleCriollosArmor) : LightMaleHumanArmor
{ {
shapeFile = "bioderm_light.dts"; shapeFile = "bioderm_light.dts";
@ -2237,7 +2152,7 @@ datablock PlayerData(MediumMaleBiodermArmor) : MediumMaleHumanArmor
waterBreathSound = WaterBreathBiodermSound; waterBreathSound = WaterBreathBiodermSound;
}; };
datablock PlayerData(MediumADraakanArmor) : MediumMaleHumanArmor datablock PlayerData(MediumMaleDraakanArmor) : MediumMaleHumanArmor
{ {
emap = false; emap = false;
@ -2277,88 +2192,6 @@ datablock PlayerData(MediumADraakanArmor) : MediumMaleHumanArmor
waterBreathSound = WaterBreathBiodermSound; waterBreathSound = WaterBreathBiodermSound;
}; };
datablock PlayerData(MediumBDraakanArmor) : MediumMaleHumanArmor
{
emap = false;
shapeFile = "bioderm_medium.dts";
jetEmitter = BiodermArmorJetEmitter;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
//Foot Prints
decalData = HeavyBiodermFootprint;
decalOffset = 0.4;
waterBreathSound = WaterBreathBiodermSound;
};
datablock PlayerData(MediumCDraakanArmor) : MediumMaleHumanArmor
{
emap = false;
shapeFile = "bioderm_medium.dts";
jetEmitter = BiodermArmorJetEmitter;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
//Foot Prints
decalData = HeavyBiodermFootprint;
decalOffset = 0.4;
waterBreathSound = WaterBreathBiodermSound;
};
datablock PlayerData(MediumMaleCriollosArmor) : MediumMaleHumanArmor datablock PlayerData(MediumMaleCriollosArmor) : MediumMaleHumanArmor
{ {
emap = false; emap = false;
@ -2401,7 +2234,7 @@ datablock PlayerData(HeavyMaleBiodermArmor) : HeavyMaleHumanArmor
waterBreathSound = WaterBreathBiodermSound; waterBreathSound = WaterBreathBiodermSound;
}; };
datablock PlayerData(HeavyADraakanArmor) : HeavyMaleHumanArmor datablock PlayerData(HeavyMaleDraakanArmor) : HeavyMaleHumanArmor
{ {
shapeFile = "bioderm_heavy.dts"; shapeFile = "bioderm_heavy.dts";
debrisShapeName = "bio_player_debris.dts"; debrisShapeName = "bio_player_debris.dts";
@ -2432,68 +2265,6 @@ datablock PlayerData(HeavyADraakanArmor) : HeavyMaleHumanArmor
}; };
datablock PlayerData(HeavyBDraakanArmor) : HeavyMaleHumanArmor
{
shapeFile = "bioderm_heavy.dts";
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
};
datablock PlayerData(HeavyCDraakanArmor) : HeavyMaleHumanArmor
{
shapeFile = "bioderm_heavy.dts";
debrisShapeName = "bio_player_debris.dts";
debris = BiodermPlayerDebris;
damageScale[$DamageType::Flame] = 0;
damageScale[$DamageType::Ground] = 0.06;
damageScale[$DamageType::Lava] = 0.009;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 18.7;
maxBackwardSpeed = 13.2;
maxSideSpeed = 7.7;
maxUnderwaterForwardSpeed = 5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
recoverDelay = 8;
recoverRunForceScale = 0.2;
jumpForce = 8.35 * 200;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
};
datablock PlayerData(HeavyMaleCriollosArmor) : HeavyMaleHumanArmor datablock PlayerData(HeavyMaleCriollosArmor) : HeavyMaleHumanArmor
{ {
shapeFile = "bioderm_heavy.dts"; shapeFile = "bioderm_heavy.dts";

View file

@ -450,34 +450,6 @@ if( isObject( %client.player ) )
return %client SPC %reason; return %client SPC %reason;
} }
function forceClientSpawn(%client,%setupBool)
{
%client.race = $Data::Race[%client.GUID];
%client.sex = $Data::Sex[%client.GUID];
%client.team = getRaceTeam(%client.race);
Game.spawnPlayer( %client, false );
%client.setControlObject(%client.player);
CloseScoreScreen(%client);
commandToClient(%client,'HandleScriptedCommand',7);
commandToClient(%client,'HandleScriptedCommand',3,3000);
commandToClient(%client,'bottomPrint',"Try not to die.",3);
if (%setupBool)
applyPlayerSave(%client);
setClientTeam(%client,0); //Has to be after everything else, or the player spawns in the middle of fucking nowhere..
}
function setClientTeam(%client,%team)
{
if (%client.oldTeam $= "")
%client.oldTeam = %client.team;
%client.team = %team;
%client.setSensorGroup(%team);
setTargetSensorGroup(%client.target,%team);
}
function initGameBots( %mission, %mType ) function initGameBots( %mission, %mType )
{ {
echo( "adding bots..." ); echo( "adding bots..." );
@ -813,14 +785,12 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
case "Bioderm": case "Bioderm":
%client.sex = "Male"; %client.sex = "Male";
%client.race = "Bioderm"; %client.race = "Bioderm";
case "Draakan A": case "Draakan Male":
%client.sex = "A"; %client.sex = "Male";
%client.race = "Draakan"; %client.race = "Draakan";
case "Draakan B": case "Draakan Female":
%client.sex = "B"; // TODO: Make this value matter based on genetics
%client.race = "Draakan"; %client.sex = "Male";
case "Draakan C":
%client.sex = "C";
%client.race = "Draakan"; %client.race = "Draakan";
case "Criollos": case "Criollos":
%client.sex = "Male"; %client.sex = "Male";

Binary file not shown.

21
scripts/simGroup.cs Normal file
View file

@ -0,0 +1,21 @@
//--------------------------------------------------------------------------
//
//
//
//--------------------------------------------------------------------------
function SimGroup::onTrigger(%this, %triggerId, %on)
{
// Just relay the trigger event to all sub objects...
//
for (%i = 0; %i < %this.getCount(); %i++)
%this.getObject(%i).onTrigger(%triggerId, %on);
}
function SimGroup::onTriggerTick(%this, %triggerId)
{
// Just relay the trigger event to all sub objects...
//
for (%i = 0; %i < %this.getCount(); %i++)
%this.getObject(%i).onTriggerTick(%triggerId);
}

View file

@ -286,10 +286,7 @@ function TurretData::replaceCallback(%this, %turret, %engineer)
function TurretData::onDestroyed(%this, %turret, %prevState) function TurretData::onDestroyed(%this, %turret, %prevState)
{ {
if( isObject( %turret.lastProjectile ) ) Parent::onDestroyed(%this, %turret, %prevState);
%turret.lastProjectile.delete();
Parent::onDestroyed(%this, %turret, %prevState);
} }
function checkTurretMount(%data, %obj, %slot) function checkTurretMount(%data, %obj, %slot)

View file

@ -280,7 +280,7 @@ if(!isobject(%obj) || %obj.client.race $= "draakan" || %obj.getclassname() !$= "
return; return;
} }
if (%obj.client.shouldscream $="") //Used for bots.. if (%obj.client.shouldscream $="" && %obj.client.isAIControlled()) //Used for bots..
%obj.client.shouldscream = true; %obj.client.shouldscream = true;
if (%obj.client.shouldscream) if (%obj.client.shouldscream)

View file

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before After
Before After

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.