Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
jmgUtility.h
1
2#pragma once
3#include "general.h"
4#include "scripts.h"
5#include "engine.h"
6#include "WeaponClass.h"
7#include "WeaponBagClass.h"
8#include "SoldierGameObj.h"
9#include "PhysicsSceneClass.h"
10#include "MoveablePhysClass.h"
11#include "VehicleGameObj.h"
12#define PI 3.14159265f
13#define PI180 PI/180
14
22class JMG_Utility_Check_If_Script_Is_In_Library : public ScriptImpClass {
23 void Created(GameObject *obj);
24 void Timer_Expired(GameObject *obj,int number);
25};
26
54class JMG_Send_Custom_When_Custom_Sequence_Matched : public ScriptImpClass {
55 int depth;
56 int failCount;
57 bool enabled;
58 void Created(GameObject *obj);
59 void Custom(GameObject *obj,int message,int param,GameObject *sender);
60 void Send_Custom(GameObject *obj,int custom,int param);
61};
62
68class JMG_Utility_Change_Model_On_Timer : public ScriptImpClass {
69 void Created(GameObject *obj);
70 void Timer_Expired(GameObject *obj,int number);
71};
72
103class JMG_Utility_Emulate_DamageableStaticPhys : public ScriptImpClass {
104 int team;
105 bool alive;
106 bool playingTransition;
107 bool playingTwitch;
108 void Created(GameObject *obj);
109 void Damaged(GameObject *obj,GameObject *damager,float damage);
110 void Animation_Complete(GameObject *obj,const char *anim);
111 void Play_Animation(GameObject *obj,bool loop,float start,float end);
112};
123 void Custom(GameObject *obj,int message,int param,GameObject *sender);
124};
135 void Custom(GameObject *obj,int message,int param,GameObject *sender);
136};
142class JMG_Utility_Soldier_Transition_On_Custom : public ScriptImpClass {
143 void Custom(GameObject *obj,int message,int param,GameObject *sender);
144};
154class JMG_Utility_Poke_Send_Self_Custom : public ScriptImpClass {
155 bool poked;
156 void Created(GameObject *obj);
157 void Poked(GameObject *obj, GameObject *poker);
158 void Timer_Expired(GameObject *obj,int number);
159};
160
168class JMG_Turret_Spawn : public ScriptImpClass
169{
170 int turretId;
171 bool hasDriver;
172 void Created(GameObject *obj);
173 void Custom(GameObject *obj,int message,int param,GameObject *sender);
174 void Killed(GameObject *obj,GameObject *killer);
175 void Destroyed(GameObject *obj);
176 void Detach(GameObject *obj);
177};
178
195class JMG_Utility_AI_Engineer : public ScriptImpClass {
196 bool canFight;
197 Vector3 centerLocation;
198 float maxRange;
199 int aiIgnorePlayers[128];
200 float repairGunRange;
201 float repairGunEffectiveRange;
202 float weaponRange;
203 float weaponEffectiveRange;
204 bool repairGun;
205 int actionUpdate;
206 int targetId;
207 float targetDistance;
208 int targetUpdate;
209 int samePosition;
210 Vector3 lastPos;
211 Vector3 moveLocation;
212 int repairTargetId;
213 GameObject *lastTarget;
214 GameObject *lastSecondaryTarget;
215 bool lastRepairTarget;
216 bool lastUseRepairGun;
217 int wanderPointGroup;
218 int randomResetAmount;
219 void Created(GameObject *obj);
220 void Enemy_Seen(GameObject *obj,GameObject *seen);
221 void Timer_Expired(GameObject *obj,int number);
222 void AttackTarget(GameObject *obj,GameObject *target,GameObject *secondaryTarget,bool repairTarget,bool useRepairGun);
223 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
224 void Damaged(GameObject *obj,GameObject *damager,float damage);
225 bool inRange(GameObject *obj);
226 inline bool Valid_Repair_Target(GameObject *obj,GameObject *target,int playerType);
227 inline bool Valid_Repair_Target_C4(GameObject *obj,GameObject *target,int playerType);
228 bool Get_Random_Wander_Point(Vector3 *position);
229};
239 void Custom(GameObject *obj,int message,int param,GameObject *sender);
240};
241class JmgUtility
242{
243public:
244 struct GenericDateTime
245 {
246 int month;
247 int day;
248 int year;
249 int hour;
250 int minute;
251 int second;
252 unsigned long lTime;
253 GenericDateTime(const GenericDateTime &dateTime)
254 {
255 this->month = dateTime.month;
256 this->day = dateTime.day;
257 this->year = dateTime.year;
258 this->hour = dateTime.hour;
259 this->minute = dateTime.minute;
260 this->second = dateTime.second;
261 this->lTime = dateTime.lTime;
262 }
263 GenericDateTime()
264 {
265 time_t theTime = time(0);
266 struct tm *timeinfo;
267 time(&theTime);
268 timeinfo = localtime(&theTime);
269 this->year = timeinfo->tm_year+1900;
270 this->month = timeinfo->tm_mon+1;
271 this->day = timeinfo->tm_mday;
272 this->hour = timeinfo->tm_hour;
273 this->minute = timeinfo->tm_min;
274 this->second = timeinfo->tm_sec;
275 this->lTime = (long)mktime(timeinfo);
276 }
277 void DebugTime()
278 {
279 char debug[220];
280 sprintf(debug,"msg %d/%d/%d %d:%02d:%02d {%lu}",month,day,year,hour,minute,second,lTime);
281 Console_Input(debug);
282 }
283 };
284 static bool IsInPathfindZone(Vector3 spot)
285 {
286 if (!Get_Random_Pathfind_Spot(spot,5.0f,&spot))
287 return false;
288 return true;
289 }
290 static void RotateZoneBox(float Angle,Matrix3 Basis)
291 {
292 Angle = Angle*3.14159265f/180.0f;
293 float Sin = sin(Angle);
294 float Cos = cos(Angle);
295 Basis[0][0] = Cos;Basis[0][1] = Sin;Basis[0][2] = 0.0f;
296 Basis[1][0] = Sin;Basis[1][1] = Cos;Basis[1][2] = 0.0f;
297 Basis[2][0] = 0.0f;Basis[2][1] = 0.0f;Basis[2][2] = 1.0f;
298 }
299 static float rotationClamp(float startRotation,float addRotation)
300 {
301 startRotation += addRotation;
302 while (startRotation > 180)
303 startRotation -= 360;
304 while (startRotation < -180)
305 startRotation += 360;
306 return startRotation;
307 }
308 static char *JMG_Get_Compass_Directions(float compassDegree)
309 {
310 static char name[6];
311 sprintf(name,"%s",compassDegree <= -168.75 ? "W":
312 compassDegree <= -146.25 ? "WSW":
313 compassDegree <= -123.75 ? "SW":
314 compassDegree <= -101.25 ? "SSW":
315 compassDegree <= -78.75 ? "S":
316 compassDegree <= -56.25 ? "SSE":
317 compassDegree <= -33.75 ? "SE":
318 compassDegree <= -11.25 ? "ESE":
319 compassDegree <= 11.25 ? "E":
320 compassDegree <= 33.75 ? "ENE":
321 compassDegree <= 56.25 ? "NE":
322 compassDegree <= 78.75 ? "NNE":
323 compassDegree <= 101.25 ? "N":
324 compassDegree <= 123.75 ? "NNW":
325 compassDegree <= 146.25 ? "NW":
326 compassDegree <= 168.75 ? "WNW":
327 compassDegree <= 180 ? "W" : "ERROR");
328 return name;
329 }
330 static char *formatDigitGrouping(double money)
331 {
332 static char groupedMoney[43];
333 if (abs(money) > 100000000000000000000000000.0)
334 {
335 sprintf(groupedMoney,"%.2lf",money);
336 return groupedMoney;
337 }
338 char sMoney[40],tMoney[53],fMoney[53];
339 sprintf(sMoney,"%.0lf",abs(money));
340 int length = strlen(sMoney),count = -1,pos;
341 pos = length+1+(length-1)/3;
342 tMoney[pos] = '\0';
343 for (int x = length;x >= 0;x--)
344 {
345 pos--;
346 tMoney[pos] = sMoney[x];
347 count++;
348 if (count == 3 && pos > 0)
349 {
350 count = 0;
351 pos--;
352 tMoney[pos] = ',';
353 }
354 }
355 if (money < 0)
356 sprintf(fMoney,"-%s",tMoney);
357 else
358 sprintf(fMoney,"%s",tMoney);
359
360 sprintf(sMoney,"%.2lf",abs(money));
361 int nLength = strlen(sMoney);
362 pos = strlen(fMoney);
363 for (int x = length;x < nLength;x++)
364 {
365 fMoney[pos] = sMoney[x];
366 pos++;
367 }
368 fMoney[pos] = '\0';
369 sprintf(groupedMoney,"%s",fMoney);
370 return groupedMoney;
371 }
372 static char *formatDigitGrouping(unsigned long value)
373 {
374 static char groupedMoney[43];
375 if (value > 10000000000000000000)
376 {
377 sprintf(groupedMoney,"%lu",value);
378 return groupedMoney;
379 }
380 char sValue[40],tValue[53],fValue[53];
381 sprintf(sValue,"%lu",value);
382 int length = strlen(sValue),count = -1,pos;
383 pos = length+1+(length-1)/3;
384 tValue[pos] = '\0';
385 for (int x = length;x >= 0;x--)
386 {
387 pos--;
388 tValue[pos] = sValue[x];
389 count++;
390 if (count == 3 && pos > 0)
391 {
392 count = 0;
393 pos--;
394 tValue[pos] = ',';
395 }
396 }
397 sprintf(fValue,"%s",tValue);
398
399 sprintf(groupedMoney,"%s",fValue);
400 return groupedMoney;
401 }
402 static char JMG_Get_Sex(GameObject *obj)
403 {
404 int TestID = Commands->Get_ID(obj);
405 if (!obj || !TestID)
406 return '\0';
407 if (!Get_Model(obj) || !_stricmp(Get_Model(obj),"null"))
408 return '\0';
409 if (!Get_Sex(obj))
410 return '\0';
411 return Get_Sex(obj);
412 }
413 static const char *JMG_Get_Units_Sex(GameObject *Unit)
414 {
415 if (JMG_Get_Sex(Unit) == 'A')
416 return "himself";
417 else if (JMG_Get_Sex(Unit) == 'B')
418 return "herself";
419 else
420 return "itself";
421 }
422 static const char *JMG_Get_Units_Sex2(GameObject *Unit)
423 {
424 if (JMG_Get_Sex(Unit) == 'A')
425 return "his";
426 else if (JMG_Get_Sex(Unit) == 'B')
427 return "her";
428 else
429 return "its";
430 }
431 static const char *JMG_Get_Units_Sex3(GameObject *Unit)
432 {
433 if (JMG_Get_Sex(Unit) == 'A')
434 return "he";
435 else if (JMG_Get_Sex(Unit) == 'B')
436 return "she";
437 else
438 return "it";
439 }
440 static char *AorAn(const char *name)
441 {
442 static char retChar[2];
443 if (strlen(name) == 0)
444 sprintf(retChar,"A");
445 else
446 {
447 if (name[0] == 'A' || name[0] == 'a' || name[0] == 'E' || name[0] == 'e' || name[0] == 'I' || name[0] == 'i' || name[0] == 'O' || name[0] == 'o' || name[0] == 'U' || name[0] == 'u' || name[0] == 'Y' || name[0] == 'y')
448 sprintf(retChar,"An");
449 else
450 sprintf(retChar,"A");
451 }
452 return retChar;
453 }
454 static char *AorAn2(const char *name)
455 {
456 static char retChar[2];
457 if (strlen(name) == 0)
458 sprintf(retChar,"a");
459 else
460 {
461 if (name[0] == 'A' || name[0] == 'a' || name[0] == 'E' || name[0] == 'e' || name[0] == 'I' || name[0] == 'i' || name[0] == 'O' || name[0] == 'o' || name[0] == 'U' || name[0] == 'u' || name[0] == 'Y' || name[0] == 'y')
462 sprintf(retChar,"an");
463 else
464 sprintf(retChar,"a");
465 }
466 return retChar;
467 }
468 static char *Get_The_Units_Name(GameObject *Unit)
469 {
470 static char RetChar[512];
471 if (Commands->Is_A_Star(Unit))
472 sprintf(RetChar,"%s",Get_Player_Name(Unit));
473 else
474 {
475 const char *name = Get_Translated_Preset_Name(Unit);
476 sprintf(RetChar,"%s %s",AorAn(name),name);
477 }
478 return RetChar;
479 }
480 static char *Get_The_Units_Name2(GameObject *Unit)
481 {
482 static char RetChar[512];
483 if (Commands->Is_A_Star(Unit))
484 sprintf(RetChar,"%s",Get_Player_Name(Unit));
485 else
486 {
487 const char *name = Get_Translated_Preset_Name(Unit);
488 sprintf(RetChar,"%s %s",AorAn2(name),Get_Translated_Preset_Name(Unit));
489 }
490 return RetChar;
491 }
492 static long JMG_Get_Player_ID(GameObject *obj)
493 {
494 if (!obj)
495 return 0;
496 SoldierGameObj *o = obj->As_SoldierGameObj();
497 if (!o)
498 return 0;
499 if (!((cPlayer *)o->Get_Player_Data()))
500 return 0;
501 return ((cPlayer *)o->Get_Player_Data())->Get_Id();
502 }
503 static int JMG_Get_Current_Weapon_ID(GameObject *obj)
504 {
505 if (!obj)
506 return -1;
507 PhysicalGameObj *o2 = obj->As_PhysicalGameObj();
508 if (!o2)
509 return -1;
510 ArmedGameObj *o3 = o2->As_ArmedGameObj();
511 if (!o3)
512 return -1;
513 WeaponBagClass *w = o3->Get_Weapon_Bag();
514 if ((w->Get_Index()) && (w->Get_Index() < w->Get_Count()))
515 return w->Peek_Weapon(w->Get_Index())->Get_ID();
516 return -1;
517 }
518 static float SimpleDistance(const Vector3 &Pos1,const Vector3 &Pos2)
519 {
520 float DiffX = Pos1.X-Pos2.X;
521 float DiffY = Pos1.Y-Pos2.Y;
522 float DiffZ = Pos1.Z-Pos2.Z;
523 return (DiffX*DiffX+DiffY*DiffY+DiffZ*DiffZ);
524 }
525 static float SimpleFlatDistance(const Vector3 &Pos1,const Vector3 &Pos2)
526 {
527 float DiffX = Pos1.X-Pos2.X;
528 float DiffY = Pos1.Y-Pos2.Y;
529 return (DiffX*DiffX+DiffY*DiffY);
530 }
531 static float MathClamp(float Value,float Min,float Max)
532 {
533 if (Value > Max)
534 return Max;
535 if (Value < Min)
536 return Min;
537 return Value;
538 }
539 static double MathClampDouble(double Value,double Min,double Max)
540 {
541 if (Value > Max)
542 return Max;
543 if (Value < Min)
544 return Min;
545 return Value;
546 }
547 static int MathClampInt(int Value,int Min,int Max)
548 {
549 if (Value > Max)
550 return Max;
551 if (Value < Min)
552 return Min;
553 return Value;
554 }
555 static void DisplayChatMessage(GameObject *obj,int Red,int Green,int Blue,const char *Message)
556 {
557 if (!obj)
558 return;
559 int Strlen = strlen(Message);
560 if (Strlen < 220)
561 {
562 Send_Message_Player(obj,Red,Green,Blue,Message);
563 return;
564 }
565 int x;
566 char msg[230];
567 for (x = 0;x < 220 && x < Strlen;x++)
568 msg[x] = Message[x];
569 msg[x] = '\0';
570 Send_Message_Player(obj,255,0,200,msg);
571 }
572 static void MessageAllPlayers(int Red,int Green,int Blue,const char *MSG)
573 {
574 for (int x = 0;x < 128;x++)
575 {
576 GameObject *Player = Get_GameObj(x);
577 if (!Player)
578 continue;
579 DisplayChatMessage(Player,Red,Green,Blue,MSG);
580 }
581 }
582 static void MessageTeamPlayers(int Red,int Green,int Blue,int Team,const char *MSG)
583 {
584 for (int x = 0;x < 128;x++)
585 {
586 GameObject *Player = Get_GameObj(x);
587 if (!Player || Get_Team(x) != Team)
588 continue;
589 DisplayChatMessage(Player,Red,Green,Blue,MSG);
590 }
591 }
592 static void MessageTeamPlayersType(int Red,int Green,int Blue,int Team,const char *MSG)
593 {
594 for (int x = 0;x < 128;x++)
595 {
596 GameObject *Player = Get_GameObj(x);
597 if (!Player || Commands->Get_Player_Type(Player) != Team)
598 continue;
599 DisplayChatMessage(Player,Red,Green,Blue,MSG);
600 }
601 }
602 static void MessageTeamPlayersAndType(int Red,int Green,int Blue,int Team,const char *MSG)
603 {
604 for (int x = 0;x < 128;x++)
605 {
606 GameObject *Player = Get_GameObj(x);
607 if (!Player || !(Commands->Get_Player_Type(Player) == Team || Get_Team(x) == Team))
608 continue;
609 DisplayChatMessage(Player,Red,Green,Blue,MSG);
610 }
611 }
612 static GameObject *FindNearestPlayer(const Vector3 &pos)
613 {
614 GameObject *nearestPlayer = NULL;
615 float nearest = -1.0f;
616 for (int x = 1;x < 128;x++)
617 {
618 GameObject *player = Get_GameObj(x);
619 if (!player || Get_Player_Type(player) == -4)
620 continue;
621 float tempDist = SimpleDistance(pos,Commands->Get_Position(player));
622 if (nearest < 0 || tempDist < nearest)
623 {
624 nearest = tempDist;
625 nearestPlayer = player;
626 }
627 }
628 return nearestPlayer;
629 }
630 static char *Rp2Encrypt(const char *String,int EncryptionFactor,int Start)
631 {
632 static char FinalString[65536];
633 sprintf(FinalString," ");
634 int loops = strlen(String),x = 0;
635 int CurrentAdd = Start;
636 while (x < loops)
637 {
638 if (String[x] > 31 && String[x] < 127)
639 {
640 int Temp = (String[x]+CurrentAdd);
641 while (Temp > 126)
642 Temp -= 95;
643 FinalString[x] = (char)Temp;
644 }
645 else
646 FinalString[x] = String[x];
647 x++;
648 CurrentAdd++;
649 if (CurrentAdd > EncryptionFactor)
650 CurrentAdd = 1;
651 FinalString[x] = '\0';
652 }
653 return FinalString;
654 }
655 static char *Rp2Encrypt2(const char *String,int EncryptionFactor,int Start)
656 {
657 static char FinalString[65536];
658 sprintf(FinalString," ");
659 int loops = strlen(String),x = 0;
660 int CurrentAdd = Start;
661 while (x < loops)
662 {
663 if (String[x] > 31 && String[x] < 127)
664 {
665 int Temp = (String[x]+CurrentAdd);
666 while (Temp > 126)
667 Temp -= 95;
668 FinalString[x] = (char)Temp;
669 }
670 else
671 FinalString[x] = String[x];
672 x++;
673 CurrentAdd++;
674 if (CurrentAdd > EncryptionFactor)
675 CurrentAdd = 1;
676 FinalString[x] = '\0';
677 }
678 return FinalString;
679 }
680 static char *Rp2Encrypt3(const char *String,int EncryptionFactor,int Start)
681 {
682 static char FinalString[65536];
683 sprintf(FinalString," ");
684 int loops = strlen(String),x = 0;
685 int CurrentAdd = Start;
686 while (x < loops)
687 {
688 if (String[x] > 31 && String[x] < 127)
689 {
690 int Temp = (String[x]+CurrentAdd);
691 while (Temp > 126)
692 Temp -= 95;
693 FinalString[x] = (char)Temp;
694 }
695 else
696 FinalString[x] = String[x];
697 x++;
698 CurrentAdd++;
699 if (CurrentAdd > EncryptionFactor)
700 CurrentAdd = 1;
701 FinalString[x] = '\0';
702 }
703 return FinalString;
704 }
705 static char *Rp2Encrypt4(const char *String,int EncryptionFactor,int Start)
706 {
707 static char FinalString[65536];
708 sprintf(FinalString," ");
709 int loops = strlen(String),x = 0;
710 int CurrentAdd = Start;
711 while (x < loops)
712 {
713 if (String[x] > 31 && String[x] < 127)
714 {
715 int Temp = (String[x]+CurrentAdd);
716 while (Temp > 126)
717 Temp -= 95;
718 FinalString[x] = (char)Temp;
719 }
720 else
721 FinalString[x] = String[x];
722 x++;
723 CurrentAdd++;
724 if (CurrentAdd > EncryptionFactor)
725 CurrentAdd = 1;
726 FinalString[x] = '\0';
727 }
728 return FinalString;
729 }
730 static char *Rp2Decrypt(const char *String,int EncryptionFactor,int Start)
731 {
732 static char FinalString[65536];
733 int loops = strlen(String),x = 0;
734 int CurrentAdd = Start;
735 while (x < loops)
736 {
737 if (String[x] > 31 && String[x] < 127)
738 {
739 int Temp = String[x]-CurrentAdd;
740 while (!(Temp > 31))
741 Temp += 95;
742 FinalString[x] = (char)Temp;
743 }
744 else
745 if (String[x] == '\n')
746 FinalString[x] = '\0';
747 else
748 FinalString[x] = String[x];
749 x++;
750 CurrentAdd++;
751 if (CurrentAdd > EncryptionFactor)
752 CurrentAdd = 1;
753 FinalString[x] = '\0';
754 }
755 return FinalString;
756 }
757 static bool IsTruePhysicalObject(GameObject *obj)
758 {
759 if (obj->As_ScriptableGameObj() && obj->As_PhysicalGameObj())
760 {
761 if (obj->As_SoldierGameObj())
762 return true;
763 if (obj->As_VehicleGameObj())
764 {
765 //TODO: asdfasdf
766 /*if (Is_DecorationPhys(obj))
767 return false;
768 if (Is_DynamicAnimPhys(obj))
769 return false;
770 if (Is_TimedDecorationPhys(obj))
771 return false;*/
772 return true;
773 }
774 }
775 return false;
776 }
777 static float MathClampDegrees(float Value)
778 {
779 while (Value < -180.0f)
780 return Value+360.0f;
781 while (Value > 180.0f)
782 return Value-360.0f;
783 return Value;
784 }
785 static bool hasStatedDeathMessage[128];
786 static void setStatedDeathMessage(int playerId,bool value)
787 {
788 hasStatedDeathMessage[playerId] = value;
789 }
790 static void JMG_Player_Death_Message(GameObject *obj,GameObject *killer,const char *overrideMessage)
791 {
792 int playerId = JMG_Get_Player_ID(obj);
793 if (hasStatedDeathMessage[playerId])
794 return;
795 char deathMsg[500];
796 if (overrideMessage)
797 sprintf(deathMsg,"%s",overrideMessage);
798 else if (!killer)
799 sprintf(deathMsg,"%s died",JmgUtility::Get_The_Units_Name(obj));
800 else if (killer == obj)
801 sprintf(deathMsg,"%s killed %s",JmgUtility::Get_The_Units_Name(obj),JmgUtility::JMG_Get_Units_Sex(obj));
802 else
803 sprintf(deathMsg,"%s killed %s",JmgUtility::Get_The_Units_Name(killer),JmgUtility::Get_The_Units_Name2(obj));
804 if (Commands->Is_A_Star(obj))
805 MessageAllPlayers(255,255,0,deathMsg);
806 hasStatedDeathMessage[playerId] = true;
807 }
808 static void SetHUDHelpText(unsigned long stringId,Vector3 color)
809 {
810 for (int x = 0;x < 128;x++)
811 {
812 GameObject *Player = Get_GameObj(x);
813 if (!Player)
814 continue;
815 Set_HUD_Help_Text_Player(Player,stringId,color);
816 }
817 }
818 static void SetHUDHelpText(unsigned long stringId,const char *message,Vector3 color)
819 {
820 for (int x = 0;x < 128;x++)
821 {
822 GameObject *Player = Get_GameObj(x);
823 if (!Player)
824 continue;
825 Set_HUD_Help_Text_Player_Text(Player,stringId,message,color);
826 }
827 }
828 static bool DegreeDiff(float Deg1,float Deg2,float MaxDiff)
829 {
830 if (abs(Deg1-Deg2) <= MaxDiff)
831 return true;
832 if (360-abs(Deg1-Deg2) <= MaxDiff)
833 return true;
834 return false;
835 }
836 static bool CanSeeStealth(int stealthModeOverride,GameObject *obj,GameObject *seen)
837 {
838 if (stealthModeOverride == -1)
839 return false;
840 if (!stealthModeOverride && seen->As_SmartGameObj() && seen->As_SmartGameObj()->Is_Stealthed())
841 {
842 float dist = JmgUtility::SimpleDistance(Commands->Get_Position(obj),Commands->Get_Position(seen));
843 if (seen->As_SoldierGameObj() && dist > seen->As_SoldierGameObj()->Get_Stealth_Fade_Distance()*seen->As_SoldierGameObj()->Get_Stealth_Fade_Distance())
844 return false;
845 else if (seen->As_VehicleGameObj() && dist > seen->As_VehicleGameObj()->Get_Stealth_Fade_Distance()*seen->As_VehicleGameObj()->Get_Stealth_Fade_Distance())
846 return false;
847 else if (dist > seen->As_SmartGameObj()->Get_Stealth_Fade_Distance()*seen->As_SmartGameObj()->Get_Stealth_Fade_Distance())
848 return false;
849 }
850 return true;
851 }
852 static void Create_2D_Wave_Sound_Dialog(const char *soundName)
853 {
854 for (int x = 1;x < 128;x++)
855 {
856 GameObject *player = Get_GameObj(x);
857 if (!player)
858 continue;
859 Create_2D_Wave_Sound_Dialog_Player(player,soundName);
860 }
861 }
862};
863
874 void Created(GameObject *obj);
875public:
876 int objectiveId;
877 int objectivePriority;
878 char preset[128];
879 bool attach;
880};
889 void Created(GameObject *obj);
890public:
891 int gameObjectId;
892 int markerId;
893};
894
895class NewObjectiveSystem
896{
897 bool objectiveStringIdsLoaded;
898 const char *objectiveNewString;
899 const char *objectiveCancelledString;
900 const char *objectiveStatusChangedString;
901 const char *objectivePrioritieStrings[12];
902 const char *objectiveStatusStrings[4];
903 const char *objectiveListString;
904 const char *objectiveUpdateObjectiveString;
905 const char *objectiveCancelledStringNumbered;
906 const char *objectiveStatusChangedStringNumbered;
907 const char *objectiveUpdateObjectiveStringNumbered;
908 char primaryObjectiveModel[32];
909 char secondaryObjectiveModel[32];
910 char tertiaryObjectiveModel[32];
911 bool showRadarStars;
912public:
913 enum Priority{Undefined=-1,Unknown,Primary,Secondary,Tertiary,Quaternary,Quinary,Senary,Septenary,Octonary,Nonary,Denary,Bonus};
914 enum Status{Removed=-2,NotDefined=-1,Pending,Accomplished,Failed,Hidden};
915 int controllerId;
916 char infantryAttachBone[32];
917 struct ObjectiveVisibleSettingOverride
918 {
919 int objectiveId;
920 char markerModel[16];
921 int markerColor;
922 char attachBone[16];
923 int overrideTextColor;
924 Vector3 textColor;
925 int overrideHudColor;
926 Vector3 hudColor;
927 ObjectiveVisibleSettingOverride(int objectiveId,const char *model,int markerColor,const char *attachBone,int overrideTextColor,Vector3 textColor,int overrideHudColor,Vector3 hudColor)
928 {
929 this->objectiveId = objectiveId;
930 sprintf(this->markerModel,"%s",model);
931 this->markerColor = markerColor;
932 sprintf(this->attachBone,"%s",attachBone);
933 this->overrideTextColor = overrideTextColor;
934 this->textColor = textColor;
935 this->overrideHudColor = overrideHudColor;
936 this->hudColor = hudColor;
937 }
938 static Vector3 DefaultRenegadeColors(int color)
939 {
940 switch (color)
941 {
942 case RADAR_BLIP_COLOR_NOD:return Vector3(200,0,0);
943 case RADAR_BLIP_COLOR_GDI:return Vector3(225,175,65);
944 case RADAR_BLIP_COLOR_NEUTRAL:return Vector3(225,225,240);
945 case RADAR_BLIP_COLOR_MUTANT:return Vector3(0,100,0);
946 case RADAR_BLIP_COLOR_RENEGADE:return Vector3(0,0,255);
947 case RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE:return Vector3(50,225,50);
948 case RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE:return Vector3(50,150,250);
949 case RADAR_BLIP_COLOR_TERTIARY_OBJECTIVE:return Vector3(150,50,150);
950 default:return Vector3(0,0,0);
951 }
952 }
953 };
954 SList<ObjectiveVisibleSettingOverride> overrideVisibleObjectiveSettings;
955private:
956 struct ObjectiveNode
957 {
958 int id;
959 Priority priority;
960 Status status;
961 unsigned long nameId;
962 char *soundFilename;
963 unsigned long descriptionId;
964 int radarMarkerId;
965 bool active;
966 int objectiveNumber;
967 ObjectiveNode *next;
968 ObjectiveNode(int id, Priority priority, Status status, unsigned long nameId, char *soundFilename, unsigned long descriptionId,int radarMarkerId,int objectiveNumber)
969 {
970 this->id = id;
971 this->priority = priority;
972 this->status = status;
973 this->nameId = nameId;
974 this->soundFilename = soundFilename;
975 this->descriptionId = descriptionId;
976 this->radarMarkerId = radarMarkerId;
977 this->active = true;
978 this->objectiveNumber = objectiveNumber;
979 next = NULL;
980 }
981 };
982 ObjectiveNode *objectiveNodeList;
983 int objectiveCounts;
984 int team;
985 void initilizeStringIds()
986 {
987 objectiveNewString = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_NEW_OBJ"));
988 objectiveCancelledString = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_CANCELLED"));
989 objectiveStatusChangedString = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_STATUS_CHANGED"));
990 objectiveListString = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_LIST"));
991 objectiveUpdateObjectiveString = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_UPDATED"));
992 char descriptionString[512];
993 for (int x = 0;x < 12;x++)
994 {
995 sprintf(descriptionString,"IDS_OBJ2_PRIORITY_%0d",x);
996 objectivePrioritieStrings[x] = Get_Translated_String(Get_String_ID_By_Desc(descriptionString));
997 }
998 for (int x = 0;x < 4;x++)
999 {
1000 sprintf(descriptionString,"IDS_OBJ2_STATE_%0d",x);
1001 objectiveStatusStrings[x] = Get_Translated_String(Get_String_ID_By_Desc(descriptionString));
1002 }
1003 objectiveCancelledStringNumbered = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_CANCELLED_NUMBERED"));
1004 objectiveStatusChangedStringNumbered = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_STATUS_CHANGED_NUMBERED"));
1005 objectiveUpdateObjectiveStringNumbered = Get_Translated_String(Get_String_ID_By_Desc("IDS_OBJ2_UPDATED_NUMBERED"));
1006 objectiveStringIdsLoaded = true;
1007 }
1008 void selectMessageAndColor(int objectiveId,const char *format,Priority priority)
1009 {
1010 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1011 if (overrideMarker && overrideMarker->overrideTextColor)
1012 if (overrideMarker->overrideTextColor == -1)
1013 {
1014 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1015 JmgUtility::MessageTeamPlayersAndType((int)color.X,(int)color.Y,(int)color.Z,team,format);
1016 }
1017 else
1018 JmgUtility::MessageTeamPlayersAndType((int)overrideMarker->textColor.X,(int)overrideMarker->textColor.Y,(int)overrideMarker->textColor.Z,team,format);
1019 else
1020 switch (priority)
1021 {
1022 case Primary: JmgUtility::MessageTeamPlayersAndType(50,255,50,team,format); break;
1023 case Secondary: JmgUtility::MessageTeamPlayersAndType(50,150,250,team,format); break;
1024 case Tertiary:case Unknown: JmgUtility::MessageTeamPlayersAndType(150,50,150,team,format); break;
1025 default: JmgUtility::MessageTeamPlayersAndType(125,150,150,team,format); break;
1026 }
1027 }
1028 void messagePlayerAndColor(int objectiveId,GameObject *player,const char *format,Priority priority)
1029 {
1030 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1031 if (overrideMarker && overrideMarker->overrideTextColor)
1032 if (overrideMarker->overrideTextColor == -1)
1033 {
1034 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1035 JmgUtility::DisplayChatMessage(player,(int)color.X,(int)color.Y,(int)color.Z,format);
1036 }
1037 else
1038 JmgUtility::DisplayChatMessage(player,(int)overrideMarker->textColor.X,(int)overrideMarker->textColor.Y,(int)overrideMarker->textColor.Z,format);
1039 else
1040 switch (priority)
1041 {
1042 case Primary: JmgUtility::DisplayChatMessage(player,50,255,50,format); break;
1043 case Secondary: JmgUtility::DisplayChatMessage(player,50,150,250,format); break;
1044 case Tertiary:case Unknown: JmgUtility::DisplayChatMessage(player,150,50,150,format); break;
1045 default: JmgUtility::DisplayChatMessage(player,125,150,150,format); break;
1046 }
1047 }
1048 void messagePlayerAndColorBasic(GameObject *player,const char *format,Priority priority)
1049 {
1050 switch (priority)
1051 {
1052 case Primary: JmgUtility::DisplayChatMessage(player,50,255,50,format); break;
1053 case Secondary: JmgUtility::DisplayChatMessage(player,50,150,250,format); break;
1054 case Tertiary:case Unknown: JmgUtility::DisplayChatMessage(player,150,50,150,format); break;
1055 default: JmgUtility::DisplayChatMessage(player,125,150,150,format); break;
1056 }
1057 }
1058 char *formatObjectiveString(const char *format,...)
1059 {
1060 static char displayMsg[256];
1061 va_list args;
1062 va_start(args,format);
1063 vsprintf(displayMsg,format,args);
1064 va_end(args);
1065 return displayMsg;
1066 }
1067 bool addObjective(int id, Priority priority, Status status, unsigned long nameId, char *soundFilename, unsigned long descriptionId,int radarMarkerId,int objectiveNumber)
1068 {
1069 if (priority == Undefined)
1070 return false;
1071 if (!objectiveStringIdsLoaded)
1072 initilizeStringIds();
1073 ObjectiveNode *current = objectiveNodeList;
1074 if (!objectiveNodeList)
1075 objectiveNodeList = new ObjectiveNode(id,priority,status,nameId,soundFilename,descriptionId,radarMarkerId,objectiveNumber);
1076 while (current)
1077 {
1078 if (current->id == id)
1079 if (current->active)
1080 {
1081 Destroy_Radar_Marker(current->radarMarkerId);
1082 return false;
1083 }
1084 else
1085 {
1086 Destroy_Radar_Marker(current->radarMarkerId);
1087 current->id = id;
1088 current->priority = priority;
1089 current->status = status;
1090 current->nameId = nameId;
1091 current->soundFilename = soundFilename;
1092 current->descriptionId = descriptionId;
1093 current->radarMarkerId = radarMarkerId;
1094 current->objectiveNumber = objectiveNumber;
1095 current->active = true;
1096 break;
1097 }
1098 if (!current->next)
1099 {
1100 current->next = new ObjectiveNode(id,priority,status,nameId,soundFilename,descriptionId,radarMarkerId,objectiveNumber);
1101 break;
1102 }
1103 current = current->next;
1104 }
1105 objectiveCounts++;
1106 if (status != Hidden && descriptionId)
1107 {
1108 selectMessageAndColor(id,formatObjectiveString(objectiveNewString,objectivePrioritieStrings[priority]),priority);
1109 if (objectiveNumber)
1110 selectMessageAndColor(id,formatObjectiveString(Get_Translated_String(descriptionId),objectiveNumber),priority);
1111 else
1112 selectMessageAndColor(id,Get_Translated_String(descriptionId),priority);
1113 }
1114 return true;
1115 }
1116 void Destroy_Radar_Marker(int markerId)
1117 {
1118 Destroy_Objective_GameObject(markerId);
1119 GameObject *marker = Commands->Find_Object(markerId);
1120 if (!marker)
1121 return;
1122 Commands->Destroy_Object(marker);
1123 }
1124 ObjectiveVisibleSettingOverride *FindOverrideForObjective(int objectiveId)
1125 {
1126 for (SLNode<ObjectiveVisibleSettingOverride> *node = overrideVisibleObjectiveSettings.Head();node;node = node->Next())
1127 if (node->Data() && node->Data()->objectiveId == objectiveId)
1128 return node->Data();
1129 return NULL;
1130 }
1131 GameObject *Create_Radar_Marker(Vector3 pos, Priority priority,int objectiveId)
1132 {
1133 GameObject *radarMarker = Commands->Create_Object("Daves Arrow",pos);
1134 Commands->Set_Player_Type(radarMarker,team);
1135 Commands->Set_Is_Visible(radarMarker,false);
1136 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1137 if (overrideMarker && _stricmp(overrideMarker->markerModel,""))
1138 Commands->Set_Model(radarMarker,overrideMarker->markerModel);
1139 else
1140 switch (priority)
1141 {
1142 case Priority::Primary:Commands->Set_Model(radarMarker,primaryObjectiveModel);break;
1143 case Priority::Secondary:Commands->Set_Model(radarMarker,secondaryObjectiveModel);break;
1144 case Priority::Tertiary:Commands->Set_Model(radarMarker,tertiaryObjectiveModel);break;
1145 default:Commands->Set_Model(radarMarker,"null");break;
1146 }
1147 if (showRadarStars)
1148 {
1149 Commands->Set_Obj_Radar_Blip_Shape(radarMarker,RADAR_BLIP_SHAPE_OBJECTIVE);
1150 if (overrideMarker && overrideMarker->markerColor != -1)
1151 Commands->Set_Obj_Radar_Blip_Color(radarMarker,overrideMarker->markerColor);
1152 else
1153 Commands->Set_Obj_Radar_Blip_Color(radarMarker,priority == Primary ? RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE : priority == Secondary ? RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE : RADAR_BLIP_COLOR_TERTIARY_OBJECTIVE);
1154 }
1155 Create_Objective_GameObject(radarMarker,objectiveId,priority,overrideMarker);
1156 return radarMarker;
1157 }
1158public:
1159 NewObjectiveSystem(int team,bool showRadarStars = true,const char *primaryObjectiveModel = "null",const char *secondaryObjectiveModel = "null",const char *tertiaryObjectiveModel = "null")
1160 {
1161 sprintf(infantryAttachBone,"c pelvis");
1162 this->team = team;
1163 objectiveStringIdsLoaded = false;
1164 objectiveCounts = 0;
1165 sprintf(this->primaryObjectiveModel,"%s",primaryObjectiveModel);
1166 sprintf(this->secondaryObjectiveModel,"%s",secondaryObjectiveModel);
1167 sprintf(this->tertiaryObjectiveModel,"%s",tertiaryObjectiveModel);
1168 this->showRadarStars = showRadarStars;
1169 objectiveNodeList = NULL;
1170 overrideVisibleObjectiveSettings.Remove_All();
1171 }
1172 ~NewObjectiveSystem()
1173 {
1174 objectiveStringIdsLoaded = false;
1175 objectiveCounts = 0;
1176 ObjectiveNode *temp = objectiveNodeList,*die;
1177 while (temp)
1178 {
1179 die = temp;
1180 temp = temp->next;
1181 delete die;
1182 }
1183 objectiveNodeList = NULL;
1184 }
1185 bool Add_Objective(int objectiveId, Priority priority, Status status, unsigned long nameId, char *soundFilename, unsigned long descriptionId,GameObject *blipUnit,int objectiveNumber = 0)
1186 {
1187 if (!blipUnit)
1188 return false;
1189 GameObject *radarMarker = Create_Radar_Marker(Commands->Get_Position(blipUnit),priority,objectiveId);
1190 if (!radarMarker)
1191 return false;
1192 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1193 if (overrideMarker && _stricmp(overrideMarker->attachBone,""))
1194 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,overrideMarker->attachBone);
1195 else
1196 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,blipUnit->As_SoldierGameObj() ? infantryAttachBone : "origin");
1197 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,Commands->Get_ID(radarMarker),objectiveNumber);
1198 }
1199 bool Add_Objective(int objectiveId, Priority priority, Status status, unsigned long nameId, char *soundFilename, unsigned long descriptionId,Vector3 blipPosition,int objectiveNumber = 0)
1200 {
1201 GameObject *radarMarker = Create_Radar_Marker(blipPosition,priority,objectiveId);
1202 if (!radarMarker)
1203 return false;
1204 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,Commands->Get_ID(radarMarker),objectiveNumber);
1205 }
1206 bool Get_Radar_Blip_Position(int objectiveId,Vector3 *position)
1207 {
1208 ObjectiveNode *current = objectiveNodeList;
1209 while (current)
1210 {
1211 if (current->id == objectiveId)
1212 {
1213 GameObject *objectiveMarker = Commands->Find_Object(current->radarMarkerId);
1214 if (objectiveMarker)
1215 {
1216 *position = Commands->Get_Position(objectiveMarker);
1217 return true;
1218 }
1219 return false;
1220 }
1221 current = current->next;
1222 }
1223 return false;
1224 }
1225 void Set_Radar_Blip(int objectiveId,GameObject *blipUnit,const char *modelOverride = NULL)
1226 {
1227 if (!blipUnit)
1228 return;
1229 ObjectiveNode *current = objectiveNodeList;
1230 while (current)
1231 {
1232 if (current->id == objectiveId)
1233 {
1234 Destroy_Radar_Marker(current->radarMarkerId);
1235 GameObject *radarMarker = Create_Radar_Marker(Commands->Get_Position(blipUnit),current->priority,objectiveId);
1236 if (!radarMarker)
1237 return;
1238 Commands->Attach_To_Object_Bone(radarMarker,blipUnit,blipUnit->As_SoldierGameObj() ? infantryAttachBone : "origin");
1239 current->radarMarkerId = Commands->Get_ID(radarMarker);
1240 return;
1241 }
1242 current = current->next;
1243 }
1244 }
1245 void Remove_Radar_Blip(int objectiveId)
1246 {
1247 ObjectiveNode *current = objectiveNodeList;
1248 while (current)
1249 {
1250 if (current->id == objectiveId)
1251 {
1252 Destroy_Radar_Marker(current->radarMarkerId);
1253 return;
1254 }
1255 current = current->next;
1256 }
1257 }
1258 void Set_Radar_Blip(int objectiveId,Vector3 blipPosition,const char *modelOverride = NULL)
1259 {
1260 ObjectiveNode *current = objectiveNodeList;
1261 while (current)
1262 {
1263 if (current->id == objectiveId)
1264 {
1265 Destroy_Radar_Marker(current->radarMarkerId);
1266 GameObject *radarMarker = Create_Radar_Marker(blipPosition,current->priority,objectiveId);
1267 if (!radarMarker)
1268 return;
1269 current->radarMarkerId = Commands->Get_ID(radarMarker);
1270 return;
1271 }
1272 current = current->next;
1273 }
1274 }
1275 bool Add_Objective(int objectiveId, Priority priority, Status status, unsigned long nameId, char *soundFilename, unsigned long descriptionId,int objectiveNumber = 0)
1276 {
1277 return addObjective(objectiveId,priority,status,nameId,soundFilename,descriptionId,0,objectiveNumber);
1278 }
1279 long Get_Mission_Text_Id(int objectiveId)
1280 {
1281 ObjectiveNode *current = objectiveNodeList;
1282 while (current)
1283 {
1284 if (current->id == objectiveId)
1285 return current->nameId;
1286 current = current->next;
1287 }
1288 return 0;
1289 }
1290 bool Remove_Objective(int objectiveId)
1291 {
1292 ObjectiveNode *current = objectiveNodeList;
1293 while (current)
1294 {
1295 if (current->id == objectiveId)
1296 if (current->active)
1297 {
1298 objectiveCounts--;
1299 if (current->status == Pending && current->nameId)
1300 if (current->objectiveNumber)
1301 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveCancelledStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber),current->priority);
1302 else
1303 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveCancelledString,objectivePrioritieStrings[current->priority]),current->priority);
1304 Destroy_Radar_Marker(current->radarMarkerId);
1305 current->active = false;
1306 return true;
1307 }
1308 else
1309 return false;
1310 current = current->next;
1311 }
1312 return true;
1313 }
1314 bool Set_Objective_Status(int objectiveId,Status status)
1315 {
1316 ObjectiveNode *current = objectiveNodeList;
1317 while (current)
1318 {
1319 if (current->id == objectiveId)
1320 if (current->status != status)
1321 {
1322 if (status != Hidden && current->status != Hidden && current->nameId)
1323 if (current->objectiveNumber)
1324 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveStatusChangedStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber,objectiveStatusStrings[status]),current->priority);
1325 else
1326 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveStatusChangedString,objectivePrioritieStrings[current->priority],objectiveStatusStrings[status]),current->priority);
1327 GameObject *marker = Commands->Find_Object(current->radarMarkerId);
1328 if (marker)
1329 {
1330 if (status == Pending)
1331 {
1332 Commands->Set_Is_Rendered(marker,true);
1333 if (showRadarStars)
1334 Commands->Set_Obj_Radar_Blip_Shape(marker,RADAR_BLIP_SHAPE_OBJECTIVE);
1335 }
1336 else
1337 {
1338 Commands->Set_Is_Rendered(marker,false);
1339 if (showRadarStars)
1340 Commands->Set_Obj_Radar_Blip_Shape(marker,RADAR_BLIP_SHAPE_NONE);
1341 }
1342 Commands->Set_Player_Type(marker,status == Pending);
1343 }
1344 current->status = status;
1345 return true;
1346 }
1347 else
1348 return false;
1349 current = current->next;
1350 }
1351 return true;
1352 }
1353 bool Set_Objective_Mission(int objectiveId,unsigned int nameStringId,unsigned int descriptionStringId)
1354 {
1355 ObjectiveNode *current = objectiveNodeList;
1356 while (current)
1357 {
1358 if (current->id == objectiveId)
1359 if (current->nameId != nameStringId || current->descriptionId != descriptionStringId)
1360 {
1361 current->nameId = nameStringId;
1362 current->descriptionId = descriptionStringId;
1363 if (current->status != Hidden && descriptionStringId)
1364 {
1365 if (current->objectiveNumber)
1366 {
1367 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveUpdateObjectiveStringNumbered,objectivePrioritieStrings[current->priority],current->objectiveNumber),current->priority);
1368 selectMessageAndColor(objectiveId,formatObjectiveString(Get_Translated_String(descriptionStringId),current->objectiveNumber),current->priority);
1369 }
1370 else
1371 {
1372 selectMessageAndColor(objectiveId,formatObjectiveString(objectiveUpdateObjectiveString,objectivePrioritieStrings[current->priority]),current->priority);
1373 selectMessageAndColor(objectiveId,Get_Translated_String(descriptionStringId),current->priority);
1374 }
1375 }
1376 return true;
1377 }
1378 else
1379 return false;
1380 current = current->next;
1381 }
1382 return true;
1383 }
1384 Status Get_Objective_Status(int objectiveId)
1385 {
1386 ObjectiveNode *current = objectiveNodeList;
1387 while (current)
1388 {
1389 if (current->id == objectiveId)
1390 if (current->active)
1391 return current->status;
1392 else
1393 return Removed;
1394 current = current->next;
1395 }
1396 return NotDefined;
1397 }
1398 Priority Get_Objective_Priority(int objectiveId)
1399 {
1400 ObjectiveNode *current = objectiveNodeList;
1401 while (current)
1402 {
1403 if (current->id == objectiveId)
1404 return current->priority;
1405 current = current->next;
1406 }
1407 return Undefined;
1408 }
1409 int Get_Objective_Status_Count(Status status,Priority requiredPriority = Undefined)
1410 {
1411 int count = 0;
1412 ObjectiveNode *current = objectiveNodeList;
1413 while (current)
1414 {
1415 if (current->active && current->status == status && (requiredPriority == Undefined || current->priority == requiredPriority))
1416 count++;
1417 current = current->next;
1418 }
1419 return count;
1420 }
1421 int Get_Objective_Priority_Count(Priority requiredPriority,Status status = NotDefined)
1422 {
1423 int count = 0;
1424 ObjectiveNode *current = objectiveNodeList;
1425 while (current)
1426 {
1427 if (current->active && current->priority == requiredPriority && (status == NotDefined || current->status == status))
1428 count++;
1429 current = current->next;
1430 }
1431 return count;
1432 }
1433 void Dispaly_First_Pending_Primary_Objective_On_Hud(GameObject *obj)
1434 {
1435 ObjectiveNode *current = objectiveNodeList;
1436 while (current)
1437 {
1438 if (current->active && current->status == Pending && current->priority == Priority::Primary && current->nameId)
1439 {
1440 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(current->id);
1441 if (overrideMarker && overrideMarker->overrideHudColor)
1442 if (overrideMarker->overrideHudColor == -1)
1443 {
1444 Vector3 color = ObjectiveVisibleSettingOverride::DefaultRenegadeColors(overrideMarker->markerColor);
1445 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(color.X/255.0f,color.Y/255.0f,color.Z/255.0f));
1446 }
1447 else
1448 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(overrideMarker->hudColor.X/255.0f,overrideMarker->hudColor.Y/255.0f,overrideMarker->hudColor.Z/255.0f));
1449 else
1450 Set_HUD_Help_Text_Player(obj,current->nameId,Vector3(0,1,0));
1451 return;
1452 }
1453 current = current->next;
1454 }
1455 }
1456 void Display_Current_Objectives(GameObject *player,Priority priority)
1457 {
1458 messagePlayerAndColorBasic(player,formatObjectiveString(objectiveListString,objectivePrioritieStrings[priority]),priority);
1459 ObjectiveNode *current = objectiveNodeList;
1460 while (current)
1461 {
1462 if (current->active && current->status == Pending && current->priority == priority && current->nameId)
1463 {
1464 char objectiveMsg[220];
1465 if (current->objectiveNumber)
1466 sprintf(objectiveMsg,"*%s",formatObjectiveString(Get_Translated_String(current->nameId),current->objectiveNumber));
1467 else
1468 sprintf(objectiveMsg,"*%s",Get_Translated_String(current->nameId));
1469 messagePlayerAndColor(current->id,player,objectiveMsg,priority);
1470 }
1471 current = current->next;
1472 }
1473 }
1474 void Display_All_Objectives(GameObject *player)
1475 {
1476 int counts[12];
1477 for (int x = 0;x < 12;x++)
1478 counts[x] = Get_Objective_Status_Count(Pending,(Priority)x);
1479 for (int x = 0;x < 12;x++)
1480 if (counts[x])
1481 Display_Current_Objectives(player,(Priority)x);
1482 }
1483 int Get_First_Pending_Objective_Of_Priority(Priority priority)
1484 {
1485 ObjectiveNode *current = objectiveNodeList;
1486 while (current)
1487 {
1488 if (current->active && current->status == Pending && current->priority == priority && current->nameId)
1489 return current->id;
1490 current = current->next;
1491 }
1492 return 0;
1493 }
1494 Vector3 Get_Hud_Help_Text_Color(int objectiveId,Priority priority)
1495 {
1496 ObjectiveVisibleSettingOverride *overrideMarker = FindOverrideForObjective(objectiveId);
1497 if (overrideMarker && overrideMarker->overrideHudColor)
1498 return Vector3(overrideMarker->hudColor.X/255.0f,overrideMarker->hudColor.Y/255.0f,overrideMarker->hudColor.Z/255.0f);
1499 switch (priority)
1500 {
1501 case Priority::Primary:
1502 return Vector3(0.196f,0.882f,0.196f);
1503 case Priority::Secondary:
1504 return Vector3(0.196f,0.588f,0.98f);
1505 case Priority::Tertiary:
1506 return Vector3(0.588f,0.196f,0.588f);
1507 default:
1508 return Vector3(1.0f,1.0f,1.0f);
1509 }
1510 }
1511 void Create_Objective_GameObject(GameObject *radarMarker,int objectiveId,int objectivePriority,ObjectiveVisibleSettingOverride *overrideMarker)
1512 {
1513 GameObject *obj = Commands->Find_Object(controllerId);
1514 if (!obj)
1515 return;
1516 const SimpleDynVecClass<GameObjObserverClass *> & observer_list = obj->Get_Observers();
1517 for(int index = 0;index < observer_list.Count();index++)
1518 if (!_stricmp(observer_list[index]->Get_Name(),"JMG_Utility_Objective_System_Objective_GameObject"))
1519 {
1521 if (script && (script->objectiveId == objectiveId || script->objectiveId == -2) && (script->objectivePriority == objectivePriority || script->objectivePriority == -2))
1522 {
1523 GameObject *object = Commands->Create_Object(script->preset,Commands->Get_Position(radarMarker));
1524 if (script->attach)
1525 if (overrideMarker && _stricmp(overrideMarker->attachBone,""))
1526 Commands->Attach_To_Object_Bone(object,radarMarker,overrideMarker->attachBone);
1527 else
1528 Commands->Attach_To_Object_Bone(object,radarMarker,"origin");
1529 char params[128];
1530 sprintf(params,"%d,%d",Commands->Get_ID(object),Commands->Get_ID(radarMarker));
1531 Commands->Attach_Script(obj,"JMG_Utility_Objective_System_Objective_GameObject_Tracker",params);
1532 }
1533 }
1534 }
1535 void Destroy_Objective_GameObject(int markerId)
1536 {
1537 GameObject *obj = Commands->Find_Object(controllerId);
1538 if (!obj)
1539 return;
1540 const SimpleDynVecClass<GameObjObserverClass *> & observer_list = obj->Get_Observers();
1541 for(int index = 0;index < observer_list.Count();index++)
1542 if (!_stricmp(observer_list[index]->Get_Name(),"JMG_Utility_Objective_System_Objective_GameObject_Tracker"))
1543 {
1545 if (script && script->markerId == markerId)
1546 {
1547 GameObject *object = Commands->Find_Object(script->gameObjectId);
1548 if (object)
1549 Commands->Destroy_Object(object);
1550 script->Destroy_Script();
1551 }
1552 }
1553 }
1554 bool Check_If_All_Objectives_Are_Complete(int objectiveIds[],int count)
1555 {
1556 for (int x = 0;x < count;x++)
1557 {
1558 if (Get_Objective_Status(objectiveIds[x]) != Status::Accomplished)
1559 return false;
1560 }
1561 return true;
1562 }
1563 GameObject *GetObjectiveMarker(int objectiveMarkerId,GameObject *sender,int objectiveId);
1564 void OverrideObjectiveVisibilitySettings(int objectiveId,const char *model,int markerColor,const char *attachBone,int overrideTextColor,Vector3 textColor,int overrideHudColor,Vector3 hudColor)
1565 {
1566 ObjectiveVisibleSettingOverride *overrideObject = new ObjectiveVisibleSettingOverride(objectiveId,model,markerColor,attachBone,overrideTextColor,textColor,overrideHudColor,hudColor);
1567 overrideVisibleObjectiveSettings.Add_Tail(overrideObject);
1568 }
1569};
1570
1571class ClientNetworkObjectPositionSync
1572{
1573public:
1574 struct SyncObjectNode
1575 {
1576 int id;
1577 float facing;
1578 Vector3 position;
1579 struct SyncObjectNode *next;
1580 SyncObjectNode(GameObject *obj)
1581 {
1582 this->id = Commands->Get_ID(obj);
1583 this->facing = Commands->Get_Facing(obj);
1584 this->position = Commands->Get_Position(obj);
1585 this->next = NULL;
1586 }
1587
1588 };
1589private:
1590 SyncObjectNode *syncObjectNodeList;
1591 struct SyncControl
1592 {
1593 bool syncedPlayers[128];
1594 SyncObjectNode *lastSyncNode[128];
1595 SyncControl()
1596 {
1597 for (int x = 0;x < 128;x++)
1598 {
1599 syncedPlayers[x] = false;
1600 lastSyncNode[x] = NULL;
1601 }
1602 }
1603 void clientNoLongerSynced(int playerId)
1604 {
1605 syncedPlayers[playerId] = false;
1606 lastSyncNode[playerId] = NULL;
1607 }
1608 };
1609 SyncControl syncControl;
1610public:
1611 ClientNetworkObjectPositionSync()
1612 {
1613 syncObjectNodeList = NULL;
1614 syncControl = SyncControl();
1615 }
1616 SyncObjectNode *addNode(GameObject *obj)
1617 {
1618 int id = Commands->Get_ID(obj);
1619 SyncObjectNode *current = syncObjectNodeList;
1620 if (!syncObjectNodeList)
1621 return syncObjectNodeList = new SyncObjectNode(obj);
1622 while (current)
1623 {
1624 if (!current->id)
1625 {
1626 current->id = id;
1627 current->facing = Commands->Get_Facing(obj);
1628 current->position = Commands->Get_Position(obj);
1629 return current;
1630 }
1631 if (current->id == id)
1632 return current;
1633 if (!current->next)
1634 {
1635 current->next = new SyncObjectNode(obj);
1636 return current->next;
1637 }
1638 current = current->next;
1639 }
1640 return NULL;
1641 };
1642 void checkForPlayersThatLeftTheGame()
1643 {
1644 for (int x = 1;x < 128;x++)
1645 {
1646 GameObject *player = Get_GameObj(x);
1647 if (!player)
1648 syncControl.clientNoLongerSynced(x);
1649 }
1650 }
1651 void triggerSingleNetworkSync()
1652 {
1653 for (int x = 1;x < 128;x++)
1654 {
1655 if (syncControl.syncedPlayers[x])
1656 continue;
1657 GameObject *player = Get_GameObj(x);
1658 if (!player)
1659 continue;
1660 if (!syncControl.lastSyncNode[x])
1661 syncControl.lastSyncNode[x] = syncObjectNodeList;
1662 if (syncControl.lastSyncNode[x])
1663 {
1664 if (syncControl.lastSyncNode[x]->id)
1665 {
1666 GameObject *syncObject = Commands->Find_Object(syncControl.lastSyncNode[x]->id);
1667 if (syncObject)
1668 {
1669 Force_Position_Update_Player(player,syncObject);
1670 Force_Orientation_Update_Player(player,syncObject);
1671 }
1672 }
1673 syncControl.lastSyncNode[x] = syncControl.lastSyncNode[x]->next;
1674 }
1675 if (!syncControl.lastSyncNode[x])
1676 syncControl.syncedPlayers[x] = true;
1677 }
1678 }
1679 void Empty_List()
1680 {
1681 SyncObjectNode *temp = syncObjectNodeList,*die;
1682 while (temp)
1683 {
1684 die = temp;
1685 temp = temp->next;
1686 delete die;
1687 }
1688 syncObjectNodeList = NULL;
1689 syncControl = SyncControl();
1690 }
1691};
1692
1693class Rp2SimplePositionSystem
1694{
1695public:
1696 struct SimplePositionNode
1697 {
1698 int id;
1699 float facing;
1700 Vector3 position;
1701 int value;
1702 struct SimplePositionNode *next;
1703 SimplePositionNode(GameObject *obj,int value = 0)
1704 {
1705 this->id = Commands->Get_ID(obj);
1706 this->facing = Commands->Get_Facing(obj);
1707 this->position = Commands->Get_Position(obj);
1708 this->value = value;
1709 this->next = NULL;
1710 }
1711 };
1712 SimplePositionNode *SimplePositionNodeList;
1713 int ObjectCount;
1714 Rp2SimplePositionSystem()
1715 {
1716 ObjectCount = 0;
1717 SimplePositionNodeList = NULL;
1718 }
1719 Rp2SimplePositionSystem &operator += (GameObject *obj)
1720 {
1721 int id = Commands->Get_ID(obj);
1722 SimplePositionNode *Current = SimplePositionNodeList;
1723 if (!SimplePositionNodeList)
1724 SimplePositionNodeList = new SimplePositionNode(obj);
1725 while (Current)
1726 {
1727 if (Current->id == id)
1728 return *this;
1729 if (!Current->next)
1730 {
1731 Current->next = new SimplePositionNode(obj);
1732 break;
1733 }
1734 Current = Current->next;
1735 }
1736 ObjectCount++;
1737 return *this;
1738 };
1739 Rp2SimplePositionSystem &operator += (SimplePositionNode *node)
1740 {
1741 SimplePositionNode *Current = SimplePositionNodeList;
1742 if (!SimplePositionNodeList)
1743 SimplePositionNodeList = node;
1744 while (Current)
1745 {
1746 if (Current->id == node->id)
1747 return *this;
1748 if (!Current->next)
1749 {
1750 Current->next = node;
1751 break;
1752 }
1753 Current = Current->next;
1754 }
1755 ObjectCount++;
1756 return *this;
1757 };
1758 void Empty_List()
1759 {
1760 ObjectCount = 0;
1761 SimplePositionNode *temp,*die;
1762 temp = SimplePositionNodeList;
1763 while (temp)
1764 {
1765 die = temp;
1766 temp = temp->next;
1767 delete die;
1768 }
1769 SimplePositionNodeList = NULL;
1770 }
1771 SimplePositionNode *GetRandomFromGroup(int value)
1772 {
1773 int random = Commands->Get_Random_Int(0,ObjectCount*2),original;
1774 original = random;
1775 SimplePositionNode *Current = SimplePositionNodeList;
1776 while (Current)
1777 {
1778 if (random && value == Current->value)
1779 random--;
1780 if (!random && value == Current->value)
1781 return Current;
1782 Current = Current->next;
1783 if (!Current && original != random && original)
1784 Current = SimplePositionNodeList;
1785 }
1786 return NULL;
1787 }
1788 SimplePositionNode *GetNextFromGroup(int value,SimplePositionNode *last)
1789 {
1790 bool found = false;
1791 SimplePositionNode *Current = SimplePositionNodeList;
1792 while (Current)
1793 {
1794 if (found && value == Current->value)
1795 return Current;
1796 if (Current == last && value == Current->value)
1797 found = true;
1798 Current = Current->next;
1799 if (!Current)
1800 Current = SimplePositionNodeList;
1801 }
1802 return NULL;
1803 }
1804 SimplePositionNode *GetRandom()
1805 {
1806 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1807 SimplePositionNode *Current = SimplePositionNodeList;
1808 while (Current)
1809 {
1810 if (random)
1811 random--;
1812 if (!random)
1813 return Current;
1814 Current = Current->next;
1815 if (!Current)
1816 Current = SimplePositionNodeList;
1817 }
1818 return NULL;
1819 }
1820 SimplePositionNode *GetNearest(Vector3 pos)
1821 {
1822 float LongestDistance = 0;
1823 SimplePositionNode *TempObject = NULL;
1824 SimplePositionNode *Current = SimplePositionNodeList;
1825 while (Current)
1826 {
1827 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1828 if (!TempObject || Temp < LongestDistance)
1829 {
1830 TempObject = Current;
1831 LongestDistance = Temp;
1832 }
1833 Current = Current->next;
1834 }
1835 return TempObject;
1836 }
1837 SimplePositionNode *GetNearestFromGroup(int groupId,Vector3 pos)
1838 {
1839 float LongestDistance = 0;
1840 SimplePositionNode *TempObject = NULL;
1841 SimplePositionNode *Current = SimplePositionNodeList;
1842 while (Current)
1843 {
1844 if (Current->value == groupId)
1845 {
1846 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1847 if (!TempObject || Temp < LongestDistance)
1848 {
1849 TempObject = Current;
1850 LongestDistance = Temp;
1851 }
1852 }
1853 Current = Current->next;
1854 }
1855 return TempObject;
1856 }
1857 Vector3 GetNearestVector(Vector3 pos)
1858 {
1859 SimplePositionNode *TempObject = GetNearest(pos);
1860 if (TempObject)
1861 return TempObject->position;
1862 return Vector3();
1863 }
1864 SimplePositionNode *GetNearestFlat(Vector3 pos)
1865 {
1866 float LongestDistance = 0;
1867 SimplePositionNode *TempObject = NULL;
1868 SimplePositionNode *Current = SimplePositionNodeList;
1869 while (Current)
1870 {
1871 float Temp = JmgUtility::SimpleFlatDistance(Current->position,pos);
1872 if (!TempObject || Temp < LongestDistance)
1873 {
1874 TempObject = Current;
1875 LongestDistance = Temp;
1876 }
1877 Current = Current->next;
1878 }
1879 return TempObject;
1880 }
1881 SimplePositionNode *GetRandom(int minVal)
1882 {
1883 int repeatLimit = ObjectCount;
1884 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1885 SimplePositionNode *Current = SimplePositionNodeList;
1886 while (Current)
1887 {
1888 if (random && Current->value <= minVal)
1889 random--;
1890 if (!random && Current->value <= minVal)
1891 return Current;
1892 Current = Current->next;
1893 if (!Current && repeatLimit)
1894 {
1895 repeatLimit--;
1896 Current = SimplePositionNodeList;
1897 }
1898 }
1899 return NULL;
1900 }
1901 SimplePositionNode *GetRandomExcluding(SimplePositionNode *node)
1902 {
1903 int repeatLimit = ObjectCount;
1904 int random = Commands->Get_Random_Int(0,ObjectCount*2);
1905 SimplePositionNode *Current = SimplePositionNodeList;
1906 while (Current)
1907 {
1908 if (random)
1909 random--;
1910 if (!random && node != Current)
1911 return Current;
1912 Current = Current->next;
1913 if (!Current && repeatLimit)
1914 {
1915 repeatLimit--;
1916 Current = SimplePositionNodeList;
1917 }
1918 }
1919 return NULL;
1920 }
1921 SimplePositionNode *GetRandomLowestValue()
1922 {
1923 int lowest = -1;
1924 SimplePositionNode *current = SimplePositionNodeList;
1925 while (current)
1926 {
1927 if (lowest == -1 || current->value <= lowest)
1928 lowest = current->value;
1929 current = current->next;
1930 }
1931 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1932 int originalRandom = random;
1933 current = SimplePositionNodeList;
1934 while (current)
1935 {
1936 if (random && current->value == lowest)
1937 random--;
1938 if (!random)
1939 return current;
1940 current = current->next;
1941 if (!current && originalRandom != random)
1942 current = SimplePositionNodeList;
1943 }
1944 return NULL;
1945 }
1946 SimplePositionNode *GetRandomOutsideOfRange(float range,Vector3 pos)
1947 {
1948 range *= range;
1949 SimplePositionNode *current = SimplePositionNodeList;
1950 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1951 int originalRandom = random;
1952 while (current)
1953 {
1954 if (JmgUtility::SimpleDistance(current->position,pos) > range && random)
1955 random--;
1956 if (!random)
1957 return current;
1958 current = current->next;
1959 if (!current && originalRandom != random)
1960 current = SimplePositionNodeList;
1961 }
1962 return NULL;
1963 }
1964 SimplePositionNode *GetRandomOutsideOfRangeInGroup(int value,float range,Vector3 pos)
1965 {
1966 range *= range;
1967 SimplePositionNode *current = SimplePositionNodeList;
1968 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
1969 int originalRandom = random;
1970 while (current)
1971 {
1972 if (current->value == value && JmgUtility::SimpleDistance(current->position,pos) > range && random)
1973 random--;
1974 if (current->value == value && !random)
1975 return current;
1976 current = current->next;
1977 if (!current && originalRandom != random)
1978 current = SimplePositionNodeList;
1979 }
1980 return NULL;
1981 }
1982 SimplePositionNode *GetFurthestInGroup(int value,Vector3 pos)
1983 {
1984 float LongestDistance = 0;
1985 SimplePositionNode *TempObject = NULL;
1986 SimplePositionNode *Current = SimplePositionNodeList;
1987 while (Current)
1988 {
1989 if (Current->value == value)
1990 {
1991 float Temp = JmgUtility::SimpleDistance(Current->position,pos);
1992 if (!TempObject || Temp > LongestDistance)
1993 {
1994 TempObject = Current;
1995 LongestDistance = Temp;
1996 }
1997 }
1998 Current = Current->next;
1999 }
2000 return TempObject;
2001 }
2002 SimplePositionNode *GetRandomInsideOfRangeInGroup(int value,float range,Vector3 pos)
2003 {
2004 range *= range;
2005 SimplePositionNode *current = SimplePositionNodeList;
2006 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
2007 int originalRandom = random;
2008 while (current)
2009 {
2010 if (current->value == value && JmgUtility::SimpleDistance(current->position,pos) <= range && random)
2011 random--;
2012 if (value && !random)
2013 return current;
2014 current = current->next;
2015 if (!current && originalRandom != random)
2016 current = SimplePositionNodeList;
2017 }
2018 return NULL;
2019 }
2020 SimplePositionNode *GetLowestValueFurthestFromSpot(Vector3 pos)
2021 {
2022 int lowest = -1;
2023 SimplePositionNode *current = SimplePositionNodeList,*bestNode = NULL;
2024 while (current)
2025 {
2026 if (lowest == -1 || current->value <= lowest)
2027 lowest = current->value;
2028 current = current->next;
2029 }
2030
2031 current = SimplePositionNodeList;
2032 float dist = 0;
2033 while (current)
2034 {
2035 float tempDist = JmgUtility::SimpleDistance(pos,current->position);
2036 if (!bestNode || tempDist > dist)
2037 {
2038 bestNode = current;
2039 dist = tempDist;
2040 }
2041 current = current->next;
2042 }
2043 return bestNode;
2044 }
2045 SimplePositionNode *GetSpotNotVisibileFromSpot(Vector3 pos);
2046 SimplePositionNode *GetNonVisibleSpotFromPlayers(int value);
2047 SimplePositionNode *GetFurthestSpotFromPlayers(int value)
2048 {
2049 SimplePositionNode *current = SimplePositionNodeList,*bestNode = NULL;
2050 float dist = 0;
2051 while (current)
2052 {
2053 if (current->value == value)
2054 {
2055 GameObject *player = Commands->Get_A_Star(current->position);
2056 if (!player)
2057 continue;
2058 float tempDist = JmgUtility::SimpleDistance(Commands->Get_Position(player),current->position);
2059 if (!bestNode || tempDist > dist)
2060 {
2061 bestNode = current;
2062 dist = tempDist;
2063 }
2064 }
2065 current = current->next;
2066 }
2067 return bestNode;
2068 }
2069 void DecreaseValue()
2070 {
2071 SimplePositionNode *Current = SimplePositionNodeList;
2072 while (Current)
2073 {
2074 if (Current->value)
2075 Current->value--;
2076 Current = Current->next;
2077 }
2078 }
2079 void ChangeAllWanderPointGroupIdsThatMatch(int changeId,int newId)
2080 {
2081 SimplePositionNode *current = SimplePositionNodeList;
2082 while (current)
2083 {
2084 if (changeId == current->value)
2085 current->value = newId;
2086 current = current->next;
2087 }
2088 }
2089 void ChangeAllWanderPointGroupIdsThatMatchAndAreInRange(int changeId,Vector3 pos,float range,int newId)
2090 {
2091 float rangeSq = range*range;
2092 SimplePositionNode *current = SimplePositionNodeList;
2093 while (current)
2094 {
2095 if (changeId == current->value)
2096 {
2097 float tempDist = JmgUtility::SimpleDistance(pos,current->position);
2098 if (tempDist <= rangeSq)
2099 current->value = newId;
2100 }
2101 current = current->next;
2102 }
2103 }
2104};
2110class JMG_Utility_Sync_System_Object : public ScriptImpClass
2111{
2112 ClientNetworkObjectPositionSync::SyncObjectNode *syncNode;
2113 void Created(GameObject *obj);
2114 void Timer_Expired(GameObject *obj,int number);
2115 void Killed(GameObject *obj,GameObject *killer);
2116 void Destroyed(GameObject *obj);
2117 void Detach(GameObject *obj);
2118public:
2120 {
2121 syncNode = NULL;
2122 }
2123};
2124
2131class JMG_Utility_Sync_System_Controller : public ScriptImpClass
2132{
2133 void Created(GameObject *obj);
2134 void Timer_Expired(GameObject *obj,int number);
2135 void Destroyed(GameObject *obj);
2136 void Detach(GameObject *obj);
2137public:
2139};
2140
2147class JMG_Utility_Sync_Object_Periodically : public ScriptImpClass
2148{
2149 void Created(GameObject *obj);
2150 void Timer_Expired(GameObject *obj,int number);
2151};
2152
2166class JMG_Utility_Basic_Spawner : public ScriptImpClass
2167{
2168 int spawnLimit;
2169 int spawnedId;
2170 bool enabled;
2171 float respawnTime;
2172 int attachScriptsGroupId;
2173 void Created(GameObject *obj);
2174 void Timer_Expired(GameObject *obj,int number);
2175 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2176 void CalculateRespawnTime();
2177public:
2178 static Vector3 preSpawnLocation;
2179};
2180
2181class JMG_Utility_Basic_Spawner_Spawned_Object : public ScriptImpClass
2182{
2183 void Destroyed(GameObject *obj);
2184};
2185
2186struct JMGVehicleAction
2187{
2188 int targetId;
2189 Vector3 position;
2190 int useAmmo;
2191 bool backward;
2192 bool following;
2193 float arriveDistance;
2194 JMGVehicleAction()
2195 {
2196 targetId = 0;
2197 useAmmo = 0;
2198 position = Vector3();
2199 backward = false;
2200 following = false;
2201 arriveDistance = 0.0f;
2202 }
2203 bool operator == (JMGVehicleAction jva)
2204 {
2205 return (targetId == jva.targetId && position == jva.position && useAmmo == jva.useAmmo);
2206 }
2207 bool operator != (JMGVehicleAction jva)
2208 {
2209 return (!(*this == jva));
2210 }
2211 JMGVehicleAction &operator = (JMGVehicleAction jva)
2212 {
2213 targetId = jva.targetId;
2214 useAmmo = jva.useAmmo;
2215 position = jva.position;
2216 backward = jva.backward;
2217 following = jva.following;
2218 arriveDistance = jva.arriveDistance;
2219 return *this;
2220 }
2221};
2222
2223
2250class JMG_Utility_AI_Vehicle : public ScriptImpClass {
2251 struct JMGVehicleAmmo
2252 {
2253 bool allowError;
2254 float range;
2255 float speed;
2256 JMGVehicleAmmo()
2257 {
2258 allowError = false;
2259 range = 0.0f;
2260 speed = 400.0f;
2261 }
2262 };
2263 JMGVehicleAmmo primary;
2264 JMGVehicleAmmo secondary;
2265 JMGVehicleAction currentAction;
2266 JMGVehicleAction lastAction;
2267 bool overrideFireMode;
2268 bool overridePrimary;
2269 int retreatTime;
2270 int lastSeenCount;
2271 int reverseTime;
2272 int stuckCount;
2273 int useAmmo;
2274 int doNotUsePathfind;
2275 float lastHealth;
2276 float minDistanceSquared;
2277 bool moving;
2278 bool attacking;
2279 int badDestAttempt;
2280 Vector3 mypos;
2281 Vector3 homepos;
2282 Vector3 retreatPos;
2283 int myteam;
2284 bool inRange;
2285 bool drivingBackward;
2286 bool firstRetreat;
2287 float maxHuntRangeSquared;
2288 Vector3 lastWanderPointSpot;
2289 float grabNextPointDistance;
2290 float retreatDistanceSquared;
2291 void Created(GameObject *obj);
2292 void Action_Complete(GameObject *obj,int action,ActionCompleteReason reason);
2293 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2294 void Enemy_Seen(GameObject *obj,GameObject *seen);
2295 void Damaged(GameObject *obj,GameObject *damager,float damage);
2296 void Timer_Expired(GameObject *obj,int number);
2297 void RunAttack(GameObject *obj,GameObject *target);
2298 int GetThreatRating(GameObject * obj);
2299 GameObject *GetAttackObject(GameObject * obj);
2300 GameObject *SelectTarget(GameObject *obj,GameObject *target);
2301 GameObject *SetTarget(GameObject *target);
2302 GameObject *GetClosest(GameObject *obj,GameObject *new_target,GameObject *old_target);
2303 int SelectAmmo(GameObject *target);
2304 void StuckCheck(GameObject *obj);
2305 void ReturnHome(GameObject * obj);
2306 void AttackMove(GameObject *obj,GameObject *target,bool followTarget,Vector3 targetLocation,int fireMode,float weaponError,bool forceUpdate,float arriveDistance);
2307 JMGVehicleAmmo DefineAmmo(const AmmoDefinitionClass *ammo);
2308 bool GetRandomPosition(Vector3 *position);
2309 bool GetRandomPositionOutsideOfRange(Vector3 *position);
2310};
2311
2312class DynamicClockSystem
2313{
2314public:
2315 struct DynamicClockSystemNode
2316 {
2317 int clockId;
2318 GameObject *clock;
2319 bool alarmSet;
2320 int alarmHour;
2321 int alarmMinute;
2322 int alarmSounding;
2323 struct DynamicClockSystemNode *next;
2324 DynamicClockSystemNode(GameObject *obj)
2325 {
2326 clockId = Commands->Get_ID(obj);
2327 clock = obj;
2328 alarmSet = false;
2329 alarmHour = 12;
2330 alarmMinute = 0;
2331 alarmSounding = 0;
2332 next = NULL;
2333 }
2334 };
2335private:
2336 bool HasLoaded;
2337 struct DynamicClockSystemNode *DynamicClockSystemNodeList;
2338public:
2339 DynamicClockSystem()
2340 {
2341 HasLoaded = false;
2342 DynamicClockSystemNodeList = NULL;
2343 }
2344 DynamicClockSystem &operator += (GameObject *obj)
2345 {
2346 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2347 if (!DynamicClockSystemNodeList)
2348 DynamicClockSystemNodeList = new DynamicClockSystemNode(obj);
2349 while (Current)
2350 {
2351 if (Current->clock == obj)
2352 return *this;
2353 if (!Current->clock)
2354 {
2355 Current->clockId = Commands->Get_ID(obj);
2356 Current->clock = obj;
2357 return *this;
2358 }
2359 if (!Current->next)
2360 {
2361 Current->next = new DynamicClockSystemNode(obj);
2362 return *this;
2363 }
2364 Current = Current->next;
2365 }
2366 return *this;
2367 }
2368 DynamicClockSystem &operator -= (GameObject *obj)
2369 {
2370 if (!DynamicClockSystemNodeList)
2371 return *this;
2372 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2373 while (Current)
2374 {
2375 if (Current->clock == obj)
2376 {
2377 Current->clock = NULL;
2378 break;
2379 }
2380 Current = Current->next;
2381 }
2382 return *this;
2383 }
2384 void emptyList()
2385 {
2386 HasLoaded = false;
2387 DynamicClockSystemNode *temp,*die;
2388 temp = DynamicClockSystemNodeList;
2389 while (temp)
2390 {
2391 die = temp;
2392 temp = temp->next;
2393 delete die;
2394 }
2395 DynamicClockSystemNodeList = NULL;
2396 }
2397 inline void updateClocks()
2398 {
2399 time_t t = time(0);
2400 struct tm *ptm = localtime(&t);
2401 int curTime = ptm->tm_hour%24;
2402 curTime = (curTime < 0 ? curTime+24 : curTime);
2403 float frame = (curTime*60.0f+ptm->tm_min);
2404 DynamicClockSystemNode *Current = DynamicClockSystemNodeList;
2405 while (Current)
2406 {
2407 if (Current->clock)
2408 Commands->Set_Animation(Current->clock,"s_ecwClock.a_ecwClock",false,0,frame,frame,true);
2409 Current = Current->next;
2410 }
2411 }
2412};
2413class JMG_Utility_Dynamic_Clock_Control : public ScriptImpClass {
2414 int lastMinute;
2415 void Created(GameObject *obj);
2416 void Timer_Expired(GameObject *obj,int number);
2417 void Destroyed(GameObject *obj);
2418 int getMinute();
2419};
2420
2421class JMG_Utility_Dynamic_Clock_Object : public ScriptImpClass {
2422 int animSynced[128];
2423 void Created(GameObject *obj);
2424 void Timer_Expired(GameObject *obj,int number);
2425 void Destroyed(GameObject *obj);
2426};
2427
2438 void Entered(GameObject *obj,GameObject *enterer);
2439 void Exited(GameObject *obj,GameObject *exiter);
2440};
2441
2448{
2449 void Destroyed(GameObject *obj);
2450};
2451
2458class JMG_Utility_Play_Music_On_Join_Controller : public ScriptImpClass {
2459 bool playingMusic[128];
2460 void Created(GameObject *obj);
2461 void Timer_Expired(GameObject *obj,int number);
2462 void Destroyed(GameObject *obj);
2463 void Detach(GameObject *obj);
2464 static char musicFileName[256];
2465public:
2466 static bool controllerPlaced;
2467 SCRIPTS_API static void Set_Music(const char *musicFilName,int fadeOut,int fadeIn);
2468};
2469
2478class JMG_Utility_Play_Music_On_Join_Change_Music : public ScriptImpClass {
2479 void Created(GameObject *obj);
2480};
2481
2513class JMG_Utility_Toggle_Door : public ScriptImpClass {
2514 float preDamagedFrame;
2515 char originalModel[16];
2516 bool open;
2517 bool enabled;
2518 void Created(GameObject *obj);
2519 void Poked(GameObject *obj,GameObject *poker);
2520 void Damaged(GameObject *obj,GameObject *damager,float damage);
2521 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2522 void SendCustom(GameObject *obj,int param);
2523};
2524
2532class JMG_Utility_Set_Animation_Frame_On_Creation : public ScriptImpClass {
2533 void Created(GameObject *obj);
2534};
2535
2545 int damageState;
2546 float healthThresholds[3];
2547 void Created(GameObject *obj);
2548 void Damaged(GameObject *obj,GameObject *damager,float damage);
2549 void SetModel(GameObject *obj);
2550};
2551
2562 int damageState;
2563 float healthThresholds[4];
2564 void Created(GameObject *obj);
2565 void Damaged(GameObject *obj,GameObject *damager,float damage);
2566 void SetModel(GameObject *obj);
2567};
2568
2574class JMG_Utility_PCT : public ScriptImpClass {
2575 void Created(GameObject *obj);
2576 void Poked(GameObject *obj, GameObject *poker);
2577public:
2578 static int pctInaccessible[128];
2579};
2580
2586class JMG_Utility_PCT_Inaccessible_Zone : public ScriptImpClass {
2587 void Entered(GameObject *obj,GameObject *enterer);
2588 void Exited(GameObject *obj,GameObject *exiter);
2589};
2590
2596class JMG_Utility_PCT_Inaccessible_Zone_Attach : public ScriptImpClass {
2597 void Destroyed(GameObject *obj);
2598};
2609 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2610};
2611
2621 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2622};
2623
2631class JMG_Utility_Set_Team_On_Create : public ScriptImpClass {
2632 void Created(GameObject *obj);
2633 void Timer_Expired(GameObject *obj,int number);
2634};
2635
2650class JMG_Utility_AI_Aggressive_Melee : public ScriptImpClass {
2651 float noPathfindRange;
2652 int LastSeen;
2653 int lastSeenSecondary;
2654 int currentTargetID;
2655 int secondaryTargetId;
2656 int huntorattack;
2657 int waitcount;
2658 Vector3 homelocation;
2659 float speed;
2660 int minVisibilityTime;
2661 int maxVisibilityTime;
2662 float maxHuntDistance;
2663 Vector3 lastPos;
2664 int stuckTime;
2665 void Created(GameObject *obj);
2666 void Timer_Expired(GameObject *obj,int number);
2667 void Enemy_Seen(GameObject *obj,GameObject *seen);
2668 void Damaged(GameObject *obj,GameObject *damager,float damage);
2669 bool chooseTarget(GameObject *obj,GameObject *damager,int *compareId,int *seenTimer);
2670};
2671
2696 bool canRegen;
2697 int previewObjectId;
2698 int placementBlocked;
2699 int reloadTime;
2700 void Created(GameObject *obj);
2701 void Timer_Expired(GameObject *obj,int number);
2702 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2703 void Killed(GameObject *obj,GameObject *killer);
2704 void Destroyed(GameObject *obj);
2705 void DestroyPreview();
2706public:
2708 {
2709 placementBlocked = 0;
2710 }
2711};
2712class JMG_Utility_Infantry_Placed_Buildable_Object_Attached : public ScriptImpClass {
2713 void Damaged(GameObject *obj,GameObject *damager,float damage);
2714 void Killed(GameObject *obj,GameObject *killer);
2715};
2716
2717
2725 void Created(GameObject *obj);
2726 void Timer_Expired(GameObject *obj,int number);
2727};
2728
2735 void Created(GameObject *obj);
2736};
2749class JMG_Utility_Swimming_Zone : public ScriptImpClass {
2750 void Created(GameObject *obj);
2751 void Entered(GameObject *obj,GameObject *enter);
2752 void Exited(GameObject *obj,GameObject *exiter);
2753public:
2754 struct PlayerWaterNode
2755 {
2756 Vector3 waterColor;
2757 float waterColorOpacity;
2758 float waterMinViewDistance;
2759 float waterMaxViewDistance;
2760 PlayerWaterNode()
2761 {
2762 this->waterColor = Vector3(0.28f,0.43f,0.55f);
2763 this->waterColorOpacity = 0.5f;
2764 this->waterMinViewDistance = 5.0f;
2765 this->waterMaxViewDistance = 15.0f;
2766 }
2767 PlayerWaterNode(Vector3 waterColor,float waterColorOpacity,float waterMinViewDistance,float waterMaxViewDistance)
2768 {
2769 this->waterColor = waterColor;
2770 this->waterColorOpacity = waterColorOpacity;
2771 this->waterMinViewDistance = waterMinViewDistance;
2772 this->waterMaxViewDistance = waterMaxViewDistance;
2773 }
2774 };
2775 static JMG_Utility_Swimming_Zone::PlayerWaterNode waterNode[128];
2776 static float fogMinDistance;
2777 static float fogMaxDistance;
2778 SCRIPTS_API static void Update_Fog_Settings(float minFog,float maxFog);
2779};
2780
2806class JMG_Utility_Swimming_Infantry : public ScriptImpClass {
2807 int heartBeatSoundId;
2808 int pantSoundId;
2809 char enterWeapon[256];
2810 int playerId;
2811 bool startedFadeRed;
2812 float drownTime;
2813 bool underwater;
2814 int waterZoneCount;
2815 int lastWaterZoneId;
2816 time_t lastDisplayTime;
2817 float defaultSpeed;
2818 int waterDamageDelayTime;
2819 int waterDamageDelayTimeRecover;
2820 int remainingWaterDamageDelay;
2821 char originalSkin[128];
2822 char originalArmor[128];
2823 char originalModel[128];
2824 void Created(GameObject *obj);
2825 void Timer_Expired(GameObject *obj,int number);
2826 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2827 void Killed(GameObject *obj,GameObject *killer);
2828 void Destroyed(GameObject *obj);
2829 void Detach(GameObject *obj);
2830 void CreateSoundEmitter(GameObject *obj,const char *model,int *soundId);
2831 void DestroySoundEmitter(int *soundId);
2832 void HideSoundEmitter(int *soundId);
2833public:
2834 static bool isUnderwater[128];
2835 static bool isInWater[128];
2836 static bool getInWater(int playerId){return isUnderwater[playerId];}
2837 static bool getIsUnderwater(int playerId){return isInWater[playerId];}
2838};
2839
2850class JMG_Utility_Zone_Enable_Spawners_In_Range : public ScriptImpClass {
2851 void Entered(GameObject *obj,GameObject *enterer);
2852};
2853
2866 bool hasShownMessage[128];
2867 void Created(GameObject *obj);
2868 void Custom(GameObject *obj,int message,int param,GameObject *sender);
2869};
2870
2882class JMG_Utility_Zone_Apply_Damage_On_Enter : public ScriptImpClass {
2883 void Entered(GameObject *obj,GameObject *enter);
2884};
2885
2896class JMG_Utility_AI_Guardian_Aircraft : public ScriptImpClass {
2897 float fireRange;
2898 Vector3 dpPosition;
2899 int EnemyID;
2900 int EnemyTimeOutTime;
2901 Vector3 LastPos;
2902 int stealthModeOverride;
2903 int newPointDelay;
2904 int remainingDelay;
2905 void Created(GameObject *obj);
2906 void Timer_Expired(GameObject *obj,int number);
2907 void Enemy_Seen(GameObject *obj,GameObject *seen);
2908 void Damaged(GameObject *obj,GameObject *damager,float damage);
2909 void Goto_Location(GameObject *obj);
2910 bool Get_A_Defense_Point(Vector3 *position);
2911};
2912
2930 void Created(GameObject *obj);
2931 void Timer_Expired(GameObject *obj,int number);
2932};
2933
2946class JMG_Utility_Send_Custom_When_Near_Building : public ScriptImpClass {
2947 bool nearBuilding;
2948 void Created(GameObject *obj);
2949 void Timer_Expired(GameObject *obj,int number);
2950};
2951
2957class JMG_Utility_AI_Engineer_Repair_Target : public ScriptImpClass {
2958 void Created(GameObject *obj);
2959};
2960
2961class JMG_Utility_Reset_Screen_Fade_And_Fog_On_Destroy : public ScriptImpClass {
2962 void Destroyed(GameObject *obj);
2963 void Detach(GameObject *obj);
2964};
2965
2996class JMG_Utility_AI_Goto_Player : public ScriptImpClass {
2997 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
2998 struct LastAction
2999 {
3000 int targetId;
3001 Vector3 location;
3002 float speed;
3003 float distance;
3004 bool attack;
3005 bool overrideLocation;
3006 LastAction()
3007 {
3008 }
3009 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation)
3010 {
3011 this->targetId = targetId;
3012 this->location = location;
3013 this->speed = speed;
3014 this->distance = distance;
3015 this->attack = attack;
3016 this->overrideLocation = overrideLocation;
3017 }
3018 };
3019 struct ValidLastLocation
3020 {
3021 bool valid;
3022 Vector3 location;
3023 ValidLastLocation(bool valid)
3024 {
3025 this->valid = valid;
3026 }
3027 ValidLastLocation(int enemyId);
3028 };
3029 float maxSightFromHomeLocation;
3030 LastAction lastAction;
3031 aiState state;
3032 Vector3 homeLocation;
3033 bool huntStealth;
3034 int targetId;
3035 int lastSeenTime;
3036 float weaponRange;
3037 float weaponEffectiveRange;
3038 int huntingStarId;
3039 int ignoreStarsTime[128];
3040 float huntSearchDistance;
3041 float huntArriveDistance;
3042 float attackArriveDistance;
3043 int stuckTime;
3044 int reverseTime;
3045 Vector3 lastPosition;
3046 bool moveBackward;
3047 float wanderDistanceOverride;
3048 int wanderingAiGroupId;
3049 float wanderSpeed;
3050 float huntSpeed;
3051 float attackSpeed;
3052 float returnHomeSpeed;
3053 int changeWanderGroupCustom;
3054 int changeWanderSpeedCustom;
3055 int changeHuntDistanceCustom;
3056 int changeReturnHomeSpeedCustom;
3057 int changeHuntSpeedCustom;
3058 int changeMaxSightFromHomeLocationCustom;
3059 int changeAttackSpeedCustom;
3060 void Created(GameObject *obj);
3061 void Enemy_Seen(GameObject *obj,GameObject *seen);
3062 void Timer_Expired(GameObject *obj,int number);
3063 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
3064 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3065 void Damaged(GameObject *obj,GameObject *damager,float damage);
3066 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation);
3067 GameObject *findClosestStar(GameObject *obj);
3068 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
3069 void Stuck_Check(GameObject *obj,Vector3 targetPos);
3070 void Cant_Get_To_target(GameObject *obj);
3071 bool GetRandomPosition(Vector3 *position);
3072 bool Choose_Target(GameObject *obj,GameObject *target);
3073};
3074
3075class AggressiveAttackSpotSystem
3076{
3077public:
3078 struct AggressiveAttackSpotNode
3079 {
3080 int id;
3081 Vector3 position;
3082 Vector3 attackOffset;
3083 bool alive;
3084 int groupId;
3085 struct AggressiveAttackSpotNode *next;
3086 AggressiveAttackSpotNode(GameObject *obj,int groupId,Vector3 attackOffset)
3087 {
3088 this->id = Commands->Get_ID(obj);
3089 this->position = Commands->Get_Position(obj);
3090 this->attackOffset = attackOffset;
3091 this->alive = true;
3092 this->groupId = groupId;
3093 this->next = NULL;
3094 }
3095 };
3096private:
3097 int nodeCount;
3098 AggressiveAttackSpotNode *aggressiveAttackSpotNodeList;
3099public:
3100 AggressiveAttackSpotSystem()
3101 {
3102 nodeCount = 0;
3103 aggressiveAttackSpotNodeList = NULL;
3104 }
3105 AggressiveAttackSpotNode *addNode(GameObject *obj,int groupId,Vector3 attackOffset)
3106 {
3107 int id = Commands->Get_ID(obj);
3108 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3109 nodeCount++;
3110 if (!aggressiveAttackSpotNodeList)
3111 return aggressiveAttackSpotNodeList = new AggressiveAttackSpotNode(obj,groupId,attackOffset);
3112 while (current)
3113 {
3114 if (current->id == id)
3115 {
3116 nodeCount--;
3117 return current;
3118 }
3119 if (!current->next)
3120 {
3121 current->next = new AggressiveAttackSpotNode(obj,groupId,attackOffset);
3122 return current->next;
3123 }
3124 current = current->next;
3125 }
3126 return NULL;
3127 }
3128 void killNode(GameObject *obj)
3129 {
3130 int id = Commands->Get_ID(obj);
3131 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3132 while (current)
3133 {
3134 if (current->id == id)
3135 current->alive = false;
3136 current = current->next;
3137 }
3138 }
3139 AggressiveAttackSpotNode *GetRandomNode(int groupId)
3140 {
3141 if (The_Game()->Is_Game_Over())
3142 return NULL;
3143 int lastCount = -1;
3144 int random = nodeCount > 0 ? Commands->Get_Random_Int(0,nodeCount*2) : 0;
3145 AggressiveAttackSpotNode *current = aggressiveAttackSpotNodeList;
3146 while (current)
3147 {
3148 if (current->alive && (groupId == -1 || current->groupId == groupId))
3149 {
3150 if (random)
3151 random--;
3152 if (!random)
3153 return current;
3154 }
3155 current = current->next;
3156 if (!current && lastCount != random)
3157 {
3158 lastCount = random;
3159 current = aggressiveAttackSpotNodeList;
3160 }
3161 }
3162 return NULL;
3163 }
3164 void Empty_List()
3165 {
3166 nodeCount = 0;
3167 AggressiveAttackSpotNode *temp = aggressiveAttackSpotNodeList,*die;
3168 while (temp)
3169 {
3170 die = temp;
3171 temp = temp->next;
3172 delete die;
3173 }
3174 aggressiveAttackSpotNodeList = NULL;
3175 }
3176};
3177
3184{
3185 void Created(GameObject *obj);
3186 void Destroyed(GameObject *obj);
3187};
3188
3197{
3198 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
3199 void Created(GameObject *obj);
3200 void Timer_Expired(GameObject *obj,int number);
3201 void Killed(GameObject *obj,GameObject *killer);
3202 void Destroyed(GameObject *obj);
3203public:
3205 {
3206 node = NULL;
3207 }
3208};
3209
3219{
3220 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
3221 void Created(GameObject *obj);
3222 void Timer_Expired(GameObject *obj,int number);
3223 void Destroyed(GameObject *obj);
3224public:
3226 {
3227 node = NULL;
3228 }
3229};
3230
3251class JMG_Utility_AI_Aggressive_Attack_Spot : public ScriptImpClass {
3252 enum aiState{IDLE,ATTACKING_POINT,RETURNING_HOME,ATTACKING_ATTACKER,ACTION_BADPATH};
3253 struct LastAction
3254 {
3255 int targetId;
3256 Vector3 location;
3257 float speed;
3258 float distance;
3259 bool attack;
3260 bool overrideLocation;
3261 bool attackingPoint;
3262 LastAction()
3263 {
3264 }
3265 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation,bool attackingPoint)
3266 {
3267 this->targetId = targetId;
3268 this->location = location;
3269 this->speed = speed;
3270 this->distance = distance;
3271 this->attack = attack;
3272 this->overrideLocation = overrideLocation;
3273 this->attackingPoint = attackingPoint;
3274 }
3275 };
3276 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *attackNode;
3277 LastAction lastAction;
3278 aiState state;
3279 Vector3 homeLocation;
3280 int targetId;
3281 int lastSeenTime;
3282 float weaponRange;
3283 float weaponEffectiveRange;
3284 float attackArriveDistance;
3285 float attackPointArriveDistance;
3286 int stuckTime;
3287 int reverseTime;
3288 bool reactToAttackChance;
3289 Vector3 lastPosition;
3290 bool moveBackward;
3291 bool usePrimaryFire;
3292 void Created(GameObject *obj);
3293 void Enemy_Seen(GameObject *obj,GameObject *seen);
3294 void Timer_Expired(GameObject *obj,int number);
3295 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
3296 void Damaged(GameObject *obj,GameObject *damager,float damage);
3297 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation,bool attackingPoint);
3298 void Stuck_Check(GameObject *obj,Vector3 targetPos);
3299 void IdleChoice(GameObject *obj,bool allowAttackPoint);
3300 bool Choose_Target(GameObject *obj,GameObject *target);
3301public:
3303 {
3304 attackNode = NULL;
3305 }
3306};
3307
3308class JMG_Utility_Destroy_Objects_In_ID_Range_On_Death : public ScriptImpClass
3309{
3310 void Destroyed(GameObject *obj);
3311};
3312
3322class JMG_Utility_Custom_Enable_Spawners_In_Range : public ScriptImpClass {
3323 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3324};
3325
3339class JMG_Utility_Send_Custom_On_Player_Count : public ScriptImpClass
3340{
3341 int custom;
3342 int param;
3343 float delay;
3344 int id;
3345 bool supressMatchSpam;
3346 Vector3 triggerEq;
3347 int playerCountParam;
3348 int playerCount;
3349 bool conditionMatching;
3350 bool destroyAfterTrigger;
3351 void Created(GameObject *obj);
3352 void Timer_Expired(GameObject *obj,int number);
3353 void Send_The_Message(GameObject *obj,int tempCount);
3354};
3355
3367 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3368};
3369
3379class JMG_Utility_Basic_Spawner_Attach_Script : public ScriptImpClass {
3380 int scriptsGroupId;
3381 char *params;
3382 char script[128];
3383 void Created(GameObject *obj);
3384 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3385};
3386
3397class JMG_Utility_Send_Custom_On_Preset_Enter : public ScriptImpClass {
3398 void Entered(GameObject *obj,GameObject *enter);
3399};
3400
3408{
3409 void Created(GameObject *obj);
3410 void Destroyed(GameObject *obj);
3411};
3412
3413
3422class JMG_Utility_Teleport_On_Pickup : public ScriptImpClass {
3423 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3424};
3425
3438class JMG_Utility_Zone_Set_Animation : public ScriptImpClass {
3439 void Entered(GameObject *obj,GameObject *enter);
3440};
3441
3448class JMG_Utility_Scale_Infantry : public ScriptImpClass
3449{
3450 void Created(GameObject *obj);
3451};
3452
3459class JMG_Utility_Set_Innate_On_Create : public ScriptImpClass
3460{
3461 void Created(GameObject *obj);
3462 void Timer_Expired(GameObject *obj,int number);
3463};
3464
3472{
3473 void Created(GameObject *obj);
3474};
3475
3487 void Entered(GameObject *obj,GameObject *enter);
3488};
3489
3499 void Killed(GameObject *obj,GameObject *killer);
3500};
3501
3542class JMG_Utility_Objective_System_Controller : public ScriptImpClass
3543{
3544 char playerNames[128][256];
3545 void Created(GameObject *obj);
3546 void Timer_Expired(GameObject *obj,int number);
3547 void Destroyed(GameObject *obj);
3548 void Detach(GameObject *obj);
3549public:
3550 static bool controllerPlaced;
3551};
3552
3565 bool triggered;
3566 void Entered(GameObject *obj,GameObject *enter);
3567 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3568public:
3570 {
3571 triggered = false;
3572 }
3573};
3574
3587 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3588};
3589
3602 void Killed(GameObject *obj, GameObject *damager);
3603};
3604
3605
3618 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3619};
3620
3629class JMG_Utility_Destroyed_Apply_Damage : public ScriptImpClass {
3630 void Destroyed(GameObject *obj);
3631};
3632
3641class JMG_Utility_Scale_Damage_By_Player_Count : public ScriptImpClass
3642{
3643 int maxPlayersToScaleFor;
3644 float maxScaleFactor;
3645 float damageRefund;
3646 int resurrectCount;
3647 void Created(GameObject *obj);
3648 void Timer_Expired(GameObject *obj,int number);
3649 void Damaged(GameObject *obj,GameObject *damager,float damage);
3650};
3651
3661{
3662 int maxPlayersToScaleFor;
3663 float maxScaleFactor;
3664 float damageRefund;
3665 int resurrectCount;
3666 void Created(GameObject *obj);
3667 void Timer_Expired(GameObject *obj,int number);
3668 void Damaged(GameObject *obj,GameObject *damager,float damage);
3669};
3670
3687class JMG_Utility_Regen_HitPoints : public ScriptImpClass
3688{
3689 bool regenHealth;
3690 int regenArmor;
3691 float healthAmount;
3692 float armorAmount;
3693 float healthPerPlayer;
3694 float armorPerPlayer;
3695 float rate;
3696 float damageDelay;
3697 bool enabled;
3698 float scaleHealthPerHeal;
3699 float scaleArmorPerHeal;
3700 void Created(GameObject *obj);
3701 void Timer_Expired(GameObject *obj,int number);
3702 void Damaged(GameObject *obj,GameObject *damager,float damage);
3703 float ScaleValue(float value,float scale);
3704};
3705
3712class JMG_Utility_Toggle_Flight_On_Delay : public ScriptImpClass
3713{
3714 void Created(GameObject *obj);
3715 void Timer_Expired(GameObject *obj,int number);
3716};
3717
3718
3732class JMG_Utility_Fainting_Soldier : public ScriptImpClass
3733{
3734 int posLockId;
3735 bool fainted;
3736 char faintAnimation[32];
3737 char layAnimation[32];
3738 char standAnimation[32];
3739 char faintSound[256];
3740 char standSound[256];
3741 bool changeArmorTypeWhenKnockedOut;
3742 char armorTypeWhileKnockedOut[256];
3743 char armorType[256];
3744 int originalTeam;
3745 int teamWhileKnockedOut;
3746 void Created(GameObject *obj);
3747 void Timer_Expired(GameObject *obj,int number);
3748 void Animation_Complete(GameObject *obj,const char *animation);
3749 void Destroyed(GameObject *obj);
3750};
3751
3762class JMG_Utility_AI_Guardian_Infantry : public ScriptImpClass {
3763 float fireRange;
3764 Vector3 dpPosition;
3765 int EnemyID;
3766 int EnemyTimeOutTime;
3767 Vector3 LastPos;
3768 int stealthModeOverride;
3769 void Created(GameObject *obj);
3770 void Timer_Expired(GameObject *obj,int number);
3771 void Enemy_Seen(GameObject *obj,GameObject *seen);
3772 void Damaged(GameObject *obj,GameObject *damager,float damage);
3773 void Goto_Location(GameObject *obj);
3774 bool Get_A_Defense_Point(Vector3 *position);
3775};
3776
3784{
3785 void Created(GameObject *obj);
3786};
3787
3796 int custom;
3797 char weaponName[256];
3798 void Created(GameObject *obj);
3799 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3800};
3801
3802
3812 int custom;
3813 void Created(GameObject *obj);
3814 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3815};
3816
3830 void Entered(GameObject *obj,GameObject *enterer);
3831};
3832
3845 void Entered(GameObject *obj,GameObject *enterer);
3846};
3847
3856class JMG_Utility_HitPoints_In_Range_Change_Model : public ScriptImpClass {
3857 bool modelSet;
3858 float upperHP;
3859 float lowerHP;
3860 void Created(GameObject *obj);
3861 void Timer_Expired(GameObject *obj,int number);
3862};
3863
3874 int presetId;
3875 float upperHP;
3876 float lowerHP;
3877 void Created(GameObject *obj);
3878 void Timer_Expired(GameObject *obj,int number);
3879 void Killed(GameObject *obj,GameObject *killer);
3880 void Destroyed(GameObject *obj);
3881};
3882
3892 bool enabled;
3893 float upperHP;
3894 float lowerHP;
3895 void Created(GameObject *obj);
3896 void Timer_Expired(GameObject *obj,int number);
3897};
3898
3910 int presetId;
3911 float upperHP;
3912 float lowerHP;
3913 void Created(GameObject *obj);
3914 void Timer_Expired(GameObject *obj,int number);
3915 void Killed(GameObject *obj,GameObject *killer);
3916 void Destroyed(GameObject *obj);
3917};
3918
3930class JMG_Utility_HitPoints_In_Range_Send_Custom : public ScriptImpClass {
3931 bool inRange;
3932 float upperHP;
3933 float lowerHP;
3934 void Created(GameObject *obj);
3935 void Timer_Expired(GameObject *obj,int number);
3936};
3937
3948 int custom;
3949 void Created(GameObject *obj);
3950 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3951};
3952
3962class JMG_Utility_Custom_Set_Weather_Fog : public ScriptImpClass {
3963 int custom;
3964 void Created(GameObject *obj);
3965 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3966};
3967
3978class JMG_Utility_Custom_Set_Weather_Wind : public ScriptImpClass {
3979 int custom;
3980 void Created(GameObject *obj);
3981 void Custom(GameObject *obj,int message,int param,GameObject *sender);
3982};
3983
3996class JMG_Utility_Custom_Set_Weather_Lightning : public ScriptImpClass {
3997 int custom;
3998 void Created(GameObject *obj);
3999 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4000};
4001
4014class JMG_Utility_Custom_Set_Weather_War_Blitz : public ScriptImpClass {
4015 int custom;
4016 void Created(GameObject *obj);
4017 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4018};
4019
4029class JMG_Utility_Custom_Set_Weather_Clouds : public ScriptImpClass {
4030 int custom;
4031 void Created(GameObject *obj);
4032 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4033};
4034
4046 int custom;
4047 void Created(GameObject *obj);
4048 void Timer_Expired(GameObject *obj,int number);
4049 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4050};
4051
4065class JMG_Utility_Zone_Send_Custom_If_Has_Weapon : public ScriptImpClass {
4066 void Entered(GameObject *obj,GameObject *enterer);
4067};
4068
4069
4083 int resetCustom;
4084 int customs[10];
4085 bool receivedCustoms[10];
4086 void Created(GameObject *obj);
4087 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4088};
4089
4102 bool retryOnFailure;
4103 int playerType;
4104 float safeTeleportDistance;
4105 int wanderPointGroup;
4106 int changeGroupIDCustom;
4107 bool aiOnly;
4108 void Created(GameObject *obj);
4109 void Entered(GameObject *obj,GameObject *enterer);
4110 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4111 bool Get_A_Defense_Point(Vector3 *position,float *facing);
4112 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
4113};
4114
4121 float safeTeleportDistance;
4122 int wanderPointGroup;
4123 void Created(GameObject *obj);
4124 void Timer_Expired(GameObject *obj,int number);
4125 bool Get_A_Defense_Point(Vector3 *position,float *facing);
4126};
4127
4135class JMG_Utility_Zone_Set_Player_Type : public ScriptImpClass {
4136 int requiredPlayerType;
4137 int setPlayerType;
4138 void Created(GameObject *obj);
4139 void Entered(GameObject *obj,GameObject *enterer);
4140};
4141
4153class JMG_Utility_Zone_Send_Custom_Enter : public ScriptImpClass {
4154 int playerType;
4155 int custom;
4156 int param;
4157 float delay;
4158 int id;
4159 bool triggerOnce;
4160 void Created(GameObject *obj);
4161 void Entered(GameObject *obj,GameObject *enterer);
4162};
4163
4175 int custom;
4176 void Created(GameObject *obj);
4177 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4178};
4179
4189class JMG_Utility_Zone_Set_Spawner : public ScriptImpClass {
4190 void Entered(GameObject *obj,GameObject *enterer);
4191};
4192
4201class JMG_Utility_Persistant_Weapon_Powerup : public ScriptImpClass {
4202 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4203};
4204
4210class JMG_Utility_Persistant_Weapon_zStandin : public ScriptImpClass {
4211 void Created(GameObject *obj);
4212 void Timer_Expired(GameObject *obj,int number);
4213};
4214
4220class JMG_Utility_Persistant_Weapon_zAttached : public ScriptImpClass {
4221 int disarmCustom;
4222 char weaponName[256];
4223 void Created(GameObject *obj);
4224 void Timer_Expired(GameObject *obj,int number);
4225 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4226 void Destroyed(GameObject *obj);
4227};
4228
4240 Vector3 scanTeleportSpot;
4241 int playerType;
4242 float safeTeleportDistance;
4243 float teleportIgnoreDistance;
4244 int wanderPointGroup;
4245 int custom;
4246 void Created(GameObject *obj);
4247 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4248 bool Get_A_Defense_Point(Vector3 *position,float *facing);
4249 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
4250};
4251
4252
4262class JMG_Utility_Custom_Set_Tile_Frame : public ScriptImpClass {
4263 int custom;
4264 void Created(GameObject *obj);
4265 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4266};
4267
4280class JMG_Utility_Zone_Send_Custom_No_Weapon : public ScriptImpClass {
4281 void Entered(GameObject *obj,GameObject *enterer);
4282};
4283
4284
4285
4307class JMG_Utility_Custom_Display_Briefing_Message : public ScriptImpClass {
4308 struct BriefingTextNode
4309 {
4310 char Text[256];
4311 float Delay;
4312 BriefingTextNode *next;
4313 BriefingTextNode(const char *text)
4314 {
4315 Delay = 0.0f;
4316 sprintf(Text,"%s",text);
4317 next = NULL;
4318 }
4319 BriefingTextNode(const char *text,float delay)
4320 {
4321 Delay = delay;
4322 sprintf(Text,"%s",text);
4323 next = NULL;
4324 }
4325 BriefingTextNode()
4326 {
4327 next = NULL;
4328 }
4329 };
4330 BriefingTextNode *BriefingText;
4331 BriefingTextNode *CurrentNode;
4332 bool triggered;
4333 void Created(GameObject *obj);
4334 void Timer_Expired(GameObject *obj,int number);
4335 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4336 void Destroyed(GameObject *obj);
4337 void AddNewTextNode();
4338 void RemoveTextNodes();
4339public:
4340 static int voiceId;
4341};
4342
4350class JMG_Utility_Zone_Set_Player_Team : public ScriptImpClass {
4351 int requiredPlayerTeam;
4352 int setPlayerTeam;
4353 void Created(GameObject *obj);
4354 void Entered(GameObject *obj,GameObject *enterer);
4355};
4368 bool triggered;
4369 void Created(GameObject *obj);
4370 void Timer_Expired(GameObject *obj,int number);
4371public:
4373 {
4374 triggered = false;
4375 }
4376};
4377
4387 int custom;
4388 void Created(GameObject *obj);
4389 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4390};
4391
4399class JMG_Utility_Delay_Then_Rotate_Camera : public ScriptImpClass {
4400 bool triggered;
4401 void Created(GameObject *obj);
4402 void Timer_Expired(GameObject *obj,int number);
4403};
4404
4415 float range;
4416 float damage;
4417 char warhead[128];
4418 float rate;
4419 void Created(GameObject *obj);
4420 void Timer_Expired(GameObject *obj,int number);
4421};
4422
4430class JMG_Utility_Unstick_Infantry_If_Stuck : public ScriptImpClass {
4431 float distance;
4432 float rate;
4433 void Created(GameObject *obj);
4434 void Timer_Expired(GameObject *obj,int number);
4435};
4436
4449class JMG_Utility_Custom_Send_Custom_On_Count : public ScriptImpClass {
4450 int custom;
4451 int resetCustom;
4452 int count;
4453 void Created(GameObject *obj);
4454 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4455};
4456
4463class JMG_Utility_Custom_Destroy_Self : public ScriptImpClass {
4464 int custom;
4465 void Created(GameObject *obj);
4466 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4467};
4475class JMG_Utility_Zone_Set_Player_Team2 : public ScriptImpClass {
4476 int requiredPlayerTeam;
4477 int setPlayerTeam;
4478 void Created(GameObject *obj);
4479 void Entered(GameObject *obj,GameObject *enterer);
4480};
4481
4492class JMG_Utility_Poke_Send_Custom : public ScriptImpClass {
4493 void Created(GameObject *obj);
4494 void Poked(GameObject *obj, GameObject *poker);
4495};
4496
4503class JMG_Utility_Set_Collision_Group : public ScriptImpClass {
4504 void Created(GameObject *obj);
4505};
4506
4515class JMG_Utility_Cap_Credits : public ScriptImpClass {
4516 int team;
4517 float credits;
4518 int custom;
4519 void Created(GameObject *obj);
4520 void Timer_Expired(GameObject *obj,int number);
4521 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4522};
4523
4534class JMG_Utility_Custom_Apply_Damage : public ScriptImpClass {
4535 int custom;
4536 void Created(GameObject *obj);
4537 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4538};
4539
4570class JMG_Utility_AI_Goto_Enemy : public ScriptImpClass {
4571 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
4572 struct LastAction
4573 {
4574 int targetId;
4575 Vector3 location;
4576 float speed;
4577 float distance;
4578 bool attack;
4579 bool overrideLocation;
4580 LastAction()
4581 {
4582 }
4583 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation)
4584 {
4585 this->targetId = targetId;
4586 this->location = location;
4587 this->speed = speed;
4588 this->distance = distance;
4589 this->attack = attack;
4590 this->overrideLocation = overrideLocation;
4591 }
4592 bool operator == (LastAction l)
4593 {
4594 return (targetId == l.targetId && JmgUtility::SimpleDistance(location,l.location) <= 0.0f && speed == l.speed && distance == l.distance && attack == l.attack && overrideLocation == l.overrideLocation);
4595 }
4596 };
4597 struct ValidLastLocation
4598 {
4599 bool valid;
4600 Vector3 location;
4601 ValidLastLocation(bool valid)
4602 {
4603 this->valid = valid;
4604 }
4605 ValidLastLocation(int enemyId);
4606 };
4607 LastAction lastAction;
4608 aiState state;
4609 Vector3 homeLocation;
4610 float maxSightFromHomeLocation;
4611 bool huntStealth;
4612 int targetId;
4613 int lastSeenTime;
4614 float weaponRange;
4615 float weaponEffectiveRange;
4616 int huntingEnemyId;
4617 int removeIgnoreTime;
4618 int ignoreEnemyId;
4619 float huntSearchDistance;
4620 float huntArriveDistance;
4621 float attackArriveDistance;
4622 int stuckTime;
4623 int reverseTime;
4624 Vector3 lastPosition;
4625 bool moveBackward;
4626 float wanderDistanceOverride;
4627 int wanderingAiGroupId;
4628 float wanderSpeed;
4629 float huntSpeed;
4630 float attackSpeed;
4631 float returnHomeSpeed;
4632 int changeWanderGroupCustom;
4633 int changeWanderSpeedCustom;
4634 int changeHuntDistanceCustom;
4635 int changeReturnHomeSpeedCustom;
4636 int changeHuntSpeedCustom;
4637 int changeMaxSightFromHomeLocationCustom;
4638 int changeAttackSpeedCustom;
4639 void Created(GameObject *obj);
4640 void Enemy_Seen(GameObject *obj,GameObject *seen);
4641 void Timer_Expired(GameObject *obj,int number);
4642 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4643 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
4644 void Damaged(GameObject *obj,GameObject *damager,float damage);
4645 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation);
4646 GameObject *findClosestStar(GameObject *obj);
4647 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
4648 void Stuck_Check(GameObject *obj,Vector3 targetPos);
4649 void Cant_Get_To_target(GameObject *obj);
4650 bool GetRandomPosition(Vector3 *position);
4651 bool Choose_Target(GameObject *obj,GameObject *target);
4652};
4653
4684class JMG_Utility_AI_Goto_Enemy_Not_Star : public ScriptImpClass {
4685 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
4686 struct LastAction
4687 {
4688 int targetId;
4689 Vector3 location;
4690 float speed;
4691 float distance;
4692 bool attack;
4693 bool overrideLocation;
4694 LastAction()
4695 {
4696 }
4697 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation)
4698 {
4699 this->targetId = targetId;
4700 this->location = location;
4701 this->speed = speed;
4702 this->distance = distance;
4703 this->attack = attack;
4704 this->overrideLocation = overrideLocation;
4705 }
4706 };
4707 struct ValidLastLocation
4708 {
4709 bool valid;
4710 Vector3 location;
4711 ValidLastLocation(bool valid)
4712 {
4713 this->valid = valid;
4714 }
4715 ValidLastLocation(int enemyId);
4716 };
4717 float maxSightFromHomeLocation;
4718 LastAction lastAction;
4719 aiState state;
4720 Vector3 homeLocation;
4721 bool huntStealth;
4722 int targetId;
4723 int lastSeenTime;
4724 float weaponRange;
4725 float weaponEffectiveRange;
4726 int huntingEnemyId;
4727 int removeIgnoreTime;
4728 int ignoreEnemyId;
4729 float huntSearchDistance;
4730 float huntArriveDistance;
4731 float attackArriveDistance;
4732 int stuckTime;
4733 int reverseTime;
4734 Vector3 lastPosition;
4735 bool moveBackward;
4736 float wanderDistanceOverride;
4737 int wanderingAiGroupId;
4738 float wanderSpeed;
4739 float huntSpeed;
4740 float attackSpeed;
4741 float returnHomeSpeed;
4742 int changeWanderGroupCustom;
4743 int changeWanderSpeedCustom;
4744 int changeHuntDistanceCustom;
4745 int changeReturnHomeSpeedCustom;
4746 int changeHuntSpeedCustom;
4747 int changeMaxSightFromHomeLocationCustom;
4748 int changeAttackSpeedCustom;
4749 void Created(GameObject *obj);
4750 void Enemy_Seen(GameObject *obj,GameObject *seen);
4751 void Timer_Expired(GameObject *obj,int number);
4752 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4753 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
4754 void Damaged(GameObject *obj,GameObject *damager,float damage);
4755 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation);
4756 GameObject *findClosestStar(GameObject *obj);
4757 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
4758 void Stuck_Check(GameObject *obj,Vector3 targetPos);
4759 void Cant_Get_To_target(GameObject *obj);
4760 bool GetRandomPosition(Vector3 *position);
4761 bool Choose_Target(GameObject *obj,GameObject *target);
4762};
4763
4771class JMG_Utility_Grant_Key_On_Create : public ScriptImpClass
4772{
4773 AggressiveAttackSpotSystem::AggressiveAttackSpotNode *node;
4774 void Created(GameObject *obj);
4775};
4776
4789class JMG_Utility_Custom_Send_Custom : public ScriptImpClass {
4790 int recieveMessage;
4791 int id;
4792 int custom;
4793 int Param;
4794 float delay;
4795 float randomDelay;
4796 float randomChance;
4797 void Created(GameObject *obj);
4798 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4799};
4800
4812class JMG_Utility_Damage_Unoccupied_Vehicle : public ScriptImpClass {
4813 bool hasBeenOccupied;
4814 float rate;
4815 float damage;
4816 char warhead[128];
4817 float delay;
4818 float maxDelay;
4819 float decreaseTick;
4820 float increaseTick;
4821 void Created(GameObject *obj);
4822 void Timer_Expired(GameObject *obj,int number);
4823 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4824};
4825
4836 int custom;
4837 int team;
4838 float damage;
4839 char warhead[128];
4840 void Created(GameObject *obj);
4841 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4842};
4843
4856class JMG_Utility_AI_Guardian_Vehicle : public ScriptImpClass {
4857 float fireRange;
4858 bool aimAtFeet;
4859 Vector3 dpPosition;
4860 int EnemyID;
4861 int EnemyTimeOutTime;
4862 Vector3 LastPos;
4863 int backward;
4864 int stuckTime;
4865 int stealthModeOverride;
4866 void Created(GameObject *obj);
4867 void Timer_Expired(GameObject *obj,int number);
4868 void Enemy_Seen(GameObject *obj,GameObject *seen);
4869 void Damaged(GameObject *obj,GameObject *damager,float damage);
4870 void Goto_Location(GameObject *obj);
4871 bool Get_A_Defense_Point(Vector3 *position);
4872};
4873
4884 int custom;
4885 void Created(GameObject *obj);
4886 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4887};
4888
4917{
4918 bool requiresADeathToStartNoPlayerAdd;
4919 float addDeathsWhenNoPlayers;
4920 int noPlayersAddDeathSaftyTime;
4921 int currentNoPlayersAddDeathSaftyTime;
4922 void Created(GameObject *obj);
4923 void Timer_Expired(GameObject *obj,int number);
4924 void Custom(GameObject *obj,int message,int param,GameObject *sender);
4925 void Destroyed(GameObject *obj);
4926 void Detach(GameObject *obj);
4927 static char *formatReminderString(const char *format,...);
4928public:
4929 static void ReportLogic(GameObject *obj);
4930 static int deathCount;
4931 static int maxDeaths;
4932 static int deathReminder;
4933 static int urgentDeathReminder;
4934 static int stringId;
4935 static int myId;
4936 static Vector3 reminderColor;
4937 static char reminderMessage[220];
4938 static char deathSingular[220];
4939 static char deathPlural[220];
4940 static char remainingSingular[220];
4941 static char remainingPlural[220];
4942 static int reminderMessageOrder;
4943 static bool controllerPlaced;
4944 static bool announceOnFirstDeath;
4945 static bool onlyTrackPlayerDeaths;
4946 static bool recordAIDeaths;
4947};
4948
4955{
4956 void Killed(GameObject *obj,GameObject *killer);
4957};
4958
4964class JMG_Utility_AI_Goto_Player_Ignore_Object : public ScriptImpClass {
4965 void Created(GameObject *obj);
4966};
4967
4968
4974class JMG_Utility_AI_Goto_Enemy_Ignore_Object : public ScriptImpClass {
4975 void Created(GameObject *obj);
4976};
4977
4978
4985 void Created(GameObject *obj);
4986};
4987
4997class JMG_Utility_Custom_Set_Team_And_Model : public ScriptImpClass {
4998 int custom;
4999 void Created(GameObject *obj);
5000 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5001};
5002
5011class JMG_Utility_Death_Warhead_Create_Object : public ScriptImpClass {
5012 unsigned int lastDamageWarhead;
5013 void Created(GameObject *obj);
5014 void Damaged(GameObject *obj,GameObject *damager,float damage);
5015 void Killed(GameObject *obj,GameObject *killer);
5016};
5017
5027 int playerType;
5028 char entererPreset[256];
5029 void Created(GameObject *obj);
5030 void Entered(GameObject *obj,GameObject *enterer);
5031};
5032
5040class JMG_Utility_Sync_HP_With_Object : public ScriptImpClass {
5041 int id;
5042 float rate;
5043 void Created(GameObject *obj);
5044 void Timer_Expired(GameObject *obj,int number);
5045};
5046
5055 bool syncedScreen[128];
5056 void Created(GameObject *obj);
5057 void Timer_Expired(GameObject *obj,int number);
5058 void Destroyed(GameObject *obj);
5059 void Detach(GameObject *obj);
5060 static Vector3 controllerDefaultColor;
5061 static float controllerDefaultOpacity;
5062public:
5064 {
5065 controllerPlaced = true;
5066 }
5067 static bool controllerPlaced;
5068 static Vector3 color[128];
5069 static float opacity[128];
5070 SCRIPTS_API static void Update_Colors(Vector3 Color,float Opacity);
5071 SCRIPTS_API static void Update_Player_Colors(GameObject *player,Vector3 Color,float Opacity);
5072 SCRIPTS_API static void Reset_To_Default(GameObject *player);
5073 SCRIPTS_API static void Update_Player(GameObject *player,float transition);
5074 SCRIPTS_API static void Update_All_Players(float transition);
5075};
5076
5087class JMG_Utility_Set_Screen_Color_Fade_On_Custom : public ScriptImpClass {
5088 int custom;
5089 void Created(GameObject *obj);
5090 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5091};
5092
5100 void Created(GameObject *obj);
5101};
5102
5111 void Entered(GameObject *obj,GameObject *enter);
5112};
5113
5125class JMG_Utility_Simple_Mech : public ScriptImpClass {
5126 enum mvmtDir{IDLE,FORWARD,BACKWARD,LEFT,RIGHT};
5127 char idleAnimation[32];
5128 char forwardAnimation[32];
5129 char backwardAnimation[32];
5130 char turnLeftAnimation[32];
5131 char turnRightAnimation[32];
5132 int idleCooldown;
5133 int releaseDelay;
5134 bool hasIdleAnimation;
5135 mvmtDir currentDirection;
5136 mvmtDir lastMovementDirection;
5137 void Created(GameObject *obj);
5138 void Timer_Expired(GameObject *obj,int number);
5139 void Animation_Complete(GameObject *obj,const char *animation_name);
5140 void PlayAnimation(GameObject *obj,mvmtDir direction,float startFrame,float endFrame,bool looped);
5141};
5142
5157 float range;
5158 char preset[128];
5159 float rate;
5160 void Created(GameObject *obj);
5161 void Timer_Expired(GameObject *obj,int number);
5162};
5172{
5173 void Killed(GameObject *obj,GameObject *killer);
5174};
5175
5181class JMG_Utility_Enable_Loiter : public ScriptImpClass {
5182 void Created(GameObject *obj);
5183};
5184
5192class JMG_Utility_Custom_Switch_Weapon : public ScriptImpClass {
5193 int custom;
5194 void Created(GameObject *obj);
5195 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5196};
5197
5217class JMG_Utility_HUD_Count_Down : public ScriptImpClass {
5218public:
5219 struct CountdownScreenCharacterNode
5220 {
5221 int id;
5222 int charPos;
5223 char currentChar;
5224 char baseModelName[15];
5225 struct CountdownScreenCharacterNode *next;
5226 CountdownScreenCharacterNode(int id,int charPos,const char *baseModelName)
5227 {
5228 this->id = id;
5229 this->charPos = charPos;
5230 this->currentChar = '\0';
5231 sprintf(this->baseModelName,"%s",baseModelName);
5232 this->next = NULL;
5233 }
5234 };
5235 static int highestCharPos;
5236 static CountdownScreenCharacterNode *countdownScreenCharacterController;
5237 static void AddVisualCountdownNode(int id,int charPos,const char *baseModelName)
5238 {
5239 if (charPos > 5)
5240 {
5241 Console_Input("msg AddVisualCountdownNode::ERROR charPos can be at most 5!");
5242 return;
5243 }
5244 if (strlen(baseModelName) > 15)
5245 {
5246 Console_Input("msg AddVisualCountdownNode::ERROR baseModelName can be at most 15 characters (remember a number is added to the end)!");
5247 return;
5248 }
5249 if (highestCharPos < charPos)
5250 highestCharPos = charPos;
5251 CountdownScreenCharacterNode *current = countdownScreenCharacterController;
5252 if (!countdownScreenCharacterController)
5253 countdownScreenCharacterController = new CountdownScreenCharacterNode(id,charPos,baseModelName);
5254 while (current)
5255 {
5256 if (current->id == id)
5257 {
5258 Console_Input("msg AddVisualCountdownNode::ERROR: id has already been added once!");
5259 return;
5260 }
5261 if (!current->next)
5262 {
5263 current->next = new CountdownScreenCharacterNode(id,charPos,baseModelName);
5264 return;
5265 }
5266 current = current->next;
5267 }
5268 }
5269 struct SendCustomOnSecondNode
5270 {
5271 bool hasTriggered;
5272 int triggerSecond;
5273 int id;
5274 int custom;
5275 int param;
5276 float delay;
5277 struct SendCustomOnSecondNode *next;
5278 SendCustomOnSecondNode(int triggerSecond,int id,int custom,int param,float delay)
5279 {
5280 this->hasTriggered = false;
5281 this->triggerSecond = triggerSecond;
5282 this->id = id;
5283 this->custom = custom;
5284 this->param = param;
5285 this->delay = delay;
5286 this->next = NULL;
5287 }
5288 };
5289 static SendCustomOnSecondNode *sendCustomOnSecondController;
5290 static void AddSecondNode(int triggerSecond,int id,int custom,int param,float delay)
5291 {
5292 SendCustomOnSecondNode *current = sendCustomOnSecondController;
5293 if (!sendCustomOnSecondController)
5294 sendCustomOnSecondController = new SendCustomOnSecondNode(triggerSecond,id,custom,param,delay);
5295 while (current)
5296 {
5297 if (triggerSecond == current->triggerSecond && id == current->id && custom == current->custom && param == current->param)
5298 {
5299 Console_Input("msg ERROR: A custom for this trigger second already exists!");
5300 return;
5301 }
5302 if (!current->next)
5303 {
5304 current->next = new SendCustomOnSecondNode(triggerSecond,id,custom,param,delay);
5305 return;
5306 }
5307 current = current->next;
5308 }
5309 }
5310 static bool controllerPlaced;
5311private:
5312 int stringId;
5313 Vector3 color;
5314 char warningMessage[220];
5315 char hourSingular[220];
5316 char hourPlural[220];
5317 char minuteSingular[220];
5318 char minutePlural[220];
5319 char secondSingular[220];
5320 char secondPlural[220];
5321 int seconds;
5322 int pauseCustom;
5323 bool paused;
5324 void Created(GameObject *obj);
5325 void Timer_Expired(GameObject *obj,int number);
5326 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5327 void Destroyed(GameObject *obj);
5328 void Detach(GameObject *obj);
5329 char *formatReminderString(const char *format,...);
5330
5331 void NodeSendCustom(GameObject *obj,int second)
5332 {
5333 if (!sendCustomOnSecondController)
5334 return;
5335 SendCustomOnSecondNode *current = sendCustomOnSecondController;
5336 while (current)
5337 {
5338 if (current->triggerSecond == second && !current->hasTriggered)
5339 {
5340 current->hasTriggered = true;
5341 Commands->Send_Custom_Event(obj,Commands->Find_Object(current->id),current->custom,current->param,current->delay);
5342 }
5343 current = current->next;
5344 }
5345 }
5346 void CleanupSecondNodes()
5347 {
5348 controllerPlaced = false;
5349 SendCustomOnSecondNode *temp = sendCustomOnSecondController,*die;
5350 while (temp)
5351 {
5352 die = temp;
5353 temp = temp->next;
5354 delete die;
5355 }
5356 sendCustomOnSecondController = NULL;
5357 CountdownScreenCharacterNode *temp2 = countdownScreenCharacterController,*die2;
5358 while (temp2)
5359 {
5360 GameObject *kill = Commands->Find_Object(temp2->id);
5361 if (kill)
5362 Commands->Destroy_Object(kill);
5363 die2 = temp2;
5364 temp2 = temp2->next;
5365 delete die2;
5366 }
5367 countdownScreenCharacterController = NULL;
5368 highestCharPos = -1;
5369 }
5370 void UpdateCountdownHudNodes()
5371 {
5372 if (highestCharPos <= 0)
5373 return;
5374 char hhmmss[6];
5375 sprintf(hhmmss,"%02d%02d%02d",seconds/3600,(seconds%3600)/60,(seconds%3600)%60);
5376 for (int x = 0;x <= highestCharPos;x++)
5377 for (CountdownScreenCharacterNode *current = countdownScreenCharacterController;current;current = current->next)
5378 {
5379 if (current->charPos == x && current->currentChar != hhmmss[5-x])
5380 {
5381 GameObject *object = Commands->Find_Object(current->id);
5382 if (!object)
5383 continue;
5384 char model[16];
5385 sprintf(model,"%s%c",current->baseModelName,hhmmss[5-x]);
5386 Commands->Set_Model(object,model);
5387 }
5388 }
5389 }
5390};
5403class JMG_Utility_HUD_Count_Down_Send_Custom : public ScriptImpClass {
5404 void Created(GameObject *obj);
5405 void Timer_Expired(GameObject *obj,int number);
5406};
5407
5417class JMG_Utility_Zone_Screen_Fade : public ScriptImpClass {
5418 void Entered(GameObject *obj,GameObject *enter);
5419};
5420
5428class JMG_Utility_Custom_Triggers_Enemy_Seen : public ScriptImpClass {
5429 int custom;
5430 void Created(GameObject *obj);
5431 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5432};
5433
5441class JMG_Utility_Screen_Fade_Red_On_Damage : public ScriptImpClass {
5442 int playerId;
5443 Vector3 fadeColor;
5444 float fadeOpacity;
5445 float injuryRatio;
5446 float lastInjuryRatio;
5447 float screenOpacity;
5448 float lastScreenOpacity;
5449 void Created(GameObject *obj);
5450 void Timer_Expired(GameObject *obj,int number);
5451 void Damaged(GameObject *obj,GameObject *damager,float damage);
5452 void ScreenFade(GameObject *obj);
5453 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5454};
5455
5467class JMG_Utility_Player_Count_Enable_Spawners : public ScriptImpClass
5468{
5469 bool enabled;
5470 int enableCustom;
5471 Vector3 playerCount;
5472 Vector3 playerCount2;
5473 bool conditionMatching;
5474 void Created(GameObject *obj);
5475 void Timer_Expired(GameObject *obj,int number);
5476 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5477 void EnableSpawners(bool enable);
5478};
5479
5485class JMG_Utility_AI_Engineer_Ignore_Target : public ScriptImpClass {
5486 void Created(GameObject *obj);
5487};
5503class JMG_Utility_Give_Weapon_In_Range : public ScriptImpClass
5504{
5505 float rate;
5506 float refillRate;
5507 float range;
5508 Vector3 location;
5509 bool enabled;
5510 int enableCustom;
5511 char weaponName[256];
5512 bool selectWeapon;
5513 int weaponAmmo;
5514 int refillAmount;
5515 void Created(GameObject *obj);
5516 void Timer_Expired(GameObject *obj,int number);
5517 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5518 void GrantWeapon();
5519};
5520
5528 void Created(GameObject *obj);
5529 void Destroyed(GameObject *obj);
5530 void Detach(GameObject *obj);
5531public:
5532 static bool controllerPlaced;
5533 static int maxFollowers;
5534 static int followingPlayer[128];
5536 {
5537 controllerPlaced = true;
5538 }
5539};
5540
5572class JMG_Utility_AI_Follow_Player_On_Poke : public ScriptImpClass {
5573 GameObject *lastFollow;
5574 GameObject *lastTarget;
5575 Vector3 lastPos;
5576 int maxFollowTime;
5577 int maxIdleTime;
5578 int currentFollowTime;
5579 int currentIdleTime;
5580 bool detached;
5581 float followDistance;
5582 float followNearSpeed;
5583 float followFarSpeed;
5584 float followFarDistance;
5585 float followVeryFarSpeed;
5586 float followVeryFarDistance;
5587 float runHomeSpeed;
5588 int actionUpdate;
5589 float weaponRange;
5590 float targetDistance;
5591 int enemyId;
5592 int pokerPlayerId;
5593 int playerObjectId;
5594 Vector3 homeLocation;
5595 Vector3 lastLocation;
5596 int enemySeen;
5597 bool fallbackWithoutArmor;
5598 float healWhileAtHomeLocation;
5599 int sendCustomId;
5600 int pokedCustom;
5601 int lostCustom;
5602 int killedCustom;
5603 int healedCustom;
5604 int injuredCustom;
5605 Vector3 messageColor;
5606 int messagePokeFollowerId;
5607 char messagePokeFollower[220];
5608 int messageFollowingYouId;
5609 int messageFollowingPlayerId;
5610 int messageMaxFollowersId;
5611 char messageMaxFollowers[220];
5612 int messageHealingRequiredId;
5613 int messageFollowerInjuredId;
5614 int messageFollowerKilledId;
5615 int messageFollowerLostId;
5616 bool hurt;
5617 void Created(GameObject *obj);
5618 void Enemy_Seen(GameObject *obj,GameObject *seen);
5619 void Timer_Expired(GameObject *obj,int number);
5620 void Damaged(GameObject *obj,GameObject *damager,float damage);
5621 void Poked(GameObject *obj, GameObject *poker);
5622 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
5623 void Killed(GameObject *obj, GameObject *killer);
5624 void Destroyed(GameObject *obj);
5625 void Detach(GameObject *obj);
5626 void AttackTarget(GameObject *obj,GameObject *follow,GameObject *target,Vector3 location,float speed,float distance);
5627 void GiveUpOnPlayer(GameObject *obj,bool pokeable);
5628 void ForgetEnemy(GameObject *obj);
5629 void SendCustom(GameObject *obj,int custom);
5630 char *formatMaxFollowingString(const char *format,...);
5631 void ShowPlayerMessage(GameObject *player,int stringId,Vector3 color);
5632public:
5634 {
5635 detached = false;
5636 pokerPlayerId = 0;
5637 }
5638};
5639
5651class JMG_Utility_Timer_Damage_And_Teleport : public ScriptImpClass {
5652 void Created(GameObject *obj);
5653 void Timer_Expired(GameObject *obj,int number);
5654};
5655
5668class JMG_Utility_Zone_Send_Custom_If_Has_Script : public ScriptImpClass {
5669 void Entered(GameObject *obj,GameObject *enterer);
5670};
5671
5689class JMG_Utility_Damage_When_Outside_Of_Range : public ScriptImpClass {
5690 float warnDistance;
5691 float damageDistance;
5692 float vehicleWarnDistance;
5693 float vehicleDamageDistance;
5694 float aircraftWarnDistance;
5695 float aircraftDamageDistance;
5696 float maxSurviveDistance;
5697 Vector3 errorMessageColor;
5698 Vector3 screenFadeColor;
5699 int warnTime[128];
5700 bool screenEffectOn[128];
5701 int leavingFieldStringId;
5702 char damageWarhead[128];
5703 char instantKillWarhead[128];
5704 void Created(GameObject *obj);
5705 void Timer_Expired(GameObject *obj,int number);
5706};
5707
5721 char presetName[128];
5722 int enableCustom;
5723 bool enabled;
5724 void Created(GameObject *obj);
5725 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5726 void Timer_Expired(GameObject *obj,int number);
5727};
5728
5743 int sleepTime;
5744 int sleeping;
5745 bool triggerOnce;
5746 bool enabled;
5747 float distance;
5748 float delay;
5749 float maxRange;
5750 int id;
5751 int param;
5752 int custom;
5753 void Created(GameObject *obj);
5754 void Timer_Expired(GameObject *obj,int number);
5755};
5756
5763 bool hurt;
5764 int originalPlayerType;
5765 void Created(GameObject *obj);
5766 void Timer_Expired(GameObject *obj,int number);
5767};
5768
5783 bool debug;
5784 int team;
5785 int enableCustom;
5786 bool enabled;
5787 void Created(GameObject *obj);
5788 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5789 void Timer_Expired(GameObject *obj,int number);
5790};
5791
5801 char sound[128];
5802 char bone[32];
5803 int custom;
5804 bool enabled;
5805 void Created(GameObject *obj);
5806 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5807};
5808
5823 int custom;
5824 int resetCustom;
5825 int baseCount;
5826 int playerCount;
5827 int runningCount;
5828 void Created(GameObject *obj);
5829 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5830};
5831
5841class JMG_Utility_Killed_By_Player_Send_Custom : public ScriptImpClass {
5842 void Killed(GameObject *obj,GameObject *killer);
5843};
5844
5850class JMG_Utility_AI_Guardian_Ignored : public ScriptImpClass {
5851 void Created(GameObject *obj);
5852};
5853
5859class JMG_Utility_AI_Vehicle_Ignored : public ScriptImpClass {
5860 void Created(GameObject *obj);
5861};
5862
5873class JMG_Utility_Killed_By_PresetID_Send_Custom : public ScriptImpClass {
5874 void Killed(GameObject *obj,GameObject *killer);
5875};
5876
5883 void Created(GameObject *obj);
5884};
5885
5902 bool enabled;
5903 Vector3 hudStringColor;
5904 char hudMessage[220];
5905 int hudStringId;
5906 int custom;
5907 int resetCustom;
5908 void Created(GameObject *obj);
5909 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5910 char *formatHUDMessage(const char *format,...);
5911public:
5912 int runningCount;
5913 int baseCount;
5914 int playerCount;
5915};
5916
5931 void Entered(GameObject *obj,GameObject *enterer);
5932};
5933
5942 int custom;
5943 char weaponName[128];
5944 void Created(GameObject *obj);
5945 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5946};
5947
5956 int custom;
5957 char presetName[128];
5958 void Created(GameObject *obj);
5959 void Custom(GameObject *obj,int message,int param,GameObject *sender);
5960};
5961
5974 int id;
5975 int custom;
5976 int param;
5977 float delay;
5978 float damageThreshold;
5979 float lockoutTime;
5980 float timeRemaining;
5981 void Created(GameObject *obj);
5982 void Timer_Expired(GameObject *obj,int number);
5983 void Damaged(GameObject *obj,GameObject *damager,float damage);
5984};
5985
5996 int custom;
5997 Vector3 color;
5998 int stringId;
5999 bool repeatable;
6000 void Created(GameObject *obj);
6001 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6002};
6003
6012class JMG_Utility_Destroyed_Drop_Powerup : public ScriptImpClass
6013{
6014 void Destroyed(GameObject *obj);
6015};
6016
6025class JMG_Utility_Pickup_Attach_Script : public ScriptImpClass
6026{
6027 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6028};
6029
6040 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6041};
6042
6051 int custom;
6052 void Created(GameObject *obj);
6053 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6054};
6055
6062class JMG_Utility_Force_Player_Team_At_Gameover : public ScriptImpClass {
6063 int team;
6064 void Created(GameObject *obj);
6065 void Timer_Expired(GameObject *obj,int number);
6066};
6067
6082class JMG_Utility_AI_Guardian_Generic : public ScriptImpClass {
6083 float fireRange;
6084 float flightHeight;
6085 float arriveDistance;
6086 float arriveDistanceSq;
6087 Vector3 dpPosition;
6088 int EnemyID;
6089 int EnemyTimeOutTime;
6090 Vector3 LastPos;
6091 bool primaryFire;
6092 int stealthModeOverride;
6093 void Created(GameObject *obj);
6094 void Timer_Expired(GameObject *obj,int number);
6095 void Enemy_Seen(GameObject *obj,GameObject *seen);
6096 void Damaged(GameObject *obj,GameObject *damager,float damage);
6097 void Goto_Location(GameObject *obj);
6098 bool Get_A_Defense_Point(Vector3 *position);
6099};
6100
6112 int custom;
6113 char presetName[128];
6114 float distance;
6115 float height;
6116 float rotation;
6117 void Created(GameObject *obj);
6118 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6119};
6120
6128 void Created(GameObject *obj);
6129};
6130
6141 int custom;
6142 int team;
6143 float damage;
6144 char warhead[128];
6145 void Created(GameObject *obj);
6146 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6147};
6148
6156class JMG_Utility_Kill_Unit_If_Not_Moving_Enough : public ScriptImpClass {
6157 int time;
6158 int resetTime;
6159 float distance;
6160 Vector3 lastPos;
6161 void Created(GameObject *obj);
6162 void Timer_Expired(GameObject *obj,int number);
6163};
6164
6165
6183 struct BriefingTextNode
6184 {
6185 char Text[256];
6186 float Delay;
6187 BriefingTextNode *next;
6188 BriefingTextNode(const char *text)
6189 {
6190 Delay = 0.0f;
6191 sprintf(Text,"%s",text);
6192 next = NULL;
6193 }
6194 BriefingTextNode(const char *text,float delay)
6195 {
6196 Delay = delay;
6197 sprintf(Text,"%s",text);
6198 next = NULL;
6199 }
6200 BriefingTextNode()
6201 {
6202 next = NULL;
6203 }
6204 };
6205 BriefingTextNode *BriefingText;
6206 BriefingTextNode *CurrentNode;
6207 bool triggered;
6208 void Created(GameObject *obj);
6209 void Timer_Expired(GameObject *obj,int number);
6210 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6211 void Destroyed(GameObject *obj);
6212 void AddNewTextNode();
6213 void RemoveTextNodes();
6214};
6215
6222{
6223 void Killed(GameObject *obj,GameObject *killer);
6224};
6225
6237class JMG_Utility_Timer_Custom : public ScriptImpClass {
6238 int id;
6239 int message;
6240 int param;
6241 bool repeat;
6242 float time;
6243 int enableCustom;
6244 void Created(GameObject *obj);
6245 void Timer_Expired(GameObject *obj,int number);
6246 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6247};
6248
6256class JMG_Utility_Zone_Change_Character_Model : public ScriptImpClass {
6257 int playerType;
6258 char newModel[16];
6259 void Created(GameObject *obj);
6260 void Entered(GameObject *obj,GameObject *enterer);
6261};
6262
6275 bool enabled;
6276 int enableCustom;
6277 bool repeat;
6278 float time;
6279 int playerType;
6280 char newModel[16];
6281 void Created(GameObject *obj);
6282 void Timer_Expired(GameObject *obj,int number);
6283 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6284};
6285
6300 bool enabled;
6301 int enableCustom;
6302 bool repeat;
6303 float time;
6304 int playerType;
6305 float maxHp;
6306 float minHp;
6307 char newModel[16];
6308 void Created(GameObject *obj);
6309 void Timer_Expired(GameObject *obj,int number);
6310 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6311};
6312
6322class JMG_Utility_Destroy_Send_Custom : public ScriptImpClass {
6323 void Destroyed(GameObject *obj);
6324};
6325
6333 bool attemptingCollidable;
6334 bool ghost;
6335 Collision_Group_Type myCollisionGroup;
6336 void Created(GameObject *obj);
6337 void Timer_Expired(GameObject *obj,int number);
6338 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6339};
6340
6349class JMG_Utility_Attach_Script_To_All_Players : public ScriptImpClass {
6350 char scriptName[256];
6351 char params[256];
6352 void Created(GameObject *obj);
6353 void Timer_Expired(GameObject *obj,int number);
6354};
6355
6365class JMG_Utility_Send_Custom_On_Powerup_Pickup : public ScriptImpClass {
6366 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6367};
6368
6381class JMG_Utility_Set_Bullets_On_Custom_Or_Damage : public ScriptImpClass {
6382 char setWeapon[128];
6383 bool repeat;
6384 int custom;
6385 int setBackpackBullets;
6386 bool triggerOnDamage;
6387 bool fullClip;
6388 void Created(GameObject *obj);
6389 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6390 void Damaged(GameObject *obj,GameObject *damager,float damage);
6391 void UpdateBullets(GameObject *obj);
6392};
6393
6403class JMG_Utility_Custom_Damage_All_Presets : public ScriptImpClass {
6404 int custom;
6405 char preset[128];
6406 float damage;
6407 char warhead[128];
6408 void Created(GameObject *obj);
6409 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6410};
6411
6420class JMG_Utility_Death_Weapon_Create_Object : public ScriptImpClass {
6421 void Killed(GameObject *obj,GameObject *killer);
6422};
6423
6438 float speed;
6439 int id;
6440 int custom;
6441 int paramx;
6442 bool repeat;
6443 float rate;
6444 bool enabled;
6445 int enableCustom;
6446 void Created(GameObject *obj);
6447 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6448 void Timer_Expired(GameObject *obj,int number);
6449};
6450
6465 float speed;
6466 int id;
6467 int custom;
6468 int paramx;
6469 bool repeat;
6470 float rate;
6471 bool enabled;
6472 int enableCustom;
6473 void Created(GameObject *obj);
6474 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6475 void Timer_Expired(GameObject *obj,int number);
6476};
6477
6496 enum SpecialCondition{DOES_NOT_MATTER,HORIZANTAL_IS_GREATER,VERTICAL_IS_GREATER,DOES_NOT_MEET_CONDITION};
6497 Vector3 velocityFBL;
6498 Vector3 velocityRUD;
6499 int id;
6500 int custom;
6501 int paramx;
6502 bool repeat;
6503 float rate;
6504 bool enabled;
6505 int enableCustom;
6506 SpecialCondition onlyTriggerOn;
6507 Vector3 onlyTriggerOnMinHV;
6508 Vector3 onlyTriggerOnMaxHV;
6509 void Created(GameObject *obj);
6510 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6511 void Timer_Expired(GameObject *obj,int number);
6512 void SendCustom(GameObject *obj,int paramOverride);
6513 Vector3 SquareVectorSpecial(Vector3 in);
6514 bool OnlyTriggerOnTest(float horizontalSpeed,float verticalSpeed);
6515};
6516
6528class JMG_Utility_Custom_Change_Character : public ScriptImpClass {
6529 int custom;
6530 void Created(GameObject *obj);
6531 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6532};
6533
6544class JMG_Utility_Apply_Damage_While_In_Zone : public ScriptImpClass {
6545 int team;
6546 char params[512];
6547 void Created(GameObject *obj);
6548 void Entered(GameObject *obj,GameObject *enterer);
6549 void Exited(GameObject *obj,GameObject *exiter);
6550};
6551
6561class JMG_Utility_Apply_Damage_On_Timer_Base : public ScriptImpClass {
6562 float rate;
6563 int damagerId;
6564 char warhead[128];
6565 float damageAmount;
6566 void Created(GameObject *obj);
6567 void Timer_Expired(GameObject *obj,int number);
6568};
6569
6581class JMG_Utility_Zone_Send_Custom_Exit : public ScriptImpClass {
6582 int playerType;
6583 int custom;
6584 int param;
6585 float delay;
6586 int id;
6587 bool triggerOnce;
6588 void Created(GameObject *obj);
6589 void Exited(GameObject *obj,GameObject *exiter);
6590};
6591
6603 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6604};
6605
6616class JMG_Utility_Custom_Create_Explosion_At_Bone : public ScriptImpClass {
6617 char explosion[256];
6618 char bone[32];
6619 int owner;
6620 int custom;
6621 bool alive;
6622 void Created(GameObject *obj);
6623 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6624};
6625
6640 int custom;
6641 int sendCustom;
6642 int params;
6643 float delay;
6644 int id;
6645 time_t lastTriggerTime;
6646 int ignoreTime;
6647 bool enable;
6648 int enableCustom;
6649 void Created(GameObject *obj);
6650 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6651};
6652
6667class JMG_Utility_Damage_Send_Custom : public ScriptImpClass {
6668 int custom;
6669 int params;
6670 float delay;
6671 int id;
6672 int senderId;
6673 bool enable;
6674 int enableCustom;
6675 bool repeat;
6676 float minDamage;
6677 void Created(GameObject *obj);
6678 void Damaged(GameObject *obj,GameObject *damager,float damage);
6679 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6680};
6681
6696 int sleepTime;
6697 int sleeping;
6698 bool triggerOnce;
6699 bool enabled;
6700 float distance;
6701 float delay;
6702 float maxRange;
6703 int id;
6704 int param;
6705 int custom;
6706 void Created(GameObject *obj);
6707 void Timer_Expired(GameObject *obj,int number);
6708};
6709
6723 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6724};
6725
6732 void Created(GameObject *obj);
6733 void Destroyed(GameObject *obj);
6734 void Detach(GameObject *obj);
6735public:
6736 struct StringNode
6737 {
6738 char preset[128];
6739 StringNode(const char *preset)
6740 {
6741 sprintf(this->preset,"%s",preset);
6742 }
6743 };
6744 static bool controllerPlaced;
6745 static char playerWeapons[128][256];
6746 static char playerNames[128][256];
6747 static SList<StringNode> ignoredWeapons;
6749 {
6750 ignoredWeapons.Remove_All();
6751 }
6752};
6753
6762 int playerId;
6763 void Created(GameObject *obj);
6764 void Timer_Expired(GameObject *obj,int number);
6765 void Destroyed(GameObject *obj);
6766 void InitialSetup(GameObject *obj);
6767 void GrantPlayersWeapon(GameObject *obj);
6768public:
6770 {
6771 playerId = 0;
6772 }
6773};
6774
6784class JMG_Utility_Created_Give_Weapon : public ScriptImpClass {
6785 void Created(GameObject *obj);
6786};
6787
6798class JMG_Utility_Credit_Trickle_To_Ammount : public ScriptImpClass {
6799 int team;
6800 float credits;
6801 int custom;
6802 float trickleCap;
6803 float rate;
6804 void Created(GameObject *obj);
6805 void Timer_Expired(GameObject *obj,int number);
6806 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6807};
6808
6821class JMG_Utility_Custom_Damage_Objects_On_Team : public ScriptImpClass {
6822 bool triggerOnce;
6823 int team;
6824 int custom;
6825 char warhead[255];
6826 int theDamager;
6827 float damage;
6828 Vector3 soldierVehicleOther;
6829 void Created(GameObject *obj);
6830 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6831};
6832
6846class JMG_Utility_Custom_Set_Animation : public ScriptImpClass {
6847 int objectId;
6848 int custom;
6849 char animation[32];
6850 bool looping;
6851 float startFrame;
6852 float endFrame;
6853 bool blended;
6854 bool triggerOnce;
6855 void Created(GameObject *obj);
6856 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6857};
6858
6868 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6869};
6870
6877{
6878 void Entered(GameObject *obj,GameObject *enterer);
6879 char *formatReminderString(const char *format,...);
6880};
6881
6888class JMG_Utility_Killed_Give_Money : public ScriptImpClass
6889{
6890 void Killed(GameObject *obj,GameObject *killer);
6891};
6892
6901{
6902 void Created(GameObject *obj);
6903};
6904
6905
6912class JMG_Utility_Detect_AFK_Controller : public ScriptImpClass {
6913 bool isMoving[128];
6914 bool isTurning[128];
6915 bool isFiring[128];
6916 bool isMovingTarget[128];
6917 Vector3 lastTargetPos[128];
6918 float facing[128];
6919 int afkTime[128];
6920 int afkThreshold;
6921 void Created(GameObject *obj);
6922 void Timer_Expired(GameObject *obj,int number);
6923 void Destroyed(GameObject *obj);
6924 void Detach(GameObject *obj);
6925public:
6926 static bool controllerPlaced;
6927 static bool isAFK[128];
6929 {
6930 controllerPlaced = false;
6931 }
6932};
6933
6944class JMG_Utility_Credit_Trickle_When_Not_AFK : public ScriptImpClass {
6945 int team;
6946 float credits;
6947 int custom;
6948 float rate;
6949 float trickleCap;
6950 void Created(GameObject *obj);
6951 void Timer_Expired(GameObject *obj,int number);
6952 void Custom(GameObject *obj,int message,int param,GameObject *sender);
6953};
6954
6961class JMG_Utility_Killed_Create_Object : public ScriptImpClass {
6962 void Killed(GameObject *obj,GameObject *killer);
6963};
6964
6972 void Damaged(GameObject *obj,GameObject *damager,float damage);
6973};
6974
7009class JMG_Utility_Basic_Spawner_In_Radius : public ScriptImpClass {
7010public:
7011 struct SpawnObjectNode
7012 {
7013 int groupId;
7014 ReferencerClass obj;
7015 SpawnObjectNode(GameObject *obj,int spawnGroupId)
7016 {
7017 this->obj = obj;
7018 this->groupId = spawnGroupId;
7019 }
7020 };
7021 static SList<SpawnObjectNode> spawnObjectNodeList;
7022private:
7023 bool enabled;
7024 float minDistanceBetweenObjects;
7025 int spawnGroupId;
7026 int spawnedObjectScriptID;
7027 int spawnedObjects;
7028 enum SpawnFailureTypes{SPAWN_BLOCKED, SUCCESS, LIMIT_REACHED, SPAWN_CODE_ERROR};
7029 Vector3 spawnLocation;
7030 int spawnAtATime;
7031 int maxTotalSpawned;
7032 float minRadius;
7033 float maxRadius;
7034 float xMultiplier;
7035 float yMultiplier;
7036 float addHeight;
7037 float rate;
7038 float randomRate;
7039 char preset[128];
7040 int spawnCount;
7041 bool collisionCheck;
7042 int retryAttempts;
7043 float initialSpawnHeight;
7044 int changeSpawnCapCustom;
7045 bool pointMustBeInPathfind;
7046 bool manualFacing;
7047 bool ignoreRayCastFailure;
7048 Vector3 faceLocation;
7049 float faceDirection;
7050 int enableDisableCustom;
7051 int initialSpawn;
7052 Vector3 raycastRange;
7053 int attachScriptsGroupId;
7054 float playersAddToSpawnAtATime;
7055 int lastPlayerCount;
7056 void Created(GameObject *obj);
7057 void Timer_Expired(GameObject *obj,int number);
7058 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7059 SpawnFailureTypes AttemptSpawn(GameObject *obj);
7060 bool CheckIfObjectIsNearAnotherObject(Vector3 pos);
7061 void SetFacing(GameObject *obj,float facing);
7062 void Initial_Spawn(GameObject *obj);
7063 int GetPlayerLimitModifier();
7064 JMG_Utility_Basic_Spawner_In_Radius::SpawnFailureTypes TryPlacement(GameObject *spawned,Vector3 bottomRay);
7065};
7066
7077 bool sentCreateMessage;
7078 bool sentDeathMessage;
7079 void Created(GameObject *obj);
7080 void Destroyed(GameObject *obj);
7081 void AddSpawnedObjectToGroup(GameObject *spawned);
7082public:
7084 {
7085 sentCreateMessage = false;
7086 sentDeathMessage = false;
7087 }
7088};
7089
7101 bool subtractMinSpeed;
7102 char explosionPreset[128];
7103 char collisionSound[128];
7104 bool allowCrash;
7105 float minCollisionSpeed;
7106 float maxCollisionSpeed;
7107 void Created(GameObject *obj);
7108 void Timer_Expired(GameObject *obj,int number);
7109};
7110
7128class JMG_Utility_Enemy_Seen_Send_Custom : public ScriptImpClass {
7129 int lastEnemyId;
7130 int seenTime;
7131 int enemyPresetId;
7132 int id;
7133 int visibleMessage;
7134 int notVisibleMessage;
7135 int visibleParam;
7136 int notVisibleParam;
7137 int maxNotSeenTime;
7138 bool repeatSendSeenCustom;
7139 Vector3 carTankBike;
7140 Vector3 flyingTurretBoat;
7141 Vector3 submarineInfantryUnused;
7142 void Created(GameObject *obj);
7143 void Timer_Expired(GameObject *obj,int number);
7144 void Enemy_Seen(GameObject *obj,GameObject *seen);
7145 float GetPriority(GameObject *seen);
7146 void SendCustom(GameObject *obj,int custom,int param);
7147};
7148
7161 char script[128];
7162 int recieveMessage;
7163 void Created(GameObject *obj);
7164 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7165};
7166
7179 char script[128];
7180 int recieveMessage;
7181 void Created(GameObject *obj);
7182 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7183};
7184
7191 void Destroyed(GameObject *obj);
7192 void Detach(GameObject *obj);
7193};
7194
7202class JMG_Utility_Custom_Set_Engine : public ScriptImpClass {
7203 int custom;
7204 int enable;
7205 void Created(GameObject *obj);
7206 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7207};
7208
7224 int presetId;
7225 int id;
7226 int custom;
7227 int paramx;
7228 float delay;
7229 float rate;
7230 int minPlayers;
7231 int maxPlayers;
7232 bool repeat;
7233 void Created(GameObject *obj);
7234 void Timer_Expired(GameObject *obj,int number);
7235};
7236
7237
7246class JMG_Utility_Custom_Set_Position : public ScriptImpClass {
7247 int custom;
7248 Vector3 position;
7249 int id;
7250 void Created(GameObject *obj);
7251 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7252};
7253
7266class JMG_Utility_Custom_Delay_Send_Custom : public ScriptImpClass {
7267 int watchMessage;
7268 int id;
7269 int Param;
7270 ReferencerClass lastSender;
7271 int sendMessage;
7272 int lastParam;
7273 float delay;
7274 float randomDelay;
7275 int cancelCustom;
7276 void Created(GameObject *obj);
7277 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7278 void Timer_Expired(GameObject *obj,int number);
7279};
7280
7291class JMG_Utility_Scale_HP_By_Player_Count : public ScriptImpClass {
7292 int lastPlayerCount;
7293 int maxPlayerCount;
7294 float originalHealth;
7295 float originalArmor;
7296 float healthMultiplier;
7297 float armorMultiplier;
7298 int updateScaleCustom;
7299 bool repeat;
7300 void Created(GameObject *obj);
7301 void Timer_Expired(GameObject *obj,int number);
7302 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7303 void RescaleHP(GameObject *obj);
7304};
7305
7318 int recieveMessage;
7319 int team;
7320 int custom;
7321 int Param;
7322 float delay;
7323 float maxDistance;
7324 void Created(GameObject *obj);
7325 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7326};
7327
7333class JMG_Utility_Enemy_Seen_Send_Custom_Ignore : public ScriptImpClass {
7334 void Created(GameObject *obj);
7335};
7336
7350class JMG_Utility_In_Line_Of_Sight_Send_Custom : public ScriptImpClass {
7351 int lastEnemyId;
7352 int enemyPresetId;
7353 int id;
7354 int visibleMessage;
7355 int notVisibleMessage;
7356 int visibleParam;
7357 int notVisibleParam;
7358 bool enemyOnly;
7359 float rate;
7360 void Created(GameObject *obj);
7361 void Timer_Expired(GameObject *obj,int number);
7362 bool Test_Line_Of_Sight(GameObject *obj,GameObject *seen);
7363};
7364
7371 void Created(GameObject *obj);
7372};
7373
7380class JMG_Utility_Timer_Trigger_Enemy_Seen : public ScriptImpClass {
7381 float rate;
7382 void Created(GameObject *obj);
7383 void Timer_Expired(GameObject *obj,int number);
7384};
7385
7396 bool retryOnFailure;
7397 int custom;
7398 float safeTeleportDistance;
7399 int wanderPointGroup;
7400 void Created(GameObject *obj);
7401 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7402 bool Get_A_Defense_Point(Vector3 *position,float *facing);
7403 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
7404};
7405
7418 int time;
7419 int resetTime;
7420 float distance;
7421 int id;
7422 int custom;
7423 int Param;
7424 float delay;
7425 Vector3 lastPos;
7426 void Created(GameObject *obj);
7427 void Timer_Expired(GameObject *obj,int number);
7428};
7429
7430
7448class JMG_Utility_AI_Skittish_Herd_Animal : public ScriptImpClass {
7449public:
7450 class HerdAnimalPositionSystem
7451 {
7452 public:
7453 int animalCount;
7454 struct HerdPositionNode
7455 {
7456 int id;
7457 Vector3 pos;
7458 bool alive;
7459 struct HerdPositionNode *next;
7460 HerdPositionNode(GameObject *obj)
7461 {
7462 this->id = Commands->Get_ID(obj);
7463 this->pos = Commands->Get_Position(obj);
7464 this->alive = true;
7465 next = NULL;
7466 }
7467 };
7468 Vector3 herdRetreatLocation;
7469 float herdRetreatTime;
7470 time_t herdRetreatStart;
7471 private:
7472 Vector3 centerPos;
7473 time_t lastPosCalcTime;
7474 float minUpdateDelay;
7475 bool hascalculatedPos;
7476 HerdPositionNode *HerdPositionNodeList;
7477 public:
7478 HerdAnimalPositionSystem()
7479 {
7480 herdRetreatLocation = Vector3(0.0f,0.0f,0.0f);
7481 herdRetreatTime = 0.0f;
7482 herdRetreatStart = clock();
7483 minUpdateDelay = 10000.0f;
7484 hascalculatedPos = false;
7485 animalCount = 0;
7486 centerPos = Vector3(0.0f,0.0f,0.0f);
7487 lastPosCalcTime = clock();
7488 HerdPositionNodeList = NULL;
7489 }
7490 HerdPositionNode *AddNode(GameObject *obj)
7491 {
7492 int id = Commands->Get_ID(obj);
7493 HerdPositionNode *Current = HerdPositionNodeList;
7494 while (Current)
7495 {
7496 if (Current->id == id)
7497 {
7498 animalCount--;
7499 return Current;
7500 }
7501 Current = Current->next;
7502 }
7503 animalCount++;
7504 if (!HerdPositionNodeList)
7505 return (HerdPositionNodeList = new HerdPositionNode(obj));
7506 Current = HerdPositionNodeList;
7507 while (Current)
7508 {
7509 if (!Current->alive)
7510 {
7511 Current->id = Commands->Get_ID(obj);
7512 Current->pos = Commands->Get_Position(obj);
7513 Current->alive = true;
7514 return Current;
7515 }
7516 if (!Current->next)
7517 {
7518 Current->next = new HerdPositionNode(obj);
7519 return Current->next;
7520 }
7521 Current = Current->next;
7522 }
7523 return NULL;
7524 }
7525 HerdAnimalPositionSystem &operator -= (GameObject *obj)
7526 {
7527 int id = Commands->Get_ID(obj);
7528 HerdPositionNode *Current = HerdPositionNodeList;
7529 while (Current)
7530 {
7531 if (Current->id == id)
7532 {
7533 animalCount--;
7534 Current->alive = false;
7535 break;
7536 }
7537 Current = Current->next;
7538 }
7539 return *this;
7540 }
7541 Vector3 getCenterLocation(bool allowWander,int wanderPointGroup,float minUpdateHerdCenter,float maxUpdateHerdCenter);
7542 bool checkRetreatSuccessful()
7543 {
7544 HerdPositionNode *Current = HerdPositionNodeList;
7545 int retreatedCount = 0;
7546 while (Current)
7547 {
7548 if (Current->alive && JmgUtility::SimpleDistance(Current->pos,herdRetreatLocation) < 2500)
7549 retreatedCount++;
7550 Current = Current->next;
7551 }
7552 if (animalCount == retreatedCount)
7553 return true;
7554 return false;
7555 }
7556 bool checkRetreatCloseEnough()
7557 {
7558 HerdPositionNode *Current = HerdPositionNodeList;
7559 int retreatedCount = 0;
7560 while (Current)
7561 {
7562 if (Current->alive && JmgUtility::SimpleDistance(Current->pos,herdRetreatLocation) < 2500)
7563 retreatedCount++;
7564 Current = Current->next;
7565 }
7566 if (animalCount*0.75 <= retreatedCount)
7567 return true;
7568 return false;
7569 }
7570 void Empty_List()
7571 {
7572 HerdPositionNode *temp = HerdPositionNodeList,*die;
7573 while (temp)
7574 {
7575 die = temp;
7576 temp = temp->next;
7577 delete die;
7578 }
7579 HerdPositionNodeList = NULL;
7580 }
7581 };
7582 static HerdAnimalPositionSystem HerdAnimalPositionControl[128];
7583private:
7584 int herdId;
7585 HerdAnimalPositionSystem::HerdPositionNode *HerdPositionNode;
7586 int wanderPointGroup;
7587 char defaultWeapon[128];
7588 float weaponRange;
7589 float minRetreatRange;
7590 float maxRetreatRange;
7591 float minRetreatTime;
7592 float maxRetreatTime;
7593 float minUpdateHerdCenter;
7594 float maxUpdateHerdCenter;
7595 float wanderRadiusAroundHerdCenter;
7596 float wanderRadiusAroundHerdCenterSq;
7597 float minWanderFrequency;
7598 float maxWanderFrequency;
7599 float runTowardThreatChance;
7600 float actionCrouched;
7601 void Created(GameObject *obj);
7602 void Enemy_Seen(GameObject *obj,GameObject *seen);
7603 void Timer_Expired(GameObject *obj,int number);
7604 void Damaged(GameObject *obj,GameObject *damager,float damage);
7605 void Destroyed(GameObject *obj);
7606 void GotoLocation(GameObject *obj,const Vector3 &pos,GameObject *Enemy,float speed = 0);
7607 void setRetreatLocation(GameObject *obj,GameObject *enemy);
7608public:
7610 {
7611 herdId = 0;
7612 HerdPositionNode = NULL;
7613 }
7614 static bool Get_A_Wander_Point(Vector3 *position,int wanderPointGroup);
7615};
7621class JMG_Utility_AI_Skittish_Herd_Animal_Ignore : public ScriptImpClass {
7622 void Created(GameObject *obj);
7623};
7624
7631public:
7633 {
7634 for (int x = 0;x < 128;x++)
7635 JMG_Utility_AI_Skittish_Herd_Animal::HerdAnimalPositionControl[x] = JMG_Utility_AI_Skittish_Herd_Animal::HerdAnimalPositionSystem();
7636 }
7637 void Destroyed(GameObject *obj);
7638 void Detach(GameObject *obj);
7639};
7640
7649class JMG_Utility_Custom_Display_Dialog_Box : public ScriptImpClass {
7650 int custom;
7651 char *textMessage;
7652 void Created(GameObject *obj);
7653 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7654};
7655
7670 int recieveMessage;
7671 int presetId;
7672 int minCount;
7673 int maxCount;
7674 int id;
7675 int custom;
7676 int Param;
7677 float delay;
7678 void Created(GameObject *obj);
7679 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7680};
7681
7696 int recieveMessage;
7697 char script[128];
7698 int minCount;
7699 int maxCount;
7700 int id;
7701 int custom;
7702 int Param;
7703 float delay;
7704 void Created(GameObject *obj);
7705 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7706};
7707
7708
7719class JMG_Utility_Poke_Send_Custom_From_Poker : public ScriptImpClass {
7720 void Created(GameObject *obj);
7721 void Poked(GameObject *obj, GameObject *poker);
7722};
7723
7738class JMG_Utility_Custom_Grant_Scaled_Score : public ScriptImpClass {
7739 int lastPlayerCount;
7740 int maxPlayerCount;
7741 int grantCustom;
7742 float score;
7743 float scoreMultiplier;
7744 int updateScaleCustom;
7745 bool repeat;
7746 bool grantToSender;
7747 float theScore;
7748 bool entireTeam;
7749 int stopUpdateCustom;
7750 void Created(GameObject *obj);
7751 void Timer_Expired(GameObject *obj,int number);
7752 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7753 void RescaleScore(GameObject *obj);
7754};
7755
7763class JMG_Utility_Custom_Set_Infantry_Height : public ScriptImpClass {
7764 int custom;
7765 float height;
7766 void Created(GameObject *obj);
7767 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7768};
7769
7777class JMG_Utility_Custom_Set_Infantry_Width : public ScriptImpClass {
7778 int custom;
7779 float width;
7780 void Created(GameObject *obj);
7781 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7782};
7783
7791class JMG_Utility_Custom_Set_Weapon_Hold_Sytle : public ScriptImpClass {
7792 int custom;
7793 int style;
7794 void Created(GameObject *obj);
7795 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7796};
7797
7805class JMG_Utility_Custom_Set_Human_Anim_Override : public ScriptImpClass {
7806 int custom;
7807 bool enable;
7808 void Created(GameObject *obj);
7809 void Custom(GameObject *obj,int message,int param,GameObject *sender);
7810};
7811
7818public:
7819 struct WeaponNode
7820 {
7821 char weaponName[128];
7822 unsigned int weaponId;
7823 float sortOrder;
7824 int holdStyle;
7825 float speed;
7826 WeaponNode *next;
7827 WeaponNode *prev;
7828 WeaponNode(const char *weaponName,unsigned int weaponId,float sortOrder,int holdStyle,float speed,WeaponNode *prev,WeaponNode *next)
7829 {
7830 sprintf(this->weaponName,"%s",weaponName);
7831 this->weaponId = weaponId;
7832 this->sortOrder = sortOrder;
7833 this->holdStyle = holdStyle;
7834 this->speed = speed;
7835 this->prev = prev;
7836 this->next = next;
7837 }
7838 };
7839 static WeaponNode *weaponNodeGroups[128];
7840 static WeaponNode *weaponNodeGroupsEnd[128];
7841 static WeaponNode *addNode(int groupId,const char *weaponName,unsigned int weaponId,float sortOrder,int holdStyle,float speed)
7842 {
7843 if (!weaponNodeGroups[groupId])
7844 return weaponNodeGroups[groupId] = weaponNodeGroupsEnd[groupId] = new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,NULL,NULL);
7845 if (sortOrder < weaponNodeGroups[groupId]->sortOrder)
7846 return weaponNodeGroups[groupId] = weaponNodeGroups[groupId]->prev = new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,NULL,weaponNodeGroups[groupId]);
7847 WeaponNode *current = weaponNodeGroups[groupId],*prev = NULL;
7848 while (current)
7849 {
7850 if (current->weaponId == weaponId)
7851 {
7852 current->holdStyle = holdStyle;
7853 current->sortOrder = sortOrder;
7854 current->speed = speed;
7855 return current;
7856 }
7857 if (prev && prev->sortOrder <= sortOrder && current->sortOrder > sortOrder)
7858 return prev->next = current->prev = new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,prev,current);
7859 if (!current->next)
7860 return current->next = weaponNodeGroupsEnd[groupId] = new WeaponNode(weaponName,weaponId,sortOrder,holdStyle,speed,current,NULL);
7861 prev = current;
7862 current = current->next;
7863 }
7864 return NULL;
7865 };
7866 static WeaponNode *getNode(int groupId,const char *weaponName)
7867 {
7868 WeaponNode *current = weaponNodeGroups[groupId];
7869 while (current)
7870 {
7871 if (!_stricmp(weaponName,current->weaponName))
7872 return current;
7873 current = current->next;
7874 }
7875 return NULL;
7876 };
7877 static WeaponNode *getWeapon(int groupId,unsigned int weaponId)
7878 {
7879 WeaponNode *current = weaponNodeGroups[groupId];
7880 while (current)
7881 {
7882 if (weaponId == current->weaponId)
7883 return current;
7884 current = current->next;
7885 }
7886 return NULL;
7887 };
7888 static WeaponNode *getNext(GameObject *obj,int groupId,WeaponNode *current)
7889 {
7890 if (current)
7891 current = current->next;
7892 if (!current)
7893 current = weaponNodeGroups[groupId];
7894 for (int x = 0;x < 2;x++)
7895 {
7896 while (current)
7897 {
7898 if (Has_Weapon(obj,current->weaponName))
7899 return current;
7900 current = current->next;
7901 }
7902 current = weaponNodeGroups[groupId];
7903 }
7904 return NULL;
7905 };
7906 static WeaponNode *getPrev(GameObject *obj,int groupId,WeaponNode *current)
7907 {
7908 if (current)
7909 current = current->prev;
7910 if (!current)
7911 current = weaponNodeGroupsEnd[groupId];
7912 for (int x = 0;x < 2;x++)
7913 {
7914 while (current)
7915 {
7916 if (Has_Weapon(obj,current->weaponName))
7917 return current;
7918 current = current->prev;
7919 }
7920 current = weaponNodeGroupsEnd[groupId];
7921 }
7922 return NULL;
7923 };
7924 static void Empty_List()
7925 {
7926 for (int x = 0;x < 128;x++)
7927 {
7928 WeaponNode *temp = weaponNodeGroups[x],*die;
7929 weaponNodeGroups[x] = NULL;
7930 weaponNodeGroupsEnd[x] = NULL;
7931 while (temp)
7932 {
7933 die = temp;
7934 temp = temp->next;
7935 delete die;
7936 }
7937 }
7938 }
7939private:
7940 void Destroyed(GameObject *obj);
7941 void Detach(GameObject *obj);
7942public:
7943 static bool exists;
7945 {
7946 exists = true;
7947 for (int x = 0;x < 128;x++)
7948 weaponNodeGroups[x] = NULL;
7949 }
7950};
7951
7983class JMG_Utility_Swimming_Infantry_Advanced : public ScriptImpClass {
7984 int heartBeatSoundId;
7985 int pantSoundId;
7986 char enterWeapon[256];
7987 int playerId;
7988 bool startedFadeRed;
7989 float drownTime;
7990 bool underwater;
7991 int waterZoneCount;
7992 int lastWaterZoneId;
7993 time_t lastDisplayTime;
7994 float defaultSpeed;
7995 int waterDamageDelayTime;
7996 int waterDamageDelayTimeRecover;
7997 int remainingWaterDamageDelay;
7998 char originalSkin[128];
7999 char originalArmor[128];
8000 char originalModel[128];
8001 int weaponGroupId;
8002 unsigned int currentWeaponId;
8003 int defaultHoldStyle;
8004 float defaultSwimSpeedMultiplier;
8005 float waterSpeedMultiplier;
8006 char defaultWeaponPreset[128];
8007 float defaultDrownTime;
8008 float startDrownSequence;
8009 float waterDamageAmount;
8010 char waterDamageWarhead[128];
8011 float drownDamageRate;
8012 char swimmingSkin[128];
8013 char swimmingArmor[128];
8014 char swimmingModel[128];
8015 float swimmingHeightScale;
8016 float swimmingWidthScale;
8017 float originalHeightScale;
8018 float originalWidthScale;
8019 int enterWaterMessageStringId;
8020 Vector3 waterEnterMessageColorRGB;
8021 char heartBeatSoundEmitterModel[16];
8022 char pantingSoundEmitterModel[16];
8023 char gaspForBreath[128];
8024 float catchBreathRate;
8025 bool forceDefinedWeapons;
8026 int weaponSwitchForward;
8027 JMG_Utility_Swimming_Infantry_Advanced_Controller::WeaponNode *currentWeapon;
8028 void Created(GameObject *obj);
8029 void Timer_Expired(GameObject *obj,int number);
8030 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8031 void Killed(GameObject *obj,GameObject *killer);
8032 void Destroyed(GameObject *obj);
8033 void Detach(GameObject *obj);
8034 void CreateSoundEmitter(GameObject *obj,const char *model,int *soundId);
8035 void DestroySoundEmitter(int *soundId);
8036 void HideSoundEmitter(int *soundId);
8037 void SwitchWeapon(GameObject *obj);
8038 void UpdateWeaponSwimming(GameObject *obj,const WeaponDefinitionClass *weaponDef);
8039 void GetWeaponId(const WeaponDefinitionClass *weaponDef);
8040 int GetWeaponPosition(GameObject *obj,int weaponId);
8041public:
8043 {
8044 weaponGroupId = 0;
8045 currentWeaponId = 0;
8046 currentWeapon = NULL;
8047 }
8048};
8049
8061 void Created(GameObject *obj);
8062 void Timer_Expired(GameObject *obj,int number);
8063};
8064
8076 void Created(GameObject *obj);
8077 void Timer_Expired(GameObject *obj,int number);
8078};
8079
8119class JMG_Utility_Custom_Send_Cycled_Customs : public ScriptImpClass {
8120 int recieveMessage;
8121 int id;
8122 int custom[10];
8123 int Param[10];
8124 float delay[10];
8125 float randomDelay;
8126 float randomChance;
8127 int cycle;
8128 void Created(GameObject *obj);
8129 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8130};
8131
8141class JMG_Utility_Killed_Send_Custom_From_Killer : public ScriptImpClass {
8142 void Killed(GameObject *obj,GameObject *killer);
8143};
8144
8155class JMG_Utility_Emulate_Sound_Heard_On_FDS : public ScriptImpClass {
8156 class WeaponNode
8157 {
8158 public:
8159 enum FireWeaponReturn{NONE,INFANTRY_FIRE,VEHICLE_FIRE};
8160 bool infiniteBullets;
8161 char weaponName[256];
8162 int totalBullets;
8163 int GetWeaponBullets(GameObject *obj)
8164 {
8165 return infiniteBullets ? Get_Current_Bullets(obj) : Get_Current_Total_Bullets(obj);
8166 }
8167 WeaponNode(GameObject *obj)
8168 {
8169 sprintf(weaponName,"%s",Get_Current_Weapon(obj));
8170 infiniteBullets = Get_Current_Total_Bullets(obj) == -1 ? true : false;
8171 totalBullets = GetWeaponBullets(obj);
8172 }
8173 WeaponNode()
8174 {
8175 sprintf(weaponName,"");
8176 infiniteBullets = false;
8177 totalBullets = 0;
8178 }
8179 };
8180 float updateRate;
8181 int crouchSoundId;
8182 int walkSoundId;
8183 int runSoundId;
8184 WeaponNode currentWeapon;
8185 WeaponNode vehicleWeapon;
8186 void Created(GameObject *obj);
8187 void Timer_Expired(GameObject *obj,int number);
8188 WeaponNode::FireWeaponReturn FiredWeapon(GameObject *obj);
8189};
8190
8208 enum sBool{sNULL=-1,sFALSE,sTRUE};
8209 int team;
8210 sBool teamHoldingZone;
8211 bool enabled;
8212 int enableCustom;
8213 float rate;
8214 int id;
8215 int captureCustom;
8216 int captureParam;
8217 int lostCustom;
8218 int lostParam;
8219 float delay;
8220 bool sendCustomEveryTick;
8221 void Created(GameObject *obj);
8222 void Timer_Expired(GameObject *obj,int number);
8223 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8224};
8225
8242class JMG_Utility_Send_Custom_When_Team_Zone : public ScriptImpClass {
8243 enum sBool{sNULL=-1,sFALSE,sTRUE};
8244 int team;
8245 sBool teamInZone;
8246 bool enabled;
8247 int enableCustom;
8248 float rate;
8249 int id;
8250 int inCustom;
8251 int inParam;
8252 float delay;
8253 int outCustom;
8254 int outParam;
8255 bool sendCustomEveryTick;
8256 void Created(GameObject *obj);
8257 void Timer_Expired(GameObject *obj,int number);
8258 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8259};
8260
8272 void Created(GameObject *obj);
8273 void Timer_Expired(GameObject *obj,int number);
8274};
8275
8291 int triggerCustom;
8292 int countCustom;
8293 int count;
8294 int id;
8295 int sendCustom;
8296 int Param;
8297 float delay;
8298 int resetCustom;
8299 bool onceMatchedContinue;
8300 void Created(GameObject *obj);
8301 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8302};
8303
8320class JMG_Utility_Send_Custom_When_Not_Team_Zone : public ScriptImpClass {
8321 enum sBool{sNULL=-1,sFALSE,sTRUE};
8322 int team;
8323 sBool teamInZone;
8324 bool enabled;
8325 int enableCustom;
8326 float rate;
8327 int id;
8328 int inCustom;
8329 int inParam;
8330 float delay;
8331 int outCustom;
8332 int outParam;
8333 bool sendCustomEveryTick;
8334 void Created(GameObject *obj);
8335 void Timer_Expired(GameObject *obj,int number);
8336 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8337};
8338
8345 void Created(GameObject *obj);
8346};
8347
8354 void Created(GameObject *obj);
8355};
8356
8363 void Created(GameObject *obj);
8364};
8365
8377class JMG_Utility_Send_Custom_On_Armor : public ScriptImpClass {
8378 bool hurt;
8379 int id;
8380 int armorCustom;
8381 int armorParam;
8382 int noArmorCustom;
8383 int noArmorParam;
8384 float delay;
8385 void Created(GameObject *obj);
8386 void Timer_Expired(GameObject *obj,int number);
8387};
8388
8400class JMG_Utility_Base_Defense_Simple : public ScriptImpClass {
8401 int enemyId;
8402 float maxDistance;
8403 float maxDist;
8404 float minDist;
8405 int resetTime;
8406 int userSetResetTime;
8407 Vector3 carTankBike;
8408 Vector3 flyingTurretBoat;
8409 Vector3 submarineInfantryUnused;
8410 void Created(GameObject *obj);
8411 void Enemy_Seen(GameObject *obj,GameObject *seen);
8412 void Timer_Expired(GameObject *obj,int number);
8413 void Damaged(GameObject *obj,GameObject *damager,float damage);
8414 float GetPriority(GameObject *seen);
8415 void AttackTarget(GameObject *obj,int seenId,GameObject *seen);
8416};
8417
8428class JMG_Utility_Custom_Send_Custom_Supress_Spam : public ScriptImpClass {
8429 int catchCustom[10];
8430 int id;
8431 int lastCustom;
8432 int lastParam;
8433 int lastSentCustom;
8434 int lastSentParam;
8435 float spamDelay;
8436 bool supressingSpam;
8437 bool sendDuplicates;
8438 int senderId;
8439 void Created(GameObject *obj);
8440 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8441 void Timer_Expired(GameObject *obj,int number);
8442 bool SendCustom(GameObject *obj);
8443};
8444
8460 int sleepTime;
8461 int sleeping;
8462 bool triggerOnce;
8463 bool enabled;
8464 float minDistance;
8465 float maxDistance;
8466 float delay;
8467 int id;
8468 int param;
8469 int custom;
8470 void Created(GameObject *obj);
8471 void Timer_Expired(GameObject *obj,int number);
8472};
8473
8491 struct BriefingTextNode
8492 {
8493 char Text[256];
8494 float Delay;
8495 BriefingTextNode *prev;
8496 BriefingTextNode *next;
8497 BriefingTextNode(const char *text)
8498 {
8499 Delay = 0.0f;
8500 sprintf(Text,"%s",text);
8501 next = NULL;
8502 prev = NULL;
8503 }
8504 BriefingTextNode(const char *text,float delay)
8505 {
8506 Delay = delay;
8507 sprintf(Text,"%s",text);
8508 next = NULL;
8509 prev = NULL;
8510 }
8511 BriefingTextNode()
8512 {
8513 next = NULL;
8514 prev = NULL;
8515 }
8516 };
8517 BriefingTextNode *BriefingText;
8518 BriefingTextNode *lastNode;
8519 void Created(GameObject *obj);
8520 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8521 void Destroyed(GameObject *obj);
8522 void AddNewTextNode();
8523 void RemoveTextNodes();
8524};
8525
8536 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8537};
8538
8551 int playerType;
8552 int custom;
8553 int param;
8554 float delay;
8555 int id;
8556 bool triggerOnce;
8557 void Created(GameObject *obj);
8558 void Entered(GameObject *obj,GameObject *enterer);
8559};
8560
8589 int targetCustom;
8590 float minDistanceSquared;
8591 float lowAngleMaxDistance;
8592 bool useLowAngleWhenAboveMinDistance;
8593 float useLowAngleTargetAboveHeight;
8594 float reloadTime;
8595 float fireDelay;
8596 float fireVelocity;
8597 float velocitySquared;
8598 char fireSound[128];
8599 char vehicleProjectilePreset[128];
8600 char muzzleFlashExplosion[128];
8601 char projectileExplosion[128];
8602 char reloadSound[128];
8603 float minAngle;
8604 float maxAngle;
8605 float gravityScale;
8606 int clipCount;
8607 int currentClipCount;
8608 float missAmountPerMeter;
8609 float baseMissAmount;
8610 bool delayComplete;
8611 bool reloadComplete;
8612 int targetId;
8613 int aimTurret;
8614 int timeoutTime;
8615 int refreshTime;
8616 double lastAngle;
8617 float projectedShotsChance;
8618 bool projectShots;
8619 void Created(GameObject *obj);
8620 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8621 void Timer_Expired(GameObject *obj,int number);
8622 bool CalculateAngle(double *returnAngle,double distance,double height,bool highAngle);
8623 void FireProjectile(GameObject *obj,double zAngle,double aimAngle);
8624};
8625
8638 int id;
8639 int custom;
8640 int Param;
8641 float delay;
8642 bool triggerOnce;
8643 int team;
8644 void Created(GameObject *obj);
8645 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8646};
8647
8661 int custom;
8662 int resetCustom;
8663 int count;
8664 void Created(GameObject *obj);
8665 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8666};
8667
8678class JMG_Utility_Player_Seen_Send_Custom : public ScriptImpClass {
8679 int id;
8680 int custom;
8681 int Param;
8682 float delay;
8683 bool triggerOnce;
8684 void Created(GameObject *obj);
8685 void Timer_Expired(GameObject *obj,int number);
8686};
8699 char animation[32];
8700 char attachedModel[16];
8701 char attachedAnimation[32];
8702 char presetName[128];
8703 float zoneRotation;
8704 bool centerToZone;
8705 int custom;
8706 int customParam;
8707 void Created(GameObject *obj);
8708 void Entered(GameObject *obj,GameObject *enterer);
8709};
8710
8717 int holderId;
8718 Vector3 offset;
8719 void Created(GameObject *obj);
8720 void Animation_Complete(GameObject *obj,const char *anim);
8721 void Destroyed(GameObject *obj);
8722};
8723
8734 int custom;
8735 void Created(GameObject *obj);
8736 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8737};
8738
8751 int custom;
8752 void Created(GameObject *obj);
8753 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8754};
8755
8756
8765class JMG_Utility_Custom_Restore_Building : public ScriptImpClass {
8766 int id;
8767 int custom;
8768 bool triggerOnce;
8769 void Created(GameObject *obj);
8770 void Custom(GameObject *obj,int message,int param,GameObject *sender);
8771};
8772
8784class JMG_Utility_Timer_Custom_Random : public ScriptImpClass {
8785 int id;
8786 int message;
8787 int param;
8788 bool repeat;
8789 float time;
8790 float random;
8791 void Created(GameObject *obj);
8792 void Timer_Expired(GameObject *obj,int number);
8793};
8794
8795class DynamicAttachScript
8796{
8797public:
8798 class DynamicAttachScriptParams
8799 {
8800 public:
8801 struct DynamicAttachScriptParamNode
8802 {
8803 int index;
8804 char param[512];
8805 struct DynamicAttachScriptParamNode *next;
8806 DynamicAttachScriptParamNode(int index,const char *param)
8807 {
8808 this->index = index;
8809 sprintf(this->param,"%s",param);
8810 next = NULL;
8811 }
8812 };
8813 private:
8814 DynamicAttachScriptParamNode *DynamicAttachScriptParamNodeList;
8815 public:
8816 int objectCount;
8817 DynamicAttachScriptParams()
8818 {
8819 objectCount = 0;
8820 DynamicAttachScriptParamNodeList = NULL;
8821 }
8822 DynamicAttachScriptParamNode *AddOrUpdateParam(int index,const char *param)
8823 {
8824 DynamicAttachScriptParamNode *current = DynamicAttachScriptParamNodeList;
8825 if (!DynamicAttachScriptParamNodeList)
8826 {
8827 objectCount++;
8828 return (DynamicAttachScriptParamNodeList = new DynamicAttachScriptParamNode(index,param));
8829 }
8830 while (current)
8831 {
8832 if (current->index == index)
8833 {
8834 sprintf(current->param,"%s",param);
8835 return current;
8836 }
8837 if (!current->next)
8838 {
8839 objectCount++;
8840 return (current->next = new DynamicAttachScriptParamNode(index,param));
8841 }
8842 current = current->next;
8843 }
8844 return NULL;
8845 };
8846 DynamicAttachScriptParamNode *FindParam(int index)
8847 {
8848 DynamicAttachScriptParamNode *current = DynamicAttachScriptParamNodeList;
8849 while (current)
8850 {
8851 if (current->index == index)
8852 return current;
8853 current = current->next;
8854 }
8855 return NULL;
8856 };
8857 void EmptyList()
8858 {
8859 objectCount = 0;
8860 DynamicAttachScriptParamNode *temp = DynamicAttachScriptParamNodeList,*die;
8861 while (temp)
8862 {
8863 die = temp;
8864 temp = temp->next;
8865 delete die;
8866 }
8867 DynamicAttachScriptParamNodeList = NULL;
8868 }
8869 };
8870 struct DynamicAttachScriptNode
8871 {
8872 int scriptId;
8873 char scriptName[512];
8874 DynamicAttachScriptParams dynamicAttachScriptParams;
8875 struct DynamicAttachScriptNode *next;
8876 DynamicAttachScriptNode(int scriptId,const char *scriptName)
8877 {
8878 this->scriptId = scriptId;
8879 sprintf(this->scriptName,"%s",scriptName);
8880 next = NULL;
8881 }
8882 };
8883private:
8884 DynamicAttachScriptNode *DynamicAttachScriptNodeList;
8885public:
8886 DynamicAttachScript()
8887 {
8888 DynamicAttachScriptNodeList = NULL;
8889 }
8890 DynamicAttachScriptNode *AddDynamicScript(int scriptId,const char *scriptName)
8891 {
8892 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8893 if (!DynamicAttachScriptNodeList)
8894 {
8895 DynamicAttachScriptNodeList = new DynamicAttachScriptNode(scriptId,scriptName);
8896 return DynamicAttachScriptNodeList;
8897 }
8898 while (current)
8899 {
8900 if (current->scriptId == scriptId)
8901 {
8902 char errorMsg[220];
8903 sprintf(errorMsg,"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d already exists!",scriptId);
8904 Console_Input(errorMsg);
8905 return current;
8906 }
8907 if (!current->next)
8908 {
8909 current->next = new DynamicAttachScriptNode(scriptId,scriptName);
8910 return current->next;
8911 }
8912 current = current->next;
8913 }
8914 return NULL;
8915 };
8916 DynamicAttachScriptNode *FindDynamicScript(int scriptId)
8917 {
8918 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8919 while (current)
8920 {
8921 if (current->scriptId == scriptId)
8922 return current;
8923 current = current->next;
8924 }
8925 char errorMsg[220];
8926 sprintf(errorMsg,"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d doesn't exist!",scriptId);
8927 Console_Input(errorMsg);
8928 return NULL;
8929 };
8930 void AddParamToScript(int scriptId,int index,const char *param)
8931 {
8932 DynamicAttachScriptNode *current = DynamicAttachScriptNodeList;
8933 while (current)
8934 {
8935 if (current->scriptId == scriptId)
8936 {
8937 current->dynamicAttachScriptParams.AddOrUpdateParam(index,param);
8938 return;
8939 }
8940 }
8941 char errorMsg[220];
8942 sprintf(errorMsg,"msg JMG_Utility_Dynamic_Script_Add_Parameter ERROR: ScriptID %d doesn't exist!",scriptId);
8943 Console_Input(errorMsg);
8944 }
8945 void EmptyList()
8946 {
8947 DynamicAttachScriptNode *temp = DynamicAttachScriptNodeList,*die;
8948 while (temp)
8949 {
8950 die = temp;
8951 temp = temp->next;
8952 die->dynamicAttachScriptParams.EmptyList();
8953 delete die;
8954 }
8955 DynamicAttachScriptNodeList = NULL;
8956 }
8957};
8958
8964class JMG_Utility_Dynamic_Script_Controller : public ScriptImpClass {
8965 void Destroyed(GameObject *obj);
8966public:
8967 static DynamicAttachScript dynamicAttachScript;
8968};
8969
8977class JMG_Utility_Dynamic_Script_Definition : public ScriptImpClass {
8978 void Created(GameObject *obj);
8979};
8980
8991 void Created(GameObject *obj);
8992 void Timer_Expired(GameObject *obj,int number);
8993};
8994
9006 int custom;
9007 void Created(GameObject *obj);
9008 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9009};
9010
9018class JMG_Utility_Dynamic_Script_Custom_Attach : public ScriptImpClass {
9019 int custom;
9020 void Created(GameObject *obj);
9021 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9022};
9023
9041 int custom;
9042 void Created(GameObject *obj);
9043 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9044};
9045
9059 int objectiveId;
9060 int status;
9061 int recieveMessage;
9062 int id;
9063 int custom;
9064 int Param;
9065 float delay;
9066 void Created(GameObject *obj);
9067 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9068};
9069
9082 int objectiveId;
9083 int recieveMessage;
9084 int id;
9085 int custom;
9086 int Param;
9087 float delay;
9088 void Created(GameObject *obj);
9089 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9090};
9091
9103 int objectiveId[10];
9104 int recieveMessage;
9105 int id;
9106 int Param;
9107 float delay;
9108 void Created(GameObject *obj);
9109 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9110};
9111
9125 int objectiveId;
9126 int status;
9127 int recieveMessage;
9128 int id;
9129 int custom;
9130 int Param;
9131 float delay;
9132 void Created(GameObject *obj);
9133 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9134};
9135
9136class GlobalKeycardSystem
9137{
9138private:
9139 struct GlobalKeycardNode
9140 {
9141 int keycardId;
9142 int groupId;
9143 struct GlobalKeycardNode *next;
9144 GlobalKeycardNode(int keycardId,int groupId)
9145 {
9146 this->keycardId = keycardId;
9147 this->groupId = groupId;
9148 this->next = NULL;
9149 }
9150 };
9151 GlobalKeycardNode *globalKeycardNodeList;
9152 void AddKeycardToPlayerObjects(int keycardId,int groupId);
9153 void RemoveKeycardFromPlayerObjects(int keycardId,int groupId);
9154public:
9155 GlobalKeycardSystem()
9156 {
9157 globalKeycardNodeList = NULL;
9158 }
9159 GlobalKeycardNode *AddKeycard(int keycardId,int groupId)
9160 {
9161 GlobalKeycardNode *current = globalKeycardNodeList;
9162 if (!globalKeycardNodeList)
9163 {
9164 AddKeycardToPlayerObjects(keycardId,groupId);
9165 return (globalKeycardNodeList = new GlobalKeycardNode(keycardId,groupId));
9166 }
9167 while (current)
9168 {
9169 if (current->keycardId == keycardId && current->groupId == groupId)
9170 return current;
9171 if (!current->keycardId)
9172 {
9173 AddKeycardToPlayerObjects(keycardId,groupId);
9174 current->keycardId = keycardId;
9175 return current;
9176 }
9177 if (!current->next)
9178 {
9179 AddKeycardToPlayerObjects(keycardId,groupId);
9180 current->next = new GlobalKeycardNode(keycardId,groupId);
9181 return current;
9182 }
9183 current = current->next;
9184 }
9185 return NULL;
9186 }
9187 void RemoveKeycard(int keycardId,int groupId)
9188 {
9189 if (!globalKeycardNodeList)
9190 return;
9191 GlobalKeycardNode *current = globalKeycardNodeList;
9192 while (current)
9193 {
9194 if (current->keycardId == keycardId && current->groupId == groupId)
9195 {
9196 RemoveKeycardFromPlayerObjects(keycardId,groupId);
9197 current->keycardId = 0;
9198 break;
9199 }
9200 current = current->next;
9201 }
9202 }
9203 void emptyList()
9204 {
9205 GlobalKeycardNode *temp = globalKeycardNodeList,*die;
9206 while (temp)
9207 {
9208 RemoveKeycardFromPlayerObjects(temp->keycardId,temp->groupId);
9209 die = temp;
9210 temp = temp->next;
9211 delete die;
9212 }
9213 globalKeycardNodeList = NULL;
9214 }
9215 void GrantKeycards(GameObject *obj,int groupId)
9216 {
9217 GlobalKeycardNode *current = globalKeycardNodeList;
9218 while (current)
9219 {
9220 if (current->keycardId && current->groupId == groupId)
9221 Commands->Grant_Key(obj,current->keycardId,true);
9222 current = current->next;
9223 }
9224 }
9225};
9226
9233 void Destroyed(GameObject *obj);
9234};
9235
9244 void Created(GameObject *obj);
9245};
9246
9256 int custom;
9257 void Created(GameObject *obj);
9258 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9259};
9260
9270 int custom;
9271 void Created(GameObject *obj);
9272 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9273};
9274
9281class JMG_Utility_Global_Keycard_System_Soldier : public ScriptImpClass {
9282 void Created(GameObject *obj);
9283public:
9284 int groupId;
9285};
9286
9301 int occupiedId;
9302 int occupiedCustom;
9303 int occupiedParam;
9304 float occupiedDelay;
9305 int vacantId;
9306 int vacantCustom;
9307 int vacantParam;
9308 float vacantDelay;
9309 bool inZone[128];
9310 int count;
9311 void Created(GameObject *obj);
9312 void Entered(GameObject *obj,GameObject *enterer);
9313public:
9315 {
9316 for (int x = 0;x < 128;x++)
9317 inZone[x] = false;
9318 count = 0;
9319 }
9320 void Exited(GameObject *obj,GameObject *exiter);
9321};
9322
9329 void Destroyed(GameObject *obj);
9330};
9331
9337class JMG_Utility_Silent_Countdown_Controller : public ScriptImpClass {
9338public:
9339 struct SendCustomOnSecondNode
9340 {
9341 int triggerSecond;
9342 int id;
9343 int custom;
9344 int param;
9345 float delay;
9346 struct SendCustomOnSecondNode *next;
9347 SendCustomOnSecondNode(int triggerSecond,int id,int custom,int param,float delay)
9348 {
9349 this->triggerSecond = triggerSecond;
9350 this->id = id;
9351 this->custom = custom;
9352 this->param = param;
9353 this->delay = delay;
9354 this->next = NULL;
9355 }
9356 };
9357 struct SendCustomIdNode
9358 {
9359 int countdownId;
9360 struct SendCustomOnSecondNode *nodes;
9361 struct SendCustomIdNode *next;
9362 SendCustomIdNode(int countdownId)
9363 {
9364 this->countdownId = countdownId;
9365 this->nodes = NULL;
9366 this->next = NULL;
9367 }
9368 void Empty()
9369 {
9370 SendCustomOnSecondNode *temp = nodes,*die;
9371 while (temp)
9372 {
9373 die = temp;
9374 temp = temp->next;
9375 delete die;
9376 }
9377 nodes = NULL;
9378 }
9379 };
9380 static SendCustomIdNode *sendCustomIdNodeList;
9381 static SendCustomIdNode *FindOrCreateCountdownId(int countdownId)
9382 {
9383 SendCustomIdNode *current = sendCustomIdNodeList;
9384 if (!sendCustomIdNodeList)
9385 return (sendCustomIdNodeList = new SendCustomIdNode(countdownId));
9386 while (current)
9387 {
9388 if (current->countdownId == countdownId)
9389 return current;
9390 if (!current->next)
9391 return (current->next = new SendCustomIdNode(countdownId));
9392 current = current->next;
9393 }
9394 return NULL;
9395 }
9396private:
9397 void Created(GameObject *obj);
9398 void Destroyed(GameObject *obj);
9399public:
9400 static bool controllerPlaced;
9402 {
9403 controllerPlaced = false;
9404 }
9405 static void AddSecondNode(int countdownId,int triggerSecond,int id,int custom,int param,float delay)
9406 {
9407 SendCustomIdNode *baseNode = FindOrCreateCountdownId(countdownId);
9408 SendCustomOnSecondNode *current = baseNode->nodes;
9409 if (!baseNode->nodes)
9410 baseNode->nodes = new SendCustomOnSecondNode(triggerSecond,id,custom,param,delay);
9411 while (current)
9412 {
9413 if (triggerSecond == current->triggerSecond && id == current->id && custom == current->custom && param == current->param)
9414 {
9415 Console_Input("msg ERROR: A custom for this trigger second already exists!");
9416 return;
9417 }
9418 if (!current->next)
9419 {
9420 current->next = new SendCustomOnSecondNode(triggerSecond,id,custom,param,delay);
9421 return;
9422 }
9423 current = current->next;
9424 }
9425 }
9426 static void NodeSendCustom(GameObject *obj,SendCustomIdNode *countdownNode,int second)
9427 {
9428 if (!countdownNode)
9429 return;
9430 SendCustomOnSecondNode *current = countdownNode->nodes;
9431 while (current)
9432 {
9433 if (current->triggerSecond == second)
9434 Commands->Send_Custom_Event(obj,Commands->Find_Object(current->id),current->custom,current->param,current->delay);
9435 current = current->next;
9436 }
9437 }
9438 void EmptyList()
9439 {
9440 controllerPlaced = false;
9441 SendCustomIdNode *temp = sendCustomIdNodeList,*die;
9442 while (temp)
9443 {
9444 temp->Empty();
9445 die = temp;
9446 temp = temp->next;
9447 delete die;
9448 }
9449 sendCustomIdNodeList = NULL;
9450 }
9451};
9462class JMG_Utility_Silent_Countdown_Timer : public ScriptImpClass {
9463 bool paused;
9464 int startCustom;
9465 int pausedCustom;
9466 int cancelCustom;
9467 int time;
9468 JMG_Utility_Silent_Countdown_Controller::SendCustomIdNode *sendCustomIdNode;
9469 void Created(GameObject *obj);
9470 void Timer_Expired(GameObject *obj,int number);
9471 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9472};
9473
9485class JMG_Utility_Silent_Countdown_Send_Custom : public ScriptImpClass {
9486 void Created(GameObject *obj);
9487};
9488
9501class JMG_Utility_Zone_Teleport_To_Random_WP_Boss : public ScriptImpClass {
9502 bool faceBoss;
9503 bool retryOnFailure;
9504 int playerType;
9505 float safeTeleportDistance;
9506 int wanderPointGroup;
9507 int changeGroupIDCustom;
9508 bool aiOnly;
9509 void Created(GameObject *obj);
9510 void Entered(GameObject *obj,GameObject *enterer);
9511 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9512 bool Get_A_Defense_Point(Vector3 *position,float *facing,GameObject *boss);
9513 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
9514public:
9515 static int BossObjectId;
9516};
9517
9524 void Created(GameObject *obj);
9525};
9526
9534class JMG_Utility_Custom_Set_Soldier_Speed : public ScriptImpClass {
9535 int custom;
9536 void Created(GameObject *obj);
9537 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9538};
9539
9565class JMG_Utility_Control_Point_Controller : public ScriptImpClass {
9566public:
9567 struct ControlPointTeamData
9568 {
9569 int teamId;
9570 char teamName[128];
9571 int playerType;
9572 int radarBlipColor;
9573 char pointModel[16];
9574 char defaultAnimation[32];
9575 float animationLength;
9576 int defenseMultiplier;
9577 int captureMultiplier;
9578 int unoccupiedMultiplier;
9579 char lostSound[128];
9580 char captureSound[128];
9581 char lockedModel[16];
9582 char lockedAnim[32];
9583 float lockedAnimLen;
9584 int customId;
9585 int teamMemberCaptureCustom;
9586 int teamMembmerLostCustom;
9587 int teamCaptureCustom;
9588 int teamLostCustom;
9589 int teamMemberNeutralize;
9590 ControlPointTeamData(int teamId,const char *teamName,int playerType,int radarBlipColor,const char *pointModel,const char *defaultAnimation,float animationLength,const char *captureSound,const char *lostSound,const char *lockedModel,const char *lockedAnim,float lockedAnimLen,int defenseMultiplier,int captureMultiplier,int unoccupiedMultiplier,int customId,int teamMemberCaptureCustom,int teamMembmerLostCustom,int teamCaptureCustom,int teamLostCustom,int teamMemberNeutralize)
9591 {
9592 this->teamId = teamId;
9593 sprintf(this->teamName,"%s",teamName);
9594 this->playerType = playerType;
9595 this->radarBlipColor = radarBlipColor;
9596 sprintf(this->pointModel,"%s",pointModel);
9597 sprintf(this->defaultAnimation,"%s",defaultAnimation);
9598 this->animationLength = animationLength;
9599 this->defenseMultiplier = defenseMultiplier;
9600 this->captureMultiplier = captureMultiplier;
9601 this->unoccupiedMultiplier = unoccupiedMultiplier;
9602 sprintf(this->captureSound,"%s",captureSound);
9603 sprintf(this->lostSound,"%s",lostSound);
9604 sprintf(this->lockedModel,"%s",lockedModel);
9605 sprintf(this->lockedAnim,"%s",lockedAnim);
9606 this->lockedAnimLen = lockedAnimLen;
9607 this->customId = customId;
9608 this->teamMemberCaptureCustom = teamMemberCaptureCustom;
9609 this->teamMembmerLostCustom = teamMembmerLostCustom;
9610 this->teamCaptureCustom = teamCaptureCustom;
9611 this->teamLostCustom = teamLostCustom;
9612 this->teamMemberNeutralize = teamMemberNeutralize;
9613 }
9614 };
9615 static SList<ControlPointTeamData> controlPointTeamData;
9616 static bool controllerPlaced;
9617private:
9618 void Created(GameObject *obj);
9619 void Timer_Expired(GameObject *obj,int number);
9620 void Destroyed(GameObject *obj);
9621public:
9623 {
9624 controllerPlaced = true;
9625 allSetupComplete = false;
9626 }
9627 static SList<GameObject> controlPoints;
9628 static SList<GameObject> wanderPoints;
9629 static bool allSetupComplete;
9630};
9631
9658class JMG_Utility_Control_Point_Team_Setting : public ScriptImpClass {
9659 void Created(GameObject *obj);
9660};
9661
9678class JMG_Utility_Control_Point : public ScriptImpClass {
9679public:
9680 struct ControlPointSettingOverride
9681 {
9682 int teamId;
9683 int id;
9684 int captureCustom;
9685 int lostCustom;
9686 char pointModelOverride[16];
9687 char animOverride[32];
9688 float animationLength;
9689 char lockedPointModelOverride[16];
9690 char lockedAnimOverride[32];
9691 float lockedAnimationLength;
9692 ControlPointSettingOverride(int teamId,int id,int captureCustom,int lostCustom,const char *pointModelOverride,const char *animOverride,float animationLength,const char *lockedPointModelOverride,const char *lockedAnimOverride,float lockedAnimationLength)
9693 {
9694 this->teamId = teamId;
9695 this->id = id;
9696 this->captureCustom = captureCustom;
9697 this->lostCustom = lostCustom;
9698 sprintf(this->pointModelOverride,"%s",pointModelOverride);
9699 sprintf(this->animOverride,"%s",animOverride);
9700 this->animationLength = animationLength;
9701 sprintf(this->lockedPointModelOverride,"%s",lockedPointModelOverride);
9702 sprintf(this->lockedAnimOverride,"%s",lockedAnimOverride);
9703 this->lockedAnimationLength = lockedAnimationLength;
9704 }
9705 };
9706 SList<ControlPointSettingOverride> controlPointSettingOverride;
9707private:
9708 float captureScore;
9709 float neutralizeScore;
9710 int currerntCapturePoints;
9711 int maxCapturePoints;
9712 float currentFrame;
9713 float controlDistance;
9714 bool occupied;
9715 bool specialLocked;
9716 int lockCustom;
9717 int radarBipType;
9718 bool wasLocked;
9719 Vector3 controlHeightMinMax;
9720 int zoneId;
9721 ControlPointSettingOverride *controllingTeamOverride;
9722 ControlPointSettingOverride *lastTeamOverride;
9723 JMG_Utility_Control_Point_Controller::ControlPointTeamData *controllingTeam;
9724 JMG_Utility_Control_Point_Controller::ControlPointTeamData *neutralTeam;
9725 JMG_Utility_Control_Point_Controller::ControlPointTeamData *lastTeam;
9726 void Created(GameObject *obj);
9727 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9728 void Timer_Expired(GameObject *obj,int number);
9729 void Destroyed(GameObject *obj);
9730 void SetAnimation(GameObject *obj,const char *anim,float length);
9731 void AddUpCpPoints(GameObject *obj,JMG_Utility_Control_Point_Controller::ControlPointTeamData *unitTeamData,int multiplier);
9732 void JMG_Utility_Control_Point::Final_CP_Calculation(GameObject *obj);
9733 void LostControlPoint(GameObject *obj);
9734 void CaptureControlPoint(GameObject *obj);
9735 void GrantPointsToTeamMembersInRange(GameObject *obj,float points,bool matchTeam);
9736 void UpdateTeamOverride(int teamId);
9737 void UpdateTeam(int teamId);
9738 void TriggerAssaultLinesUpdate();
9739 void UpdateControllerWanderPoints();
9740 void SendCustomToAllInRange(GameObject *obj,int id,int teamId,int custom);
9741 void SendNeutralizeToAllInRange(GameObject *obj,int teamId);
9742public:
9743 char controlPointName[128];
9744 int cpGroupId;
9745 bool locked;
9746 bool captured;
9747 bool setupComplete;
9748 int controllingTeamId;
9749 void ChangeModelAndTeam(GameObject *obj);
9750 void UpdateAnimation(GameObject *obj);
9751 SList<GameObject> controlPointWanderPoints;
9753 {
9754 setupComplete = false;
9755 }
9756};
9757
9773class JMG_Utility_Control_Point_Setting_Override : public ScriptImpClass {
9774 void Created(GameObject *obj);
9775};
9776
9784class JMG_Utility_Control_Point_Team_Member : public ScriptImpClass {
9785 void Created(GameObject *obj);
9786 void Timer_Expired(GameObject *obj,int number);
9787 void Killed(GameObject *obj,GameObject *killer);
9788public:
9789 int teamId;
9790 JMG_Utility_Control_Point_Controller::ControlPointTeamData *teamData;
9791 bool setupComplete;
9792 int multiplier;
9794 {
9795 teamData = NULL;
9796 setupComplete = false;
9797 }
9798};
9799
9812class JMG_Utility_Control_Point_Assault_Mode : public ScriptImpClass {
9813 int id;
9814 int advanceCustom;
9815 int pushedBackCustom;
9816 int controlAllCustom;
9817 int lostAllCustom;
9818 void Created(GameObject *obj);
9819 void Timer_Expired(GameObject *obj,int number);
9820 void Destroyed(GameObject *obj);
9821 void SendCustom(GameObject* obj,int custom,int thisFrontLineGroup);
9822public:
9823 static int teamId;
9824 static int frontLineGroup;
9825 static int controllerId;
9826 static int spawnGroup;
9827 static int enemySpawnGroup;
9828 void UpdateAssaultLine(GameObject *obj,bool initialSetup);
9829};
9830
9840class JMG_Utility_Control_Point_Wander_Point : public ScriptImpClass {
9841 int spawnableGroupId;
9842 int unspawnableGroupId;
9843 JMG_Utility_Control_Point *cpScript;
9844 Rp2SimplePositionSystem::SimplePositionNode *wanderPoint;
9845 void Created(GameObject *obj);
9846 void Timer_Expired(GameObject *obj,int number);
9847 Rp2SimplePositionSystem::SimplePositionNode *AddAndReturnWanderpoint(GameObject *obj);
9848public:
9850 {
9851 cpScript = NULL;
9852 }
9853 int teamId;
9854 int controlPointId;
9855 void ControlPointChanged();
9856 void UpdateWanderpointSettings();
9857};
9858
9874 int stringId;
9875 int teamId;
9876 int controlPointId;
9877 int ungroupedControlPointId;
9878 int selectedCpId;
9879 int groupChangeCustom;
9880 int ungroupedChangeCustom;
9881 int spawnCustom;
9882 float safeTeleportDistance;
9883 int lastSpawnGroup;
9884 int maxSpawnTime;
9885 int spawnTime;
9886 float maxWanderRange;
9887 float startFadeRange;
9888 void Created(GameObject *obj);
9889 void Timer_Expired(GameObject *obj,int number);
9890 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9891 int SelectCpToSpawnFrom(GameObject *obj,int cpId,bool assaultLines);
9892 bool MoveToControlledWanderPointForCp(GameObject *obj,int cpId);
9893 void DisplaySpawnTime(GameObject *obj);
9894};
9895
9909class JMG_Utility_Custom_And_Param_Send_Custom : public ScriptImpClass {
9910 int recieveMessage;
9911 int recieveParam;
9912 int id;
9913 int custom;
9914 int Param;
9915 float delay;
9916 float randomDelay;
9917 float randomChance;
9918 void Created(GameObject *obj);
9919 void Custom(GameObject *obj,int message,int param,GameObject *sender);
9920};
9921
9927class JMG_Utility_Create_Move_To_Nearest_Pathfind : public ScriptImpClass {
9928 void Created(GameObject *obj);
9929};
9930
9943 char weaponName[128];
9944 char *params;
9945 char script[128];
9946 float rate;
9947 int playerType;
9948 void Created(GameObject *obj);
9949 void Timer_Expired(GameObject *obj,int number);
9950};
9951
9964 void Killed(GameObject *obj,GameObject *killer);
9965};
9966
9972class JMG_SinglePlayer_M04_Modifier : public ScriptImpClass {
9973 bool setupComplete;
9974 void Created(GameObject *obj);
9975 void Timer_Expired(GameObject *obj,int number);
9976public:
9977 void Register_Auto_Save_Variables();
9979 {
9980 setupComplete = false;
9981 }
9982};
9983
9994 struct TimedOrderedCustom
9995 {
9996 public:
9997 int senderId;
9998 int custom;
9999 int param;
10000 float time;
10001 TimedOrderedCustom(int senderid,int custom,int param,float time)
10002 {
10003 this->senderId = senderId;
10004 this->custom = custom;
10005 this->param = param;
10006 this->time = time;
10007 }
10008 };
10009 SList<TimedOrderedCustom> timedOrderedCustom;
10010 int id;
10011 int customs[10];
10012 float times[10];
10013 bool delay;
10014 void Created(GameObject *obj);
10015 void Timer_Expired(GameObject *obj,int number);
10016 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10017 void Destroyed(GameObject *obj);
10018 void Detach(GameObject *obj);
10019public:
10021 {
10022 timedOrderedCustom.Remove_All();
10023 }
10024};
10025
10037class JMG_Utility_Custom_Send_Custom_If_Model : public ScriptImpClass {
10038 int recieveMessage;
10039 int id;
10040 int custom;
10041 int Param;
10042 float delay;
10043 char model[16];
10044 void Created(GameObject *obj);
10045 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10046};
10047
10056class JMG_Utility_Poke_Grant_Weapon_Destroy_Self : public ScriptImpClass {
10057 void Created(GameObject *obj);
10058 void Poked(GameObject *obj, GameObject *poker);
10059};
10060
10070{
10071 bool dropped;
10072 void Killed(GameObject *obj,GameObject *killer);
10073 void Destroyed(GameObject *obj);
10074 void Detach(GameObject *obj);
10075public:
10077 {
10078 dropped = false;
10079 }
10080};
10081
10096class JMG_Utility_Poke_Send_Custom_If_Has_Weapon : public ScriptImpClass {
10097 int id;
10098 int playerType;
10099 int custom;
10100 int param;
10101 float delay;
10102 int triggerOnce;
10103 char weapon[256];
10104 int removeWeapon;
10105 int mustBeHeld;
10106 void Created(GameObject *obj);
10107 void Poked(GameObject *obj, GameObject *poker);
10108};
10109
10126 int id;
10127 int playerType;
10128 int custom;
10129 int param;
10130 float delay;
10131 int triggerOnce;
10132 char weapon[256];
10133 int removeWeapon;
10134 int mustBeHeld;
10135 float range;
10136 void Created(GameObject *obj);
10137 void Timer_Expired(GameObject *obj,int number);
10138};
10139
10147class JMG_Utility_Custom_Refect_Custom_If_Model : public ScriptImpClass {
10148 int sendFromSelf;
10149 char model[16];
10150 void Created(GameObject *obj);
10151 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10152};
10153
10161class JMG_Utility_Custom_Set_Team : public ScriptImpClass {
10162 int custom;
10163 int team;
10164 void Created(GameObject *obj);
10165 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10166};
10167
10177 int custom;
10178 char preset[128];
10179 int wanderPointGroup;
10180 void Created(GameObject *obj);
10181 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10182 bool Get_A_Defense_Point(Vector3 *position,float *facing);
10183};
10184
10197 bool retryOnFailure;
10198 int playerType;
10199 float safeTeleportDistance;
10200 int wanderPointGroup;
10201 int changeGroupIDCustom;
10202 bool aiOnly;
10203 void Created(GameObject *obj);
10204 void Entered(GameObject *obj,GameObject *enterer);
10205 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10206 bool Get_A_Defense_Point(Vector3 *position,float *facing);
10207 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
10208};
10209
10216 float safeTeleportDistance;
10217 int wanderPointGroup;
10218 void Created(GameObject *obj);
10219 void Timer_Expired(GameObject *obj,int number);
10220 bool Get_A_Defense_Point(Vector3 *position,float *facing);
10221};
10222
10241 int buttonIds[12];
10242 void Created(GameObject *obj);
10243 void Destroyed(GameObject *obj);
10244public:
10245 char combination[25];
10246};
10247
10268class JMG_Utility_Custom_Combination_Lock : public ScriptImpClass {
10269 char inputCode[128];
10270 unsigned int depth;
10271 int failCount;
10272 bool enabled;
10273 int inputCustom;
10274 int inputEnter;
10275 int inputClear;
10276 int enableCustom;
10277 char combination[25];
10278 int successCustom;
10279 int failureSaftey;
10280 int maxFailures;
10281 int partialFailCustom;
10282 int failureCustom;
10283 bool disableOnFailure;
10284 bool disableOnSuccess;
10285 int id;
10286 char soundNameBase[128];
10287 void Created(GameObject *obj);
10288 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10289 void Send_Custom(GameObject *obj,int custom,int param);
10290 void Enable(bool enableLock);
10291 void ClearUserEntry();
10292};
10298class JMG_Utility_Custom_Combination_Lock_Key : public ScriptImpClass {
10299 int id;
10300 int message;
10301 int param;
10302 bool useAltAnimation;
10303 char animation[32];
10304 char animation2[32];
10305 char soundName[128];
10306 void Created(GameObject *obj);
10307 void Poked(GameObject *obj,GameObject *poker);
10308};
10309
10318 char delim;
10319 int stringId;
10320 void Created(GameObject *obj);
10321 void Timer_Expired(GameObject *obj,int number);
10322};
10323
10332 char animation[32];
10333 char subobject[16];
10334 bool animating[128];
10335 void Created(GameObject *obj);
10336 void Timer_Expired(GameObject *obj,int number);
10337 void TriggerAnimationForThePlayer(GameObject *obj,int playerId);
10338};
10339
10354 int receivedCustom;
10355 int id;
10356 int custom;
10357 int Param;
10358 float delay;
10359 char animation[32];
10360 float startFrame;
10361 float endFrame;
10362 void Created(GameObject *obj);
10363 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10364 void Animation_Complete(GameObject *obj,const char *anim);
10365};
10366
10374 void Created(GameObject *obj);
10375};
10376
10387class JMG_Utility_Custom_Send_Custom_To_Preset : public ScriptImpClass {
10388 int receivedCustom;
10389 char preset[128];
10390 int custom;
10391 int Param;
10392 float delay;
10393 void Created(GameObject *obj);
10394 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10395};
10396
10397
10405class JMG_Utility_Custom_Talk : public ScriptImpClass {
10406 int custom;
10407 int soundId;
10408 int stringId;
10409 char soundName[128];
10410 void Created(GameObject *obj);
10411 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10412 void Killed(GameObject *obj,GameObject *killer);
10413};
10414
10427class JMG_Utility_Zone_Send_Custom_Enter_Preset : public ScriptImpClass {
10428 char preset[128];
10429 int playerType;
10430 int custom;
10431 int param;
10432 float delay;
10433 int id;
10434 bool triggerOnce;
10435 void Created(GameObject *obj);
10436 void Entered(GameObject *obj,GameObject *enterer);
10437};
10438
10446class JMG_Utility_Global_Armor_Controller : public ScriptImpClass {
10447 void Created(GameObject *obj);
10448public:
10449 static float maxArmor;
10450 static float armor;
10451};
10452
10462class JMG_Utility_Global_Armor_Custom : public ScriptImpClass {
10463 int custom;
10464 float maxArmor;
10465 float armor;
10466 bool updateAllObjects;
10467 void Created(GameObject *obj);
10468 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10469};
10470
10476class JMG_Utility_Global_Armor_Object : public ScriptImpClass {
10477 void Created(GameObject *obj);
10478};
10479
10487class JMG_Utility_Global_Health_Controller : public ScriptImpClass {
10488 void Created(GameObject *obj);
10489public:
10490 static float maxHealth;
10491 static float health;
10492};
10493
10503class JMG_Utility_Global_Health_Custom : public ScriptImpClass {
10504 int custom;
10505 float maxHealth;
10506 float health;
10507 bool updateAllObjects;
10508 void Created(GameObject *obj);
10509 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10510};
10511
10517class JMG_Utility_Global_Health_Object : public ScriptImpClass {
10518 void Created(GameObject *obj);
10519};
10520
10531class JMG_Utility_Custom_Create_Random_Explosions : public ScriptImpClass {
10532 int custom;
10533 int count;
10534 float distance;
10535 int killerId;
10536 char explosionPreset[256];
10537 void Created(GameObject *obj);
10538 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10539};
10540
10551 int currentId;
10552 int custom;
10553 int endId;
10554 bool enable;
10555 void Created(GameObject *obj);
10556 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10557};
10558
10569 int targetGroupId;
10570 int nonTargetGroupId;
10571 JMG_Utility_Control_Point *cpScript;
10572 Rp2SimplePositionSystem::SimplePositionNode *wanderPoint;
10573 void Created(GameObject *obj);
10574 void Timer_Expired(GameObject *obj,int number);
10575 Rp2SimplePositionSystem::SimplePositionNode *AddAndReturnWanderpoint(GameObject *obj);
10576public:
10578 {
10579 cpScript = NULL;
10580 }
10581 int teamId;
10582 int controlPointId;
10583 void ControlPointChanged();
10584 void UpdateWanderpointSettings();
10585};
10586
10587
10613class JMG_Utility_AI_Control_Point : public ScriptImpClass {
10614 enum aiState{IDLE,CONTROL_POINT_ATTACK,CONTROL_POINT_DEFENSE,ATTACKING_TARGET,CHECKING_LOCATION,ACTION_BADPATH};
10615 struct LastAction
10616 {
10617 int targetId;
10618 Vector3 location;
10619 float speed;
10620 float distance;
10621 bool attack;
10622 bool overrideLocation;
10623 LastAction()
10624 {
10625 }
10626 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation)
10627 {
10628 this->targetId = targetId;
10629 this->location = location;
10630 this->speed = speed;
10631 this->distance = distance;
10632 this->attack = attack;
10633 this->overrideLocation = overrideLocation;
10634 }
10635 };
10636 struct ValidLastLocation
10637 {
10638 bool valid;
10639 Vector3 location;
10640 ValidLastLocation(bool valid)
10641 {
10642 this->valid = valid;
10643 }
10644 ValidLastLocation(int enemyId);
10645 };
10646 LastAction lastAction;
10647 aiState state;
10648 Rp2SimplePositionSystem::SimplePositionNode *lastWanderPoint;
10649 int targetId;
10650 int lastSeenTime;
10651 float weaponRange;
10652 float weaponEffectiveRange;
10653 float attackArriveDistance;
10654 int stuckTime;
10655 int reverseTime;
10656 Vector3 lastPosition;
10657 bool moveBackward;
10658 float captureDistanceSquared;
10659 float defendDistanceSquared;
10660 bool allowCaptureAttackDistract;
10661
10662 int captureCpGroupId;
10663 float captureCpChance;
10664 float captureSpeed;
10665 float captureDistance;
10666 int defendCpGroupId;
10667 float defendSpeed;
10668 float defendDistance;
10669 float closeDefendDistanceSquared;
10670 float chooseFarDefendChance;
10671 float attackSpeed;
10672 float attackDistance;
10673 float randomAttackDistance;
10674 float attackDistractFromCaptureChance;
10675 float chanceToInvestigateLastSeenLocation;
10676 bool attackCheckBlocked;
10677 int canSeeStealth;
10678 bool shutdownEngineOnArrival;
10679 int changeDefendSpeedCustom;
10680 int changeCaptureSpeedCustom;
10681 int changeAttackSpeedCustom;
10682 void Created(GameObject *obj);
10683 void Enemy_Seen(GameObject *obj,GameObject *seen);
10684 void Timer_Expired(GameObject *obj,int number);
10685 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
10686 void Damaged(GameObject *obj,GameObject *damager,float damage);
10687 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation);
10688 void SelectNextMission(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
10689 void Stuck_Check(GameObject *obj,Vector3 targetPos);
10690 bool Choose_Target(GameObject *obj,GameObject *target);
10691 Rp2SimplePositionSystem::SimplePositionNode *Get_Capture_Point();
10692 Rp2SimplePositionSystem::SimplePositionNode *Get_Defense_Point(GameObject *obj);
10693 void TriggerAttack(GameObject *obj,GameObject *target);
10694 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10695public:
10697 {
10698 lastWanderPoint = NULL;
10699 }
10700};
10701
10702
10710{
10711 void Created(GameObject *obj);
10712 void Timer_Expired(GameObject *obj,int number);
10713};
10714
10733 int buttonIds[12];
10734 void Created(GameObject *obj);
10735 void Destroyed(GameObject *obj);
10736};
10737
10748 int customMsg;
10749 bool retryOnFailure;
10750 float safeTeleportDistance;
10751 int wanderPointGroup;
10752 void Created(GameObject *obj);
10753 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10754 bool Get_A_Defense_Point(Vector3 *position,float *facing);
10755 bool Grab_Teleport_Spot(GameObject *enter,int attempts);
10756};
10757
10765class JMG_Utility_Create_Set_Random_Model : public ScriptImpClass {
10766 void Created(GameObject *obj);
10767};
10768
10775class JMG_Utility_Custom_Destroy_Sender : public ScriptImpClass {
10776 int custom;
10777 void Created(GameObject *obj);
10778 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10779};
10780
10790 int custom;
10791 char weapon[128];
10792 char fullAmmoString[128];
10793 void Created(GameObject *obj);
10794 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10795};
10796
10797
10808class JMG_Utility_Remove_Script_While_Has_Weapon : public ScriptImpClass {
10809 char weaponName[128];
10810 char *params;
10811 char script[128];
10812 float rate;
10813 void Created(GameObject *obj);
10814 void Timer_Expired(GameObject *obj,int number);
10815};
10816
10822class JMG_Utility_Swimming_Infantry_AI : public ScriptImpClass {
10823 int heartBeatSoundId;
10824 int pantSoundId;
10825 char enterWeapon[256];
10826 bool startedFadeRed;
10827 float drownTime;
10828 bool underwater;
10829 int waterZoneCount;
10830 int lastWaterZoneId;
10831 float defaultSpeed;
10832 int waterDamageDelayTime;
10833 int waterDamageDelayTimeRecover;
10834 int remainingWaterDamageDelay;
10835 char originalSkin[128];
10836 char originalArmor[128];
10837 char originalModel[128];
10838 bool isUnderwater;
10839 void Created(GameObject *obj);
10840 void Timer_Expired(GameObject *obj,int number);
10841 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10842 void Killed(GameObject *obj,GameObject *killer);
10843 void Destroyed(GameObject *obj);
10844 void Detach(GameObject *obj);
10845 void CreateSoundEmitter(GameObject *obj,const char *model,int *soundId);
10846 void DestroySoundEmitter(int *soundId);
10847 void HideSoundEmitter(int *soundId);
10848};
10849
10856class JMG_Utility_Damaged_Refund_Damage : public ScriptImpClass {
10857 WarheadType warhead;
10858 void Created(GameObject *obj);
10859 void Damaged(GameObject *obj,GameObject *damager,float damage);
10860public:
10862 {
10863 warhead = NULL;
10864 }
10865};
10866
10874{
10875 int custom;
10876 void Created(GameObject *obj);
10877 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10878public:
10880 {
10881 AllowAttach = true;
10882 }
10883 static bool AllowAttach;
10884};
10885
10893class JMG_Utility_Turret_Spawn_Global_Flag : public ScriptImpClass
10894{
10895 int turretId;
10896 bool hasDriver;
10897 void Created(GameObject *obj);
10898 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10899 void Killed(GameObject *obj,GameObject *killer);
10900 void Destroyed(GameObject *obj);
10901 void Detach(GameObject *obj);
10902};
10903
10913 char warhead[128];
10914 float giveDamage;
10915 int time;
10916 int originalTime;
10917 void Created(GameObject *obj);
10918 void Timer_Expired(GameObject *obj,int number);
10919 void Damaged(GameObject *obj,GameObject *damager,float damage);
10920};
10921
10929{
10930 void Created(GameObject *obj);
10931public:
10933 {
10934 globalFlag = -1;
10935 }
10936 static int globalFlag;
10937};
10938
10947{
10948 int custom;
10949 int globalFlag;
10950 void Created(GameObject *obj);
10951 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10952};
10953
10963class JMG_Utility_Global_Attach_Script_On_Flag : public ScriptImpClass {
10964 void Created(GameObject *obj);
10965};
10966
10974{
10975 int custom;
10976 char *params;
10977 char script[128];
10978 char preset[128];
10979 void Created(GameObject *obj);
10980 void Custom(GameObject *obj,int message,int param,GameObject *sender);
10981};
10982
10993 char animation[32];
10994 float maxFrame;
10995 int controllerId;
10996 float lastCalculation;
10997 void Created(GameObject *obj);
10998 void Timer_Expired(GameObject *obj,int number);
10999};
11000
11007 void Created(GameObject *obj);
11008};
11009
11018 int originalTime;
11019 int time;
11020 Vector3 location;
11021 Vector3 lastSpot;
11022 void Created(GameObject *obj);
11023 void Timer_Expired(GameObject *obj,int number);
11024};
11025
11033{
11034 void Created(GameObject *obj);
11035public:
11037 {
11038 sprintf(extension,"");
11039 }
11040 static char extension[16];
11041};
11042
11051{
11052 int custom;
11053 char extension[16];
11054 void Created(GameObject *obj);
11055 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11056};
11057
11065class JMG_Utility_Global_Set_Random_Model : public ScriptImpClass {
11066 int randomValue;
11067 char baseName[16];
11068 void Created(GameObject *obj);
11069public:
11070 void UpdateModel(GameObject *obj);
11071};
11072
11078class JMG_Utility_Swimming_Infantry_Advanced_AI : public ScriptImpClass {
11079 int heartBeatSoundId;
11080 int pantSoundId;
11081 char enterWeapon[256];
11082 bool startedFadeRed;
11083 float drownTime;
11084 bool underwater;
11085 int waterZoneCount;
11086 int lastWaterZoneId;
11087 float defaultSpeed;
11088 int waterDamageDelayTime;
11089 int waterDamageDelayTimeRecover;
11090 int remainingWaterDamageDelay;
11091 char originalSkin[128];
11092 char originalArmor[128];
11093 char originalModel[128];
11094 int weaponGroupId;
11095 unsigned int currentWeaponId;
11096 int defaultHoldStyle;
11097 float defaultSwimSpeedMultiplier;
11098 float waterSpeedMultiplier;
11099 char defaultWeaponPreset[128];
11100 float defaultDrownTime;
11101 float startDrownSequence;
11102 float waterDamageAmount;
11103 char waterDamageWarhead[128];
11104 float drownDamageRate;
11105 char swimmingSkin[128];
11106 char swimmingArmor[128];
11107 char swimmingModel[128];
11108 float swimmingHeightScale;
11109 float swimmingWidthScale;
11110 float originalHeightScale;
11111 float originalWidthScale;
11112 char heartBeatSoundEmitterModel[16];
11113 char pantingSoundEmitterModel[16];
11114 char gaspForBreath[128];
11115 float catchBreathRate;
11116 bool forceDefinedWeapons;
11117 int weaponSwitchForward;
11118 JMG_Utility_Swimming_Infantry_Advanced_Controller::WeaponNode *currentWeapon;
11119 void Created(GameObject *obj);
11120 void Timer_Expired(GameObject *obj,int number);
11121 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11122 void Killed(GameObject *obj,GameObject *killer);
11123 void Destroyed(GameObject *obj);
11124 void Detach(GameObject *obj);
11125 void CreateSoundEmitter(GameObject *obj,const char *model,int *soundId);
11126 void DestroySoundEmitter(int *soundId);
11127 void HideSoundEmitter(int *soundId);
11128 void SwitchWeapon(GameObject *obj);
11129 void UpdateWeaponSwimming(GameObject *obj,const WeaponDefinitionClass *weaponDef);
11130 void GetWeaponId(const WeaponDefinitionClass *weaponDef);
11131 int GetWeaponPosition(GameObject *obj,int weaponId);
11132public:
11134 {
11135 weaponGroupId = 0;
11136 currentWeaponId = 0;
11137 currentWeapon = NULL;
11138 }
11139};
11140
11148{
11149 void Created(GameObject *obj);
11150public:
11152 {
11153 globalFlag = -1;
11154 }
11155 static int globalFlag;
11156};
11157
11166{
11167 int custom;
11168 int globalFlag;
11169 void Created(GameObject *obj);
11170 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11171};
11172
11187{
11188 int globalFlag;
11189 int recieveMessage;
11190 int id;
11191 int custom;
11192 int Param;
11193 float delay;
11194 float randomDelay;
11195 float randomChance;
11196 void Created(GameObject *obj);
11197 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11198};
11218 struct JMGVehicleAmmo
11219 {
11220 bool allowError;
11221 float range;
11222 float speed;
11223 JMGVehicleAmmo()
11224 {
11225 allowError = false;
11226 range = 0.0f;
11227 speed = 400.0f;
11228 }
11229 };
11230 Vector3 gotoLocation;
11231 int gotoObjectId;
11232 float maxPlayerDistance;
11233 JMGVehicleAmmo primary;
11234 JMGVehicleAmmo secondary;
11235 JMGVehicleAction currentAction;
11236 JMGVehicleAction lastAction;
11237 bool overrideFireMode;
11238 bool overridePrimary;
11239 int lastSeenCount;
11240 int reverseTime;
11241 int stuckCount;
11242 int useAmmo;
11243 int doNotUsePathfind;
11244 float lastHealth;
11245 float minDistanceSquared;
11246 bool moving;
11247 bool attacking;
11248 int badDestAttempt;
11249 Vector3 lastPos;
11250 Vector3 homepos;
11251 int myteam;
11252 bool inRange;
11253 bool drivingBackward;
11254 float minAttackRange;
11255 float definedWeaponError;
11256 int forceFire;
11257 float vtolHover;
11258 int vsSoldier;
11259 int vsAircraft;
11260 int vsVehicle;
11261 float overrideSpeed;
11262 int playerType;
11263 void Created(GameObject *obj);
11264 void Action_Complete(GameObject *obj,int action,ActionCompleteReason reason);
11265 void Enemy_Seen(GameObject *obj,GameObject *seen);
11266 void Damaged(GameObject *obj,GameObject *damager,float damage);
11267 void Timer_Expired(GameObject *obj,int number);
11268 void RunAttack(GameObject *obj,GameObject *target);
11269 int GetThreatRating(GameObject * obj);
11270 GameObject *GetAttackObject(GameObject * obj);
11271 GameObject *SelectTarget(GameObject *obj,GameObject *target);
11272 GameObject *SetTarget(GameObject *target);
11273 GameObject *GetClosest(GameObject *obj,GameObject *new_target,GameObject *old_target);
11274 int SelectAmmo(GameObject *target);
11275 void StuckCheck(GameObject *obj);
11276 void AttackMove(GameObject *obj,GameObject *target,bool gotoObject,Vector3 targetLocation,int fireMode,float weaponError,bool forceUpdate,float arriveDistance);
11277 JMGVehicleAmmo DefineAmmo(const AmmoDefinitionClass *ammo);
11278};
11285{
11286 void Created(GameObject *obj);
11287};
11288
11298{
11299 void Killed(GameObject *obj,GameObject *killer);
11300 void Timer_Expired(GameObject *obj,int number);
11301};
11302
11318 int id;
11319 int custom;
11320 int Param;
11321 float delay;
11322 float randomDelay;
11323 int objectiveIds[128];
11324 int objectiveCount;
11325 bool repeat;
11326 void Created(GameObject *obj);
11327 void Timer_Expired(GameObject *obj,int number);
11328};
11329
11339class JMG_Utility_Damage_Update_Animation_Frame : public ScriptImpClass {
11340 char animation[32];
11341 float maxFrame;
11342 float lastCalculation;
11343 void Created(GameObject *obj);
11344 void Damaged(GameObject *obj,GameObject *damager,float damage);
11345};
11346
11356 void Created(GameObject *obj);
11357 void Timer_Expired(GameObject *obj,int number);
11358};
11359
11390class JMG_Utility_AI_Goto_Target_Script : public ScriptImpClass {
11391 enum aiState{IDLE,HUNTING_STAR,ATTACKING_TARGET,RETURNING_HOME,WANDERING_GROUP,ACTION_BADPATH};
11392 struct LastAction
11393 {
11394 int targetId;
11395 Vector3 location;
11396 float speed;
11397 float distance;
11398 bool attack;
11399 bool overrideLocation;
11400 LastAction()
11401 {
11402 }
11403 LastAction(int targetId,Vector3 location,float speed,float distance,bool attack,bool overrideLocation)
11404 {
11405 this->targetId = targetId;
11406 this->location = location;
11407 this->speed = speed;
11408 this->distance = distance;
11409 this->attack = attack;
11410 this->overrideLocation = overrideLocation;
11411 }
11412 bool operator == (LastAction l)
11413 {
11414 return (targetId == l.targetId && JmgUtility::SimpleDistance(location,l.location) <= 0.0f && speed == l.speed && distance == l.distance && attack == l.attack && overrideLocation == l.overrideLocation);
11415 }
11416 };
11417 struct ValidLastLocation
11418 {
11419 bool valid;
11420 Vector3 location;
11421 ValidLastLocation(bool valid)
11422 {
11423 this->valid = valid;
11424 }
11425 ValidLastLocation(int enemyId);
11426 };
11427 LastAction lastAction;
11428 aiState state;
11429 Vector3 homeLocation;
11430 float maxSightFromHomeLocation;
11431 bool huntStealth;
11432 int targetId;
11433 int lastSeenTime;
11434 float weaponRange;
11435 float weaponEffectiveRange;
11436 int huntingEnemyId;
11437 int removeIgnoreTime;
11438 int ignoreEnemyId;
11439 float huntSearchDistance;
11440 float huntArriveDistance;
11441 float attackArriveDistance;
11442 int stuckTime;
11443 int reverseTime;
11444 Vector3 lastPosition;
11445 bool moveBackward;
11446 float wanderDistanceOverride;
11447 int wanderingAiGroupId;
11448 float wanderSpeed;
11449 float huntSpeed;
11450 float attackSpeed;
11451 float returnHomeSpeed;
11452 int changeWanderGroupCustom;
11453 int changeWanderSpeedCustom;
11454 int changeHuntDistanceCustom;
11455 int changeReturnHomeSpeedCustom;
11456 int changeHuntSpeedCustom;
11457 int changeMaxSightFromHomeLocationCustom;
11458 int changeAttackSpeedCustom;
11459 void Created(GameObject *obj);
11460 void Enemy_Seen(GameObject *obj,GameObject *seen);
11461 void Timer_Expired(GameObject *obj,int number);
11462 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11463 void Action_Complete(GameObject *obj,int action_id,ActionCompleteReason reason);
11464 void Damaged(GameObject *obj,GameObject *damager,float damage);
11465 void Attack_Move(GameObject *obj,GameObject *target,Vector3 location,float speed,float distance,bool attack,bool overrideLocation);
11466 GameObject *findClosestStar(GameObject *obj);
11467 void Return_Home(GameObject *obj,ValidLastLocation goNearLastWanderPoint);
11468 void Stuck_Check(GameObject *obj,Vector3 targetPos);
11469 void Cant_Get_To_target(GameObject *obj);
11470 bool GetRandomPosition(Vector3 *position);
11471 bool Choose_Target(GameObject *obj,GameObject *target);
11472};
11473
11480 void Created(GameObject *obj);
11481};
11482
11488class JMG_Utility_AI_Goto_Target_Script_Target : public ScriptImpClass {
11489 void Created(GameObject *obj);
11490};
11491
11508 int maxCount;
11509 float playerAddMaxCount;
11510 char script[256];
11511 int recieveMessage;
11512 int id;
11513 int custom;
11514 int Param;
11515 float delay;
11516 float randomDelay;
11517 float randomChance;
11518 void Created(GameObject *obj);
11519 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11520};
11521
11531class JMG_Utility_Created_Trigger_Create_Vehicle : public ScriptImpClass {
11532 void Created(GameObject *obj);
11533};
11534
11548{
11549 int custom;
11550 bool repeat;
11551 bool requiresRemoveScript;
11552 char *params;
11553 char *attachScript;
11554 char *removeScript;
11555 void Created(GameObject *obj);
11556 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11557};
11558
11564class JMG_Utility_AI_Guardian_Aircraft_Ignored : public ScriptImpClass {
11565 void Created(GameObject *obj);
11566};
11567
11573class JMG_Utility_AI_Guardian_Infantry_Ignored : public ScriptImpClass {
11574 void Created(GameObject *obj);
11575};
11576
11582class JMG_Utility_AI_Guardian_Vehicle_Ignored : public ScriptImpClass {
11583 void Created(GameObject *obj);
11584};
11585
11591class JMG_Utility_AI_Guardian_Generic_Ignored : public ScriptImpClass {
11592 void Created(GameObject *obj);
11593};
11594
11602 void Created(GameObject *obj);
11603public:
11605 {
11606 objectiveId = -1;
11607 }
11608 int objectiveId;
11609};
11610
11622 char weaponName[128];
11623 char *params;
11624 char script[128];
11625 float rate;
11626 void Created(GameObject *obj);
11627 void Timer_Expired(GameObject *obj,int number);
11628};
11629
11637 void Created(GameObject *obj);
11638 void Timer_Expired(GameObject *obj,int number);
11639};
11640
11655 void Created(GameObject *obj);
11656 void Timer_Expired(GameObject *obj,int number);
11657};
11658
11669class JMG_Utility_Custom_Create_Object_At_Bone : public ScriptImpClass
11670{
11671 int custom;
11672 bool repeat;
11673 void Created(GameObject *obj);
11674 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11675};
11676
11687 void Killed(GameObject *obj,GameObject *killer);
11688};
11689
11698class JMG_Utility_Custom_Drop_Corpse : public ScriptImpClass
11699{
11700 int custom;
11701 bool repeat;
11702 char powerupName[128];
11703 void Created(GameObject *obj);
11704 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11705 void Timer_Expired(GameObject *obj,int number);
11706};
11707
11719class JMG_Utility_Custom_Send_Shuffled_Customs : public ScriptImpClass {
11720 int recieveMessage;
11721 int id;
11722 SList<int> customs;
11723 int Param;
11724 float delay;
11725 void Created(GameObject *obj);
11726 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11727};
11728
11741 int recieveMessage;
11742 SList<int> ids;
11743 SList<int> customs;
11744 int Param;
11745 float delay;
11746 void Created(GameObject *obj);
11747 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11748};
11749
11758 int custom;
11759 bool forceOutOfOtherVehicles;
11760 float delay;
11761 enum SuccessState{SUCCESS,RETRY,ALREADY_IN,FAILED,VEHICLE_FULL,STUCK_IN_ANOTHER_VEHICLE};
11762 void Created(GameObject *obj);
11763 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11764 SuccessState ForceIntoVehicle(GameObject *obj,GameObject *target);
11765};
11766
11775 int custom;
11776 void Created(GameObject *obj);
11777 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11778 void Timer_Expired(GameObject *obj,int number);
11779};
11780
11793 int occupants;
11794 int recieveMessage;
11795 int id;
11796 int custom;
11797 int Param;
11798 float delay;
11799 bool repeat;
11800 void Created(GameObject *obj);
11801 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11802};
11803
11816 int occupants;
11817 int recieveMessage;
11818 int id;
11819 int custom;
11820 int Param;
11821 float delay;
11822 bool repeat;
11823 void Created(GameObject *obj);
11824 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11825};
11826
11848class JMG_Utility_Basic_Spawner_Wander_Point : public ScriptImpClass {
11849public:
11850 struct SpawnObjectNode
11851 {
11852 int groupId;
11853 ReferencerClass obj;
11854 SpawnObjectNode(GameObject *obj,int spawnGroupId)
11855 {
11856 this->obj = obj;
11857 this->groupId = spawnGroupId;
11858 }
11859 };
11860 static SList<SpawnObjectNode> spawnObjectNodeList;
11861private:
11862 bool enabled;
11863 int spawnGroupId;
11864 int spawnedObjectScriptID;
11865 int spawnedObjects;
11866 enum SpawnFailureTypes{SPAWN_BLOCKED, SUCCESS, LIMIT_REACHED, SPAWN_CODE_ERROR};
11867 int spawnAtATime;
11868 int maxTotalSpawned;
11869 float rate;
11870 float randomRate;
11871 char preset[128];
11872 int spawnCount;
11873 int changeSpawnCapCustom;
11874 int enableDisableCustom;
11875 int initialSpawn;
11876 int attachScriptsGroupId;
11877 float playersAddToSpawnAtATime;
11878 int wanderPointGroup;
11879 float safeTeleportDistance;
11880 int lastPlayerCount;
11881 void Created(GameObject *obj);
11882 void Timer_Expired(GameObject *obj,int number);
11883 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11884 SpawnFailureTypes AttemptSpawn(GameObject *obj);
11885 void Initial_Spawn(GameObject *obj);
11886 int GetPlayerLimitModifier();
11887 bool Grab_Teleport_Spot(GameObject *spawnedObject,int attempts);
11888 bool Get_A_Defense_Point(Vector3 *position,float *facing);
11889};
11890
11898{
11899 void Created(GameObject *obj);
11900public:
11902 {
11903 globalParam = -1;
11904 }
11905 static int globalParam;
11906};
11907
11916{
11917 int custom;
11918 int globalParam;
11919 void Created(GameObject *obj);
11920 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11921};
11922
11934class JMG_Utility_Global_CSC_With_Global_Param : public ScriptImpClass
11935{
11936 int recieveMessage;
11937 int id;
11938 int custom;
11939 float delay;
11940 float randomDelay;
11941 float randomChance;
11942 void Created(GameObject *obj);
11943 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11944};
11945
11952class JMG_Utility_Global_Armor_Scaled_Controller : public ScriptImpClass {
11953 void Created(GameObject *obj);
11954public:
11955 static float scale;
11956};
11957
11965class JMG_Utility_Global_Armor_Scaled_Custom : public ScriptImpClass {
11966 int custom;
11967 float scale;
11968 void Created(GameObject *obj);
11969 void Custom(GameObject *obj,int message,int param,GameObject *sender);
11970};
11971
11977class JMG_Utility_Global_Armor_Scaled_Object : public ScriptImpClass {
11978 void Created(GameObject *obj);
11979};
11980
11987class JMG_Utility_Global_Health_Scaled_Controller : public ScriptImpClass {
11988 void Created(GameObject *obj);
11989public:
11990 static float scale;
11991};
11992
12000class JMG_Utility_Global_Health_Scaled_Custom : public ScriptImpClass {
12001 int custom;
12002 float scale;
12003 void Created(GameObject *obj);
12004 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12005};
12006
12012class JMG_Utility_Global_Health_Scaled_Object : public ScriptImpClass {
12013 void Created(GameObject *obj);
12014};
12015
12023 void Created(GameObject *obj);
12024public:
12025 static float speed;
12026};
12027
12035class JMG_Utility_Global_Infantry_Speed_Custom : public ScriptImpClass {
12036 int custom;
12037 float speed;
12038 void Created(GameObject *obj);
12039 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12040};
12041
12047class JMG_Utility_Global_Infantry_Speed_Object : public ScriptImpClass {
12048 void Created(GameObject *obj);
12049};
12050
12056class JMG_Utility_AI_Control_Point_Ignore_Object : public ScriptImpClass {
12057 void Created(GameObject *obj);
12058};
12059
12072 int occupants;
12073 int recieveMessage;
12074 int id;
12075 int custom;
12076 int Param;
12077 float delay;
12078 char preset[512];
12079 bool repeat;
12080 void Created(GameObject *obj);
12081 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12082};
12095 int occupants;
12096 int recieveMessage;
12097 int id;
12098 int custom;
12099 int Param;
12100 float delay;
12101 char preset[512];
12102 bool repeat;
12103 void Created(GameObject *obj);
12104 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12105};
12106
12118 int recieveMessage;
12119 int id;
12120 int custom;
12121 int Param;
12122 float delay;
12123 void Created(GameObject *obj);
12124 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12125};
12126
12137 void Killed(GameObject *obj,GameObject *killer);
12138};
12139
12147class JMG_Utility_Sync_Fog_Controller : public ScriptImpClass {
12148 bool fogSynced[128];
12149 void Created(GameObject *obj);
12150 void Timer_Expired(GameObject *obj,int number);
12151public:
12152 static float min;
12153 static float max;
12154};
12155
12165class JMG_Utility_Sync_Fog_Custom_Update : public ScriptImpClass {
12166 int custom;
12167 float min;
12168 float max;
12169 float transition;
12170 void Created(GameObject *obj);
12171 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12172};
12173
12179class JMG_Utility_Sync_Animation_On_Join : public ScriptImpClass {
12180 bool synced[128];
12181 void Created(GameObject *obj);
12182 void Timer_Expired(GameObject *obj,int number);
12183};
12184
12191 char animation[32];
12192 int lastFrame;
12193 void Created(GameObject *obj);
12194 void Timer_Expired(GameObject *obj,int number);
12195};
12196
12205class JMG_Utility_Poke_Grant_Weapon : public ScriptImpClass {
12206 void Created(GameObject *obj);
12207 void Poked(GameObject *obj, GameObject *poker);
12208};
12209
12221 char preset[128];
12222 int enableCustom;
12223 bool enabled;
12224 int id;
12225 Vector3 location;
12226 float facing;
12227 int objectsInZone;
12228 bool reCreateOnDeath;
12229 void Created(GameObject *obj);
12230 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12231 void Entered(GameObject *obj,GameObject *enterer);
12232 void Exited(GameObject *obj,GameObject *exiter);
12233 void TriggerCreate(GameObject *obj);
12234};
12241 void Killed(GameObject *obj,GameObject *killer);
12242 void Destroyed(GameObject *obj);
12243};
12244
12251 int ownerScriptId;
12252 bool deathByScript;
12253 void Created(GameObject *obj);
12254 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12255 void Destroyed(GameObject *obj);
12256};
12257
12269 char subObject[16];
12270 char idle[32];
12271 char death[32];
12272 char move[32];
12273 float deathFrame;
12274 bool moving;
12275 void Created(GameObject *obj);
12276 void Timer_Expired(GameObject *obj,int number);
12277 void Killed(GameObject *obj,GameObject *killer);
12278 void PlayAnimation(GameObject *obj,const char *aniamtionName,float frame);
12279};
12280
12293 bool below;
12294 int id;
12295 float targetRatio;
12296 int aboveCustom;
12297 int aboveParam;
12298 int belowCustom;
12299 int belowParam;
12300 void Created(GameObject *obj);
12301 void Damaged(GameObject *obj,GameObject *damager,float damage);
12302};
12303
12311 char skinType[128];
12312 float minHealthRatio;
12313 void Created(GameObject *obj);
12314 void Damaged(GameObject *obj,GameObject *damager,float damage);
12315public:
12317 {
12318 sprintf(skinType,"None");
12319 }
12320};
12321
12334 Vector3 location;
12335 float distance;
12336 bool requireInPathfind;
12337 void Created(GameObject *obj);
12338 void Timer_Expired(GameObject *obj,int number);
12339};
12340
12350class JMG_Utility_Killed_Send_Custom : public ScriptImpClass {
12351 void Killed(GameObject *obj,GameObject *killer);
12352};
12353
12363class JMG_Utility_Killed_Send_Custom_Killer : public ScriptImpClass {
12364 void Killed(GameObject *obj,GameObject *killer);
12365};
12366
12379 int recieveMessage;
12380 int team;
12381 int custom;
12382 int Param;
12383 float delay;
12384 float maxDistance;
12385 void Created(GameObject *obj);
12386 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12387};
12388
12399class JMG_Utility_Created_Fire_Randomly : public ScriptImpClass {
12400 float rate;
12401 float angle;
12402 float minHeight;
12403 float maxHeight;
12404 float useFacing;
12405 void Created(GameObject *obj);
12406 void Timer_Expired(GameObject *obj,int number);
12407};
12408
12416class JMG_Utility_Turret_Spawn : public ScriptImpClass
12417{
12418 int turretId;
12419 bool hasDriver;
12420 void Created(GameObject *obj);
12421 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12422 void Killed(GameObject *obj,GameObject *killer);
12423 void Destroyed(GameObject *obj);
12424 void Detach(GameObject *obj);
12425};
12426
12439class JMG_Utility_Custom_Send_Custom_Sender : public ScriptImpClass {
12440 int recieveMessage;
12441 int id;
12442 int custom;
12443 int Param;
12444 float delay;
12445 float randomDelay;
12446 float randomChance;
12447 void Created(GameObject *obj);
12448 void Custom(GameObject *obj,int message,int param,GameObject *sender);
12449};
12450
12455class JMG_Utility_Created_Disable_Footsteps : public ScriptImpClass {
12456 void Created(GameObject *obj);
12457 void Timer_Expired(GameObject *obj,int number);
12458};
Sends a custom when customs are sent in a certain order (kind of like a combo lock) \Success_Custom -...
Definition jmgUtility.h:54
Tweaks M04 so the bubbles work right and infantry carrying the shotgun drop it.
Definition jmgUtility.h:9972
Use JMG_Utility_Turret_Spawn instead \Turret_Preset - Preset of the turret \Bone_Name - Bone to hook ...
Definition jmgUtility.h:169
Used to clean up the attack point list at gameover.
Definition jmgUtility.h:3184
Used to specify a point that JMG_Utility_AI_Aggressive_Attack_Spot should use to attack,...
Definition jmgUtility.h:3219
Used to specify a point that JMG_Utility_AI_Aggressive_Attack_Spot should use to attack \GroupId - de...
Definition jmgUtility.h:3197
Used to designate repair targets for the Engineer AI that are things other than vehicles,...
Definition jmgUtility.h:3251
Makes the AI run up to an enemy and attack it as close as possible, used for melee AI \ReturnHomeSpee...
Definition jmgUtility.h:2650
Tell objects with JMG_Utility_AI_Control_Point to ignore this object.
Definition jmgUtility.h:12056
This script makes the AI seek out the nearest enemy, players are ignored, it works for infantry and v...
Definition jmgUtility.h:10613
Used to designate targets that the engineer AI should ignore.
Definition jmgUtility.h:5485
Used to designate repair targets for the Engineer AI that are things other than vehicles,...
Definition jmgUtility.h:2957
Basic Engineer AI that will try to repair all OBJECTs in the patrol range, if an enemy gets close the...
Definition jmgUtility.h:195
Needed for AI using JMG_Utility_AI_Follow_Player_On_Poke, this script controls the limits of how many...
Definition jmgUtility.h:5527
Makes an AI follow the player that pokes it, if the player dies it goes to its original position \Fol...
Definition jmgUtility.h:5572
Tell objects with JMG_Utility_AI_Goto_Enemy_Ignore_Object to ignore this object.
Definition jmgUtility.h:4974
Tell objects with JMG_Utility_AI_Goto_Enemy_Not_Star_Ignore_Object to ignore this object.
Definition jmgUtility.h:4984
This script makes the AI seek out the nearest enemy, players are ignored, it works for infantry and v...
Definition jmgUtility.h:4684
This script makes the AI hunt down the nearest enemy, it works for infantry and vehicles \HuntSearchD...
Definition jmgUtility.h:4570
Any object this is attached to will not be shot at by JMG_Utility_AI_Goto_Location_While_Player_Nearb...
Definition jmgUtility.h:11285
AI that will attempt to go to a location as long as a player is near it \GotoObjectId - Object that t...
Definition jmgUtility.h:11217
Tell objects with JMG_Utility_AI_Goto_Player to ignore this object.
Definition jmgUtility.h:4964
This script makes the AI hunt down the nearest player, it works for infantry and vehicles \HuntSearch...
Definition jmgUtility.h:2996
Tell objects with JMG_Utility_AI_Goto_Player to ignore this object.
Definition jmgUtility.h:11479
Tell objects with JMG_Utility_AI_Goto_Target_Script that this is a target.
Definition jmgUtility.h:11488
This script makes the AI hunt down the nearest object with JMG_Utility_AI_Goto_Target_Script_Target a...
Definition jmgUtility.h:11390
Makes this unit ignored by JMG_Utility_AI_Guardian_Aircraft.
Definition jmgUtility.h:11564
Makes an aircraft move between wander points, it'll strafe at the target while it has one \WanderingA...
Definition jmgUtility.h:2896
Makes this unit ignored by JMG_Utility_AI_Guardian_Generic.
Definition jmgUtility.h:11591
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:6082
Makes this unit ignored by all the Guardian AI scripts.
Definition jmgUtility.h:5850
Makes this unit ignored by JMG_Utility_AI_Guardian_Infantry.
Definition jmgUtility.h:11573
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:3762
Makes this unit ignored by JMG_Utility_AI_Guardian_Vehicle.
Definition jmgUtility.h:11582
Makes a unit move between wander points, it'll strafe at the target while it has one,...
Definition jmgUtility.h:4856
Uses maths to "launch" a vehicle with projectile phyiscs at an enemy's location provided by a spotter...
Definition jmgUtility.h:8588
Just used to clean up JMG_Utility_AI_Skittish_Herd_Animal at game end, not required but nice to have.
Definition jmgUtility.h:7630
Prevents JMG_Utility_AI_Skittish_Herd_Animal from seening the attached object.
Definition jmgUtility.h:7621
The AI attached to this script will flee enemies seen and combat (Like in Deer Hunter mode for ECW) \...
Definition jmgUtility.h:7448
Makes this unit ignored by all JMG_Utility_AI_Vehicle.
Definition jmgUtility.h:5859
Vehicle AI that can be used for both aircraft and wheeled vehicles, the AI will attempt to backup whe...
Definition jmgUtility.h:2250
Makes the object or a sub-object of the object animate while moving, dead, or idle....
Definition jmgUtility.h:12268
Applies damage to object at a specified rate (JMG_Utility_Apply_Damage_On_Timer) \Rate - How often to...
Definition jmgUtility.h:6561
Applies damage while in the zone by attaching the script below (JMG_Utility_Apply_Damage_While_In_Zon...
Definition jmgUtility.h:6544
Attaches a script to all players in game (can only attach the designated distinct script name once) \...
Definition jmgUtility.h:6349
Scans the map and attaches the specifed script to all objects that have the specified weapon \WeaponN...
Definition jmgUtility.h:9942
Very basic AI that won't reset its attack while still seeing a target, first come first serve \MinAtt...
Definition jmgUtility.h:8400
Attaches the script supplied to anything spawned by a basic spawner \Script - Name of the script to a...
Definition jmgUtility.h:3379
Tells an object that it belongs to a group of the JMG_Utility_Basic_Spawner_In_Radius (normally attac...
Definition jmgUtility.h:7076
Place this script on an object that exists the duration of the map, all it does is deletes the spawn ...
Definition jmgUtility.h:7190
Spawns objects randomly in a circle using ray casts to find the ground around the location specified ...
Definition jmgUtility.h:7009
Allows you to set where the spawner creates the original spawn (this allows you to hide the flash whe...
Definition jmgUtility.h:3408
Spawns objects randomly in a circle using ray casts to find the ground around the location specified ...
Definition jmgUtility.h:11848
Turns a placed object into a renstyle spawner that can be sent customs like a normal object,...
Definition jmgUtility.h:2167
Used to cap the credits of a team, can be updated by sending a custom \Credits - What is the max amou...
Definition jmgUtility.h:4515
Changes a objects w3d model on a timer.
Definition jmgUtility.h:68
Fades screen color to set color while in zone \Color[Red|Green|Blue] RGB value of the color you want ...
Definition jmgUtility.h:2437
Changes the SkinType to Blamo until Armor takes any damage, after that it reverts the SkinType back t...
Definition jmgUtility.h:12310
Displays a message if the script named isn't in the scripts build on the server. \ScriptName - The na...
Definition jmgUtility.h:22
Turns the control point system into something resembling Mutant Assault in ECW, it uses the groupId o...
Definition jmgUtility.h:9812
Controller for the control point system, needed if control points are on the map (NeutralPlayer is -2...
Definition jmgUtility.h:9565
Allows the player to select their spawn location before entering the map much like Mutant Assault in ...
Definition jmgUtility.h:9873
Allows team specific overrides for a control point, script must be on the control point itself \TeamI...
Definition jmgUtility.h:9773
Needs to be on objects that can affect the control point scripts \TeamID - Team this belongs to \Mult...
Definition jmgUtility.h:9784
Adds a team's settings to the game, needs one per team \TeamID - ID of the team, this is used to inde...
Definition jmgUtility.h:9658
Updates a wander point's group ID depending on if the attached control point can be spawned at by the...
Definition jmgUtility.h:10568
Updates a wander point's group ID depending on if the attached control point can be spawned at by the...
Definition jmgUtility.h:9840
Sets this control point's default settings \ControlPointName - Name displayed when CP is lost or capt...
Definition jmgUtility.h:9678
Moves object to nearest pathfind location on create.
Definition jmgUtility.h:9927
Sets a random model on create \BaseName - Base model name in the random set to assign \FinalModelNumb...
Definition jmgUtility.h:10765
Starts a looping animation on a sub object when a client joins a game \SubObject - Subobject to play ...
Definition jmgUtility.h:10331
Destroys self if not in a pathfind sector.
Definition jmgUtility.h:11006
Disables the footstep effects of the attached infantry.
Definition jmgUtility.h:12455
Sends a custom message when the attached object moves a distance from its initial spawn location \Fir...
Definition jmgUtility.h:12399
Gives a weapon to the player without need of a powerup \WeaponName - Name of the weapon to give \Gran...
Definition jmgUtility.h:6784
Makes an AI able to shoot directions the gun isn't aiming.
Definition jmgUtility.h:5882
Plays a looped animation on the attached infantry, disables all animations \Animation - Animation to ...
Definition jmgUtility.h:10373
Sets the damage and death points of an object on attach \Damage_Points - Points to give when damaged,...
Definition jmgUtility.h:6901
Creates the preset from the specified team's vehicle factory on create \PresetName - Vehicle preset t...
Definition jmgUtility.h:11531
Like any other credit trickle script but it will stop once the amount is reached for the player \Cred...
Definition jmgUtility.h:6798
Gives players a trickle of credits while they are determined not AFK (requires JMG_Utility_Detect_AFK...
Definition jmgUtility.h:6944
Sends a custom on a custom with matching param \Custom - Custom to watch for \Param - Param to watch ...
Definition jmgUtility.h:9909
Applys damage to the closest preset to the attached object (works with powerups and other "dumb" obje...
Definition jmgUtility.h:8750
Applys damage to an object when custom is received \Custom - Custom to trigger on \ID - ID of the obj...
Definition jmgUtility.h:4534
Controls if JMG_Utility_Global_Attach_Script_On_Flags can attach scripts, default flag is -1 \Custom ...
Definition jmgUtility.h:10974
Changes the character of the sender object (only works on infantry) \Custom - custom to trigger on (H...
Definition jmgUtility.h:6528
Used for pressing keys on the combination lock, script is attached by the code.
Definition jmgUtility.h:10298
Used by to make a param send when customs are sent in in the correct order \ID - ID to send the messa...
Definition jmgUtility.h:10268
Creates an explosion at the bone specified on the attached object \Custom - Custom to trigger the exp...
Definition jmgUtility.h:6616
Basic creates an object at the bone position when a custom is received \Custom - Custom message neede...
Definition jmgUtility.h:11670
Creates a specified preset at a random wander point \Custom - Custom to trigger on \Preset - Preset t...
Definition jmgUtility.h:10176
Creates an object in front of this object \Custom - Custom to trigger the script \PresetName - Name o...
Definition jmgUtility.h:6111
Creates random explosions around the attached object within the specified paramaters \Custom - Custom...
Definition jmgUtility.h:10531
Creates a 3D sound at the specified bone on custom \Sound - Sound preset to play \Bone - Bone to play...
Definition jmgUtility.h:5800
Damages all units of a preset type when a custom is received \Custom - Custom to count \PresetName - ...
Definition jmgUtility.h:6403
Kills all soldiers on a team when a custom is received \Custom - Custom to count \Team - team to wipe...
Definition jmgUtility.h:4835
Damages all vehicles on a team when a custom is received \Custom - Custom to count \Team - team to wi...
Definition jmgUtility.h:6140
Damages all objects on a team when a custom is received \Custom - Custom to trigger on \Team - Requir...
Definition jmgUtility.h:6821
Sends a custom after a delay, if the custom being watched for is received again the delay is reset be...
Definition jmgUtility.h:7266
Destroys all the objects on the map with matching preset name \Custom - Custom to trigger the script ...
Definition jmgUtility.h:5955
Destroys the closest object with the 3d model to the position (works with powerups and other "dumb" o...
Definition jmgUtility.h:4883
Destroys the closest preset to the position (works with powerups and other "dumb" objects) \Custom - ...
Definition jmgUtility.h:4174
Destroys the closest preset to the attached object (works with powerups and other "dumb" objects) \Cu...
Definition jmgUtility.h:8733
Destroy self when a custom is received \Custom - Custom to trigger on.
Definition jmgUtility.h:4463
Destroys the sender on custom \Custom - custom to destroy the sender on.
Definition jmgUtility.h:10775
Reads text from a file and displays it to the screen, \ the text in a file is broken every 150 charac...
Definition jmgUtility.h:6182
Reads text from a file and displays it to the screen, \ the text in a file is broken every 150 charac...
Definition jmgUtility.h:4307
Reads text from a file and displays it to the screen, as little popup dialogs \ the text in a file is...
Definition jmgUtility.h:8490
Displays a popup dialog to the attached player object \Custom - Custom to trigger the teleport \Messa...
Definition jmgUtility.h:7649
Works like JMG_Utility_Killed_Drop_Powerup_Become_Corpse but triggers on custom \Custom - Custom mess...
Definition jmgUtility.h:11699
Works exactly like JMG_Utility_Custom_Enable_Spawners_In_Range_Mod but player count subtracts from th...
Definition jmgUtility.h:6722
Used to enable or disable all spawners within an ID range on zone enter but only enables the IDs that...
Definition jmgUtility.h:6602
Used to enable or disable all spawners within an ID range on zone enter \StartID - ID to start at \En...
Definition jmgUtility.h:3322
Used to enable or disable a spawner within an ID range of the script each time a custom is sent (adds...
Definition jmgUtility.h:10550
When the custom is received all players on the map will attempt to enter the vehicle until it is full...
Definition jmgUtility.h:11757
Forces all occupants out of the vehicle (taking as many attempts as needed 10 times a second) once fi...
Definition jmgUtility.h:11774
Scales the given score as players join/leave the match (if no players are in game the score is not up...
Definition jmgUtility.h:7738
Destroys the sender on custom \Custom - custom to destroy the sender on \Weapon - weapon to grant/add...
Definition jmgUtility.h:10789
When a specified custom is received it plays an animation, when the animation complete it sends a cus...
Definition jmgUtility.h:10353
Sends any custom message caught back to the sender \Model - Model this object must be for the script ...
Definition jmgUtility.h:10147
Removes a script and then attaches another script on custom \Custom - Custom that triggers the script...
Definition jmgUtility.h:11548
Removes a weapon from all the players in game when a custom is received \Custom - Custom to count \We...
Definition jmgUtility.h:5941
Applys damage to the closest preset to the attached object (works with powerups and other "dumb" obje...
Definition jmgUtility.h:8765
Sends a custom on a custom from each of the players on the map \Custom - Custom to watch for \ID - ID...
Definition jmgUtility.h:12117
Sends a custom on a custom if the model matches \Model - Model this object must be for the script to ...
Definition jmgUtility.h:10037
Sends a custom if the number of occupants in a vehicle is greater than or equal to the value specifie...
Definition jmgUtility.h:11815
Sends a custom if the number of occupants in a vehicle is less than or equal to the value specified \...
Definition jmgUtility.h:11792
Sends a custom on a custom if the specified script is attached \Custom - Custom to count \ID - ID to ...
Definition jmgUtility.h:7160
Sends a custom on a custom if the count of objects with the specified script is less than the count \...
Definition jmgUtility.h:11507
Sends a custom on a custom if the specified script is not attached \Custom - Custom to count \ID - ID...
Definition jmgUtility.h:7178
Sends a custom when there are no objects of the preset type inside of the vehicle \Custom - Custom to...
Definition jmgUtility.h:12094
Sends a custom when there are no objects of the preset type outside of the vehicle \Custom - Custom t...
Definition jmgUtility.h:12071
Sends a custom when a custom has been received x times, message comes from sender \Custom - Custom to...
Definition jmgUtility.h:8660
Sends a custom when a custom has been received x times \Custom - Custom to count \Count - how many cu...
Definition jmgUtility.h:4449
References an object with JMG_Utility_Custom_Send_Custom_On_Player_Count_HUD and uses the count to se...
Definition jmgUtility.h:10992
Sends a custom when a custom has been received x times with addition of a player count multiplier,...
Definition jmgUtility.h:5901
Sends a custom when a custom has been received x times with addition of a player count multiplier,...
Definition jmgUtility.h:5822
Sends a custom if the specified preset ID is on the map \Custom - Custom to watch for \PresetID - Pre...
Definition jmgUtility.h:7669
Sends a custom if the specified script is on a preset on the map \Custom - Custom to watch for \Scrip...
Definition jmgUtility.h:7695
Sends a custom when a custom is received while a secondary count of a secondary custom matches \Trigg...
Definition jmgUtility.h:8290
Sends a custom when a custom is recieved, ignore time makes it unable to send another custom until ti...
Definition jmgUtility.h:6639
Sends a custom on a custom from the sender \Custom - Custom to watch for \ID - ID to send to,...
Definition jmgUtility.h:12439
When one of the defined customs is caught it will be instantly sent, after sending a delay timer star...
Definition jmgUtility.h:8428
Sends a to all objects on the map sends from the sender \Custom - Custom to watch for \Team - Require...
Definition jmgUtility.h:12378
Sends a to all objects on the map \Custom - Custom to watch for \Team - Required team to send to,...
Definition jmgUtility.h:7317
Sends a custom to all matching presets on the map on custom \ReceivedCustom - Message needed to trigg...
Definition jmgUtility.h:10387
Sends a custom on a custom \Custom - Custom to watch for \ID - ID to send to, 0 sends to self,...
Definition jmgUtility.h:4789
Sends a custom on a custom, the custom that is sent is cycled through the loop of customs provided (n...
Definition jmgUtility.h:8119
Watches for specific custom and sends them to the specified id, after each send starts a timer,...
Definition jmgUtility.h:9993
Sends a random custom to a random id on a custom, each time the custom is received a custom and id is...
Definition jmgUtility.h:11740
Sends a random custom on a custom, each time the custom is received a custom is sent and removed from...
Definition jmgUtility.h:11719
Sends a chat message to all players on custom \Custom - Custom message to trigger the script on \Stri...
Definition jmgUtility.h:5995
Sets the animation of an object when a custom is received \Custom - Custom to trigger on \ID - ID of ...
Definition jmgUtility.h:6846
Enables or disables the attached vehicles engine on custom \Custom - Custom to trigger on \Enable - W...
Definition jmgUtility.h:7202
Enables or disables the human anim override of a soldier \Custom - custom to update the height on \En...
Definition jmgUtility.h:7805
Sets the height scaler for an infantry on a custom \Custom - custom to update the height on \Height -...
Definition jmgUtility.h:7763
Sets the height scaler for an infantry on a custom \Custom - custom to update the height on \Width - ...
Definition jmgUtility.h:7777
Moves an object when a custom is received, works on zones \Custom - Custom to trigger on \Position - ...
Definition jmgUtility.h:7246
Sets the speed of the attached soldier on Custom \Custom - Custom needed to trigger script \Speed - M...
Definition jmgUtility.h:9534
Changes the model, team, and resets the action of an object on custom. \Custom - Custom to trigger th...
Definition jmgUtility.h:4997
Sets the attached object's team when a custom is received \Custom - Custom to trigger on \Team - Team...
Definition jmgUtility.h:10161
Sets the animation frame of a tile when a custom is received \Custom - Custom to trigger the teleport...
Definition jmgUtility.h:4262
Sets the hold style for all weapons, if -1 hold style will not be locked \Custom - custom to update t...
Definition jmgUtility.h:7791
Receiving a custom changes the Clouds on the map \Custom - Custom event to trigger the change \Cover ...
Definition jmgUtility.h:4029
Receiving a custom changes the Fog on the map \Custom - Custom event to trigger the change \StartDist...
Definition jmgUtility.h:3962
Receiving a custom changes the Lightning on the map \Custom - Custom event to trigger the change \Int...
Definition jmgUtility.h:3996
Receiving a custom changes the Precipitation on the map \Custom - Custom event to trigger the change ...
Definition jmgUtility.h:3947
Receiving a custom changes the Warblitz on the map \Custom - Custom event to trigger the change \Inte...
Definition jmgUtility.h:4014
Receiving a custom changes the Wind on the map \Custom - Custom event to trigger the change \Heading ...
Definition jmgUtility.h:3978
Switches the current weapon to a different weapon on custom \Custom - custom to trigger on \Weapon - ...
Definition jmgUtility.h:5192
Plays a sound from the position of the attached soldier, also animates their face dynamically \Custom...
Definition jmgUtility.h:10405
Teleports the object that enters the zone to a random wander point \Custom - Custom to trigger the te...
Definition jmgUtility.h:4239
Teleports the sender of a custom to a random wander point \Custom - Custom message to listen for \Wan...
Definition jmgUtility.h:10747
Teleports the object that enters the zone to a random wander point \Custom - Custom to trigger the te...
Definition jmgUtility.h:7395
Sets whether AI with Enemy Seen can see this object \Custom - custom to trigger on \Visible - Does en...
Definition jmgUtility.h:5428
Sends a custom when damaged \MinDamage - min damage required to trigger the script \ID - ID to send t...
Definition jmgUtility.h:6667
Applies damage to all smart game objects in range \Range - Range to damage objects inside of \Damage ...
Definition jmgUtility.h:4414
Empty vehicles slowly die if not occupied by a player (a player must enter the vehicle once first) \R...
Definition jmgUtility.h:4812
Changes the animation frame as an object is damaged \ (Math is (currentHP/MaxHP)*MaxFrame \Animation ...
Definition jmgUtility.h:11339
Fades the screen and applies damage as the player gets further from the spot on the map,...
Definition jmgUtility.h:5689
Creates an object at the location where the attached was when the attached object's shield is zero,...
Definition jmgUtility.h:6971
Refunds the damage if the warhead is a match \WarheadName - Warhead to refund the damage from.
Definition jmgUtility.h:10856
Basic turret attach script, turrets match team of vehicle attached to, turrets are destroyed by destr...
Definition jmgUtility.h:5172
Spawns an object if the last warhead that damaged the object matches the specified warhead \Warhead -...
Definition jmgUtility.h:5011
Spawns an object if the weapon that killed the object matches the specified weapon preset (warhead sc...
Definition jmgUtility.h:6420
Rotates the player's camera after a delay \Time - Time amount to wait \Facing - Direction to rotate t...
Definition jmgUtility.h:4399
Same as JMG_Utility_Destroy_Objects_In_ID_Range_On_Destroy but tiggers on death instead of destroy.
Definition jmgUtility.h:6222
Sends a custom when an object is destroyed \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:6322
Applies damage to the target when DESTROYED \ID - Id of the object to damage \Damage - Amount of dama...
Definition jmgUtility.h:3629
Creates a powerup at the objects origin when it is destroyed if it has that weapon \RequiredWeaponPre...
Definition jmgUtility.h:6013
Sets a flag for each player when they are determined to be AFK, the determination is done by if the p...
Definition jmgUtility.h:6912
Displays a hud message to all players on custom, allows user to override string with custom string \C...
Definition jmgUtility.h:2608
Displays a hud message to all players on custom \Custom - Custom message to trigger on \StringId - ID...
Definition jmgUtility.h:122
Displays a hud message to a player on custom \Custom - Custom message to trigger on \StringId - ID of...
Definition jmgUtility.h:134
Used to display a HUD message to a player that enters a vehicle \StringId - ID of the string to displ...
Definition jmgUtility.h:2865
Displays a hud message to all players on custom, allows user to override string with custom string \C...
Definition jmgUtility.h:2620
Basically GTH_Drop_Object_On_Death but attaches a script to the dropped object \Drop_Object - Object ...
Definition jmgUtility.h:9963
Used for cleanup after the level completes, place on an object that will exist the whole level.
Definition jmgUtility.h:8964
Adds (or updates) a parameter on the specified script ID on create (there is a 0.1 second delay after...
Definition jmgUtility.h:8990
Same as JMG_Utility_Dynamic_Script_Created_Add_Update_Parameter but triggers on custom \Custom - Cust...
Definition jmgUtility.h:9005
Attaches the script specified by ID and the currently defined parameters \Custom - Custom to trigger ...
Definition jmgUtility.h:9018
Setup a dynamic script identity \ScriptID - ID that this script is stored under, used to look up the ...
Definition jmgUtility.h:8977
Turns an object into an object that emulates the damange system of DamageableStaticPhysics tiles \Ani...
Definition jmgUtility.h:103
This script makes for a rather cruddy emulation of sound_heard on a dedicated server....
Definition jmgUtility.h:8155
Enables loiter animations.
Definition jmgUtility.h:5181
Prevents JMG_Utility_Enemy_Seen_Send_Custom from seening the attached object.
Definition jmgUtility.h:7333
Sends a custom when an enemy is seen, sends a custom again after no enemy in the criteria is visible ...
Definition jmgUtility.h:7128
Attached by JMG_Utility_Enter_Play_Animation_And_Relocate, not designed to be used directly.
Definition jmgUtility.h:8716
Plays an animation on the object that enters the zone, the object is also attached to another object ...
Definition jmgUtility.h:8698
Plays an animation and locks the soldier in place when they run out of armor, when armor is full agai...
Definition jmgUtility.h:3733
Applies damage based on speed when a flying vehicle collides with terrain or another object \Min_Coll...
Definition jmgUtility.h:7100
Places all players on the same team at the end of the round \Team - Team to force all players to.
Definition jmgUtility.h:6062
Grants specified weapon to all players in range \WeaponName - Name of the weapon to grant to the play...
Definition jmgUtility.h:5504
Controller is required for the global armor system for all objects on the map that have the object sc...
Definition jmgUtility.h:10446
When a custom is received it will change the armor of all objects on the map that have the object scr...
Definition jmgUtility.h:10462
When the object is created it will use the armor specified by the controller.
Definition jmgUtility.h:10476
Controller is required for the global armor scaled system for all objects on the map that have the ob...
Definition jmgUtility.h:11952
When a custom is received it will update the scale amount for the scale system \Custom - Custom neede...
Definition jmgUtility.h:11965
When the object is created it will scale the objects armor specified by the controller.
Definition jmgUtility.h:11977
Controls if JMG_Utility_Global_Attach_Script_On_Flags can attach scripts, default flag is -1 \Custom ...
Definition jmgUtility.h:10929
Changes what the global flag is on custom \Custom - Custom to flip if attaching is allowed \GlobalFla...
Definition jmgUtility.h:10947
Attaches a script on create if the global flag matches \GlobalFlag - Value that must be matched \Scri...
Definition jmgUtility.h:10963
Controls if JMG_Utility_Global_CSC_With_Global_Param can send a custom, default param is -1 \Custom -...
Definition jmgUtility.h:11898
Changes what the global param is on custom \Custom - Custom to flip if sending is allowed \GlobalFlag...
Definition jmgUtility.h:11916
Sends a custom with the global param \Custom - Custom to watch for \ID - ID to send to,...
Definition jmgUtility.h:11935
Controls if JMG_Utility_Global_Custom_Send_Custom_Flag can send a custom, default flag is -1 \Custom ...
Definition jmgUtility.h:11148
Changes what the global flag is on custom \Custom - Custom to flip if sending is allowed \GlobalFlag ...
Definition jmgUtility.h:11166
Sends a custom if the global flag matches the specified \GlobalFlag - Value needed to match in order ...
Definition jmgUtility.h:11187
Controller is required for the global health system for all objects on the map that have the object s...
Definition jmgUtility.h:10487
When a custom is received it will change the health of all objects on the map that have the object sc...
Definition jmgUtility.h:10503
When the object is created it will use the health specified by the controller.
Definition jmgUtility.h:10517
Controller is required for the global health scaled system for all objects on the map that have the o...
Definition jmgUtility.h:11987
When a custom is received it will update the scale amount for the scale system \Custom - Custom neede...
Definition jmgUtility.h:12000
When the object is created it will scale the objects health specified by the controller.
Definition jmgUtility.h:12012
Controller is required for the global speed system for all infantry on the map that have the object s...
Definition jmgUtility.h:12022
When a custom is received it will update the speed amount for the speed system \Custom - Custom neede...
Definition jmgUtility.h:12035
When the infantry is created it will update its movement speed to the global speed.
Definition jmgUtility.h:12047
Controller for the keycard system (Grants Renegade keycards to soldiers that have the soldier scirpt ...
Definition jmgUtility.h:9232
Adds a keycard to the list of keycards to be granted to any global keycard soldier (also grants to an...
Definition jmgUtility.h:9243
Adds a keycard to the list of keycards to be granted to any global keycard soldier (also grants to an...
Definition jmgUtility.h:9255
Removes a keycard to the list of keycards to be granted to any global keycard soldier (also removes f...
Definition jmgUtility.h:9269
The attached soldier will get and lose keycards whenever the global keycard system is updated or on s...
Definition jmgUtility.h:9281
Used to set the default extension for the global random model system \DefaultExtension - String to us...
Definition jmgUtility.h:11033
Updates all objects with JMG_Utility_Global_Set_Random_Model attached to use the new global extension...
Definition jmgUtility.h:11051
Sets a random model on create, makes use of the global extension \BaseName - Base model name in the r...
Definition jmgUtility.h:11065
Grants or removes a key on attach \Key - Key number to grant \Grant - 1 to grant, 0 to remove.
Definition jmgUtility.h:4772
Sends a custom when TimeInSeconds (on JMG_Utility_HUD_Count_Down) matches the TriggerTime,...
Definition jmgUtility.h:5403
Ties a gameObject to JMG_Utility_HUD_Count_Down \ Can be placed before JMG_Utility_HUD_Count_Down is ...
Definition jmgUtility.h:8271
Displays HUD messages once at each hour, 30 min, 20 min, 10 min, 5 4 3 2 1 min, 30 sec 10 9 8 7 6 5 4...
Definition jmgUtility.h:5217
Attaches a preset to the object while its total HitPoint Percent are inside a range (object is destro...
Definition jmgUtility.h:3873
Changes the model of an object when its total HitPoint Percent enters a range \LowerHitPointsPercent ...
Definition jmgUtility.h:3856
Creates a preset at the location specified while total HitPoint Percent are inside a range (object is...
Definition jmgUtility.h:3909
Enables a spawner while the HitPoint Percent is inside a range \LowerHitPointsPercent - Lower end of ...
Definition jmgUtility.h:3891
Sends a custom upon entering the HP range \LowerHitPointsPercent - Lower end of the range (percent of...
Definition jmgUtility.h:3930
Prevents JMG_Utility_In_Line_Of_Sight_Send_Custom from seening the attached object.
Definition jmgUtility.h:7370
Sends a custom when an enemy is in the line of sight, sends a custom again after no enemy in the crit...
Definition jmgUtility.h:7350
Script used to make placeable/building objects for infantry \WeaponPreset � Weapon that must be selec...
Definition jmgUtility.h:2695
Kills a unit if it doesn't manage to move more than the specified distance in the specified time \Tim...
Definition jmgUtility.h:6156
Sends a custom message when killed by a player from the player \ID - Id of the object to send the cus...
Definition jmgUtility.h:12136
Sends a custom message when killed by a player \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:5841
Sends a custom message when killed by a specific PresetID \PresetID - Preset ID to detect \ID - Id of...
Definition jmgUtility.h:5873
Creates an object at the location where the attached was killed, removes old object at the second new...
Definition jmgUtility.h:6961
Drops an object on destroyed/killed/Detached (only drops once, whichever comes first) \Weapon - Weapo...
Definition jmgUtility.h:10070
Creates a powerup at the objects origin when it is killed, then turns the powerup into the parent obj...
Definition jmgUtility.h:11298
Gives money to the player that killed it \Money - Money to give.
Definition jmgUtility.h:6889
Sends the custom message from the object that killed the attached object \ID - Id of the object to se...
Definition jmgUtility.h:8141
Sends a custom message when killed from the killer \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:12363
Sends the custom message from the itself when its killed by nothing \ID - Id of the object to send th...
Definition jmgUtility.h:11686
Sends a custom message when killed \ID - Id of the object to send the custom to, 0 sends to itself,...
Definition jmgUtility.h:12350
While this script is attached it will select the weapon in the player's inventory as long as they hav...
Definition jmgUtility.h:2724
Used to control a basic objective system \ShowMarkersOnRadar - Should stars be shown on the radar \Pr...
Definition jmgUtility.h:3543
Works just like JMG_Utility_Objective_System_Objective_Update_Custom except sends a custom if the obj...
Definition jmgUtility.h:9040
Same as JMG_Utility_Objective_System_Custom_Send_Custom_Pending but only sends if the objective is re...
Definition jmgUtility.h:9081
Sends a custom on a custom if the specified objective is not matching the defined status \Custom - Cu...
Definition jmgUtility.h:9124
Sends a custom on a custom if the specified objective is matching the defined status \Custom - Custom...
Definition jmgUtility.h:9058
Used to make an objective show up as failed \Custom - Custom to trigger this script \ObjectiveID - ID...
Definition jmgUtility.h:6050
Attached by the objective controller so the code can remove the object when needed \GameObjectID - ID...
Definition jmgUtility.h:888
Creates a game object at the location of the objective's objective marker while active \ObjectivePrio...
Definition jmgUtility.h:873
Changes the location/object of the objective system's marker \Custom - Custom to trigger on \Objectiv...
Definition jmgUtility.h:6867
This allows the objective system to search through all the game objects to find the object that is ne...
Definition jmgUtility.h:11601
Used to remove an objective on custom \Custom - Custom to trigger this script \ObjectiveID - ID of th...
Definition jmgUtility.h:4386
Used to update the status of an objective \Custom - Custom to trigger on \ObjectiveID - ID of the new...
Definition jmgUtility.h:6039
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:4367
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3617
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3564
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3601
Used to update your objectives \NewObjectiveID - ID of the new objective to add \NewObjectiveStringID...
Definition jmgUtility.h:3586
Sends a custom once all objectives in the required list are complete, (Not instant,...
Definition jmgUtility.h:11317
Allows the visible marker, text color, and radar blip color to be overridden for a specific objective...
Definition jmgUtility.h:11654
Chooses an non-existant or removed objective from the provided list to send as a custom \Custom - Cus...
Definition jmgUtility.h:9102
Sets what bone the visible objective marker attaches to for the objective system \InfantryAttachBone ...
Definition jmgUtility.h:10710
Script is attached by JMG_Utility_PCT_Inaccessible_Zone, no need to do anything with this one.
Definition jmgUtility.h:2596
If the player is in this zone they won't be able to access any PCT defined by JMG_Utility_PCT.
Definition jmgUtility.h:2586
Works just like a normal PCT except you can definie zones with JMG_Utility_PCT_Inaccessible_Zone in w...
Definition jmgUtility.h:2574
Attach this script to the powerup of the weapon you wish not to be lost throughout the game \WeaponNa...
Definition jmgUtility.h:4201
Script used by JMG_Utility_Persistant_Weapon_Powerup.
Definition jmgUtility.h:4220
Script used by JMG_Utility_Persistant_Weapon_Powerup.
Definition jmgUtility.h:4210
Attaches a script to the soldier that picked up the powerup \Script - Script to attach \Params - Para...
Definition jmgUtility.h:6026
Switches what music is playing, you must have a JMG_Utility_Play_Music_On_Join_Controller on the map!...
Definition jmgUtility.h:2478
Plays music for a player on join, the music can be changed for all players by calling JMG_Utility_Pla...
Definition jmgUtility.h:2458
Switches what music is playing on custom, you must have a JMG_Utility_Play_Music_On_Join_Controller o...
Definition jmgUtility.h:4045
Switches what music is playing when an object enters the attached zone, you must have a JMG_Utility_P...
Definition jmgUtility.h:3486
Switches what music is playing when the attached object is killed, you must have a JMG_Utility_Play_M...
Definition jmgUtility.h:3498
Enables spawners when player count meets specified values, disables when outside of values \StartID -...
Definition jmgUtility.h:5468
Sends a custom when a player is seen, ignores team -4 (spec) and non-visible \ID - ID to send the cus...
Definition jmgUtility.h:8678
Grants a weapon and then destroys self on poke \Weapon - Weapon to grant \Rounds - Rounds in the gun,...
Definition jmgUtility.h:10056
Grants a weapon on poke \Weapon - Weapon to grant \Rounds - Rounds in the gun, -1 = infinite \Backpac...
Definition jmgUtility.h:12205
Sends a custom message on poke, also enables the pokable indicator icon, just like JMG_Utility_Poke_S...
Definition jmgUtility.h:7719
Sends a custom message on poke if the poker has a specified weapon, the message is sent from the poke...
Definition jmgUtility.h:10096
Sends a custom message on poke, also enables the pokable indicator icon \ID - ID to send the custom t...
Definition jmgUtility.h:4492
On Poke sends custom to self \Custom - Message to send when poked \Param - Param to send when poked \...
Definition jmgUtility.h:154
Requires all customs to be received before custom can be sent (unless the custom has a value of 0) \C...
Definition jmgUtility.h:4082
Regen's health via set health/shield strength instead of Apply_Damage, useful for infantry if you don...
Definition jmgUtility.h:3688
Removes a script while if the attached doesn't have a weapon, gives it back when they have the weapon...
Definition jmgUtility.h:11621
Removes a script while a character has a weapon, gives it back when they lose the weapon \WeaponName ...
Definition jmgUtility.h:10808
Resets screen color and opacity on object destruction.
Definition jmgUtility.h:2448
This script refunds damage on the attached object by a percentage of the number of players there are ...
Definition jmgUtility.h:3642
This script refunds damage on the attached object by a percentage of the number of players there are ...
Definition jmgUtility.h:3661
Scales the HP and armor of the object as players join/leave the match (if no players are in game the ...
Definition jmgUtility.h:7291
Only use this script once unless you want to risk crashing \Scale - Scale to set the infantry to.
Definition jmgUtility.h:3449
Fades the screen red when damage, mixes with colors provided by the swimming script and JMG_Utility_S...
Definition jmgUtility.h:5441
Builds a keypad using a model with bones named Number(0-9), Clear, and Enter, the buttons it creates ...
Definition jmgUtility.h:10732
Builds a keypad using a model with bones named Number(0-9), Clear, and Enter, the buttons it creates ...
Definition jmgUtility.h:10240
Takes model and replaces it with the number slot generated by JMG_Utility_Security_System_Random_Numb...
Definition jmgUtility.h:11355
Takes a string and replaces the delim with the code generated by JMG_Utility_Security_System_Random_N...
Definition jmgUtility.h:10317
Sends a custom if the unit doesn't manage to move more than the specified distance in the specified t...
Definition jmgUtility.h:7417
Sends a custom message on if a player holds a specified weapon within a range of the attached object ...
Definition jmgUtility.h:10125
Sends a custom when the object's armor hits zero and then again when it hits full \ID - ID to send th...
Definition jmgUtility.h:8377
Counts the deaths of any object with the reporter script attached, displays hud messages at a set int...
Definition jmgUtility.h:4917
Attach this to a zone and everytime a unit enters it it will increase the death tracking system,...
Definition jmgUtility.h:6877
Attach this to the objects you want the death tracking system applied to, requires JMG_Utility_Send_C...
Definition jmgUtility.h:4955
Sends a custom message when the player count condition is hit \PlayerCount - Player count to trigger ...
Definition jmgUtility.h:3340
Sends a custom whne the attached powerup is collected from the collector \ID - Id of the object to se...
Definition jmgUtility.h:8535
Sends a custom when the attached powerup is collected \ID - Id of the object to send the custom to,...
Definition jmgUtility.h:6365
Sends a custom message when a preset enters the zone \PresetName - preset to trigger on \ID - Id of t...
Definition jmgUtility.h:3397
Sends a custom when the count of presets on the map matches the player count \Preset_ID - Preset ID r...
Definition jmgUtility.h:7223
Sends a custom when the player count condition is hit \TriggerCustom - Custom to trigger the script o...
Definition jmgUtility.h:3366
Sends a custom when an object has been damaged over a specified amount, also can have a delay how oft...
Definition jmgUtility.h:5973
Sends the matching custom when the units HP drops below the ratio \TargetRatio - (Health+Armor)*THIS ...
Definition jmgUtility.h:12292
Sends a custom message when the attached object moves a distance from its initial spawn location \Dis...
Definition jmgUtility.h:12333
Sends a custom when an object gets near a building or moves away from a building \SendCustomObjectID ...
Definition jmgUtility.h:2946
Sends a custom message when no more objects of the preset name exist on the map, then removes itself ...
Definition jmgUtility.h:5720
Makes this unit ignored by JMG_Utility_Send_Custom_When_No_More_Units_On_Team_Exist \Ignore - Does no...
Definition jmgUtility.h:6127
Sends a custom message when no more objects on the specified team exist (ignores obelisk and agt) \Te...
Definition jmgUtility.h:5782
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Not_Team_Zone.
Definition jmgUtility.h:8362
Sends a custom when any team but the specified team is in the zone (only checks smart game objects an...
Definition jmgUtility.h:8320
Sends a custom message when a player is detected between the min and max range \MinDistance - How clo...
Definition jmgUtility.h:8459
Sends a custom message when a player comes into range of this object \Distance - how far away can the...
Definition jmgUtility.h:6695
Sends a custom message when a player goes beyond a certain range of this object \Distance - how far a...
Definition jmgUtility.h:5742
Sends a custom message when a preset gets into range \Preset - Preset to detect \Range - Range to det...
Definition jmgUtility.h:5156
Sends a custom if the object's speed is below a certain amount \Speed - speed to watch for \Rate - ho...
Definition jmgUtility.h:6464
Sends a custom if the object's speed reaches or exceeds a certain amount \Speed - speed to watch for ...
Definition jmgUtility.h:6437
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Team_Dominates_Zone.
Definition jmgUtility.h:8344
Sends a custom when the specified team holds the zone with more objects than all the other teams comb...
Definition jmgUtility.h:8207
The attached object will be ignored from checks by JMG_Utility_Send_Custom_When_Team_Zone.
Definition jmgUtility.h:8353
Sends a custom when the specified team is in the zone (only checks smart game objects and neutral is ...
Definition jmgUtility.h:8242
Sends a custom if the object's speed is below a certain amount when going a direction \MinVelocity[Fo...
Definition jmgUtility.h:6495
Sets the animation of an object to the frame specified on script attach \Animation - Animation to pla...
Definition jmgUtility.h:2532
Makes the attached object sync its animation frame to the object's clip count.
Definition jmgUtility.h:12190
Sets the objects bullet count when it is damaged or receives a custom \WeaponName - Name of the weapo...
Definition jmgUtility.h:6381
Locks the collision mode of an object on create \CollisionGroupID - ID of the collision mode to use.
Definition jmgUtility.h:4503
Sets the maximum distance an AI can wander before returning home (the location it was created) \Dista...
Definition jmgUtility.h:3784
Allows you to Enable/Disable an AI's Innate behavior on create \Enable - Should it be enabled.
Definition jmgUtility.h:3460
Switches the model to different models as the object is damaged (Hint: Use skeleton models to fully s...
Definition jmgUtility.h:2544
Switches the model to different models as the object is damaged (Hint: Use skeleton models to fully s...
Definition jmgUtility.h:2561
Will change the visibility of an object on custom for the specified player id \Custom - Custom to tri...
Definition jmgUtility.h:238
Sets the screen opacity and color of all people that join the game, also resets the screen fade for J...
Definition jmgUtility.h:5054
Switches the default screen color and opacity of the map on a custom and updates all players \Custom ...
Definition jmgUtility.h:5087
Updates the screen of the attached player when the object is created \Transition - how long to fade t...
Definition jmgUtility.h:5099
Fades the screen back to the values set by JMG_Utility_Set_Screen_Color_Fade_Controller for a specifi...
Definition jmgUtility.h:5110
Sets the skin type and armor type on a custom \Custom - Custom to trigger setting the armor and skin ...
Definition jmgUtility.h:3811
Allows you to Enable/Disable a soldiers damage animations \Enable - Should it be enabled.
Definition jmgUtility.h:3472
Sets an object team on attach \PlayerType - Player type to set the object to. \Delay - Amount of time...
Definition jmgUtility.h:2631
Sets the player type to -2 when no armor, sets player type back to the original player type when armo...
Definition jmgUtility.h:5762
Sets the Vehicle's collision to soldier ghost when all players exit (excluding on build) and then set...
Definition jmgUtility.h:6332
Controls setup and cleanup for the Silent countdown.
Definition jmgUtility.h:9337
Sends a custom when the time on JMG_Utility_Silent_Countdown matches the defined seconds on this scri...
Definition jmgUtility.h:9485
Sends a custom when the time on JMG_Utility_Silent_Countdown matches the defined seconds on this scri...
Definition jmgUtility.h:9462
A simplified script for mech walking animatons, use w3danimsound to provide synced walk sounds \Forwa...
Definition jmgUtility.h:5125
Soldier well enter the nearest vehicle on custom.
Definition jmgUtility.h:142
Needs to be placed on the map to make JMG_Utility_Spawn_With_Last_Selected_Gun_Player work.
Definition jmgUtility.h:6731
Tells the game that this weapon shouldn't be used with the JMG_Utility_Spawn_With_Last_Selected_Gun s...
Definition jmgUtility.h:11636
When attached to a player preset, it tracks what weapon the player was holding when they died and tri...
Definition jmgUtility.h:6761
This script allows a AI soldier to swim when in a swimming zone. Attached by JMG_Utility_Swimming_Inf...
Definition jmgUtility.h:10822
This script allows an AI soldier to swim when in a swimming zone. Attached by JMG_Utility_Swimming_In...
Definition jmgUtility.h:11078
Adds all defined weapons of a specific hold style to the JMG_Utility_Swimming_Infantry_Advanced_Contr...
Definition jmgUtility.h:8060
Adds a weapon to JMG_Utility_Swimming_Infantry_Advanced_Controller \WeaponGroupID - Weapon Group to a...
Definition jmgUtility.h:8075
Script must be placed on the map in order to control the advanced swimming scripts.
Definition jmgUtility.h:7817
This script allows a soldier to swim when in a swimming zone. \ If using my swimming animations make ...
Definition jmgUtility.h:7983
This script allows a soldier to swim when in a swimming zone. Weapon that is granted should use the L...
Definition jmgUtility.h:2806
Used to trigger the simple swimming animation system this is to be used along side JMG_Utility_Swimmi...
Definition jmgUtility.h:2749
Used to set the default fog values of the map if there is no water but there are soldiers with the sw...
Definition jmgUtility.h:2734
Selects empty hands on create, the weapon it was holding before script attach is counted as the prima...
Definition jmgUtility.h:3795
Makes a unit switch its gun to a secondary gun whenever the ammo count in its primary clip runs out \...
Definition jmgUtility.h:2929
Syncs the current animation with any players that join, this is useful if you see objects slowly slid...
Definition jmgUtility.h:12179
Sets the level's fog on create, after that point its used to sync up any player that joins with the c...
Definition jmgUtility.h:12147
Updates the fog controller's fog settings \Custom - Custom to watch for \Min - Min range of the fog \...
Definition jmgUtility.h:12165
Syncs the health of an object with the ID of the object specified, object is destroyed if id object d...
Definition jmgUtility.h:5040
Syncs object positions between the client and the server \Sync_Rate - How often does this object send...
Definition jmgUtility.h:2148
Controls all objects that have the script JMG_Utility_Sync_System_Object \Sync_Rate - Speed at which ...
Definition jmgUtility.h:2132
An object that will have its position synced by JMG_Utility_Sync_System_Controller.
Definition jmgUtility.h:2111
Teleports a unit to a different location if it hasn't moved for X seconds \Seconds - Time before it m...
Definition jmgUtility.h:11017
Teleports a player to a location when they pickup a powerup, will move the player within the range de...
Definition jmgUtility.h:3422
Changes the model of any soldier that enters the zone \Time - delay to send the custom \NewModel - W3...
Definition jmgUtility.h:6299
Changes the model of any soldier that enters the zone \Time - delay to send the custom \NewModel - W3...
Definition jmgUtility.h:6274
Basically exactly the same as JMG_Utility_Timer_Custom but with a random delay \Time - delay to send ...
Definition jmgUtility.h:8784
Basically exactly the same as JFW_Timer_Custom except an id of 0 sends to itself \Time - delay to sen...
Definition jmgUtility.h:6237
Damages the attached object and teleports it after a timed delay \Delay - Amount of time in seconds t...
Definition jmgUtility.h:5651
Kills an object after a time period of not being damaged, damage resets the countdown \Time - How lon...
Definition jmgUtility.h:10912
Forces the attached object to scan for enemies more often (server's default rate has a random of 0....
Definition jmgUtility.h:7380
Just like JFW_Toggle_Door except you can't toggle during transition, and the switch object can also b...
Definition jmgUtility.h:2513
Toggles flight after delay completes \Delay - Time to wait before toggling flight.
Definition jmgUtility.h:3713
Controls if JMG_Utility_Turret_Spawn_Global_Flag can attach turrets \Custom - Custom to flip if attac...
Definition jmgUtility.h:10874
Attaches turret as long as the global flag is true otherwise is ignored \Turret_Preset - Preset of th...
Definition jmgUtility.h:10894
Basic turret attach script, turrets match team of vehicle attached to, turrets are destroyed by destr...
Definition jmgUtility.h:12417
Use this script to get AI back out of the ground \Distance - Max distance to try to move the infantry...
Definition jmgUtility.h:4430
Sends a custom to an object on entry from the enterer \PlayerType - Player type the zone triggers for...
Definition jmgUtility.h:8637
Used to apply damage to an object id or the object that entered the zone, damager is the script zone ...
Definition jmgUtility.h:2882
Changes the model of any soldier that enters the zone \NewModel - W3D Model to change it to \PlayerTy...
Definition jmgUtility.h:6256
Changes the soldier's preset on enter if the original preset matches \EntererPreset - required preset...
Definition jmgUtility.h:5026
Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise.
Definition jmgUtility.h:12240
Used by JMG_Utility_Zone_Create_Object_While_Occupied, ignore otherwise.
Definition jmgUtility.h:12250
Creates an object while at least object is in a zone \Preset - Preset to create \Location - Spot to c...
Definition jmgUtility.h:12220
Used to damage all objects in an id range on enter \StartID - ID to start at \EndID - ID to stop at \...
Definition jmgUtility.h:3829
Used to enable or disable all spawners within an ID range on zone enter \StartID - ID to start at \En...
Definition jmgUtility.h:2850
Fades the screen of a specific player \Color - color to fade to (if Red (X) is set to less than 0 col...
Definition jmgUtility.h:5417
Sends a custom to an object on entry from the enterer \PlayerType - Player type the zone triggers for...
Definition jmgUtility.h:8550
Sends a custom to an object on entry if the preset matches \Preset - Preset required \PlayerType - Pl...
Definition jmgUtility.h:10427
Sends a custom to an object on entry \PlayerType - Player type the zone triggers for \ID - ID to send...
Definition jmgUtility.h:4153
Sends a custom to an object on exit \PlayerType - Player type the zone triggers for \ID - ID to send ...
Definition jmgUtility.h:6581
Sends a custom if the object entering the zone has a weapon \PlayerType - Player type the zone trigge...
Definition jmgUtility.h:5668
Sends a custom if the object entering the zone has a weapon, one custom is sent for each ammo count t...
Definition jmgUtility.h:5930
Sends a custom if the object entering the zone has a weapon \PlayerType - Player type the zone trigge...
Definition jmgUtility.h:4065
Sends a custom if the object entering the zone does not have a weapon \PlayerType - Player type the z...
Definition jmgUtility.h:4280
Attached by JMG_Utility_Zone_Send_Custom_On_Player_Occupation_Change.
Definition jmgUtility.h:9328
Sends a custom when the zone becomes occupied by a player and then sends a custom again when its vaca...
Definition jmgUtility.h:9300
Sends a custom to all objects with the specified script attached, sender is the enter \PlayerType - P...
Definition jmgUtility.h:3844
Sets the animation of an object when the script zone is entered \ObjectID - ID of the object to anima...
Definition jmgUtility.h:3438
Changes the player's team to the value specified, then kills the player, finally subtracting 1 from t...
Definition jmgUtility.h:4475
Changes the player's team the value \RequiredPlayerTeam - Player team that the player has to be in or...
Definition jmgUtility.h:4350
Changes the player type of the player's game object (not the player's team) \RequiredPlayerType - Pla...
Definition jmgUtility.h:4135
Used to enable or disable a spawner, allows you to only have it trigger the script once \SpawnerID - ...
Definition jmgUtility.h:4189
Used by JMG_Utility_Zone_Teleport_To_Random_Wander_Point.
Definition jmgUtility.h:10215
Teleports the object that enters the zone to a wander point that isn't visible to players \WanderingA...
Definition jmgUtility.h:10196
Marks this object as a boss object for the JMG_Utility_Zone_Teleport_To_Random_WP_Boss script,...
Definition jmgUtility.h:9523
Teleports the object that enters the zone to a random wander point furthest from a boss object \Wande...
Definition jmgUtility.h:9501
Used by JMG_Utility_Zone_Teleport_To_Random_Wander_Point.
Definition jmgUtility.h:4120
Teleports the object that enters the zone to a random wander point \WanderingAIGroupID - Group of poi...
Definition jmgUtility.h:4101