2 entity ctf_worldflaglist; // CTF flags in the map
3 .entity ctf_worldflagnext;
5 .float next_take_time; // the next time a player can pick up a flag (time + blah)
6 /// I used this, in part, to fix the looping score bug. - avirox
7 //float FLAGSCORE_PICKUP = 1;
8 //float FLAGSCORE_RETURN = 5; // returned by owner team
9 //float FLAGSCORE_RETURNROGUE = 10; // returned by rogue team
10 //float FLAGSCORE_CAPTURE = 5;
11 //float FLAGSCORE_CAPTURE_TEAM = 20;
13 #define FLAG_CARRY_POS '-15 0 7'
15 void FakeTimeLimit(entity e, float t)
18 WriteByte(MSG_ONE, 3); // svc_updatestat
19 WriteByte(MSG_ONE, 236); // STAT_TIMELIMIT
21 WriteCoord(MSG_ONE, cvar("timelimit"));
23 WriteCoord(MSG_ONE, (t + 1) / 60);
26 float flagcaptimerecord;
27 .float flagpickuptime;
37 self.t_width = 0.1; // frame animation rate
39 self.t_length = 119; // maximum frame
41 setattachment(self, world, "");
42 self.mdl = self.model;
44 self.solid = SOLID_TRIGGER;
45 self.movetype = MOVETYPE_NONE;
46 self.velocity = '0 0 0';
47 self.origin_z = self.origin_z + 6;
48 self.think = FlagThink;
49 self.touch = FlagTouch;
50 self.nextthink = time + 0.1;
52 self.mangle = self.angles;
53 self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
54 //self.effects = self.effects | EF_DIMLIGHT;
57 self.movetype = MOVETYPE_TOSS;
60 dprint("Flag fell out of level at ", vtos(self.origin), "\n");
65 self.oldorigin = self.origin;
68 void LogCTF(string mode, float flagteam, entity actor)
71 if(!cvar("sv_eventlog"))
73 s = strcat(":ctf:", mode);
74 s = strcat(s, ":", ftos(flagteam));
76 s = strcat(s, ":", ftos(actor.playerid));
77 GameLogEcho(s, FALSE);
80 void RegenFlag(entity e)
82 setattachment(e, world, "");
83 e.movetype = MOVETYPE_NONE;
85 e.movetype = MOVETYPE_TOSS;
86 e.solid = SOLID_TRIGGER;
87 // TODO: play a sound here
88 setorigin(e, e.oldorigin);
92 e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
95 void ReturnFlag(entity e)
98 if (e.owner.flagcarried == e)
100 WaypointSprite_DetachCarrier(e.owner);
101 e.owner.flagcarried = world;
104 FakeTimeLimit(e.owner, -1);
110 void DropFlag(entity e)
122 dprint("FLAG: drop - no owner?!?!\n");
126 if (p.flagcarried != e)
128 dprint("FLAG: drop - owner is not carrying this flag??\n");
131 bprint(p.netname, "^7 lost the ", e.netname, "\n");
133 if(cvar("g_ctf_flagpenalty_drop"))
134 UpdateFrags(p, -cvar("g_ctf_flagpenalty_drop"));
136 //if(e.enemy && e.enemy != e)
137 //UpdateFrags(e.enemy, cvar("g_ctf_flagscore_kill"));
138 WaypointSprite_DetachCarrier(p);
139 LogCTF("dropped", p.team, p.flagcarried);
141 setattachment(e, world, "");
143 if (p.flagcarried == e)
144 p.flagcarried = world;
147 e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
148 e.solid = SOLID_TRIGGER;
149 e.movetype = MOVETYPE_TOSS;
150 // setsize(e, '-16 -16 0', '16 16 74');
151 setorigin(e, p.origin - '0 0 24' + '0 0 37');
152 e.cnt = FLAG_DROPPED;
153 e.velocity = '0 0 300';
154 e.pain_finished = time + cvar("g_ctf_flag_returntime");//30;
156 trace_startsolid = FALSE;
157 tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
159 dprint("FLAG FALLTHROUGH will happen SOON\n");
164 if(self.delay > time)
166 self.delay = time + self.t_width;
167 if(self.nextthink > self.delay)
168 self.nextthink = self.delay;
170 self.frame = self.frame + 1;
171 if(self.frame > self.t_length)
179 self.nextthink = time + 0.1;
183 if(self.speedrunning)
184 if(self.cnt == FLAG_CARRY)
187 if(flagcaptimerecord)
188 if(time >= self.flagpickuptime + flagcaptimerecord)
190 bprint("The ", self.netname, " became impatient after ", ftos_decimals(flagcaptimerecord, 2), " seconds and returned itself\n");
192 self.owner.impulse = 77; // returning!
202 if (self.cnt == FLAG_BASE)
205 if (self.cnt == FLAG_DROPPED)
207 // flag fallthrough? FIXME remove this if bug is really fixed now
208 if(self.origin_z < -131072)
210 dprint("FLAG FALLTHROUGH just happened\n");
211 self.pain_finished = 0;
213 setattachment(self, world, "");
214 if (time > self.pain_finished)
216 bprint("The ", self.netname, " has returned to base\n");
217 sound (e, CHAN_AUTO, self.noise3, 1, ATTN_NONE);
218 LogCTF("returned", self.team, world);
225 if (e.classname != "player" || (e.deadflag) || (e.flagcarried != self))
227 dprint("CANNOT HAPPEN - player dead and STILL had a flag!\n");
233 void ctf_UpdateCaptures(float msg_target)
236 WriteByte(msg_target, SVC_TEMPENTITY);
237 WriteByte(msg_target, TE_CSQC_CAPTURES);
238 WriteByte(msg_target, cvar("g_ctf_win_mode"));
239 WriteByte(msg_target, caps_team1);
240 WriteByte(msg_target, caps_team2);
243 WriteByte(msg_target, num_for_edict(p));
244 WriteByte(msg_target, p.captures);
246 WriteByte(msg_target, 0);
248 void ctf_UpdateReturns(float msg_target)
251 WriteByte(msg_target, SVC_TEMPENTITY);
252 WriteByte(msg_target, TE_CSQC_RETURNS);
255 WriteByte(msg_target, num_for_edict(p));
256 WriteByte(msg_target, p.returns);
258 WriteByte(msg_target, 0);
268 local string s, s0, h0, h1;
269 if (other.classname != "player")
271 if (other.health < 1) // ignore dead players
274 if (self.cnt == FLAG_CARRY)
277 if (self.cnt == FLAG_BASE)
278 if (other.team == self.team)
279 if (other.flagcarried) // he's got a flag
280 if (other.flagcarried.team != self.team) // capture
282 if (other.flagcarried == world)
286 t = time - other.flagcarried.flagpickuptime;
287 s = ftos_decimals(t, 2);
288 s0 = ftos_decimals(flagcaptimerecord, 2);
289 h0 = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
294 h0 = strcat(h0, "^7's"); // h0: display text for previous netname
295 if (flagcaptimerecord == 0)
297 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");
298 flagcaptimerecord = t;
299 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
300 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
302 else if (t < flagcaptimerecord)
304 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", breaking ", strcat(h0, " previous record of ", s0, " seconds\n"));
305 flagcaptimerecord = t;
306 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
307 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
311 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", failing to break ", strcat(h0, " record of ", s0, " seconds\n"));
315 if(other.team == COLOR_TEAM1)
317 else if(other.team == COLOR_TEAM2)
320 print("Unknown team captured the flag!\n");
321 ctf_UpdateCaptures(MSG_BROADCAST);
322 // FIXME: When counting captures, should the score be updated?
324 LogCTF("capture", other.flagcarried.team, other);
325 // give credit to the individual player
326 UpdateFrags(other, cvar("g_ctf_flagscore_capture"));
328 // give credit to all players of the team (rewards large teams)
329 // NOTE: this defaults to 0
330 FOR_EACH_PLAYER(head)
331 if (head.team == self.team)
332 UpdateFrags(head, cvar("g_ctf_flagscore_capture_team"));
334 sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NONE);
335 WaypointSprite_DetachCarrier(other);
336 if(self.speedrunning)
337 FakeTimeLimit(other, -1);
338 RegenFlag (other.flagcarried);
339 other.flagcarried = world;
340 other.next_take_time = time + 1;
342 if (self.cnt == FLAG_BASE)
343 if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2) // only red and blue team can steal flags
344 if (other.team != self.team)
345 if (!other.flagcarried)
347 if (other.next_take_time > time)
350 self.flagpickuptime = time; // used for timing runs
351 self.speedrunning = other.speedrunning; // if speedrunning, flag will self-return and teleport the owner back after the record
352 if(other.speedrunning)
353 if(flagcaptimerecord)
354 FakeTimeLimit(other, time + flagcaptimerecord);
355 self.solid = SOLID_NOT;
356 setorigin(self, self.origin); // relink
358 other.flagcarried = self;
359 self.cnt = FLAG_CARRY;
360 self.angles = '0 0 0';
361 bprint(other.netname, "^7 got the ", self.netname, "\n");
362 UpdateFrags(other, cvar("g_ctf_flagscore_pickup"));
363 LogCTF("steal", self.team, other);
364 sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE);
366 FOR_EACH_PLAYER(player)
367 if(player.team == self.team)
368 centerprint(player, "The enemy got your flag! Retrieve it!");
370 self.movetype = MOVETYPE_NONE;
371 setorigin(self, FLAG_CARRY_POS);
372 setattachment(self, other, "");
373 WaypointSprite_AttachCarrier("flagcarrier", other);
378 if (self.cnt == FLAG_DROPPED)
380 self.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
381 if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
384 bprint(other.netname, "^7 returned the ", self.netname, "\n");
385 if(cvar("g_ctf_win_mode") == 2)
387 if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2)
388 UpdateFrags(other, cvar("g_ctf_flagscore_return"));
390 UpdateFrags(other, cvar("g_ctf_flagscore_return_rogue"));
393 ctf_UpdateReturns(MSG_BROADCAST);
394 LogCTF("return", self.team, other);
395 sound (self, CHAN_AUTO, self.noise1, 1, ATTN_NONE);
398 else if (!other.flagcarried)
401 self.solid = SOLID_NOT;
402 setorigin(self, self.origin); // relink
404 other.flagcarried = self;
405 self.cnt = FLAG_CARRY;
406 bprint(other.netname, "^7 picked up the ", self.netname, "\n");
407 UpdateFrags(other, cvar("g_ctf_flagscore_pickup"));
408 LogCTF("pickup", self.team, other);
409 sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE);
411 FOR_EACH_PLAYER(player)
412 if(player.team == self.team)
413 centerprint(player, "The enemy got your flag! Retrieve it!");
415 self.movetype = MOVETYPE_NONE; // flag must have MOVETYPE_NONE here, otherwise it will drop through the floor...
416 setorigin(self, FLAG_CARRY_POS);
417 setattachment(self, other, "");
418 WaypointSprite_AttachCarrier("flagcarrier", other);
423 /*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24)
424 CTF Starting point for a player
429 viewing angle when spawning
431 void spawnfunc_info_player_team1()
433 self.team = COLOR_TEAM1; // red
434 spawnfunc_info_player_deathmatch();
436 //self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();};
438 /*QUAKED spawnfunc_info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24)
439 CTF Starting point for a player in
444 viewing angle when spawning
446 void spawnfunc_info_player_team2()
448 self.team = COLOR_TEAM2; // blue
449 spawnfunc_info_player_deathmatch();
451 //self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();};
453 /*QUAKED spawnfunc_info_player_team3 (1 0 0) (-16 -16 -24) (16 16 24)
454 CTF Starting point for a player in
455 team three (Magenta).
459 viewing angle when spawning
461 void spawnfunc_info_player_team3()
463 self.team = COLOR_TEAM3; // purple
464 spawnfunc_info_player_deathmatch();
468 /*QUAKED spawnfunc_info_player_team4 (1 0 0) (-16 -16 -24) (16 16 24)
469 CTF Starting point for a player in
474 viewing angle when spawning
476 void spawnfunc_info_player_team4()
478 self.team = COLOR_TEAM4; // yellow
479 spawnfunc_info_player_deathmatch();
485 /*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
486 CTF flag for team one (Red).
487 Multiple are allowed.
491 Angle the flag will point
494 model to use, note this needs red and blue as skins 0 and 1
495 (default models/ctf/flag.md3)
497 sound played when flag is picked up
498 (default ctf/take.wav)
500 sound played when flag is returned by a teammate
501 (default ctf/return.wav)
503 sound played when flag is captured
504 (default ctf/redcapture.wav)
506 sound played when flag is lost in the field and respawns itself
507 (default ctf/respawn.wav)
510 void spawnfunc_item_flag_team1()
518 //if(!cvar("teamplay"))
519 // cvar_set("teamplay", "3");
521 // link flag into ctf_worldflaglist
522 self.ctf_worldflagnext = ctf_worldflaglist;
523 ctf_worldflaglist = self;
525 self.classname = "item_flag_team";
526 self.team = COLOR_TEAM1; // color 4 team (red)
527 self.items = IT_KEY2; // gold key (redish enough)
528 self.netname = "^1RED^7 flag";
529 self.target = "###item###";
531 if(self.spawnflags & 1)
534 self.model = "models/ctf/flag_red.md3";
536 self.noise = "ctf/take.wav";
538 self.noise1 = "ctf/return.wav";
540 self.noise2 = "ctf/redcapture.wav"; // blue team scores by capturing the red flag
542 self.noise3 = "ctf/respawn.wav";
543 precache_model (self.model);
544 setmodel (self, self.model); // precision set below
545 precache_sound (self.noise);
546 precache_sound (self.noise1);
547 precache_sound (self.noise2);
548 precache_sound (self.noise3);
549 setsize(self, '-16 -16 -37', '16 16 37');
550 setorigin(self, self.origin + '0 0 37');
551 self.nextthink = time + 0.2; // start after doors etc
552 self.think = place_flag;
556 //if(!self.glow_size)
557 // self.glow_size = 50;
559 self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
563 waypoint_spawnforitem(self);
565 WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 37', self, sprite);
568 /*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -24) (48 48 64)
569 CTF flag for team two (Blue).
570 Multiple are allowed.
574 Angle the flag will point
577 model to use, note this needs red and blue as skins 0 and 1
578 (default models/ctf/flag.md3)
580 sound played when flag is picked up
581 (default ctf/take.wav)
583 sound played when flag is returned by a teammate
584 (default ctf/return.wav)
586 sound played when flag is captured
587 (default ctf/bluecapture.wav)
589 sound played when flag is lost in the field and respawns itself
590 (default ctf/respawn.wav)
593 void spawnfunc_item_flag_team2()
600 //if(!cvar("teamplay"))
601 // cvar_set("teamplay", "3");
603 // link flag into ctf_worldflaglist
604 self.ctf_worldflagnext = ctf_worldflaglist;
605 ctf_worldflaglist = self;
607 self.classname = "item_flag_team";
608 self.team = COLOR_TEAM2; // color 13 team (blue)
609 self.items = IT_KEY1; // silver key (bluish enough)
610 self.netname = "^4BLUE^7 flag";
611 self.target = "###item###";
613 if(self.spawnflags & 1)
616 self.model = "models/ctf/flag_blue.md3";
618 self.noise = "ctf/take.wav";
620 self.noise1 = "ctf/return.wav";
622 self.noise2 = "ctf/bluecapture.wav"; // red team scores by capturing the blue flag
624 self.noise3 = "ctf/respawn.wav";
625 precache_model (self.model);
626 setmodel (self, self.model); // precision set below
627 precache_sound (self.noise);
628 precache_sound (self.noise1);
629 precache_sound (self.noise2);
630 precache_sound (self.noise3);
631 setsize(self, '-16 -16 -37', '16 16 37');
632 setorigin(self, self.origin + '0 0 37');
633 self.nextthink = time + 0.2; // start after doors etc
634 self.think = place_flag;
638 //if(!self.glow_size)
639 // self.glow_size = 50;
641 self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
645 waypoint_spawnforitem(self);
647 WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 37', self, sprite);
651 /*QUAKED spawnfunc_ctf_team (0 .5 .8) (-16 -16 -24) (16 16 32)
652 Team declaration for CTF gameplay, this allows you to decide what team
653 names and control point models are used in your map.
655 Note: If you use spawnfunc_ctf_team entities you must define at least 2! However, unlike
656 domination, you don't need to make a blank one too.
660 Name of the team (for example Red, Blue, Green, Yellow, Life, Death, Offense, Defense, etc)
662 Scoreboard color of the team (for example 4 is red and 13 is blue)
666 void spawnfunc_ctf_team()
673 self.classname = "ctf_team";
674 self.team = self.cnt + 1;
677 // code from here on is just to support maps that don't have control point and team entities
678 void ctf_spawnteam (string teamname, float teamcolor)
680 local entity oldself;
683 self.classname = "ctf_team";
684 self.netname = teamname;
685 self.cnt = teamcolor;
687 spawnfunc_ctf_team();
692 // spawn some default teams if the map is not set up for ctf
693 void ctf_spawnteams()
697 numteams = 2;//cvar("g_ctf_default_teams");
699 ctf_spawnteam("Red", COLOR_TEAM1 - 1);
700 ctf_spawnteam("Blue", COLOR_TEAM2 - 1);
703 void ctf_delayedinit()
705 self.think = SUB_Remove;
706 self.nextthink = time;
707 // if no teams are found, spawn defaults
708 if (find(world, classname, "ctf_team") == world)
716 caps_team1 = caps_team2 = 0;
717 registercvar("capturelimit", "8");
718 registercvar("g_ctf_win_mode", "0");
719 //registercvar("g_overtime", "1");
720 registercvar("g_ctf_flagscore_kill", "6");
721 registercvar("g_ctf_flagpenalty_drop", "0");
722 //addstat(STAT_CTF_CAPTURES, AS_INT, captures);
723 //addstat(STAT_CTF_STATE, AS_FLOAT_TRUNCATED, ctf_state);
725 e.think = ctf_delayedinit;
726 e.nextthink = time + 0.1;
727 flagcaptimerecord = stof(db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time")));
730 void ctf_setstatus2(entity flag, float shift)
732 if (flag.cnt == FLAG_CARRY)
733 if (flag.owner == self)
734 self.items |= shift * 3;
736 self.items |= shift * 1;
737 else if (flag.cnt == FLAG_DROPPED)
738 self.items |= shift * 2;
747 self.items = self.items - (self.items & IT_RED_FLAG_TAKEN);
748 self.items = self.items - (self.items & IT_RED_FLAG_LOST);
749 self.items = self.items - (self.items & IT_BLUE_FLAG_TAKEN);
750 self.items = self.items - (self.items & IT_BLUE_FLAG_LOST);
754 float redflags, blueflags;
759 for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE)
761 if(flag.team == COLOR_TEAM1)
763 else if(flag.team == COLOR_TEAM2)
767 // blinking magic: if there is more than one flag, show one of these in a clever way
769 redflags = mod(floor(time * redflags * 0.75), redflags);
771 blueflags = mod(floor(time * blueflags * 0.75), blueflags);
773 for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE)
775 if(flag.team == COLOR_TEAM1)
777 if(--redflags == -1) // happens exactly once (redflags is in 0..count-1, and will --'ed count times)
778 ctf_setstatus2(flag, IT_RED_FLAG_TAKEN);
780 else if(flag.team == COLOR_TEAM2)
782 if(--blueflags == -1) // happens exactly once
783 ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN);
789 entity(float cteam) ctf_team_has_commander =
792 if(cteam != COLOR_TEAM1 || cteam != COLOR_TEAM2)
795 FOR_EACH_REALPLAYER(pl) {
796 if(pl.team == cteam && pl.iscommander) {
803 void(entity e, float st) ctf_setstate =
809 void(float cteam) ctf_new_commander =
814 FOR_EACH_REALPLAYER(pl) {
815 if(pl.team == cteam) {
816 if(pl.iscommander) { // don't reassign if alreay there
819 if(plmax == world || plmax.frags < pl.frags)
824 bprint(strcat(ColoredTeamName(cteam), " Team has no Commander!\n"));
828 plmax.iscommander = TRUE;
829 ctf_setstate(plmax, 3);
830 sprint(plmax, "^3You're the commander now!\n");
831 centerprint(plmax, "^3You're the commander now!\n");
834 void() ctf_clientconnect =
836 self.iscommander = FALSE;
838 if(!self.team || self.classname != "player") {
839 ctf_setstate(self, -1);
841 ctf_setstate(self, 0);
843 self.team_saved = self.team;
845 if(self.team != 0 && self.classname == "player" && !ctf_team_has_commander(self.team)) {
846 ctf_new_commander(self.team);
850 void() ctf_playerchanged =
852 if(!self.team || self.classname != "player") {
853 ctf_setstate(self, -1);
854 } else if(self.ctf_state < 0 && self.classname == "player") {
855 ctf_setstate(self, 0);
858 if(self.iscommander &&
859 (self.classname != "player" || self.team != self.team_saved)
862 self.iscommander = FALSE;
863 if(self.classname == "player")
864 ctf_setstate(self, 0);
866 ctf_setstate(self, -1);
867 ctf_new_commander(self.team_saved);
870 self.team_saved = self.team;
872 ctf_new_commander(self.team);
875 void() ctf_clientdisconnect =
879 ctf_new_commander(self.team);
883 entity GetPlayer(string);
884 float() ctf_clientcommand =
887 if(argv(0) == "order") {
889 sprint(self, "This command is not supported in this gamemode.\n");
892 if(!self.iscommander) {
893 sprint(self, "^1You are not the commander!\n");
897 sprint(self, "Usage: order #player status - (playernumber as in status)\n");
900 e = GetPlayer(argv(1));
902 sprint(self, "Invalid player.\nUsage: order #player status - (playernumber as in status)\n");
905 if(e.team != self.team) {
906 sprint(self, "^3You can only give orders to your own team!\n");
909 if(argv(2) == "attack") {
910 sprint(self, strcat("Ordering ", e.netname, " to attack!\n"));
911 sprint(e, "^1Attack!\n");
912 centerprint(e, "^7You've been ordered to^9\n^1Attack!\n");
914 } else if(argv(2) == "defend") {
915 sprint(self, strcat("Ordering ", e.netname, " to defend!\n"));
916 sprint(e, "^Defend!\n");
917 centerprint(e, "^7You've been ordered to^9\n^2Defend!\n");
920 sprint(self, "^7Invalid command, use ^3attack^7, or ^3defend^7.\n");