Additional bug fixes

Chat bot fixes, Demon Lord Zombie Fixes, F2 Menu Fixes, Officer
Promotion Challenge Fixes.
This commit is contained in:
Robert Fritzen 2017-06-29 22:11:25 -05:00
parent 43f1b91df3
commit 497ecfc182
9 changed files with 213 additions and 162 deletions

View file

@ -264,10 +264,7 @@ function parseSuperAdminCommands(%sender, %command, %args) {
messageclient(%sender, 'MsgClient', '\c2No such player.'); messageclient(%sender, 'MsgClient', '\c2No such player.');
return 1; return 1;
} }
if(!isSet(%target.ksListInstance)) {
%target.ksListInstance = initList();
}
%cAmt = 0; %cAmt = 0;
%sw = strlwr(getWord(%args,1)); %sw = strlwr(getWord(%args,1));

View file

@ -66,7 +66,11 @@ function LoadClientRankfile(%client) {
echo("Found TWM2 Rank/Setting Client Controller for "@%client@" -> "@%object@""); echo("Found TWM2 Rank/Setting Client Controller for "@%client@" -> "@%object@"");
%client.TWM2Core = %object; %client.TWM2Core = %object;
} }
// //Check Officer Challenges.
for(%i = %client.TWM2Core.officer; %i > 0; %i--) {
%oChN = "Prestige"@%i;
CompleteNWChallenge(%client, %oChN);
}
TWM2Lib_MainControl("PlayerTimeLoop", %client); //post load functions TWM2Lib_MainControl("PlayerTimeLoop", %client); //post load functions
} }
@ -109,43 +113,42 @@ function UpdateClientRank(%client) {
} }
function runRankUpdateLoop(%client, %j, %continue) { function runRankUpdateLoop(%client, %j, %continue) {
if(!%continue) { if(!%continue) {
return; return;
//break the function run through here }
} if(%j <= 0) {
if(%j <= 0) { return;
return; }
} %name = %client.namebase;
%name = %client.namebase; %scriptController = %client.TWM2Core;
%scriptController = %client.TWM2Core; //perform rank update
if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){ if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){
if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%scriptController.officer)*$Rank::RankCount)+%j)) { if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%scriptController.officer)*$Rank::RankCount)+%j)) {
%scriptController.rankNumber = %j; %scriptController.rankNumber = %j;
if($TWM2::UseRankTags) { if($TWM2::UseRankTags) {
DoNameChangeChecks(%client); DoNameChangeChecks(%client);
} }
%scriptController.rank = $Ranks::NewRank[%j]; %scriptController.rank = $Ranks::NewRank[%j];
if($Prestige::Name[%scriptController.officer] >= 1) { if($Prestige::Name[%scriptController.officer] >= 1) {
$Prestige::Name[%scriptController.officer] = ""; $Prestige::Name[%scriptController.officer] = "";
} }
messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@printCurrentEXP(%client)@"!"); messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@printCurrentEXP(%client)@"!");
messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav"); messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav");
bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 ); bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 );
echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@"."); echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@".");
//UpdateRankFile(%client); SaveClientFile(%client);
SaveClientFile(%client); //
// if(!$TWM2::PGDConnectDisabled) {
if(!$TWM2::PGDConnectDisabled) { PrepareUpload(%client);
PrepareUpload(%client); }
} %j = 1;
%j = 1; runRankUpdateLoop(%client, %j, 0);
runRankUpdateLoop(%client, %j, 0); }
} }
} else {
else { %j--;
%j--; runRankUpdateLoop(%client, %j, 1);
runRankUpdateLoop(%client, %j, 1); }
}
} }
function fetchCap(%type, %index) { function fetchCap(%type, %index) {
@ -258,35 +261,10 @@ function PromoteToPrestige(%client) {
MessageAll('msgSpecial', "\c5"@%client.namebase@" has promoted to Officer level "@%next@"."); MessageAll('msgSpecial', "\c5"@%client.namebase@" has promoted to Officer level "@%next@".");
recordAction(%client, "", ""); //record blank action for the challenges to pick off any officer challenges recordAction(%client, "", ""); //record blank action for the challenges to pick off any officer challenges
switch(%next) { for(%i = %next; %i > 0; %i--) {
case 1: %oChN = "Prestige"@%i;
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); CompleteNWChallenge(%client, %oChN);
case 2:
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1");
schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2");
case 3:
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1");
schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2");
schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3");
case 4:
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1");
schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2");
schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3");
schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4");
case 5 or 6 or 7 or 8:
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1");
schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2");
schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3");
schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4");
schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5");
case 9:
schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1");
schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2");
schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3");
schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4");
schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5");
schedule(3500, 0, "CompleteNWChallenge", %client, "Prestige9");
} }
} }

