From 1b8fbe76a72949465f5dec0fd42ff879375cfccc Mon Sep 17 00:00:00 2001 From: aldrichdev Date: Tue, 4 Aug 2020 07:53:57 -0700 Subject: [PATCH] Initial Commit --- .gitignore | 3 + V1.0/Scripts/AWE Scripts/_awe_bots.gsc | 494 + V2.0/Scriptmenus/weapon_american.menu | 1381 +++ V2.0/Scriptmenus/weapon_german.menu | 1248 +++ V2.0/Scripts/AWE Scripts/_awe.gsc | 11986 +++++++++++++++++++++ V2.0/Scripts/AWE Scripts/_awe_bots.gsc | 365 + V2.0/Scripts/AWE Scripts/_teams.gsc | 2701 +++++ V2.0/Weapons/Client/minigun_mp | 1 + V2.0/Weapons/Client/noobtube_mp | 1 + V2.0/Weapons/Client/remi_shotgun_mp | 1 + V2.0/Workbench/hud@shotgun.dds | Bin 0 -> 8320 bytes V2.0/Workbench/remi_shotgun_mp | 1 + V2.0/Workbench/secondary weapon menu.txt | 0 V2.0/Workbench/shotgun_fixed.pk3 | Bin 0 -> 645611 bytes V2.1/Scriptmenus/weapon_american.menu | 1381 +++ V2.1/Scriptmenus/weapon_german.menu | 1248 +++ V2.1/Scripts/AWE Scripts/_awe.gsc | 11986 +++++++++++++++++++++ V2.1/Scripts/AWE Scripts/_awe_bots.gsc | 418 + V2.1/Scripts/AWE Scripts/_teams.gsc | 2701 +++++ V2.1/Weapons/Client/minigun_mp | 1 + V2.1/Weapons/Client/noobtube_mp | 1 + V2.1/Weapons/Client/remi_shotgun_mp | 1 + V2.1/Workbench/hud@shotgun.dds | Bin 0 -> 8320 bytes V2.1/Workbench/remi_shotgun_mp | 1 + V2.1/Workbench/secondary weapon menu.txt | 0 V2.1/Workbench/shotgun_fixed.pk3 | Bin 0 -> 645611 bytes 26 files changed, 35920 insertions(+) create mode 100644 .gitignore create mode 100644 V1.0/Scripts/AWE Scripts/_awe_bots.gsc create mode 100644 V2.0/Scriptmenus/weapon_american.menu create mode 100644 V2.0/Scriptmenus/weapon_german.menu create mode 100644 V2.0/Scripts/AWE Scripts/_awe.gsc create mode 100644 V2.0/Scripts/AWE Scripts/_awe_bots.gsc create mode 100644 V2.0/Scripts/AWE Scripts/_teams.gsc create mode 100644 V2.0/Weapons/Client/minigun_mp create mode 100644 V2.0/Weapons/Client/noobtube_mp create mode 100644 V2.0/Weapons/Client/remi_shotgun_mp create mode 100644 V2.0/Workbench/hud@shotgun.dds create mode 100644 V2.0/Workbench/remi_shotgun_mp create mode 100644 V2.0/Workbench/secondary weapon menu.txt create mode 100644 V2.0/Workbench/shotgun_fixed.pk3 create mode 100644 V2.1/Scriptmenus/weapon_american.menu create mode 100644 V2.1/Scriptmenus/weapon_german.menu create mode 100644 V2.1/Scripts/AWE Scripts/_awe.gsc create mode 100644 V2.1/Scripts/AWE Scripts/_awe_bots.gsc create mode 100644 V2.1/Scripts/AWE Scripts/_teams.gsc create mode 100644 V2.1/Weapons/Client/minigun_mp create mode 100644 V2.1/Weapons/Client/noobtube_mp create mode 100644 V2.1/Weapons/Client/remi_shotgun_mp create mode 100644 V2.1/Workbench/hud@shotgun.dds create mode 100644 V2.1/Workbench/remi_shotgun_mp create mode 100644 V2.1/Workbench/secondary weapon menu.txt create mode 100644 V2.1/Workbench/shotgun_fixed.pk3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..043a4b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Junk/* +*Release* +*Resources* \ No newline at end of file diff --git a/V1.0/Scripts/AWE Scripts/_awe_bots.gsc b/V1.0/Scripts/AWE Scripts/_awe_bots.gsc new file mode 100644 index 0000000..5d6fd37 --- /dev/null +++ b/V1.0/Scripts/AWE Scripts/_awe_bots.gsc @@ -0,0 +1,494 @@ +addBotClients() +{ + //Define RCON cvars + setcvar("sv_target", 100); + setcvar("sv_kick", 0); + setcvar("sv_clone", 100); + setcvar("sv_tele", 100); + setcvar("sv_tele_all", 0); + setcvar("sv_tele_allies", 0); + setcvar("sv_tele_axis", 0); + setcvar("sv_teleport_to", 100); + setcvar("sv_disable", 0); + + level endon("awe_boot"); + + wait 2; + + if(level.awe_debug) + iprintln(level.awe_allplayers.size + " players found."); + + numbots = 0; + // Catch & count running bots and start their think threads. + for(i=0;i 0) + { + if (!isDefined(self)) + { + iprintln("A bot (self) was not defined - return; (No disabling.)"); + return; + } + self setweaponslotammo("primary", 0); + self setweaponslotclipammo("primary", 0); + if (self == level.debugBot && counter == 0) iprintln("^3Bots temporarily disabled"); + counter = counter + 1; + wait 2; + continue; + } + + //reset counter + counter = 0; + + //If a target is not set, target the closest enemy + //The target can be removed by setting the cvar to 64 or higher + if (getCvarInt("sv_target") > (players.size - 1)) + { + if (!isDefined(self)) + { + iprintln("A bot (self) was not defined - return (No normal targeting.)"); + return; + } + targetedPlayer = self getTarget(); + self targetPlayer(targetedPlayer); + wait 0.4; + continue; + } + else break; + } + + //iprintln("---FINISHED INNER LOOP---"); + + //When sv_target is set to a player: + clientNumber = getCvarInt("sv_target"); + + if (self == level.debugBot) + { + iprintln("Uh-oh.... " + players[clientNumber].name + "^3 is the new target!"); + iprintlnbold(players[clientNumber].name + " is entering ^1SURVIVOR MODE!"); + iprintln(players[clientNumber].name + " ^3has been given unlimited primary gun ammo"); + } + + for(i = 0; i < players.size; i++) + { + if (i == getCvarInt("sv_target")) + { + if (!isDefined(players[i])) continue; + targetedPlayer = players[i]; + break; + } + } + + while (getCvarInt("sv_target") == clientNumber) + { + //Keep targeting the player until the cvar changes. + if (!isDefined(targetedPlayer) || !isDefined(self)) break; + closestDistance = distance(self.origin, targetedPlayer.origin); + self targetPlayer(targetedPlayer, closestDistance); + targetedPlayer setweaponslotammo("primary", 300); + targetedPlayer setweaponslotclipammo("primary", 30); + wait 0.2; + } + + if (self == level.debugBot) + { + iprintln("Player " + players[clientNumber].name + "^2 is no longer targeted! ^3(Ammo reset)"); + iprintlnbold("^2Free for all!"); + } + + wait 1; //10 + + //iprintln("---FINISHED OUTER LOOP---"); + } + } +} + +getTarget() +{ + if (!isDefined(self)) + { + //iprintln("self is not defined"); + return; + } + if (!isAlive(self)) + { + return; + } + + + players = getentarray("player", "classname"); + for(i = 0; i < players.size; i++) + { + if (players[0] != self && players[0].sessionstate == "playing" + && isNotMyTeam(players[0])) + { + targetedPlayer = players[0]; + // if (isDefined(targetedPlayer)) + // { + // iprintln("My name is " + self + " and I am targeting " + targetedPlayer); + // } + closestDistance = distance(self.origin, players[0].origin); + } + else if (players[1] != self && players[1].sessionstate == "playing" + && isNotMyTeam(players[1])) + { + targetedPlayer = players[1]; + // if (isDefined(targetedPlayer)) + // { + // iprintln("My name is " + self + " and I am targeting " + targetedPlayer); + // } + closestDistance = distance(self.origin, players[1].origin); + } + for(i = 1; i < players.size; i++) + { + if (!isDefined(players[i])) continue; + dist = distance(self.origin, players[i].origin); + if (players[i] != self && players[i].sessionstate == "playing" + && isNotMyTeam(players[i]) && closestDistance > dist) + { + targetedPlayer = players[i]; + // if (isDefined(targetedPlayer)) + // { + // iprintln("My name is " + self + " and I am targeting " + targetedPlayer + " in inner for loop"); + // } + closestDistance = distance(self.origin, targetedPlayer.origin); + } + } + } + + // if (isDefined(targetedPlayer)) + // { + // iprintln("End of getTarget(): targetedPlayer IS DEFINED YAY"); + // } + // else + // { + // iprintln("End of getTarget(): targetedPlayer IS NOT DEFINED BOOHOO"); + // } + return targetedPlayer; +} + +targetPlayer(targetedPlayer) +{ + if (!isDefined(self)) + { + return; + } + if (!isDefined(targetedPlayer) && isDefined(level.debugBot) && self == level.debugBot) + { + iprintln("My name is " + level.debugBot + ". In targetPlayer() function - targetedPlayer was not defined"); + return; + } + + closestDistance = distance(self.origin, targetedPlayer.origin); + if (targetedPlayer.sessionstate != "playing") + { + self setweaponslotammo("primary", 0); + self setweaponslotclipammo("primary", 0); + return; + } + + if(targetedPlayer.sessionstate == "playing" && targetedPlayer != self && closestDistance < 100000 + && isNotMyTeam(targetedPlayer)) + { + //Go towards the closest player. + playerAngles = vectortoangles(targetedPlayer.origin - self.origin); + self setplayerangles(playerAngles); + } + if(targetedPlayer.sessionstate == "playing" && targetedPlayer != self && closestDistance < 2000 + && isNotMyTeam(targetedPlayer)) + { + playerAngles = vectortoangles(targetedPlayer.origin - self.origin); + self setplayerangles(playerAngles); + self setweaponslotammo("primary", 125); + self setweaponslotclipammo("primary", 5); + } + else + { + self setweaponslotammo("primary", 0); + self setweaponslotclipammo("primary", 0); + } +} + +isBot(player) +{ + if (!isPlayer(player)) { return false; } + return (player.name[0] == "b" && player.name[1] == "o" && player.name[2] == "t"); +} + +isTeamGame() +{ + if (level.awe_gametype == "dm") return false; + else return true; +} + +isNotMyTeam(player) +{ + myTeam = self.pers["team"]; + if (isTeamGame()) + { + if (player.pers["team"] != myTeam) return true; + else return false; + } + else return true; +} + +isPaul(player) +{ + if(player.name == "Stunt//Paul") + { + return true; + } + else return false; +} + +teleportAllBots(teleporter) +{ + players = getentarray("player", "classname"); + + for(i = 0; i < players.size; i++) + { + if (!isDefined(players[i])) continue; + if (self == level.debugBot && isBot(players[i])) + { + players[i] setorigin(teleporter.origin); + if (players[i] == players[(players.size - 1)]) //Last bot? + { + setcvar("sv_tele_all", 0); + break; + } + } + } +} + +teleportTeamBots(teleporter, team) +{ + players = getentarray("player", "classname"); + + for(i = 0; i < players.size; i++) + { + if (!isDefined(players[i])) continue; + if (self == level.debugBot && isBot(players[i]) && players[i].pers["team"] == team) + { + players[i] setorigin(teleporter.origin); + } + } + + //Don't teleport bots more than once: + if (self == level.debugBot) setcvar("sv_tele_" + team, 0); +} + +kickBots() +{ + // players = getEntArray("player", "classname"); + + // for(i = 0; i < players.size; i++) + // { + // if (isBot(players[i])) + // kick(players[i] getEntityNumber(), "EXE_PLAYERKICKED"); + // } +} + +//Comment Code// + //iprintln("Debug bot active= " + level.debugBot.name); + //iprintln("Cvar is set to <= " + (players.size - 1)); + //Teleport bot to Paul (if he exists) + //botToTeleport = getCvarInt("sv_tele"); + //iprintln("I am " + self.name + "and I am also " + players[getCvarInt("sv_tele")]); + + //iprintln("allare good- self is debug. cvar is " + getCvarInt("sv_tele")); + + //iprintlnbold("If you can read this, " + players[getCvarInt("sv_tele")] + // + " was teleported to " + teleporter.name); + +//iprintln(players[(players.size - 1)].name + " will be checked against players[i] (last bot?)"); + + //iprintln("teleporting to stunt//paul:" + players[i].name); + + //iprintln("players[i] is " + players[i].name); + //iprintln("To Continue - self: " + self.name + " must be also " + level.debugBot + ", " + players[i].name + " must be a bot, and " + players[i].pers["team"] + " must be " + team); + + //iprintln("players[i] is a bot; players[i] team = " + players[i].pers["team"] + "which is also " + team); + + // if (getCvarInt("sv_clone") > 0 && self.name == "bot0") + // { + // self cloneplayer(); + // } + + + \ No newline at end of file diff --git a/V2.0/Scriptmenus/weapon_american.menu b/V2.0/Scriptmenus/weapon_american.menu new file mode 100644 index 0000000..41f3c68 --- /dev/null +++ b/V2.0/Scriptmenus/weapon_american.menu @@ -0,0 +1,1381 @@ +#include "ui_mp/menudef.h" + +#define ORIGIN_MENUTABS 96 64 +#define ORIGIN_MENUWINDOW 96 96 +#define ORIGIN_WEAPONIMAGE 296 116 +#define ORIGIN_WEAPONTEXT 296 220 +#define ORIGIN_WEAPONPROPERTIESTEXT 296 330 +#define ORIGIN_WEAPONACCURACY 395 319 +#define ORIGIN_WEAPONDAMAGE 395 336 +#define ORIGIN_WEAPONMOBILITY 395 353 + +{ + menuDef + { + name "weapon_american" + fullscreen 0 + rect 0 0 640 480 + focuscolor 1 1 1 1 + disablecolor 0 0 0 0 + style WINDOW_STYLE_EMPTY + onEsc + { + scriptMenuResponse "close"; + close weapon_american; + } + onOpen + { + scriptMenuResponse "open"; + show m1carbine_info; + show weapon_propertiestext; + } + onClose + { + scriptMenuResponse "close"; + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + } + +// WINDOW BACKGROUND + itemDef + { + name "window_background" + visible 1 + rect 0 0 448 288 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + decoration + } + +// WINDOW BANNER + itemDef + { + name "window_banner" + visible 1 + rect 9 6 430 24 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@banner_weapon.tga" + decoration + } + +// WINDOW LINES + itemDef + { + name "window_lines" + visible 1 + rect 3 0 2 283 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 443 0 2 283 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 3 283 442 2 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 5 0 438 2 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 5 34 438 1 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// MAIN MENU BUTTON + itemDef + { + name "button_mainmenu" + visible 1 + rect 0 0 89 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_MAIN_MENU" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + close weapon_american; + open main; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_mainmenu_hline" + visible 1 + rect 3 3 86 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_mainmenu_lvline" + visible 1 + rect 3 5 2 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_mainmenu_rvline" + visible 1 + rect 88 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// TEAM BUTTON + itemDef + { + name "button_team" + visible 1 + rect 89 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_TEAM" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + scriptMenuResponse "team"; + close weapon_american; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_team_hline" + visible 1 + rect 89 3 90 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_team_lvline" + visible 1 + rect 89 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_team_rvline" + visible 1 + rect 178 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// WEAPON BUTTON + itemDef + { + name "button_weapon" + visible 1 + rect 179 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + text "@MPMENU_WEAPON" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + decoration + } + itemDef + { + name "button_weapon_gray" + visible 1 + rect 179 3 90 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// VIEW MAP BUTTON + itemDef + { + name "button_viewmap" + visible 1 + rect 269 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_VIEW_MAP" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + scriptMenuResponse "viewmap"; + close weapon_american; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_viewmap_hline" + visible 1 + rect 269 3 90 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_viewmap_lvline" + visible 1 + rect 269 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_viewmap_rvline" + visible 1 + rect 358 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// CALL VOTE BUTTON + itemDef + { + name "button_callvote" + visible 1 + rect 359 0 89 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_CALL_VOTE" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 42 + textaligny 24 + textalign ITEM_ALIGN_CENTER + cvartest "ui_allowvote" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "callvote"; + close weapon_american; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_callvote_hline" + visible 1 + rect 359 3 86 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + itemDef + { + name "button_callvote_lvline" + visible 1 + rect 359 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + itemDef + { + name "button_callvote_rvline" + visible 1 + rect 443 5 2 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + +// CALL VOTE BUTTON HIDDEN + itemDef + { + name "button_callvote_lvedge" + visible 1 + rect 359 0 4 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 0 0 0 0.7975 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + itemDef + { + name "button_callvote_bhedge" + visible 1 + rect 359 29 89 3 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 0 0 0 0.7975 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + itemDef + { + name "button_callvote_lvline" + visible 1 + rect 359 3 1 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + +// MENU CHOICES + itemDef + { + name "button_m1carbine" + visible 1 + rect 16 46 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_1_M1A1_CARBINE" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_m1carbine" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "m1carbine_mp"; + close weapon_american; + } + onFocus + { + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show m1carbine_info; + show weapon_propertiestext; + } + } + execKey "1" { play "mouse_click"; scriptMenuResponse "m1carbine_mp"; close weapon_american } + + itemDef + { + name "button_m1garand" + visible 1 + rect 16 70 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_2_M1_GARAND" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_m1garand" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "m1garand_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show m1garand_info; + show weapon_propertiestext; + } + } + execKey "2" { play "mouse_click"; scriptMenuResponse "m1garand_mp"; close weapon_american } + + itemDef + { + name "button_thompson" + visible 1 + rect 16 94 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_3_THOMPSON" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_thompson" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "thompson_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show thompson_info; + show weapon_propertiestext; + } + } + execKey "3" { play "mouse_click"; scriptMenuResponse "thompson_mp"; close weapon_american } + + itemDef + { + name "button_bar" + visible 1 + rect 16 118 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_4_BAR" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_bar" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "bar_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show bar_info; + show weapon_propertiestext; + } + } + execKey "4" { play "mouse_click"; scriptMenuResponse "bar_mp"; close weapon_american } + + itemDef + { + name "button_springfield" + visible 1 + rect 16 142 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_5_SPRINGFIELD" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_springfield" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "springfield_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show springfield_info; + show weapon_propertiestext; + } + } + execKey "5" { play "mouse_click"; scriptMenuResponse "springfield_mp"; close weapon_american } + + itemDef + { + name "button_fg42" + visible 1 + rect 16 166 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "6. FG42" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_fg42_allies" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "fg42_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show fg42_info; + show weapon_propertiestext; + } + } + execKey "6" { play "mouse_click"; scriptMenuResponse "fg42_mp"; close weapon_american } + + itemDef + { + name "button_minigun" + visible 1 + rect 16 190 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "7. Minigun" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_minigun" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "minigun_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show minigun_info; + show weapon_propertiestext; + } + } + execKey "7" { play "mouse_click"; scriptMenuResponse "minigun_mp"; close weapon_american } + + itemDef + { + name "button_noobtube" + visible 1 + rect 16 214 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "8. NoobTube" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_noobtube" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "noobtube_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide shotgun_info; + play "mouse_over"; + show noobtube_info; + show weapon_propertiestext; + } + } + execKey "8" { play "mouse_click"; scriptMenuResponse "noobtube_mp"; close weapon_american } + + itemDef + { + name "button_shotgun" + visible 1 + rect 16 238 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "9. Shotgun" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_shotgun" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "remi_shotgun_mp"; + close weapon_american; + } + onFocus + { + hide m1carbine_info; + hide m1garand_info; + hide thompson_info; + hide bar_info; + hide springfield_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + play "mouse_over"; + show shotgun_info; + show weapon_propertiestext; + } + } + execKey "9" { play "mouse_click"; scriptMenuResponse "remi_shotgun_mp"; close weapon_american } +// WEAPON IMAGES + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@m1carbine.tga" + decoration + } + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@m1garand.tga" + decoration + } + itemDef + { + name "thompson_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@thompson.tga" + decoration + } + itemDef + { + name "bar_info" + visible 0 + rect 0 0 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@bar.tga" + decoration + } + itemDef + { + name "springfield_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@springfield.tga" + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 10 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@fg42.tga" + decoration + } + itemDef + { + name "minigun_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } + itemDef + { + name "noobtube_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } + itemDef + { + name "shotgun_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } +// WEAPON DESCRIPTIONS + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_M1A1_CARBINE_IS_A" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_M1_GARAND_IS_A_POWERFUL" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "thompson_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_THOMPSON_IS_DEADLY" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "bar_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_BROWNING_AUTOMATIC" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THIS_IS_A_SNIPER_RIFLE" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The FG42 is a scoped assault rifle. Up close, it can be used as a submachine gun, while at longer ranges it can operate as a scoped rifle." + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "minigun_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The original Gatling gun.. what else is there to say?" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "noobtube_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "BOOM SHAKA LAKA!" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "shotgun_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The Remington 1893 Shotgun." + textfont UI_FONT_NORMAL + textscale .24 + decoration + } +// WEAPON PROPERTIES + itemDef + { + name "weapon_propertiestext" + visible 0 + origin ORIGIN_WEAPONPROPERTIESTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_ACCURACY_DAMAGE_MOBILITY" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 61 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 80 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1carbine_info" + visible 0 + rect 0 0 121 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 80 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 96 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "m1garand_info" + visible 0 + rect 0 0 97 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 30 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 83 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "thompson_info" + visible 0 + rect 0 0 119 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "bar_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "bar_info" + visible 0 + rect 0 0 90 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "bar_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "bar_info" + visible 0 + rect 0 0 96 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "bar_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "bar_info" + visible 0 + rect 0 0 67 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "springfield_info" + visible 0 + rect 0 0 89 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 90 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 96 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 67 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + } +} diff --git a/V2.0/Scriptmenus/weapon_german.menu b/V2.0/Scriptmenus/weapon_german.menu new file mode 100644 index 0000000..578a903 --- /dev/null +++ b/V2.0/Scriptmenus/weapon_german.menu @@ -0,0 +1,1248 @@ +#include "ui_mp/menudef.h" + +#define ORIGIN_MENUTABS 96 64 +#define ORIGIN_MENUWINDOW 96 96 +#define ORIGIN_WEAPONIMAGE 296 116 +#define ORIGIN_WEAPONTEXT 296 220 +#define ORIGIN_WEAPONPROPERTIESTEXT 296 330 +#define ORIGIN_WEAPONACCURACY 395 319 +#define ORIGIN_WEAPONDAMAGE 395 336 +#define ORIGIN_WEAPONMOBILITY 395 353 + +{ + menuDef + { + name "weapon_german" + fullscreen 0 + rect 0 0 640 480 + focuscolor 1 1 1 1 + disablecolor 0 0 0 0 + style WINDOW_STYLE_EMPTY + onEsc + { + scriptMenuResponse "close"; + close weapon_german; + } + onOpen + { + scriptMenuResponse "open"; + show kar98k_info; + show weapon_propertiestext; + } + onClose + { + scriptMenuResponse "close"; + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + } + +// WINDOW BACKGROUND + itemDef + { + name "window_background" + visible 1 + rect 0 0 448 288 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + decoration + } + +// WINDOW BANNER + itemDef + { + name "window_banner" + visible 1 + rect 9 6 430 24 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@banner_weapon.tga" + decoration + } + +// WINDOW LINES + itemDef + { + name "window_lines" + visible 1 + rect 3 0 2 283 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 443 0 2 283 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 3 283 442 2 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 5 0 438 2 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + + itemDef + { + name "window_lines" + visible 1 + rect 5 34 438 1 + origin ORIGIN_MENUWINDOW + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// MAIN MENU BUTTON + itemDef + { + name "button_mainmenu" + visible 1 + rect 0 0 89 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_MAIN_MENU" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + close weapon_german; + open main; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_mainmenu_hline" + visible 1 + rect 3 3 86 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_mainmenu_lvline" + visible 1 + rect 3 5 2 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_mainmenu_rvline" + visible 1 + rect 88 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// TEAM BUTTON + itemDef + { + name "button_team" + visible 1 + rect 89 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_TEAM" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + scriptMenuResponse "team"; + close weapon_german; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_team_hline" + visible 1 + rect 89 3 90 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_team_lvline" + visible 1 + rect 89 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_team_rvline" + visible 1 + rect 178 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// WEAPON BUTTON + itemDef + { + name "button_weapon" + visible 1 + rect 179 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + text "@MPMENU_WEAPON" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + decoration + } + itemDef + { + name "button_weapon_gray" + visible 1 + rect 179 3 90 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// VIEW MAP BUTTON + itemDef + { + name "button_viewmap" + visible 1 + rect 269 0 90 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_VIEW_MAP" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 45 + textaligny 24 + textalign ITEM_ALIGN_CENTER + action + { + play "mouse_click"; + scriptMenuResponse "viewmap"; + close weapon_german; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_viewmap_hline" + visible 1 + rect 269 3 90 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_viewmap_lvline" + visible 1 + rect 269 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + itemDef + { + name "button_viewmap_rvline" + visible 1 + rect 358 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + } + +// CALL VOTE BUTTON + itemDef + { + name "button_callvote" + visible 1 + rect 359 0 89 32 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + forecolor 1 1 1 1 + backcolor 0 0 0 0.7975 + type ITEM_TYPE_BUTTON + text "@MPMENU_CALL_VOTE" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 42 + textaligny 24 + textalign ITEM_ALIGN_CENTER + cvartest "ui_allowvote" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "callvote"; + close weapon_german; + } + onFocus + { + play "mouse_over"; + } + } + itemDef + { + name "button_callvote_hline" + visible 1 + rect 359 3 86 2 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + itemDef + { + name "button_callvote_lvline" + visible 1 + rect 359 5 1 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + itemDef + { + name "button_callvote_rvline" + visible 1 + rect 443 5 2 27 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + hideCvar { "0" } + } + +// CALL VOTE BUTTON HIDDEN + itemDef + { + name "button_callvote_lvedge" + visible 1 + rect 359 0 4 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 0 0 0 0.7975 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + itemDef + { + name "button_callvote_bhedge" + visible 1 + rect 359 29 89 3 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 0 0 0 0.7975 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + itemDef + { + name "button_callvote_lvline" + visible 1 + rect 359 3 1 29 + origin ORIGIN_MENUTABS + style WINDOW_STYLE_FILLED + backcolor 1 1 1 .125 + decoration + cvartest "ui_allowvote" + showCvar { "0" } + } + +// MENU CHOICES + itemDef + { + name "button_kar98k" + visible 1 + rect 16 46 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_1_KAR98K" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_kar98k" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "kar98k_mp"; + close weapon_german; + } + onFocus + { + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show kar98k_info; + show weapon_propertiestext; + } + } + execKey "1" { play "mouse_click"; scriptMenuResponse "kar98k_mp"; close weapon_german } + + itemDef + { + name "button_mp40" + visible 1 + rect 16 70 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_2_MP40" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_mp40" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "mp40_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show mp40_info; + show weapon_propertiestext; + } + } + execKey "2" { play "mouse_click"; scriptMenuResponse "mp40_mp"; close weapon_german } + + itemDef + { + name "button_mp44" + visible 1 + rect 16 94 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_3_MP44" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_mp44" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "mp44_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show mp44_info; + show weapon_propertiestext; + } + } + execKey "3" { play "mouse_click"; scriptMenuResponse "mp44_mp"; close weapon_german } + + itemDef + { + name "button_kar98ksniper" + visible 1 + rect 16 118 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "@MPMENU_4_SCOPED_KAR98K" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_kar98ksniper" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "kar98k_sniper_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show kar98ksniper_info; + show weapon_propertiestext; + } + } + execKey "4" { play "mouse_click"; scriptMenuResponse "kar98k_sniper_mp"; close weapon_german } + + itemDef + { + name "button_fg42" + visible 1 + rect 16 142 160 22 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "5. FG42" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 8 + textaligny 16 + cvartest "ui_allow_fg42_axis" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "fg42_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide minigun_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show fg42_info; + show weapon_propertiestext; + } + } + execKey "5" { play "mouse_click"; scriptMenuResponse "fg42_mp"; close weapon_german } + + itemDef + { + name "button_minigun" + visible 1 + rect 16 166 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "6. Minigun" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_minigun" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "minigun_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide noobtube_info; + hide shotgun_info; + play "mouse_over"; + show minigun_info; + show weapon_propertiestext; + } + } + execKey "6" { play "mouse_click"; scriptMenuResponse "minigun_mp"; close weapon_german } + + itemDef + { + name "button_noobtube" + visible 1 + rect 16 190 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "7. NoobTube" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_noobtube" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "noobtube_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide shotgun_info; + play "mouse_over"; + show noobtube_info; + show weapon_propertiestext; + } + } + execKey "7" { play "mouse_click"; scriptMenuResponse "noobtube_mp"; close weapon_german } + + itemDef + { + name "button_shotgun" + visible 1 + rect 16 214 160 23 + origin ORIGIN_MENUWINDOW + forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + text "8. Shotgun" + textfont UI_FONT_NORMAL + textscale .24 + textalignx 10 + textaligny 20 + cvartest "scr_allow_shotgun" + hideCvar { "0" } + action + { + play "mouse_click"; + scriptMenuResponse "remi_shotgun_mp"; + close weapon_german; + } + onFocus + { + hide kar98k_info; + hide mp40_info; + hide mp44_info; + hide kar98ksniper_info; + hide fg42_info; + hide minigun_info; + hide noobtube_info; + play "mouse_over"; + show shotgun_info; + show weapon_propertiestext; + } + } + execKey "8" { play "mouse_click"; scriptMenuResponse "remi_shotgun_mp"; close weapon_german } +// WEAPON IMAGES + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@kar98.tga" + decoration + } + itemDef + { + name "mp40_info" + visible 0 + rect 0 10 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@mp40.tga" + decoration + } + itemDef + { + name "mp44_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@mp44.tga" + decoration + } + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@kar98scoped.tga" + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 10 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "ui_mp/assets/hud@fg42.tga" + decoration + } + itemDef + { + name "minigun_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } + itemDef + { + name "noobtube_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } + itemDef + { + name "shotgun_info" + visible 0 + rect 0 4 224 112 + origin ORIGIN_WEAPONIMAGE + style WINDOW_STYLE_SHADER + background "" + decoration + } +// WEAPON DESCRIPTIONS + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_KAR98K_IS_THE_STANDARD" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "mp40_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_MP40_SUBMACHINE_GUN" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "mp44_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THE_MP44_IS_AN_ASSAULT" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_THIS_KAR98K_VARIANT_USES" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The FG42 is a scoped assault rifle. Up close, it can be used as a submachine gun, while at longer ranges it can operate as a scoped rifle." + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "minigun_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The original Gatling gun.. what else is there to say?" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "noobtube_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "BOOM SHAKA LAKA!" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + itemDef + { + name "shotgun_info" + visible 0 + rect 0 17 224 64 + origin ORIGIN_WEAPONTEXT + forecolor 1 1 1 1 + autowrapped + text "The Remington 1893 Shotgun." + textfont UI_FONT_NORMAL + textscale .24 + decoration + } +// WEAPON PROPERTIES + itemDef + { + name "weapon_propertiestext" + visible 0 + origin ORIGIN_WEAPONPROPERTIESTEXT + forecolor 1 1 1 1 + autowrapped + text "@MPMENU_ACCURACY_DAMAGE_MOBILITY" + textfont UI_FONT_NORMAL + textscale .24 + decoration + } + + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 90 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98k_info" + visible 0 + rect 0 0 114 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 50 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 77 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp40_info" + visible 0 + rect 0 0 120 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 71 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 93 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "mp44_info" + visible 0 + rect 0 0 94 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "kar98ksniper_info" + visible 0 + rect 0 0 89 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 90 10 + origin ORIGIN_WEAPONACCURACY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 96 10 + origin ORIGIN_WEAPONDAMAGE + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 128 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 .125 + style WINDOW_STYLE_FILLED + decoration + } + itemDef + { + name "fg42_info" + visible 0 + rect 0 0 67 10 + origin ORIGIN_WEAPONMOBILITY + backcolor 1 1 1 1 + style WINDOW_STYLE_FILLED + decoration + } + } +} diff --git a/V2.0/Scripts/AWE Scripts/_awe.gsc b/V2.0/Scripts/AWE Scripts/_awe.gsc new file mode 100644 index 0000000..bbc7ea1 --- /dev/null +++ b/V2.0/Scripts/AWE Scripts/_awe.gsc @@ -0,0 +1,11986 @@ +/* + +_awe.gsc by Bell + +http://www.awemod.com/ +http://forums.awemod.com/ + +Version 2.12 (for Call of Duty and United Offensive) + + Credits: + Mortars, hitblip, cvardef, firstaid, - Ravir (http://demolition.codcity.org/) + spawnmodel and admin tool functions. + + Bomber planes - Pharao_FS (http://www.pharao-fs.de.vu/) + + Parachutes, tracers, skyflashes code - Parts (http://www.vs-uk.net/) + laserdot and welcome message are based + on Total War 2.3a + + Painscreen, bloodyscreen, bleeding, - Chris P (http://www.mercilessmod.com) + taunts, and the bleeding effect are based + on Merciless Blood Mod. + + Mobile MG42 and mobile PTRS41 is based on - RedMercury, Hellspawn + RedMercury and Hellspawns mobileMG42 mod + + Drop Weapon on arm/hand hit is based on - Poolmaster (http://ediv.codfiles.com) + Merciless but propably origins from + Poolmasters Realism Mod (PRM) + + Alternate position for team status - Pethron + + Reflection formula in bounceObject() - Hellspawn + + Searching for useable sounds in stock CoD - Vicool + + Code to disable secondary weapon - Zeus[BTY] + + Snow effect is loosely based on the one - + used in the map FU-Flint + + Jeep respawn wait time, basehealth fix - #7 (Number 7) + + Tank limiting - [MW]gitman + + British taunts - DirtyRat + + Enhanced parachuting and stuka sounds - DetPak + + Conquest TDM gametype - Innocent Bystander + + Map exploit fixes - Innocent Bystander and all the people who report exploits + + Selectable UO weapons based on mod by - Scrumby + + RSD fixes - Groundpounder + + Cold breath is based on forums posts by - Frenchy Daddy and [MW]gitman + + Map voting based on code by - NC-17(codam, powerserver) (REWORKED BY wizard220, MODIFIED BY FrAnCkY55) + + Spanish fix for client and listen servers - CEAL mod-team + + Some stock UO bug fixes - Bits + + The rest - Bell (http://www.awemod.com/) + + + Problems + -------- + + Done + ---- + + In the works + ------------ + + Todo + ---- + + + Ideas (for later or never) + -------------------------- + +*/ + +Callback_StartGameType() +{ + level.awe_uo = maps\mp\gametypes\_awe_uncommon::isUo(); + + if(!isdefined(level.awe_uo)) + level.awe = true; + + // Check global AWE cvar + level.awe_disable = cvardef("awe_disable",0,0,1,"int"); + if(level.awe_disable) return; + + // Set up variables + setupVariables(); + + // Find map limits + findmapdimensions(); + + // Find play area by checking all the spawnpoints + findPlayArea(); + + // Show AWE logo under compass + showlogo(); + + // Precache + if(!isdefined(game["gamestarted"])) + doPrecaching(); + + // Warm up round + warmupround(); + + // Start threads + thread startThreads(); +} + +startThreads() +{ + + level notify("awe_boot"); + + // Limit bases in Base Assault + if(level.awe_limitbases && (level.awe_gametype == "bas" || level.awe_gametype == "mc_bas") ) + thread limitBases(); + + // Wait for threads to die + wait 0.05; + + // Pretend gametype? + if(level.awe_pretendgametype != "") + setcvar("g_gametype",level.awe_pretendgametype); + + // Override falldamage +// setcvar("bg_fallDamageMaxHeight", 10*12); +// setcvar("bg_fallDamageMinHeight", 14*12); + +/* if(level.awe_falldamage != 100) + { + setcvar("bg_fallDamageMinHeight", 256 * 100 / level.awe_falldamage); + setcvar("bg_fallDamageMaxHeight", 480 * 100 / level.awe_falldamage); + }*/ + + // Override fog settings + overridefog(); + + // Start Ravirs admin tools + thread maps\mp\gametypes\_user_Ravir_admin::main(); + + // Update team status and global player array + thread updateteamstatus(); + + // Start mortar threads + if(level.awe_mortar && !isdefined(level.awe_classbased)) + for(i = 0; i < level.awe_mortar; i++) + thread incoming(); + + // Stukas + if(level.awe_stukas) + thread stukas(); + + // Bombers + if(level.awe_bombers) + { + // Calculate start positions for C47 planes + iX = (int)(level.awe_vMax[0] + level.awe_vMin[0])/2; + + if(level.awe_bombers_distance) + iY = level.awe_bombers_distance; + else + iY = level.awe_vMin[1]; + + if(level.awe_bombers_altitude) + iZ = level.awe_bombers_altitude; + else + iZ = level.awe_vMax[2]; + + // Loop effect + maps\mp\_fx::loopfx("bombers", (iX - 500, iY, iZ), level.awe_bombers_delay); + thread C47sounds( (iX - 500, iY, iZ), level.awe_bombers_delay); + maps\mp\_fx::loopfx("bombers", (iX + 500, iY, iZ), level.awe_bombers_delay + 10); + thread C47sounds( (iX + 500, iY, iZ), level.awe_bombers_delay + 10); + + } + + //Ambient tracers + if(level.awe_tracers) + for(i = 0; i < level.awe_tracers; i++) + thread tracers(); + + // Ambient sky flashes + if(level.awe_skyflashes) + for(i = 0; i < level.awe_skyflashes; i++) + thread skyflashes(); + + // Fix corrupt maprotations + if(level.awe_fixmaprotation && !level.awe_mapvote) + fixMapRotation(); + + // Do maprotation randomization + thread randomMapRotation(); + + // Announce next map and display server messages + if(!level.awe_messageindividual) + thread serverMessages(); + + // Setup turrets + thread turretStuff(); + + // Rain/snow + if(isdefined(level.awe_rainfx)) + thread rain(); + + // Bots + thread maps\mp\gametypes\_awe_bots::addBotClients(); + + // Start thread that rotates map if server is empty + if(level.awe_rotateifempty) + thread rotateIfEmpty(); + + if(level.awe_riflelimit || level.awe_boltriflelimit || level.awe_semiriflelimit || level.awe_smglimit || level.awe_assaultlimit || level.awe_sniperlimit || level.awe_lmglimit) + thread checkLimitedWeapons(); + + // Start thread for updating variables from cvars + thread updateGametypeCvars(false); +} + +setupVariables() +{ + level.awe_gametype = getcvar("g_gametype"); // Save gametype in case we are pretending to be another gametype + + // Override callbackPlayerDamage + level.awe_orignalPlayerDamage = level.callbackPlayerDamage; // Save old + level.callbackPlayerDamage = ::Callback_PlayerDamage; // Set new + + // defaults if not defined in level script + if(!isDefined(game["allies"])) + game["allies"] = "american"; + if(!isDefined(game["axis"])) + game["axis"] = "german"; + + level.awe_uomap = checkUOmaps(); + + // Setup time counter + if(!isdefined(game["awe_emptytime"])) + game["awe_emptytime"] = 0; + + // Set up the number of available punishments + level.awe_punishments = 3; + + // Set up object queues + level.awe_objectQ["head"] = []; + level.awe_objectQcurrent["head"] = 0; + level.awe_objectQsize["head"] = 4; + + level.awe_objectQ["helmet"] = []; + level.awe_objectQcurrent["helmet"] = 0; + level.awe_objectQsize["helmet"] = 8; + + // Setup variables depending on gametypes + switch(level.awe_gametype) + { + case "dm": + level.awe_spawnalliedname = "mp_deathmatch_spawn"; + level.awe_spawnaxisname = "mp_deathmatch_spawn"; + level.awe_spawnspectatorname = "mp_deathmatch_intermission"; + break; + case "mc_dm": + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_deathmatch_spawn"; + level.awe_spawnaxisname = "mp_deathmatch_spawn"; + level.awe_spawnspectatorname = "mp_deathmatch_intermission"; + break; + + case "re": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_spawnalliedname = "mp_retrieval_spawn_allied"; + level.awe_spawnaxisname = "mp_retrieval_spawn_axis"; + level.awe_spawnspectatorname = "mp_retrieval_intermission"; + break; + case "mc_re": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_retrieval_spawn_allied"; + level.awe_spawnaxisname = "mp_retrieval_spawn_axis"; + level.awe_spawnspectatorname = "mp_retrieval_intermission"; + break; + + case "dem": + case "rsd": + case "sd": + case "lts": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_spawnalliedname = "mp_teamdeathmatch_spawn"; + level.awe_spawnaxisname = "mp_teamdeathmatch_spawn"; + level.awe_spawnspectatorname = "mp_teamdeathmatch_intermission"; + break; + case "mc_dem": + case "mc_rsd": + case "mc_sd": + case "mc_lts": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_teamdeathmatch_spawn"; + level.awe_spawnaxisname = "mp_teamdeathmatch_spawn"; + level.awe_spawnspectatorname = "mp_teamdeathmatch_intermission"; + break; + + + case "mc_tdom": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_merciless = true; + level.awe_classbased = true; + level.awe_tdom = true; + level.awe_spawnalliedname = "mp_searchanddestroy_spawn_allied"; + level.awe_spawnaxisname = "mp_searchanddestroy_spawn_axis"; + level.awe_spawnspectatorname = "mp_searchanddestroy_intermission"; + break; + + case "ctf": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_spawnalliedname = "mp_uo_spawn_allies"; + level.awe_spawnaxisname = "mp_uo_spawn_axis"; + level.awe_spawnspectatorname = "mp_ctf_intermission"; + break; + case "mc_ctf": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_uo_spawn_allies"; + level.awe_spawnaxisname = "mp_uo_spawn_axis"; + level.awe_spawnspectatorname = "mp_ctf_intermission"; + break; + + case "ad": + case "dom": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_spawnalliedname = "mp_uo_spawn_allies"; + level.awe_spawnaxisname = "mp_uo_spawn_axis"; + level.awe_spawnspectatorname = "mp_dom_intermission"; + break; + case "mc_ad": + case "mc_dom": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_uo_spawn_allies"; + level.awe_spawnaxisname = "mp_uo_spawn_axis"; + level.awe_spawnspectatorname = "mp_dom_intermission"; + break; + + case "bas": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_spawnalliedname = "mp_gmi_bas_allies_spawn"; + level.awe_spawnaxisname = "mp_gmi_bas_axis_spawn"; + level.awe_spawnspectatorname = "mp_gmi_bas_intermission"; + break; + case "mc_bas": + level.awe_teamplay = true; +// level.awe_roundbased = true; + level.awe_alternatehud = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_gmi_bas_allies_spawn"; + level.awe_spawnaxisname = "mp_gmi_bas_axis_spawn"; + level.awe_spawnspectatorname = "mp_gmi_bas_intermission"; + break; + + case "cnq": + case "tdm": + case "bel": + case "hq": + case "actf": + level.awe_teamplay = true; + level.awe_spawnalliedname = "mp_teamdeathmatch_spawn"; + level.awe_spawnaxisname = "mp_teamdeathmatch_spawn"; + level.awe_spawnspectatorname = "mp_teamdeathmatch_intermission"; + break; + case "mc_cnq": + case "mc_tdm": + case "mc_bel": + case "mc_hq": + case "mc_actf": + level.awe_teamplay = true; + level.awe_merciless = true; + level.awe_spawnalliedname = "mp_teamdeathmatch_spawn"; + level.awe_spawnaxisname = "mp_teamdeathmatch_spawn"; + level.awe_spawnspectatorname = "mp_teamdeathmatch_intermission"; + break; + + default: + level.awe_teamplay = true; + level.awe_spawnalliedname = "mp_teamdeathmatch_spawn"; + level.awe_spawnaxisname = "mp_teamdeathmatch_spawn"; + level.awe_spawnspectatorname = "mp_teamdeathmatch_intermission"; + break; + } + + + if(!isdefined(game["roundsplayed"])) + level.awe_roundbased = undefined; + else + level.awe_roundbased = true; + + // Set up number of voices + level.awe_voices["german"] = 3; + level.awe_voices["american"] = 7; + level.awe_voices["russian"] = 4; + level.awe_voices["british"] = 5; + + // Set up grenade voices + level.awe_grenadevoices["german"][0]="german_grenade"; + level.awe_grenadevoices["german"][1]="generic_grenadeattack_german_1"; + if(!isdefined(level.awe_uo)) + { + level.awe_grenadevoices["german"][2]="generic_grenadeattack_german_2"; + level.awe_grenadevoices["german"][3]="generic_grenadeattack_german_3"; + } + + level.awe_grenadevoices["american"][0]="american_grenade"; + level.awe_grenadevoices["american"][1]="generic_grenadeattack_american_1"; + if(!isdefined(level.awe_uo)) + { + level.awe_grenadevoices["american"][2]="generic_grenadeattack_american_2"; + level.awe_grenadevoices["american"][3]="generic_grenadeattack_american_3"; + level.awe_grenadevoices["american"][4]="generic_grenadeattack_american_4"; + level.awe_grenadevoices["american"][5]="generic_grenadeattack_american_5"; + level.awe_grenadevoices["american"][6]="generic_grenadeattack_american_6"; + } + + level.awe_grenadevoices["russian"][0]="russian_grenade"; + level.awe_grenadevoices["russian"][1]="generic_grenadeattack_russian_3"; + if(!isdefined(level.awe_uo)) + { + level.awe_grenadevoices["russian"][2]="generic_grenadeattack_russian_4"; + level.awe_grenadevoices["russian"][3]="generic_grenadeattack_russian_5"; + level.awe_grenadevoices["russian"][4]="generic_grenadeattack_russian_6"; + } + + level.awe_grenadevoices["british"][0]="british_grenade"; + level.awe_grenadevoices["british"][1]="generic_grenadeattack_british_1"; + if(!isdefined(level.awe_uo)) + { + level.awe_grenadevoices["british"][2]="generic_grenadeattack_british_2"; + level.awe_grenadevoices["british"][3]="generic_grenadeattack_british_4"; + level.awe_grenadevoices["british"][4]="generic_grenadeattack_british_5"; + level.awe_grenadevoices["british"][5]="generic_grenadeattack_british_6"; + } + + // Reserve objective 6 to 15 for all gametypes but BEL and DEM + if(level.awe_gametype != "dem" && level.awe_gametype != "mc_dem" && level.awe_gametype != "dom" && level.awe_gametype != "mc_dom" && level.awe_gametype != "bel" && level.awe_gametype != "mc_bel") + level.awe_objnum_min = 6; + else // Reserve only the last 5 objectives for BEL and DEM + level.awe_objnum_min = 11; // (requires modification of bel.gsc) + level.awe_objnum_cur = level.awe_objnum_min; + level.awe_objnum_max = 15; + + // Initialize variables from cvars + updateGametypeCvars(true); + + // Reset weapon limiting cvars + level.awe_allplayers = getentarray("player", "classname"); + limitWeapons("allies"); + limitWeapons("axis"); + + if(isdefined(level.awe_teamplay) && level.awe_firstaid) + game["firstaid"] = "gfx/icons/hint_health.tga"; + + if(isdefined(level.awe_teamplay)) + { + level.awe_tripwires["axis"] = 0; + level.awe_tripwires["allies"] = 0; + level.awe_satchels["axis"] = 0; + level.awe_satchels["allies"] = 0; + } + else + { + level.awe_tripwires = 0; + level.awe_satchels = 0; + } + + if(isdefined(game["german_soldiervariation"]) && game["german_soldiervariation"] == "winter") + level.awe_wintermap = true; + + overrideteams(); + + if(level.awe_spawnprotection) + game["headicon_protect"] = "gfx/hud/hud@health_cross.tga"; + + if( level.awe_anticamptime && !level.awe_anticampmethod && !isdefined(level.awe_tdom) ) + { + game["headicon_star"] = "gfx/hud/headicon@re_objcarrier.dds"; + if(!isdefined(level.awe_teamplay)) + game["headicon_crosshair"]="gfx/hud/hud@fire_ready.tga"; + game["objective_default"]="gfx/hud/objective.dds"; + } + + if( isdefined(level.awe_teamplay) && level.awe_anticamptime && !level.awe_anticampmethod && !isdefined(level.awe_tdom) ) + { + // Precache radio objectives + game["radio_axis"] = "gfx/hud/hud@objective_german.tga"; + game["headicon_axis"] = "gfx/hud/headicon@german.tga"; + + switch(game["allies"]) + { + case "american": + game["radio_allies"] = "gfx/hud/hud@objective_american.tga"; + game["headicon_allies"] = "gfx/hud/headicon@american.tga"; + break; + + case "british": + game["radio_allies"] = "gfx/hud/hud@objective_british.tga"; + game["headicon_allies"] = "gfx/hud/headicon@british.tga"; + break; + + case "russian": + game["radio_allies"] = "gfx/hud/hud@objective_russian.tga"; + game["headicon_allies"] = "gfx/hud/headicon@russian.tga"; + break; + } + } + + if(isdefined(level.awe_teamplay) && level.awe_showteamstatus == 1) + { + game["radio_axis"] = "gfx/hud/hud@objective_german.tga"; + switch(game["allies"]) + { + case "american": + game["radio_allies"] = "gfx/hud/hud@objective_american.tga"; + break; + + case "british": + game["radio_allies"] = "gfx/hud/hud@objective_british.tga"; + break; + + case "russian": + game["radio_allies"] = "gfx/hud/hud@objective_russian.tga"; + break; + } + } + + if(isdefined(level.awe_teamplay) && level.awe_showteamstatus == 2) + { + game["headicon_axis"] = "gfx/hud/headicon@german.tga"; + switch(game["allies"]) + { + case "american": + game["headicon_allies"] = "gfx/hud/headicon@american.tga"; + break; + + case "british": + game["headicon_allies"] = "gfx/hud/headicon@british.tga"; + break; + + case "russian": + game["headicon_allies"] = "gfx/hud/headicon@russian.tga"; + break; + } + } + + // Setup mortars + if(level.awe_mortar && !isdefined(level.awe_classbased)) + { + level.awe_mortarmodel = "xmodel/105"; + + level.awe_mortars = []; + level.awe_mortars[level.awe_mortars.size]["incoming"] = "mortar_incoming2"; + level.awe_mortars[level.awe_mortars.size-1]["delay"] = 0.65; + level.awe_mortars[level.awe_mortars.size]["incoming"] = "mortar_incoming1"; + level.awe_mortars[level.awe_mortars.size-1]["delay"] = 1.05; + level.awe_mortars[level.awe_mortars.size]["incoming"] = "mortar_incoming3"; + level.awe_mortars[level.awe_mortars.size-1]["delay"] = 1.5; + level.awe_mortars[level.awe_mortars.size]["incoming"] = "mortar_incoming4"; + level.awe_mortars[level.awe_mortars.size-1]["delay"] = 2.1; + level.awe_mortars[level.awe_mortars.size]["incoming"] = "mortar_incoming5"; + level.awe_mortars[level.awe_mortars.size-1]["delay"] = 3.0; + + if(isdefined(level.awe_uo)) + { + level.awe_mortarfx["generic"] = loadfx("fx/weapon/explosions/mortar_generic.efx"); +// level.awe_mortarfx["brick"] = loadfx("fx/weapon/explosions/artillery_brick.efx"); +// level.awe_mortarfx["concrete"]= loadfx("fx/weapon/explosions/artillery_concrete.efx"); +// level.awe_mortarfx["dirt"] = loadfx("fx/weapon/explosions/artillery_dirt.efx"); +// level.awe_mortarfx["grass"] = loadfx("fx/weapon/explosions/artillery_grass.efx"); +// level.awe_mortarfx["gravel"] = loadfx("fx/weapon/explosions/artillery_gravel.efx"); +// level.awe_mortarfx["metal"] = loadfx("fx/weapon/explosions/artillery_metal.efx"); + level.awe_mortarfx["snow"] = loadfx("fx/weapon/explosions/artillery_snow.efx"); + level.awe_mortarfx["water"] = loadfx("fx/weapon/explosions/artillery_water.efx"); +// level.awe_mortarfx["wood"] = loadfx("fx/weapon/explosions/artillery_wood.efx"); + } + else + { + level.awe_mortarfx["generic"] = loadfx("fx/impacts/dirthit_mortar.efx"); +// level.awe_mortarfx["snow"] = loadfx("fx/surfacehits/mortarimpact_snow.efx"); + level.awe_mortarfx["snow"] = loadfx("fx/impacts/snow_mortar.efx"); + level.awe_mortarfx["water"] = loadfx("fx/surfacehits/mortarhit_water.efx"); + } + } + // C47 planes + if(level.awe_bombers) + level._effect["bombers"] = loadfx ("fx/atmosphere/c47flyover2d.efx"); + + // Load effect for bomb explosion (used by anticamp, antiteamkill, antiteamdamage and grenade cooking) +// level.awe_effect["bombexplosion"]= loadfx("fx/explosions/pathfinder_explosion.efx"); + if(isdefined(level.awe_uo)) + level.awe_effect["bombexplosion"]= loadfx("fx/weapon/explosions/grenade_generic.efx"); + else + { + if(isdefined(level.awe_wintermap)) + level.awe_effect["bombexplosion"]= loadfx("fx/explosions/grenade_snow.efx"); + else + level.awe_effect["bombexplosion"]= loadfx("fx/explosions/grenade3.efx"); + } + + //Ambient tracers + if(level.awe_tracers) + level._effect["awe_tracers"] = loadfx("fx/atmosphere/antiair_tracers.efx"); + + // Ambient sky flashes + if(level.awe_skyflashes) + { + level.awe_skyeffects = []; + level.awe_skyeffects[level.awe_skyeffects.size]["effect"] = loadfx("fx/atmosphere/cloudflash1.efx"); + level.awe_skyeffects[level.awe_skyeffects.size-1]["delay"] = 0.0; + level.awe_skyeffects[level.awe_skyeffects.size]["effect"] = loadfx("fx/atmosphere/longrangeflash_altocloud.efx"); + level.awe_skyeffects[level.awe_skyeffects.size-1]["delay"] = 0.0; + level.awe_skyeffects[level.awe_skyeffects.size]["effect"] = loadfx("fx/atmosphere/antiair_tracerscloseup.efx"); + level.awe_skyeffects[level.awe_skyeffects.size-1]["delay"] = 6.5; + level.awe_skyeffects[level.awe_skyeffects.size]["effect"] = loadfx("fx/atmosphere/thunderhead.efx"); + level.awe_skyeffects[level.awe_skyeffects.size-1]["delay"] = 0; + level.awe_skyeffects[level.awe_skyeffects.size]["effect"] = loadfx("fx/atmosphere/lowlevelburst.efx"); + level.awe_skyeffects[level.awe_skyeffects.size-1]["delay"] = 0; + } + + // Effect for burning & no bodies + if(isdefined(level.awe_uo) && (level.awe_burningbodies || level.awe_nobodies == 2)) + { + level.awe_burningbodies_smokefx = loadfx("fx/smoke/smoke_flamethrower.efx"); + } + + // Effect for no bodies + if(!isdefined(level.awe_uo) && level.awe_nobodies == 2) + { + level.awe_burningbodies_smokefx = loadfx("fx/impacts/newimps/v_blast1.efx"); + } + + // Effect for burning bodies + if(isdefined(level.awe_uo) && level.awe_burningbodies) + { + level.awe_burningbodies_burnfx = loadfx("fx/fire/barreloil_fire.efx"); + } + + // Flesh hit effect used by bouncing heads + if(level.awe_pophead && !isdefined(level.awe_merciless)) + level.awe_popheadfx = loadfx("fx/impacts/flesh_hit.efx"); + + if(level.awe_bleeding && !isdefined(level.awe_merciless)) + level.awe_bleedingfx = loadfx("fx/atmosphere/drop1.efx"); + + if(isdefined(level.awe_wintermap) && randomInt(100)0) + newmaprotationcurrent += exec + jeep + tank + gametype + " map " + maps[i]["map"]; + } + + // Set the new rotation + setCvar("sv_maprotation", strip(newmaprotation)); + + // Set the new rotationcurrent + setCvar("sv_maprotationcurrent", newmaprotationcurrent); + + // Set awe_fix_maprotation to "0" to indicate that initial fixing has been done + setCvar("awe_fix_maprotation", "0"); +} + +randomMapRotation() +{ + level endon("awe_boot"); + + // Do random maprotation? + if(!level.awe_randommaprotation || level.awe_mapvote) + return; + + // Randomize maps of maprotationcurrent is empty or on a fresh start + if( strip(getcvar("sv_maprotationcurrent")) == "" || level.awe_randommaprotation == 1) + { + x = GetRandomMapRotation(); + if(isdefined(x)) + { + if(isdefined(x.maps)) + maps = x.maps; + x delete(); + } + + if(!isdefined(maps) || !maps.size) + return; + + lastexec = ""; + lastjeep = ""; + lasttank = ""; + lastgt = ""; + + // Built new maprotation string + newmaprotation = ""; + for(i = 0; i < maps.size; i++) + { + if(!isdefined(maps[i]["exec"]) || lastexec == maps[i]["exec"]) + exec = ""; + else + { + lastexec = maps[i]["exec"]; + exec = " exec " + maps[i]["exec"]; + } + + if(!isdefined(maps[i]["jeep"]) || lastjeep == maps[i]["jeep"]) + jeep = ""; + else + { + lastjeep = maps[i]["jeep"]; + jeep = " allow_jeeps " + maps[i]["jeep"]; + } + + if(!isdefined(maps[i]["tank"]) || lasttank == maps[i]["tank"]) + tank = ""; + else + { + lasttank = maps[i]["tank"]; + tank = " allow_tanks " + maps[i]["tank"]; + } + + if(!isdefined(maps[i]["gametype"]) || lastgt == maps[i]["gametype"]) + gametype = ""; + else + { + lastgt = maps[i]["gametype"]; + gametype = " gametype " + maps[i]["gametype"]; + } + + newmaprotation += exec + jeep + tank + gametype + " map " + maps[i]["map"]; + } + + // Set the new rotation + setCvar("sv_maprotationcurrent", newmaprotation); + + // Set awe_random_maprotation to "2" to indicate that initial randomizing is done + setCvar("awe_random_maprotation", "2"); + } +} + +randomizeArray(arr) +{ + if(arr.size) + { + // Shuffle the array 10 times + for(k = 0; k < 10; k++) + { + for(i = 0; i < arr.size; i++) + { + j = randomInt(arr.size); + element = arr[i]; + arr[i] = arr[j]; + arr[j] = element; + } + } + } + return arr; +} + +showWelcomeMessages() +{ + self endon("awe_spawned"); + self endon("awe_died"); + + if(isdefined(self.pers["awe_welcomed"])) return; + self.pers["awe_welcomed"] = true; + + wait 2; + + count = 0; + message = cvardef("awe_welcome" + count, "", "", "", "string"); + while(message != "") + { + self iprintlnbold(message); + count++; + message = cvardef("awe_welcome" + count, "", "", "", "string"); + wait level.awe_welcomedelay; + } +} + +serverMessages() +{ + level endon("awe_boot"); + if(level.awe_messageindividual) + { + // Check if thread has allready been called. + if(isdefined(self.pers["awe_serverMessages"])) + return; + + self endon("awe_spawned"); + self endon("awe_died"); + } + else + { + // Check if thread has allready been called. + if(isdefined(game["serverMessages"])) + return; + } + + wait level.awe_messagedelay; + + for(;;) + { + if( !level.awe_mapvote && level.awe_messagenextmap && !(level.awe_messageindividual && isdefined(self.pers["awe_messagecount"])) ) + { + x = GetCurrentMapRotation(1); + if(isdefined(x)) + { + if(isdefined(x.maps)) + maps = x.maps; + x delete(); + } + + if(isdefined(maps) && maps.size) + { + // Get next map + if(isdefined(maps[0]["gametype"])) + nextgt=maps[0]["gametype"]; + else + nextgt=level.awe_gametype; + + nextmap=maps[0]["map"]; + + if(level.awe_messagenextmap == 4) + { + if(level.awe_randommaprotation) + { + if(level.awe_messageindividual) + self iprintln("^3This server uses ^5random ^3maprotation."); + else + iprintln("^3This server uses ^5random ^3maprotation."); + } + else + { + if(level.awe_messageindividual) + self iprintln("^3This server uses ^5normal ^3maprotation."); + else + iprintln("^3This server uses ^5normal ^3maprotation."); + } + + wait 1; + } + + if(level.awe_messagenextmap > 2) + { + if(level.awe_messageindividual) + self iprintln("^3Next gametype: ^5" + getGametypeName(nextgt) ); + else + iprintln("^3Next gametype: ^5" + getGametypeName(nextgt) ); + wait 1; + } + + if(level.awe_messagenextmap > 2 || level.awe_messagenextmap == 1) + { + if(level.awe_messageindividual) + self iprintln("^3Next map: ^5" + getMapName(nextmap) ); + else + iprintln("^3Next map: ^5" + getMapName(nextmap) ); + } + + if(level.awe_messagenextmap == 2) + { + if(level.awe_messageindividual) + self iprintln("^3Next: ^5" + getMapName(nextmap) + "^3/^5" + getGametypeName(nextgt) ); + else + iprintln("^3Next: ^5" + getMapName(nextmap) + "^3/^5" + getGametypeName(nextgt) ); + wait 1; + } + + // Set next message + if(level.awe_messageindividual) + self.pers["awe_messagecount"] = 0; + + wait level.awe_messagedelay; + } + } + + // Get first message + if(level.awe_messageindividual && isdefined(self.pers["awe_messagecount"])) + count = self.pers["awe_messagecount"]; + else + count = 0; + + message = cvardef("awe_message" + count, "", "", "", "string"); + + // Avoid infinite loop + if(message == "" && !(isdefined(maps) && maps.size)) + wait level.awe_messagedelay; + + // Announce messages + while(message != "") + { + if(level.awe_messageindividual) + self iprintln(message); + else + iprintln(message); + count++; + // Set next message + if(level.awe_messageindividual) + self.pers["awe_messagecount"] = count; + + wait level.awe_messagedelay; + + message = cvardef("awe_message" + count, "", "", "", "string"); + } + + if(level.awe_messageindividual) + self.pers["awe_messagecount"] = undefined; + + // Loop? + if(!level.awe_messageloop) + break; + } + // Set flag to indicate that this thread has been called and run all through once + if(level.awe_messageindividual) + self.pers["awe_serverMessages"] = true; + else + game["serverMessages"] = true; +} + +getGametypeName(gt) +{ + switch(gt) + { + case "dm": + case "mc_dm": + gtname = "Deathmatch"; + break; + + case "tdm": + case "mc_tdm": + gtname = "Team Deathmatch"; + break; + + case "sd": + case "mc_sd": + gtname = "Search & Destroy"; + break; + + case "re": + case "mc_re": + gtname = "Retrieval"; + break; + + case "hq": + case "mc_hq": + gtname = "Headquarters"; + break; + + case "bel": + case "mc_bel": + gtname = "Behind Enemy Lines"; + break; + + case "cnq": + case "mc_cnq": + gtname = "Conquest TDM"; + break; + + case "lts": + case "mc_lts": + gtname = "Last Team Standing"; + break; + + case "ctf": + case "mc_ctf": + gtname = "Capture The Flag"; + break; + + case "dom": + case "mc_dom": + gtname = "Domination"; + break; + + case "ad": + case "mc_ad": + gtname = "Attack and Defend"; + break; + + case "bas": + case "mc_bas": + gtname = "Base assault"; + break; + + case "actf": + case "mc_actf": + gtname = "AWE Capture The Flag"; + break; + + case "htf": + case "mc_htf": + gtname = "Hold The Flag"; + break; + + case "ter": + case "mc_ter": + gtname = "Territory"; + break; + + case "asn": + case "mc_asn": + gtname = "Assassin"; + break; + + case "mc_tdom": + gtname = "Team Domination"; + break; + + default: + gtname = gt; + break; + } + + return gtname; +} + +getMapName(map) +{ + switch(map) + { + case "mp_arnhem": + mapname = "Arnhem"; + break; + + case "mp_berlin": + mapname = "Berlin"; + break; + + case "mp_bocage": + mapname = "Bocage"; + break; + + case "mp_brecourt": + mapname = "Brecourt"; + break; + + case "mp_carentan": + mapname = "Carentan"; + break; + + case "mp_uo_carentan": + mapname = "Carentan(UO)"; + break; + + case "mp_cassino": + mapname = "Cassino"; + break; + + case "mp_chateau": + mapname = "Chateau"; + break; + + case "mp_dawnville": + mapname = "Dawnville"; + break; + + case "mp_uo_dawnville": + mapname = "Dawnville(UO)"; + break; + + case "mp_depot": + mapname = "Depot"; + break; + + case "mp_uo_depot": + mapname = "Depot(UO)"; + break; + + case "mp_foy": + mapname = "Foy"; + break; + + case "mp_harbor": + mapname = "Harbor"; + break; + + case "mp_uo_harbor": + mapname = "Harbor(UO)"; + break; + + case "mp_hurtgen": + mapname = "Hurtgen"; + break; + + case "mp_uo_hurtgen": + mapname = "Hurtgen(UO)"; + break; + + case "mp_italy": + mapname = "Italy"; + break; + + case "mp_kharkov": + mapname = "Kharkov"; + break; + + case "mp_kursk": + mapname = "Kursk"; + break; + + case "mp_neuville": + mapname = "Neuville"; + break; + + case "mp_pavlov": + mapname = "Pavlov"; + break; + + case "mp_peaks": + mapname = "Peaks"; + break; + + case "mp_ponyri": + mapname = "Ponyri"; + break; + + case "mp_powcamp": + mapname = "P.O.W Camp"; + break; + + case "mp_uo_powcamp": + mapname = "P.O.W Camp(UO)"; + break; + + case "mp_railyard": + mapname = "Railyard"; + break; + + case "mp_rhinevalley": + mapname = "Rhine Valley"; + break; + + case "mp_rocket": + mapname = "Rocket"; + break; + + case "mp_ship": + mapname = "Ship"; + break; + + case "mp_streets": + mapname = "Streets"; + break; + + case "mp_sicily": + mapname = "Sicily"; + break; + + case "mp_stalingrad": + mapname = "Stalingrad"; + break; + + case "mp_tigertown": + mapname = "Tigertown"; + break; + + case "mp_uo_stanjel": + mapname = "Stanjel(UO)"; + break; + + case "DeGaulle_beta2": + mapname = "DeGaulle Beta2"; + break; + + case "mp_bellicourt": + mapname = "Bellicourt"; + break; + + case "mp_offensive": + mapname = "Offensive"; + break; + + case "mp_rzgarena": + mapname = "Rezorg Arena"; + break; + + case "mp_venicedock": + mapname = "Venicedock"; + break; + + case "nuenen": + mapname = "Nuenen"; + break; + + case "Outlaw_Bridge": + mapname = "Outlaw Bridge"; + break; + + case "Outlaws_SFrance": + mapname = "Outlaws France"; + break; + + case "the_hunt": + mapname = "The Hunt"; + break; + + case "mp_streetwar": + mapname = "Streetwar"; + break; + + case "mp_subharbor_night": + mapname = "Subharbor Night"; + break; + + case "mp_subharbor_day": + mapname = "Subharbor Day"; + break; + + case "mp_landsitz": + mapname = "Landsitz"; + break; + + case "Hafen_beta": + mapname = "Hafen"; + break; + + case "mp_hollenberg": + mapname = "Hollenberg"; + break; + + case "viaduct": + mapname = "Viaduct"; + break; + + case "mp_oase": + mapname = "Oase"; + break; + + case "mp_v2_ver3": + mapname = "V2 Rocket"; + break; + + case "arcville": + mapname = "Arcville"; + break; + + case "arkov4": + mapname = "Arkov"; + break; + + case "mp_saint-lo": + mapname = "Saint-Lo"; + break; + + case "second_coming": + mapname = "The Second Coming"; + break; + + case "mp_westwall": + mapname = "Westwall"; + break; + + case "mp_maaloy": + mapname = "Maaloy"; + break; + + case "dufresne": + mapname = "Dufresne"; + break; + + case "dufresne_winter": + mapname = "Dufresne Winter"; + break; + + case "gorges_du_wet": + mapname = "Les Gorges du Wet"; + break; + + case "d-day+7": + mapname = "D-Day"; + break; + + case "mp_wolfsquare_final": + mapname = "Wolfsquare Public"; + break; + + case "the_bridge": + mapname = "The Bridge"; + break; + + case "mp_amberville": + case "mc_amberville": + mapname = "Amberville"; + break; + + case "mp_stanjel": + case "mc_stanjel": + mapname = "Stanjel"; + break; + + case "mp_bazolles": + case "mc_bazolles": + mapname = "Bazolles"; + break; + + case "townville_beta": + case "mp_townville": + case "mc_townville": + mapname = "Townville"; + break; + + case "german_town": + case "mp_german_town": + case "mc_german_town": + mapname = "German Town"; + break; + + case "mp_drumfergus2": + mapname = "Drum Fergus 2"; + break; + + case "mp_uo_vaddhe": + mapname = "V2 Base"; + break; + + default: + mapname = map; + break; + } + + return mapname; +} + +explode(s,delimiter) +{ + j=0; + temparr[j] = ""; + + for(i=0;i0) + i--; + + for(j=0;j<=i;j++) + { + s3 += s2[j]; + } + + return s3; +} + + +updateGametypeCvars(init) +{ + level endon("awe_boot"); + + // Debug + level.awe_debug = cvardef("awe_debug", 0, 0, 1, "int"); + level.awe_debugentities = cvardef("awe_debug_entities", 0, 0, 1, "int"); + + // Pretend to be another gametype? + level.awe_pretendgametype = cvardef("awe_pretend_gametype","","","","string"); + + // Limit bases + level.awe_limitbases = cvardef("awe_limit_bases", 0, 0, 2, "int"); + + // Disable minefields + level.awe_disableminefields = cvardef("awe_disable_minefields", 0, 0, 1, "int"); + + // Rain/Snow 0-100% + level.awe_rain = cvardef("awe_rain", 0, 0, 100, "int"); + level.awe_snow = cvardef("awe_snow", 0, 0, 100, "int"); + + // Laserdot + level.awe_laserdot = cvardef("awe_laserdot", 0, 0, 1, "float"); // 0 = don't show, 1 = solid + level.awe_laserdotsize = cvardef("awe_laserdot_size", 2, 0.5, 5, "float"); // size + level.awe_laserdotred = cvardef("awe_laserdot_red", 1, 0, 1, "float"); // amount of red in dot + level.awe_laserdotgreen = cvardef("awe_laserdot_green", 0, 0, 1, "float"); // amount of green in dot + level.awe_laserdotblue = cvardef("awe_laserdot_blue", 0, 0, 1, "float"); // amount of blue in dot + + // Show team status on hud + level.awe_showteamstatus = cvardef("awe_show_team_status", 0, 0, 2, "int"); + + // Show hit blip + level.awe_showhit = cvardef("awe_showhit", 0, 0, 1, "int"); + + // Painscreen + level.awe_painscreen = cvardef("awe_painscreen", 0, 0, 100, "int"); + + // Bloodyscreen + level.awe_bloodyscreen = cvardef("awe_bloodyscreen", 0, 0, 1, "int"); + + // Bulletholes + level.awe_bulletholes = cvardef("awe_bulletholes", 0, 0, 2, "int"); + + // shell & death shock + level.awe_shellshock = cvardef("scr_shellshock", 0, 0, 1, "int"); + level.awe_deathshock = cvardef("awe_deathshock", 0, 0, 1, "int"); + + // Weapon options + level.awe_primaryweapon["default"] = cvardef("awe_primary_weapon", "", "", "", "string"); + level.awe_primaryweapon["american"] = cvardef("awe_primary_weapon_american", "", "", "", "string"); + level.awe_primaryweapon["british"] = cvardef("awe_primary_weapon_british", "", "", "", "string"); + level.awe_primaryweapon["german"] = cvardef("awe_primary_weapon_german", "", "", "", "string"); + level.awe_primaryweapon["russian"] = cvardef("awe_primary_weapon_russian", "", "", "", "string"); + + level.awe_secondaryweaponkeepold = cvardef("awe_secondary_weapon_keepold", 1, 0, 1, "int"); + level.awe_secondaryweapon["default"]= cvardef("awe_secondary_weapon", "", "", "", "string"); + level.awe_secondaryweapon["american"]=cvardef("awe_secondary_weapon_american", "", "", "", "string"); + level.awe_secondaryweapon["british"]= cvardef("awe_secondary_weapon_british", "", "", "", "string"); + level.awe_secondaryweapon["german"] = cvardef("awe_secondary_weapon_german", "", "", "", "string"); + level.awe_secondaryweapon["russian"]= cvardef("awe_secondary_weapon_russian", "", "", "", "string"); + + level.awe_pistoltype["default"] = cvardef("awe_pistol_type", "", "", "", "string"); + level.awe_pistoltype["american"] = cvardef("awe_pistol_type_american", "", "", "", "string"); + level.awe_pistoltype["british"] = cvardef("awe_pistol_type_british", "", "", "", "string"); + level.awe_pistoltype["german"] = cvardef("awe_pistol_type_german", "", "", "", "string"); + level.awe_pistoltype["russian"] = cvardef("awe_pistol_type_russian", "", "", "", "string"); + + level.awe_grenadetype["default"] = cvardef("awe_grenade_type", "", "", "", "string"); + level.awe_grenadetype["american"] = cvardef("awe_grenade_type_american", "", "", "", "string"); + level.awe_grenadetype["british"] = cvardef("awe_grenade_type_british", "", "", "", "string"); + level.awe_grenadetype["german"] = cvardef("awe_grenade_type_german", "", "", "", "string"); + level.awe_grenadetype["russian"] = cvardef("awe_grenade_type_russian", "", "", "", "string"); + + level.awe_smokegrenadetype["default"] = cvardef("awe_smokegrenade_type", "", "", "", "string"); + level.awe_smokegrenadetype["american"] = cvardef("awe_smokegrenade_type_american", "", "", "", "string"); + level.awe_smokegrenadetype["british"] = cvardef("awe_smokegrenade_type_british", "", "", "", "string"); + level.awe_smokegrenadetype["german"] = cvardef("awe_smokegrenade_type_german", "", "", "", "string"); + level.awe_smokegrenadetype["russian"] = cvardef("awe_smokegrenade_type_russian", "", "", "", "string"); + + // Parachuting + level.awe_parachutes = cvardef("awe_parachutes", 0, 0, 2, "int"); + level.awe_parachutesonlyattackers = cvardef("awe_parachutes_only_attackers", 1, 0, 1, "int"); + level.awe_parachutesprotection = cvardef("awe_parachutes_protection", 1, 0, 1, "int"); + level.awe_parachuteslimitaltitude = cvardef("awe_parachutes_limit_altitude", 1700, 0, 50000, "int"); + + // Turret options + level.awe_turretmobile = cvardef("awe_turret_mobile", 0, 0, 2, "int"); + level.awe_turretplanttime = cvardef("awe_turret_plant_time", 2, 0, 30, "float"); + level.awe_turretpicktime = cvardef("awe_turret_pick_time", 1, 0, 30, "float"); + level.awe_mg42spawnextra = cvardef("awe_mg42_spawn_extra", 0, 0, 20, "int"); + level.awe_ptrs41spawnextra = cvardef("awe_ptrs41_spawn_extra", 0, 0, 20, "int"); + + // Tripwire options + level.awe_tripwire = cvardef("awe_tripwire", 0, 0, 3, "int"); + level.awe_tripwirelimit = cvardef("awe_tripwire_limit", 5, 1, 20, "int"); + level.awe_tripwirewarning = cvardef("awe_tripwire_warning", 1, 0, 1, "int"); + level.awe_tripwireplanttime = cvardef("awe_tripwire_plant_time", 3, 0, 30, "float"); + level.awe_tripwirepicktime = cvardef("awe_tripwire_pick_time", 5, 0, 30, "float"); + + // Remote detonable satchel options + level.awe_satchel = cvardef("awe_satchel", 0, 0, 1, "int"); + level.awe_satchellimit = cvardef("awe_satchel_limit", 5, 1, 20, "int"); + level.awe_satchelplanttime = cvardef("awe_satchel_plant_time", 3, 0, 30, "float"); + level.awe_satchelpicktime = cvardef("awe_satchel_pick_time", 5, 0, 30, "float"); + + // Stick nades options + level.awe_stickynades = cvardef("awe_sticky_nades", 0, 0, 2, "int"); + + // Spawn protection + level.awe_spawnprotection = cvardef("awe_spawn_protection", 0, 0, 99, "int"); + + // Stukas + level.awe_stukas = cvardef("awe_stukas", 0, 0, 99, "int"); + level.awe_stukascrash = cvardef("awe_stukas_crash", 20, 0, 100, "int"); + level.awe_stukascrashsafety = cvardef("awe_stukas_crash_safety", 0, 0, 1, "int"); + level.awe_stukascrashquake = cvardef("awe_stukas_crash_quake", 1, 0, 1, "int"); + level.awe_stukascrashstay = cvardef("awe_stukas_crash_stay", 30, 0, 10000, "int"); + level.awe_stukasdelay = cvardef("awe_stukas_delay", 500, 1, 10000, "int"); + + // Dead body handling + level.awe_nobodies = cvardef("awe_no_bodies", 0, 0, 2, "int"); + level.awe_burningbodies = cvardef("awe_burning_bodies", 5, 0, 99, "float"); + level.awe_searchablebodies = cvardef("awe_searchable_bodies", 1, 0, 99, "float"); + level.awe_searchablebodieshealth = cvardef("awe_searchable_bodies_health", 1, 0, 1, "int"); + + // Pop head + level.awe_pophead = cvardef("awe_pophead", 0, 0, 100, "int"); + + // Anticamping + level.awe_anticamptime = cvardef("awe_anticamp_time", 0, 0, 1440, "int"); + level.awe_anticampmethod = cvardef("awe_anticamp_method", 0, 0, level.awe_punishments + 1, "int"); + + // Cold breath + level.awe_coldbreath = cvardef("awe_cold_breath", 0, 0, 1, "int"); + + // Map voting + level.awe_mapvote = cvardef("awe_map_vote", 0, 0, 1, "int"); + level.awe_mapvotetime = cvardef("awe_map_vote_time", 30, 10, 180, "int"); + level.awe_mapvotereplay = cvardef("awe_map_vote_replay",0,0,1,"int"); + + // Show grenade cooking + level.awe_showcooking = cvardef("awe_show_cooking", 1, 0, 1, "int"); + + // First aid + level.awe_firstaid = cvardef("awe_firstaid",0,0,1,"int"); + + // UO Sprinting + level.awe_uosprint = cvardef("awe_uo_sprint",1,0,3,"int"); + + // AWE Sprinting + level.awe_sprint = cvardef("awe_sprint",0,0,3,"int"); + level.awe_sprinthud = cvardef("awe_sprint_hud",1,0,2,"int"); + level.awe_sprinthudhint = cvardef("awe_sprint_hud_hint",1,0,1,"int"); + + // Override falldamage +// level.awe_falldamage = cvardef("awe_falldamage",100,1,99999,"int"); + + for(;;) + { + // First aid + level.awe_firstaidkits = cvardef("awe_firstaid_kits",1,1,99,"int"); + level.awe_firstaidhealth= cvardef("awe_firstaid_health",25,1,100,"int"); + level.awe_firstaiddelay = cvardef("awe_firstaid_delay",10,0,999,"int"); + level.awe_firstaidscore = cvardef("awe_firstaid_score",1,0,999,"int"); + + // Stick nades options + level.awe_stickynadesgrenadefuse = cvardef("awe_sticky_nades_grenade_fuse", 4, 1, 99, "int"); + level.awe_stickynadessatchelfuse = cvardef("awe_sticky_nades_satchel_fuse", 6, 1, 99, "int"); + + // Damage blocking + level.awe_blockdamagespectator = cvardef("awe_block_damage_spectator", 1, 0, 1, "int"); + level.awe_blockdamageteamswitch= cvardef("awe_block_damage_team_switch", 1, 0, 1, "int"); + + // Sprinting + level.awe_sprintspeed = (float)1 + cvardef("awe_sprint_speed",60,0,9999,"float")*(float)0.01; + level.awe_sprinttime = cvardef("awe_sprint_time",3,1,999,"int") * 20; + level.awe_sprintrecovertime = cvardef("awe_sprint_recover_time",2,0,999,"int") * 20; + + // UO Sprinting + level.awe_uosprintspeed = (float)cvardef("awe_uo_sprint_speed",100,0,9999,"float")*(float)0.01; + level.awe_uosprinttime = (float)100 / (float)cvardef("awe_uo_sprint_time",100,1,9999,"int"); + level.awe_uosprintrecovertime = (float)100 / (float)cvardef("awe_uo_sprint_recover_time",100,1,9999,"int"); + + // Unlimted ammo + level.awe_unlimitedammo = cvardef("awe_unlimited_ammo", 0, 0, 2, "int"); + level.awe_unlimitedgrenades = cvardef("awe_unlimited_grenades", 0, 0, 1, "int"); + level.awe_unlimitedsmokegrenades = cvardef("awe_unlimited_smokegrenades", 0, 0, 1, "int"); + + // head popping controls + level.awe_popheadbullet = cvardef("awe_pophead_bullet", 1, 0, 1, "int"); + level.awe_popheadmelee = cvardef("awe_pophead_melee", 1, 0, 1, "int"); + level.awe_popheadexplosion= cvardef("awe_pophead_explosion", 1, 0, 1, "int"); + + // Zombie mode + level.awe_zombie = cvardef("awe_zombie",0,0,1,"int"); + + // Player max speed + level.awe_playerspeed = cvardef("awe_player_speed",100,0,9999,"float"); + + // Override gravity? + gravity = cvardef("awe_gravity",100,0,9999,"float"); + if(!isdefined(level.awe_gravity) || gravity != level.awe_gravity) + { + level.awe_gravity = gravity; + setcvar("g_gravity", 8 * gravity); + if(level.awe_debug) + iprintln("Gravity set to:" + 8 * gravity); + } + + // Unknown Soldiers handling + level.awe_unknownreflect = cvardef("awe_unknown_reflect",1,0,1,"int"); + level.awe_unknownmethod = cvardef("awe_unknown_method",0,0,3,"int"); + level.awe_unknownrenamemsg = cvardef("awe_unknown_rename_msg","Unknown Soldier is not a valid name! You have been renamed by the server.","","","string"); + + // Vsay dropping + level.awe_vsaydropweapon = cvardef("awe_vsay_drop_weapon",1,0,1,"int"); + level.awe_vsaydrophealth = cvardef("awe_vsay_drop_health",0,0,1,"int"); + + // Use bots (for debugging) + level.awe_bots = cvardef("awe_bots", 0, 0, 99, "int"); + + // Disable crosshair? + level.awe_nocrosshair = cvardef("awe_no_crosshair", 0, 0, 2, "int"); + + if(!init) wait 0.5; + + // turn on ambient mortars + level.awe_mortar = cvardef("awe_mortar", 3, 0, 10, "int"); + // quake? + level.awe_mortar_quake = cvardef("awe_mortar_quake", 1, 0, 1, "int"); + // random? + level.awe_mortar_random = cvardef("awe_mortar_random", 0, 0, 1, "int"); + // make them safe for players + level.awe_mortar_safety = cvardef("awe_mortar_safety", 1, 0, 1, "int"); + // minimum delay between mortars + level.awe_mortar_delay_min = cvardef("awe_mortar_delay_min", 20, 5, 179, "int"); + // maximum delay between mortars + level.awe_mortar_delay_max = cvardef("awe_mortar_delay_max", 60, level.awe_mortar_delay_min+1, 180, "int"); + + // warm up round for round based gametypes + level.awe_warmupround = cvardef("awe_warmup_round", 0, 0, 1, "int"); + + // team overriding + level.awe_teamallies = cvardef("awe_team_allies","","","","string"); + level.awe_teamswap = cvardef("awe_team_swap", 0, 0, 1,"int"); + + if(!init) wait 0.5; + + // fog options + cfogstr = cvardef("awe_cfog", "none", "", "", "string"); + if(cfogstr != "none" && (!isdefined(level.awe_cfogstr) || level.awe_cfogstr != cfogstr)) + { + level.awe_cfogstr = cfogstr; + cfogstr = strip(level.awe_cfogstr); + if(cfogstr!="") + { + cfog = explode(cfogstr," "); + if(cfog.size == 6) + { + level.awe_cfog = (int)cfog[0]; + level.awe_cfogdistance = (int)cfog[1]; + level.awe_cfogdistance2 = (int)cfog[2]; + level.awe_cfogred = (float)cfog[3]; + level.awe_cfoggreen = (float)cfog[4]; + level.awe_cfogblue = (float)cfog[5]; + } + } + } + efogstr = cvardef("awe_efog", "none", "", "", "string"); + if(efogstr != "none" && (!isdefined(level.awe_efogstr) || level.awe_efogstr != efogstr)) + { + level.awe_efogstr = efogstr; + efogstr = strip(level.awe_efogstr); + if(efogstr!="") + { + efog = explode(efogstr," "); + if(efog.size == 6) + { + level.awe_efog = (int)efog[0]; + level.awe_efogdensity = (float)efog[1]; + level.awe_efogdensity2 = (float)efog[2]; + level.awe_efogred = (float)efog[3]; + level.awe_efoggreen = (float)efog[4]; + level.awe_efogblue = (float)efog[5]; + } + } + } + + if(!init) wait 0.5; + + // Damage modifiers + // American + level.awe_dmgmod["m1carbine_mp"] = (float)cvardef("awe_dmgmod_m1carbine_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["m1garand_mp"] = (float)cvardef("awe_dmgmod_m1garand_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["thompson_mp"] = (float)cvardef("awe_dmgmod_thompson_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["bar_mp"] = (float)cvardef("awe_dmgmod_bar_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["springfield_mp"] = (float)cvardef("awe_dmgmod_springfield_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["fraggrenade_mp"] = (float)cvardef("awe_dmgmod_fraggrenade_mp",183,0,9999,"float")*(float)0.01; + level.awe_dmgmod["colt_mp"] = (float)cvardef("awe_dmgmod_colt_mp",100,0,9999,"float")*(float)0.01; + + // British + level.awe_dmgmod["enfield_mp"] = (float)cvardef("awe_dmgmod_enfield_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["sten_mp"] = (float)cvardef("awe_dmgmod_sten_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["bren_mp"] = (float)cvardef("awe_dmgmod_bren_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mk1britishfrag_mp"] = (float)cvardef("awe_dmgmod_mk1britishfrag_mp",183,0,9999,"float")*(float)0.01; + + // German + level.awe_dmgmod["kar98k_mp"] = (float)cvardef("awe_dmgmod_kar98k_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mp40_mp"] = (float)cvardef("awe_dmgmod_mp40_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mp44_mp"] = (float)cvardef("awe_dmgmod_mp44_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["kar98k_sniper_mp"] = (float)cvardef("awe_dmgmod_kar98k_sniper_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["stielhandgranate_mp"] = (float)cvardef("awe_dmgmod_stielhandgranate_mp",183,0,9999,"float")*(float)0.01; + level.awe_dmgmod["luger_mp"] = (float)cvardef("awe_dmgmod_luger_mp",100,0,9999,"float")*(float)0.01; + + // Russian + level.awe_dmgmod["mosin_nagant_mp"] = (float)cvardef("awe_dmgmod_mosin_nagant_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["ppsh_mp"] = (float)cvardef("awe_dmgmod_ppsh_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mosin_nagant_sniper_mp"]= (float)cvardef("awe_dmgmod_mosin_nagant_sniper_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["rgd-33russianfrag_mp"] = (float)cvardef("awe_dmgmod_rgd-33russianfrag_mp",183,0,9999,"float")*(float)0.01; + + // Turrets + level.awe_dmgmod["mg42_bipod_duck_mp"] = (float)cvardef("awe_dmgmod_mg42_bipod_duck_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg42_bipod_prone_mp"] = (float)cvardef("awe_dmgmod_mg42_bipod_prone_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg42_bipod_stand_mp"] = (float)cvardef("awe_dmgmod_mg42_bipod_stand_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["ptrs41_antitank_rifle_mp"]= (float)cvardef("awe_dmgmod_ptrs41_antitank_rifle_mp",100,0,9999,"float")*(float)0.01; + + // "Common" + level.awe_dmgmod["fg42_mp"] = (float)cvardef("awe_dmgmod_fg42_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["panzerfaust_mp"] = (float)cvardef("awe_dmgmod_panzerfaust_mp",100,0,9999,"float")*(float)0.01; + + if(isdefined(level.awe_uo)) + { + // American + level.awe_dmgmod["mg30cal_mp"] = (float)cvardef("awe_dmgmod_mg30cal_mp",100,0,9999,"float")*(float)0.01; + + // British + level.awe_dmgmod["webley_mp"] = (float)cvardef("awe_dmgmod_webley_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["sten_silenced_mp"] = (float)cvardef("awe_dmgmod_sten_silenced_mp",100,0,9999,"float")*(float)0.01; + + // German + level.awe_dmgmod["gewehr43_mp"] = (float)cvardef("awe_dmgmod_gewehr43_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg34_mp"] = (float)cvardef("awe_dmgmod_mg34_mp",100,0,9999,"float")*(float)0.01; + + // Russian + level.awe_dmgmod["tt33_mp"] = (float)cvardef("awe_dmgmod_tt33_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["svt40_mp"] = (float)cvardef("awe_dmgmod_svt40_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["dp28_mp"] = (float)cvardef("awe_dmgmod_dp28_mp",100,0,9999,"float")*(float)0.01; + + // "Common" + level.awe_dmgmod["flamethrower_mp"] = (float)cvardef("awe_dmgmod_flamethrower_mp",50,0,9999,"float")*(float)0.01; + level.awe_dmgmod["bazooka_mp"] = (float)cvardef("awe_dmgmod_bazooka_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["panzerschreck_mp"] = (float)cvardef("awe_dmgmod_panzerschreck_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["satchelcharge_mp"] = (float)cvardef("awe_dmgmod_satchelcharge_mp",100,0,9999,"float")*(float)0.01; + + // Tanks & Turrets + level.awe_dmgmod["30cal_tank_mp"] = (float)cvardef("awe_dmgmod_30cal_tank_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["50cal_tank_mp"] = (float)cvardef("awe_dmgmod_50cal_tank_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["elefant_turret_mp"] = (float)cvardef("awe_dmgmod_elefant_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg34_tank_mp"] = (float)cvardef("awe_dmgmod_mg34_tank_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg42_tank_mp"] = (float)cvardef("awe_dmgmod_mg42_tank_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["panzeriv_turret_mp"] = (float)cvardef("awe_dmgmod_panzeriv_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["sg43_tank_mp"] = (float)cvardef("awe_dmgmod_sg43_tank_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["sherman_turret_mp"] = (float)cvardef("awe_dmgmod_sherman_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["su152_turret_mp"] = (float)cvardef("awe_dmgmod_su152_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["flak88_turret_mp"] = (float)cvardef("awe_dmgmod_flak88_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg42_turret_mp"] = (float)cvardef("awe_dmgmod_mg42_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg50cal_tripod_stand_mp"]= (float)cvardef("awe_dmgmod_mg50cal_tripod_stand_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["mg_sg43_stand_mp"] = (float)cvardef("awe_dmgmod_mg_sg43_stand_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["sg43_turret_mp"] = (float)cvardef("awe_dmgmod_sg43_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_dmgmod["t34_turret_mp"] = (float)cvardef("awe_dmgmod_t34_turret_mp",100,0,9999,"float")*(float)0.01; + level.awe_flamethrowerhitrate = cvardef("awe_flamethrower_hitrate",100,0,100,"int"); + } + + if(!init) wait 0.5; + + // welcome message + level.awe_welcomedelay = cvardef("awe_welcome_delay", 1, 0.05, 30, "float"); + + // Server messages + level.awe_messagedelay = cvardef("awe_message_delay", 30, 1, 1440, "int"); + level.awe_messagenextmap = cvardef("awe_message_next_map", 2, 0, 4, "int"); + level.awe_messageloop = cvardef("awe_message_loop", 1, 0, 1, "int"); + level.awe_messageindividual = cvardef("awe_message_individual", 0, 0, 1, "int"); + + // Weapon limiting + level.awe_riflelimit = cvardef("awe_rifle_limit", 0, 0, 100, "int"); + level.awe_boltriflelimit= cvardef("awe_boltrifle_limit", 0, 0, 100, "int"); + level.awe_semiriflelimit= cvardef("awe_semirifle_limit", 0, 0, 100, "int"); + level.awe_smglimit = cvardef("awe_smg_limit", 0, 0, 100, "int"); + level.awe_assaultlimit = cvardef("awe_assault_limit", 0, 0, 100, "int"); + level.awe_sniperlimit = cvardef("awe_sniper_limit", 0, 0, 100, "int"); + level.awe_lmglimit = cvardef("awe_lmg_limit", 0, 0, 100, "int"); + level.awe_ftlimit = cvardef("awe_ft_limit", 0, 0, 100, "int"); + level.awe_rllimit = cvardef("awe_rl_limit", 0, 0, 100, "int"); + level.awe_fg42limit = cvardef("awe_fg42_limit", 0, 0, 100, "int"); + + // Drop weapon options + level.awe_droponarmhit = cvardef("awe_droponarmhit", 0, 0, 100, "int"); + level.awe_droponhandhit = cvardef("awe_droponhandhit", 0, 0, 100, "int"); + level.awe_dropondeath = cvardef("awe_dropondeath", 1, 0, 2, "int"); + + if(!init) wait 0.5; + + // Display Obituary Messages. + level.awe_obituary = cvardef("awe_obituary", 1,0,2, "int"); + level.awe_obituarydeath = cvardef("awe_obituary_death", 1,0,1, "int"); + + // Trip on foot/leg hit + level.awe_triponleghit = cvardef("awe_triponleghit", 0, 0, 100, "int"); + level.awe_triponfoothit = cvardef("awe_triponfoothit", 0, 0, 100, "int"); + + // Pop helmet + level.awe_pophelmet = cvardef("awe_pophelmet", 50, 0, 100, "int"); + + // pain & death sounds + level.awe_painsound = cvardef("awe_painsound", 1, 0, 1, "int"); + + // C47 planes + level.awe_bombers = cvardef("awe_bombers", 0, 0, 1, "int"); + // C47 planes delay + level.awe_bombers_delay = cvardef("awe_bombers_delay", 300, 1, 1440, "int"); + + if(!init) wait 0.5; + + // Override altitude? + level.awe_bombers_altitude = cvardef("awe_bombers_altitude", 0, 0, 10000, "int"); + // Override distance? + level.awe_bombers_distance = cvardef("awe_bombers_distance", 0, -25000, 25000, "int"); + + // Ambient tracers + level.awe_tracers = cvardef("awe_tracers", 0, 0, 100, "int"); + level.awe_tracersdelaymin = cvardef("awe_tracers_delay_min", 5, 1, 1440, "int"); + level.awe_tracersdelaymax = cvardef("awe_tracers_delay_max", 15, level.awe_tracersdelaymin + 1, 1440, "int"); + + // Ambient skyflashes + level.awe_skyflashes = cvardef("awe_skyflashes", 5, 0, 100, "int"); + level.awe_skyflashesdelaymin = cvardef("awe_skyflashes_delay_min", 5, 1, 1440, "int"); + level.awe_skyflashesdelaymax = cvardef("awe_skyflashes_delay_max", 15, level.awe_skyflashesdelaymin + 1, 1440, "int"); + + if(!init) wait 0.5; + + // Anti teamkilling + level.awe_teamkillmax = cvardef("awe_teamkill_max", 3, 0, 99, "int"); + level.awe_teamkillwarn = cvardef("awe_teamkill_warn", 1, 0, 99, "int"); + level.awe_teamkillmethod = cvardef("awe_teamkill_method", 0, 0, level.awe_punishments + 1, "int"); + level.awe_teamkillreflect = cvardef("awe_teamkill_reflect", 1, 0, 1, "int"); + level.awe_teamkillmsg = cvardef("awe_teamkill_msg","^6Good damnit! ^7Learn the difference between ^4friend ^7and ^1foe ^7you bastard!.","","","string"); + + // Anti teamdamage + level.awe_teamdamagemax = cvardef("awe_teamdamage_max", 0, 0, 10000, "int"); + level.awe_teamdamagewarn = cvardef("awe_teamdamage_warn", 0, 0, 10000, "int"); + level.awe_teamdamagemethod = cvardef("awe_teamdamage_method", 0, 0, level.awe_punishments + 1, "int"); + level.awe_teamdamagereflect = cvardef("awe_teamdamage_reflect", 1, 0, 1, "int"); + level.awe_teamdamagemsg = cvardef("awe_teamdamage_msg","^6Good damnit! ^7Learn the difference between ^4friend ^7and ^1foe ^7you bastard!.","","","string"); + + if(!init) wait 0.5; + + // Anticamping + level.awe_anticampmarktime = cvardef("awe_anticamp_marktime", 90, 0, 1440, "int"); + level.awe_anticampfun = cvardef("awe_anticamp_fun", 0, 0, 1440, "int"); + level.awe_anticampmsgsurvived = cvardef("awe_anticamp_msg_survived", "^6Congratulations! ^7You are no longer marked and still alive.", "", "", "string"); + level.awe_anticampmsgdied = cvardef("awe_anticamp_msg_died", "A ^1dead ^7camper is a ^2good ^7camper!", "", "", "string"); + + // Grenade options + level.awe_fusetime = cvardef("awe_fuse_time", 4, 1, 99, "int"); + level.awe_grenadewarning = cvardef("awe_grenade_warning", 100, 0, 100, "int"); + level.awe_grenadewarningrange = cvardef("awe_grenade_warning_range", 500, 0, 100000, "int"); + level.awe_grenadecount = cvardef("awe_grenade_count", 0, 0, 999, "int"); + level.awe_grenadecountrandom = cvardef("awe_grenade_count_random", 0, 0, 2, "int"); + level.awe_smokegrenadecount = cvardef("awe_smokegrenade_count", 0, 0, 999, "int"); + level.awe_smokegrenadecountrandom = cvardef("awe_smokegrenade_count_random", 0, 0, 2, "int"); + level.awe_satchelcount = cvardef("awe_satchel_count", 0, 0, 999, "int"); + + if(!init) wait 0.5; + + // Ammo limiting + level.awe_ammomin = cvardef("awe_ammo_min",100,0,100,"int"); + level.awe_ammomax = cvardef("awe_ammo_max",100,level.awe_ammomin,100,"int"); + + // Hud + level.awe_showlogo = cvardef("awe_show_logo", 1, 0, 1, "int"); + level.awe_showserverlogo = cvardef("awe_show_server_logo", 0, 0, 2, "int"); + level.awe_showsdtimer_cvar = cvardef("awe_show_sd_timer", 0, 0, 1, "int"); + if(level.awe_showsdtimer_cvar) + level.awe_showsdtimer = true; + else + level.awe_showsdtimer = undefined; + + // Fix corrupt maprotations + level.awe_fixmaprotation = cvardef("awe_fix_maprotation", 0, 0, 1, "int"); + + // Use random maprotation? + level.awe_randommaprotation = cvardef("awe_random_maprotation", 0, 0, 2, "int"); + + // Rotate map if server is empty? + level.awe_rotateifempty = cvardef("awe_rotate_if_empty", 30, 0, 1440, "int"); + + if(!init) wait 0.5; + + // Spawn protection + level.awe_spawnprotectionrange= cvardef("awe_spawn_protection_range", 50, 0, 10000, "int"); + level.awe_spawnprotectionhud = cvardef("awe_spawn_protection_hud", 1, 0, 2, "int"); + level.awe_spawnprotectionheadicon = cvardef("awe_spawn_protection_headicon", 1, 0, 1, "int"); + level.awe_spawnprotectiondropweapon = cvardef("awe_spawn_protection_dropweapon",0,0,1,"int"); + level.awe_spawnprotectiondisableweapon = cvardef("awe_spawn_protection_disableweapon",0,0,1,"int"); + + // Turret stuff + level.awe_mg42disable = cvardef("awe_mg42_disable", 0, 0, 1, "int"); + level.awe_ptrs41disable = cvardef("awe_ptrs41_disable", 0, 0, 1, "int"); + level.awe_turretpenalty = cvardef("awe_turret_penalty", 1, 0, 1, "int"); + level.awe_turretrecover = cvardef("awe_turret_recover", 1, 0, 1, "int"); + + // Bleeding & taunts + level.awe_bleeding = cvardef("awe_bleeding", 0, 0, 100, "int"); + level.awe_taunts = cvardef("awe_taunts", 0, 0, 1, "int"); + + if(!init) wait 0.5; + + // If we are initializing variables, break here + if(init) break; + +// if(getcvar("let_it_all_pour_down")=="1" && !isdefined(level.awe_raining)) +// thread letItRain(); + + if(!isdefined(level.awe_tdom)) + { + // Delete all stale objectives + for(i=level.awe_objnum_min;i<=level.awe_objnum_max;i++) // Set up array and flag all as unused + objectives[i]=false; + +// allplayers = getentarray("player", "classname"); // Get all players and flag all used objectives + + for(i = 0; i < level.awe_allplayers.size; i++) + if(isdefined(level.awe_allplayers[i])) + if( level.awe_allplayers[i].sessionstate == "playing" && isdefined(level.awe_allplayers[i].awe_objnum) ) + objectives[level.awe_allplayers[i].awe_objnum]=true; + + for(i=level.awe_objnum_min;i<=level.awe_objnum_max;i++) // Delete unused objectives + if(!objectives[i]) + objective_delete(i); + } + + wait 0.5; + } +} + +incoming() +{ + level endon("awe_boot"); + + if(level.awe_bombers_altitude) + maxz = level.awe_bombers_altitude; + else + maxz = level.awe_vMax[2]; + + surfaces = []; +// surfaces[surfaces.size] = "brick"; +// surfaces[surfaces.size] = "concrete"; +// surfaces[surfaces.size] = "dirt"; + surfaces[surfaces.size] = "generic"; +// surfaces[surfaces.size] = "grass"; +// surfaces[surfaces.size] = "gravel"; +// surfaces[surfaces.size] = "metal"; +// surfaces[surfaces.size] = "wood"; + + for(;;) + { + range = (int)(level.awe_mortar_delay_max - level.awe_mortar_delay_min); + delay = randomInt(range); + delay = delay + level.awe_mortar_delay_min; + wait delay; + + mortar = spawn("script_model", (0,0,0)); + mortar setModel(level.awe_mortarmodel); + mortar hide(); + + distance = -1; + // if the safety is on for mortars, make sure they don't hit a player + range = 1000000; + while(distance < level.awe_mortar_safety * range * 2) + { + // Get a random mortar incoming sound + m = randomInt(level.awe_mortars.size); + + // Random strength + pc = randomInt(100); + + // Get it's damage range + range = 200 + pc*360*0.01; + + // Get players + players = []; + for(i=0;i max) + definition = max; + + return definition; +} + +spawn_model(model,name,origin,angles) +{ + if (!isdefined(model) || !isdefined(name) || !isdefined(origin)) + return undefined; + + if (!isdefined(angles)) + angles = (0,0,0); + + spawn = spawn ("script_model",(0,0,0)); + spawn.origin = origin; + spawn setmodel (model); + spawn.targetname = name; + spawn.angles = angles; + + return spawn; +} + +// sort a list of entities with ".origin" properties in ascending order by their distance from the "startpoint" +// "points" is the array to be sorted +// "startpoint" (or the closest point to it) is the first entity in the returned list +// "maxdist" is the farthest distance allowed in the returned list +// "mindist" is the nearest distance to be allowed in the returned list +sortByDist(points, startpoint, maxdist, mindist) +{ + if(!isdefined(points)) + return undefined; + if(!isdefineD(startpoint)) + return undefined; + + if(!isdefined(mindist)) + mindist = -1000000; + if(!isdefined(maxdist)) + maxdist = 1000000; // almost 16 miles, should cover everything. + + sortedpoints = []; + + max = points.size-1; + for(i = 0; i < max; i++) + { + nextdist = 1000000; + next = undefined; + + for(j = 0; j < points.size; j++) + { + thisdist = distance(startpoint.origin, points[j].origin); + if(thisdist <= nextdist && thisdist <= maxdist && thisdist >= mindist) + { + next = j; + nextdist = thisdist; + } + } + + if(!isdefined(next)) + break; // didn't find one that fit the range, stop trying + + sortedpoints[i] = points[next]; + + // shorten the list, fewer compares + points[next] = points[points.size-1]; // replace the closest point with the end of the list + points[points.size-1] = undefined; // cut off the end of the list + } + + sortedpoints[sortedpoints.size] = points[0]; // the last point in the list + + return sortedpoints; +} + +painsound() +{ + if(isdefined(level.awe_teamplay)) + team = self.sessionteam; + else + team = self.pers["team"]; + + nationality = game[team]; + num = randomInt(level.awe_voices[nationality]) + 1; + + if(isdefined(level.awe_uo)) + { + num = 1; + if(team == "axis") + nationality = "german"; + else + nationality = "american"; + } + + scream = "generic_pain_" + nationality + "_" + num; // i.e. "generic_pain_german_2" + self playSound(scream); +} + +taunts(victim) +{ + self notify("awe_taunts"); + self endon("awe_taunts"); + self endon("awe_spawned"); + self endon("awe_died"); + + if(isdefined(level.awe_teamplay)) + { + if(isPlayer(self) && self != victim && self.sessionteam != victim.sessionteam ) + self.awe_killspree++; + else + return; + } + else + { + if (isPlayer(self) && self != victim) + self.awe_killspree++; + else + return; + } + + rn = randomint(16); + + if(self.awe_killspree == 2 || self.awe_killspree == 3) + rn = randomint(10); + if(self.awe_killspree == 4 || self.awe_killspree == 5) + rn = randomint(8); + if(self.awe_killspree > 5) + rn = randomint(5); + + if(isdefined(level.awe_teamplay)) + { + team = self.sessionteam; + otherteam = victim.sessionteam; + } + else + { + team = self.pers["team"]; + otherteam = victim.pers["team"]; + } + + wait (.5); + + if(self.sessionstate == "playing") + { + nationality = game[team]; + + if (rn == 1 || rn == 2) + self playsound("awe_" + nationality + "_taunt"); + if (rn == 3) + { + if((game[team] == "russian") && (game[team] == "german")) + self playsound ("awe_RvG"); + else if ((game[team] == "german") && (game[team] == "american")) + self playsound ("awe_GvA"); + else if ((game[team] == "german") && (game[team] == "russian")) + self playsound ("awe_GvR"); + else + self playsound("awe_" + nationality + "_taunt"); + } + } +} + + +PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc) +{ + // Update old team on death + if(isdefined(level.awe_teamplay)) + self.awe_oldteam = self.sessionteam; + else + self.awe_oldteam = self.pers["team"]; + + if(level.awe_disable) + { + if(!isdefined(self.autobalance)) + { + body = self cloneplayer(); + self dropItem(self getcurrentweapon()); + self aweObituary(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc); + } + return; + } + + self notify("awe_died"); + + self cleanupPlayer1(); + + if(!isdefined(level.awe_merciless) && level.awe_taunts) + attacker thread taunts(self); + + dropTurret(undefined, sMeansOfDeath); + + // Check for headpopping + switch(sHitLoc) + { + case "head": + case "helmet": + if( level.awe_popheadbullet && sMeansOfDeath != "MOD_MELEE" && (isWeaponType("rifle",sWeapon) || isWeaponType("sniper",sWeapon) || isWeaponType("turret",sWeapon)) ) + dopop = true; + break; + default: + break; + } + switch(sMeansOfDeath) + { + case "MOD_MELEE": + if(level.awe_popheadmelee && iDamage>=100 ) + dopop = true; + break; + case "MOD_PROJECTILE": + case "MOD_PROJECTILE_SPLASH": + case "MOD_GRENADE_SPLASH": + case "MOD_EXPLOSIVE": + case "MOD_ARTILLERY": + case "MOD_ARTILLERY_SPLASH": + if(level.awe_popheadexplosion && iDamage>=100 ) + dopop = true; + break; + default: + break; + } + + if(isdefined(dopop)) + { + if(randomInt(100) < level.awe_pophead && !isdefined(self.awe_headpopped) ) + self popHead( vDir, iDamage); + else if(randomInt(100) < level.awe_pophelmet && !isdefined(self.awe_helmetpopped) ) + self popHelmet( vDir, iDamage); + } + + // Deathshock + if(level.awe_deathshock && !isdefined(level.awe_merciless) ) + { + self shellshock("death", 2); + } + + if(!isdefined(self.autobalance)) + { + // Drop weapon + switch(level.awe_dropondeath) + { + case 1: + self dropItem(self getcurrentweapon()); + break; + case 2: + angles = self.angles; + self dropitem(self getWeaponSlotWeapon("primary")); + self.angles = angles + (0,30,0); + self dropitem(self getWeaponSlotWeapon("pistol")); + self.angles = angles + (0,-30,0); + self dropitem(self getWeaponSlotWeapon("grenade")); + self.angles = angles + (0,60,0); + self dropitem(self getWeaponSlotWeapon("primaryb")); + if(!isdefined(level.awe_uo)) + break; + self.angles = angles + (0,-60,0); + self dropitem(self getWeaponSlotWeapon("smokegrenade")); + self.angles = angles + (0,90,0); + self dropitem(self getWeaponSlotWeapon("binocular")); + self.angles = angles + (0,-90,0); + self dropitem(self getWeaponSlotWeapon("satchel")); + self.angles = angles; + break; + default: + break; + } + // Handle body + switch(level.awe_nobodies) + { + case 0: + level thread handleBody(self,sMeansOfDeath); + break; + case 2: + playfx(level.awe_burningbodies_smokefx,self.origin); + break; + default: + break; + } + } + +// MonitorKills(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc); + + // Show obituarys? + if(level.awe_obituary) + self aweObituary(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc); +} + +teamkill() +{ + if(level.awe_disable) return; + + if (!level.awe_teamkillmax) + return; + + // Increase value + self.pers["awe_teamkills"]++; + + // Check if it reached or passed the max level + if (self.pers["awe_teamkills"]>=level.awe_teamkillmax) + { + if(level.awe_teamkillmethod) + iprintln(self.name + " ^7has killed ^1" + self.pers["awe_teamkills"] + " ^7teammate(s) and will be punished."); + if(level.awe_teamkillreflect) + iprintln(self.name + " ^7has killed ^1" + self.pers["awe_teamkills"] + " ^7teammate(s) and will reflect damage."); + + self iprintlnbold(level.awe_teamkillmsg); + self thread punishme(level.awe_teamkillmethod, "teamkilling"); + if(level.awe_teamkillreflect) + self.pers["awe_teamkiller"] = true; + } + // Check if it reached or passed the warning level + else if (self.pers["awe_teamkills"]>=level.awe_teamkillwarn) + { + if(level.awe_teamkillmethod) + self iprintlnbold(level.awe_teamkillmax - self.pers["awe_teamkills"] + " ^7more teamkill(s) and you will be ^1punished^7!"); + else if(level.awe_teamkillreflect) + self iprintlnbold(level.awe_teamkillmax - self.pers["awe_teamkills"] + " ^7more teamkill(s) and you will reflect damage!"); + else + self iprintlnbold(level.awe_teamkillmax - self.pers["awe_teamkills"] + " ^7more teamkill(s) and nothing will happen!"); + } +} + +teamdamagedialog(victim) +{ + self notify("awe_teamdamagedialog"); + self endon("awe_teamdamagedialog"); + self endon("awe_died"); + self endon("awe_spawned"); + + wait(0.25 + randomFloat(0.5)); // 0.25 - 0.75 second delay + + if(!isAlive(victim)) + return; + + if(randomInt(2)) // 50% chance + { + if(isdefined(level.awe_tdom)) + nationality = victim.nationality; + else + { + team = victim.sessionteam; + nationality = game[team]; + } + + if(randomInt(2)) // 50% chance + scream = nationality + "_hold_fire"; + else // 50% chance + { + if(nationality == "german") + scream = nationality + "_are_you_crazy"; + else + scream = nationality + "_youre_crazy"; + } + victim playSound(scream); + + wait(1.25 + randomFloat(0.5)); // 1.25 - 1.75 second delay + + if(!isAlive(self)) + return; + + if(isdefined(level.awe_tdom)) + nationality = self.nationality; + else + { + team = self.sessionteam; + nationality = game[team]; + } + scream = nationality + "_sorry"; + self playSound(scream); + } +} + +teamdamage(victim, damage) +{ + if(level.awe_disable) return; + + if(damage <= victim.health) + self thread teamdamagedialog(victim); + + // Check if team damage is disabled + if (!level.awe_teamdamagemax) + return; + + // If damage is more than health left on victim, use health left. + if(damage > victim.health) + damage = victim.health; + + // Limit damage to 100 + if(damage>100) + damage=100; + + // Increase value + self.pers["awe_teamdamage"] += damage; + + // Check if it reached or passed the max level + if (self.pers["awe_teamdamage"]>=level.awe_teamdamagemax) + { + if(level.awe_teamdamagemethod) + iprintln(self.name + " ^7has caused ^1" + self.pers["awe_teamdamage"] + " ^7points of teamdamage and will be punished."); + if(level.awe_teamdamagereflect) + iprintln(self.name + " ^7has caused ^1" + self.pers["awe_teamdamage"] + " ^7points of teamdamage and will reflect damage."); + + self iprintlnbold(level.awe_teamdamagemsg); + self thread punishme(level.awe_teamdamagemethod, "shooting teammates"); + if(level.awe_teamdamagereflect) + self.pers["awe_teamkiller"] = true; + } + // Check if it reached or passed the warning level + else if (self.pers["awe_teamdamage"]>=level.awe_teamdamagewarn) + { + if(level.awe_teamdamagemethod) + self iprintlnbold(level.awe_teamdamagemax - self.pers["awe_teamdamage"] + " ^7points more teamdamage and you will be ^1punished^7!"); + else if(level.awe_teamdamagereflect) + self iprintlnbold(level.awe_teamdamagemax - self.pers["awe_teamdamage"] + " ^7points more teamdamage and you will reflect damage!"); + else + self iprintlnbold(level.awe_teamdamagemax - self.pers["awe_teamdamage"] + " ^7points more teamdamage and nothing will happen!"); + } +} + +punishme(iMethod, sReason) +{ + self endon("awe_spawned"); + self endon("awe_died"); + + if(iMethod == 1) + iMethod = 2 + randomInt(level.awe_punishments); + + switch (iMethod) + { + case 2: + self suicide(); + sMethodname = "killed"; + break; + + case 3: + wait 0.5; + // play the hit sound + self playsound("grenade_explode_default"); + // explode + playfx(level.awe_effect["bombexplosion"], self.origin); + wait .05; + self suicide(); + sMethodname = "blown up"; + break; + + case 4: + // Drop weapon and get 15 seconds of spanking + time = 15; + + self thread punishtimer(time,(0,1,0)); + + self thread maps\mp\gametypes\_awe_uncommon::aweShellshock(time); + self thread spankme(time); + + sMethodname = "spanked"; + break; + + default: + break; + } + if(iMethod) + iprintln(self.name + "^7 is being " + sMethodname + " ^7for " + sReason + "^7."); +} + +punishtimer(time,color) +{ + // Remove timer if it exists + if(isdefined(self.awe_punishtimer)) + self.awe_punishtimer destroy(); + + // Set up timer + self.awe_punishtimer = newClientHudElem(self); + self.awe_punishtimer.archived = true; + self.awe_punishtimer.x = 420; + if(isdefined(level.awe_alternatehud)) + self.awe_punishtimer.y = 420; + else + self.awe_punishtimer.y = 460; + self.awe_punishtimer.alignX = "center"; + self.awe_punishtimer.alignY = "middle"; + self.awe_punishtimer.alpha = 1; + self.awe_punishtimer.sort = -3; + self.awe_punishtimer.font = "bigfixed"; + self.awe_punishtimer.color = color; + self.awe_punishtimer setTimer(time - 1); + + // Wait + wait time; + + // Remove timer + if(isdefined(self.awe_punishtimer)) + self.awe_punishtimer destroy(); +} + +spankme(time) +{ + self notify("awe_spankme"); + self endon("awe_spankme"); + self endon("awe_spawned"); + self endon("awe_died"); + + for(i=0;i<(time*5);i++) + { + self setClientCvar("cl_stance", "2"); + self dropItem(self getcurrentweapon()); + wait 0.2; + } +} + +GetNextObjNum() +{ + num = level.awe_objnum_cur; + level.awe_objnum_cur++; + if(level.awe_objnum_cur > level.awe_objnum_max) + { + level.awe_objnum_cur = level.awe_objnum_min; + } + return num; +} + +markme(icon, obj, time) +{ + self endon("awe_spawned"); + self endon("awe_died"); + + // Do not mark a player twice + if(isdefined(self.awe_objnum)) + return; + + // gametype dm does not initialize level.drawfriend + if(!isdefined(level.drawfriend)) + level.drawfriend = 0; + + if(obj == "camper" && isdefined(level.awe_teamplay)) // Check if we are marking a camper and it's team play + { + // Set up the headicon + headicon = "headicon_" + self.pers["team"]; + if(self.pers["team"] == "allies") + { + if(level.drawfriend) // if scr_drawfriend=1 show headicon to all + headiconteam = "none"; + else // Show only to other team + headiconteam = "axis"; + + objective = "radio_allies"; // Use radio objective + objectiveteam = "axis"; // Show objective for other team + } + else + { + if(level.drawfriend) // if scr_drawfriend=1 show headicon to all + headiconteam = "none"; + else + headiconteam = "allies"; // Show only to other team + + objective = "radio_axis"; + objectiveteam = "allies"; + } + } + else + { + // Set up the headicon + headicon = "headicon_" + icon; + headiconteam = "none"; // Show for both teams + + // Set up the objective + if (obj == "camper") // If a camper in DM use default objective + objective = "objective_default"; + else + objective = "objective_" + obj; + objectiveteam = "none"; + } + + self.headiconteam = headiconteam; + + // Mark player on compass + objnum = GetNextObjNum(); + self.awe_objnum = objnum; + objective_add(objnum, "current", self.origin, game[objective]); + objective_team(objnum, objectiveteam); + if(time) // Time != 0 + { + for(i=0;( i