View file

@ -1544,60 +1544,141 @@ function GenerateChallengeSubMenu(%client, %subMenu, %tag, %index) {
//Officer Promotion //Officer Promotion
messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer Challenges:"); messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer Challenges:");
%index++; %index++;
if(%client.CheckNWChallengeCompletion("Prestge1")) { if(%client.CheckNWChallengeCompletion("Prestige1")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Instructive Private - Reach Officer Level 1."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Instructive Officer - Reach Officer Level 1.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Private - Reach Officer Level 1."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestge2")) { if(%client.CheckNWChallengeCompletion("Prestige2")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Excelling Private - Reach Officer Level 2."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Excelling Officer - Reach Officer Level 2.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Private - Reach Officer Level 2."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestge3")) { if(%client.CheckNWChallengeCompletion("Prestige3")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Champion Private - Reach Officer Level 3."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Champion Officer - Reach Officer Level 3.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Private - Reach Officer Level 3."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestge4")) { if(%client.CheckNWChallengeCompletion("Prestige4")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Prestigious Private - Reach Officer Level 4."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Prestigious Officer - Reach Officer Level 4.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Private - Reach Officer Level 4."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestge5")) { if(%client.CheckNWChallengeCompletion("Prestige5")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Supreme Private - Reach Officer Level 5."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Supreme Officer - Reach Officer Level 5.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Private - Reach Officer Level 5."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestge9")) { if(%client.CheckNWChallengeCompletion("Prestige6")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Phantom's Vengeance - Reach Oficer Level 9."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Glorious Officer - Reach Officer Level 6.");
%index++; %index++;
} }
else { else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom's Vengeance - Reach Oficer Level 9."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++; %index++;
} }
// //
if(%client.CheckNWChallengeCompletion("Prestige7")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Ultimate Officer - Reach Officer Level 7.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige8")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Shadowing Officer - Reach Officer Level 8.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige9")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Phantom Officer - Reach Oficer Level 9.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige10")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Brutal Officer - Reach Oficer Level 10.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige11")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Vengeful Officer - Reach Oficer Level 11.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige12")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Noble Officer - Reach Oficer Level 12.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige13")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Spectral Officer - Reach Oficer Level 13.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige14")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Masterful Officer - Reach Oficer Level 14.");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("Prestige15")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Rising Harbinger - Reach The Highest Officer Level (15).");
%index++;
}
else {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:990000>=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ===");
%index++;
}
//
if(%client.CheckNWChallengeCompletion("GameEnder")) { if(%client.CheckNWChallengeCompletion("GameEnder")) {
messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Game Ender - Call in a Fission Bomb."); messageClient( %client, 'SetLineHud', "", %tag, %index, "<color:33FF00>Game Ender - Call in a Fission Bomb.");
%index++; %index++;

View file

@ -21,6 +21,9 @@
//The Core Function //The Core Function
function ScanMessage(%sender, %message) { function ScanMessage(%sender, %message) {
if(getSubStr(trim(%message), 0, 1) $= "/") {
return;
}
%name = $ChatBot::Name; %name = $ChatBot::Name;
%inter = $ChatBot::Interactions; %inter = $ChatBot::Interactions;
%itter = $ChatBot::Itterations; %itter = $ChatBot::Itterations;
@ -38,13 +41,13 @@ function ScanMessage(%sender, %message) {
} }
} }
//ok, now onto more functioning //ok, now onto more functioning
%containsName = strStr(getWord(%message, 0), %name); %containsName = strStr(getWord(%message, 0), strlwr(trim(%name)));
//Step 2: Is the name mentioned? //Step 2: Is the name mentioned?
if(%containsName != -1) { if(%containsName != -1) {
//Step 3: Parse Admin Commands //Step 3: Parse Admin Commands
if(%admin) { if(%admin) {
if(%isA) { if(%isA) {
ParseAdminCommands(%sender, %message, %isA, %isSA); ParseAdminCommands(%sender, %message);
} }
else { else {
//Step 3 Else Case, not admin, proceed //Step 3 Else Case, not admin, proceed
@ -159,8 +162,10 @@ function botSlap(%tcl) {
} }
//Admin Module //Admin Module
function ParseAdminCommands(%sender, %message, %isA, %isSA) { function ParseAdminCommands(%sender, %message) {
if(!%isA) { %isA = %sender.isAdmin;
%isSA = %sender.isSuperAdmin;
if(!%sender.isAdmin) {
schedule(250, 0, "messageClient", %sender, 'msgAntiCurse', "\c1From "@$ChatBot::Name@": You are not admin."); schedule(250, 0, "messageClient", %sender, 'msgAntiCurse', "\c1From "@$ChatBot::Name@": You are not admin.");
} }
else { else {

View file

@ -229,12 +229,21 @@ $Challenge::Info["InvasionBuster"] = "Invade THIS!\t11\t25000\tNone";
$Challenge::Info["SurvivalistExtreme"] = "Extreme Survivalist\t11\t50000\tNone"; $Challenge::Info["SurvivalistExtreme"] = "Extreme Survivalist\t11\t50000\tNone";
//Prestige //Prestige
$Challenge::Info["Prestge1"] = "Instructive Private\t12\t100\tNone"; $Challenge::Info["Prestige1"] = "Instructive Officer\t12\t100\tNone";
$Challenge::Info["Prestge2"] = "Excelling Private\t12\t250\tNone"; $Challenge::Info["Prestige2"] = "Excelling Officer\t12\t250\tNone";
$Challenge::Info["Prestge3"] = "Champion Private\t12\t350\tNone"; $Challenge::Info["Prestige3"] = "Champion Officer\t12\t350\tNone";
$Challenge::Info["Prestge4"] = "Prestigious Private\t12\t500\tNone"; $Challenge::Info["Prestige4"] = "Prestigious Officer\t12\t500\tNone";
$Challenge::Info["Prestge5"] = "Supreme Private\t12\t1000\tNone"; $Challenge::Info["Prestige5"] = "Supreme Officer\t12\t1000\tNone";
$Challenge::Info["Prestge9"] = "Phantom's Vengeance\t12\t10000\tNone"; $Challenge::Info["Prestige6"] = "Glorious Officer\t12\t2500\tNone";
$Challenge::Info["Prestige7"] = "Ultimate Officer\t12\t5000\tNone";
$Challenge::Info["Prestige8"] = "Shadowing Officer\t12\t7500\tNone";
$Challenge::Info["Prestige9"] = "Phantom Officer\t12\t10000\tNone";
$Challenge::Info["Prestige10"] = "Brutal Officer\t12\t10000\tNone";
$Challenge::Info["Prestige11"] = "Vengeful Officer\t12\t10000\tNone";
$Challenge::Info["Prestige12"] = "Spectral Officer\t12\t10000\tNone";
$Challenge::Info["Prestige13"] = "Noble Officer\t12\t10000\tNone";
$Challenge::Info["Prestige14"] = "Masterful Officer\t12\t10000\tNone";
$Challenge::Info["Prestige15"] = "Rising Harbinger\t12\t10000\tNone";
$Challenge::Info["GameEnder"] = "Game Ender\t12\t5000\tNone"; $Challenge::Info["GameEnder"] = "Game Ender\t12\t5000\tNone";
@ -247,59 +256,39 @@ $Challenge::Info["GameEnder"] = "Game Ender\t12\t5000\tNone";
//Core Functions //Core Functions
function GameConnection::AllowedToDoNW(%client, %name) { function GameConnection::AllowedToDoNW(%client, %name) {
%scriptController = %client.TWM2Core; %scriptController = %client.TWM2Core;
%xp = getCurrentEXP(%client); %xp = getCurrentEXP(%client);
%taskCate = getField($Challenge::Info[%name], 1); %taskCate = getField($Challenge::Info[%name], 1);
switch(%taskCate) {
case 1: if(%taskCate == 5 || %taskCate == 6) {
if(%xp > $Ranks::MinPoints[13]) { //Special categories available for all players
return 1; return 1;
} }
else {
return 0; if(%taskCate == 1) {
} return %xp >= $Ranks::MinPoints[13];
case 2: }
if(%xp > $Ranks::MinPoints[18]) { else if(%taskCate == 2) {
return 1; return %xp >= $Ranks::MinPoints[18];
} }
else { else if(%taskCate == 3) {
return 0; return %xp >= $Ranks::MinPoints[23];
} }
case 3: else if(%taskCate == 4) {
if(%xp > $Ranks::MinPoints[23]) { return %xp >= $Ranks::MinPoints[28];
return 1; }
} else if(%taskCate == 7 || %taskCate == 8 || %taskCate == 9 || %taskCate == 10) {
else { return %xp >= $Ranks::MinPoints[40];
return 0; }
} else if(%taskCate == 11) {
case 4: return %xp >= $Ranks::MinPoints[59];
if(%xp > $Ranks::MinPoints[28]) { }
return 1; else if(%taskCate == 12) {
} return %scriptController.officer >= 1;
else { }
return 0; else {
} error("AllowedToDoNW: Invalid challenge category for "@%name@", system shows: "@%taskCate@" ("@%Challenge::Info[%name]@")");
case 5: }
return 1; //everyone can do these.
case 6:
return 1; //handled by a different system
case 7 or 8 or 9 or 10:
if(%xp > $Ranks::MinPoints[40]) {
return 1;
}
else {
return 0;
}
case 11:
if(%xp > $Ranks::MinPoints[59]) {
return 1;
}
else {
return 0;
}
case 12:
return 1;
}
} }
function GameConnection::CheckNWChallengeCompletion(%client, %name) { function GameConnection::CheckNWChallengeCompletion(%client, %name) {
@ -347,7 +336,7 @@ function CompleteNWChallenge(%client, %name) {
} }
//Menus //Menus
function GenerateChallegnesMenu(%client, %tag, %index) { function GenerateChallengesMenu(%client, %tag, %index) {
%scriptController = %client.TWM2Core; %scriptController = %client.TWM2Core;
%xp = getCurrentEXP(%client); %xp = getCurrentEXP(%client);
messageClient( %client, 'SetLineHud', "", %tag, %index, "Select a category to view challenges:"); messageClient( %client, 'SetLineHud', "", %tag, %index, "Select a category to view challenges:");

View file

@ -762,7 +762,7 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3,
%index++; %index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, ""); messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++; %index++;
%index = GenerateChallegnesMenu(%client, %tag, %index); %index = GenerateChallengesMenu(%client, %tag, %index);
messageClient( %client, 'SetLineHud', "", %tag, %index, ""); messageClient( %client, 'SetLineHud', "", %tag, %index, "");
%index++; %index++;
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>'); messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tChallenge\t1>Return to Challenge Menu</a>');

View file

@ -147,6 +147,9 @@ function ChargeEmitter(%zombie){
//************************************************************ //************************************************************
function ZombieLookforTarget(%zombie){ function ZombieLookforTarget(%zombie){
if(!isObject(%zombie)) {
return;
}
%wbpos = %zombie.getworldboxcenter(); %wbpos = %zombie.getworldboxcenter();
%z = getWord(%wbpos, 2); %z = getWord(%wbpos, 2);
if(%z < $zombie::FallDieHeight) { if(%z < $zombie::FallDieHeight) {

View file

@ -171,7 +171,7 @@ function DemonMotherThink(%obj){
%closestClient = getWord(%closestClient,0).Player; %closestClient = getWord(%closestClient,0).Player;
if(%closestClient != -1){ if(%closestClient != -1){
%searchobject = %closestclient.player; %searchobject = %closestclient;
%dist = vectorDist(%pos,%searchobject.getPosition()); %dist = vectorDist(%pos,%searchobject.getPosition());
if(%dist <= 100){ if(%dist <= 100){
if(%dist <= 50){ //ok were now in combat mode, lets decide on what we should do, move attack, or shoot. if(%dist <= 50){ //ok were now in combat mode, lets decide on what we should do, move attack, or shoot.

View file

@ -272,6 +272,7 @@ function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %
return; return;
} }
LogMessage(%sender, "TEAM: "@%a2@""); LogMessage(%sender, "TEAM: "@%a2@"");
ScanMessage(%sender, %a2);
if(%sender $= "" || %sender <= 0) { if(%sender $= "" || %sender <= 0) {
} }
@ -319,14 +320,12 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
echo("ChatALL: "@%sender.namebase@" : "@%a2@"."); echo("ChatALL: "@%sender.namebase@" : "@%a2@".");
} }
LogMessage(%sender, %a2); LogMessage(%sender, %a2);
ScanMessage(%sender, %a2);
//detectMessage(%sender, %a2);
if ( ( %msgString $= "" ) || spamAlert( %sender ) ) if ( ( %msgString $= "" ) || spamAlert( %sender ) )
return; return;
%count = ClientGroup.getCount(); %count = ClientGroup.getCount();
if(getSubStr(%a2, 0, 1) $= "/") { if(getSubStr(%a2, 0, 1) $= "/") {
chatcommands(%sender,%a2); chatcommands(%sender,%a2);
} }
if(strstr(%a2, "!") == 0) if(strstr(%a2, "!") == 0)
{ {
@ -356,10 +355,9 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
return; return;
} }
if(getSubStr(%a2, 0, 1) !$= "/" ) ScanMessage(%sender, %a2);
{ if(getSubStr(%a2, 0, 1) !$= "/" ) {
for ( %i = 0; %i < %count; %i++ ) for ( %i = 0; %i < %count; %i++ ) {
{
%obj = ClientGroup.getObject( %i ); %obj = ClientGroup.getObject( %i );
if(%sender.team != 0) if(%sender.team != 0)
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );