Raw model (for completeness)
{
"meta": {
"id": "02bbb121-8fab-4aab-9363-dafde9f73521",
"sha1": "8754e397c447d5dfd348312907c14efe16546c9d",
"sha256": "6852e8c7823de39b698fae71ab105bb66bb716d5fd630b927e36ef022df11548",
"filenames": [
"zh-polished-v6.pk3"
],
"additional": {
"engines": [
"ZDOOM"
],
"iwad": [],
"filename": null,
"added": "2015-06-18 22:58:05",
"locked": false,
"canDownload": true,
"adult": false,
"hidden": false,
"name": null,
"description": null,
"maps": null,
"graphicOverrides": null,
"screenshots": null,
"palettes": null,
"categories": null
},
"flags": {
"locked": false,
"canDownload": true,
"adult": false,
"hidden": false
},
"added": "2015-06-18 22:58:05",
"file": {
"type": "PK3",
"size": 2795095,
"url": "https://wadarchive2.nyc3.digitaloceanspaces.com/8754e397c447d5dfd348312907c14efe16546c9d/8754e397c447d5dfd348312907c14efe16546c9d.pk3.gz",
"corrupt": false
},
"content": {
"counts": {
"endoom": 0,
"graphics": 0,
"lumps": 626,
"maps": 0,
"palettes": 0
},
"engines_guess": [
"ZDOOM"
]
},
"text_files": [
{
"source": "pk3",
"name": "SNDINFO.txt",
"contents": "quadshotgun/fire\t\tDSQSFIRE\nquadshotgun/insert1 DSQSINS1\nquadshotgun/insert2 DSQSINS2\nquadshotgun/insert3 DSQSINS3\nquadshotgun/insert4 DSQSINS4\nCHAINDWN CHAINDWN\nAWPPULL AWPPULL\nAWPRAIS AWPRAIS\nDSMAGNUM DSMAGNUM\nRevolverReload DSMAGOUT\nRevolverReload2 DSMAGIN\nShtg/Pump SHTGRELO\nShtg/Reload 3HTLOAD1\nShtg/Fire1 3AWFIRE2\nLSRPGEXP LSRPGEXP\nm_gun1 m_gun1\nDSCHGUP DSCHGUP\nDSCHGDWN DSCHGDWN\nWWIN WWIN\nWWOPEN WWOPEN\nWWCLOSE WWCLOSE\nWWDOUBLE WWDOUBLE\nWWFIRE WWFIRE\nbloodsplat1 juicy_01\nbloodsplat2 juicy_02\nbloodsplat3 juicy_03\nbloodsplat4 juicy_04\nbloodsplat5 juicy_05\nbls1\tguts_01\nbls2\tguts_02\nbls3\tguts_03\nbls4\tguts_04\nbls5\tguts_05\nflsimp1\tblt_fls1\nflsimp2\tblt_fls2\nflsimp3\tblt_fls3\nmoan1\tmoaner_1\nmoan2\tmoaner_2\nmoan3\tmoaner_3\nmoan4\tmoaner_4\n$random bloodsplat { bls1 bls2 bls3 bls4 bls5 }\n$random gibsplat { bloodsplat1 bloodsplat2 bloodsplat3 bloodsplat4 bloodsplat5 }\n$random fleshimpact { flsimp1 flsimp2 flsimp3 }\n$limit fleshimpact 4\n$volume fleshimpact 0.65\n$random corpsemoan { moan1 moan2 moan3 moan4 }\nbrc1 brass_c1\nbrc2 brass_c2\nbrc3 brass_c3\nbrc4 brass_c4\nbrc5 brass_c5\nshc1 shotshl1\nshc2 shotshl2\nshc3 shotshl3\nshc4 shotshl4\nbulimp1 blt_imp1\nbulimp2 blt_imp2\nbulimp3 blt_imp3\nbulimp4 blt_imp4\nrico1 ric1\nrico2 ric2\nrico3 ric3\nwhz1 whiz1\nwhz2 whiz2\nwhz3 whiz3\nwhz4 whiz4\nreveseek seeker\n$random brassimpact { brc1 brc2 brc3 brc4 brc5 }\n$volume brassimpact 0.5\n$random shotshellimpact { shc1 shc2 shc3 shc4\n$random bulletimpact { bulimp1 bulimp2 bulimp3 bulimp4 }\n$volume bulletimpact 0.65\n$random ricochet { rico1 rico2 rico3 }\n$random whizby { whz1 whz2 whz3 whz4 }\nquadshotgun/fire\t\tDSQSFIRE\nquadshotgun/insert1 DSQSINS1\nquadshotgun/insert2 DSQSINS2\nquadshotgun/insert3 DSQSINS3\nquadshotgun/insert4 DSQSINS4"
},
{
"source": "pk3",
"name": "Source/ACHIEVEMEMENTS.txt",
"contents": "#library \"achievem\"\n#encryptstrings\n\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"FUNCTION.acs\"\n#Import \"COMMON.acs\"\n#Import \"MODCVARS.acs\"\n\n#define DISABLE_SECURITY 0\n\n#define ACHV_TXT_XPOS 0.02\n#define ACHV_TXT_YPOS 0.8\n\n#define ACHV_NUMBER 26\n\n#define ACHV_TYPE1_NUMB 9\n#define ACHV_TYPE2_NUMB 10\n#define ACHV_TYPE3_NUMB 7\n\n#define ACHV_TYPE_1 0\n#define ACHV_TYPE_2 1\n#define ACHV_TYPE_3 2\n\n// ------------HUDMESSAGES TIDs-----------------\n// 820-899 : display & messages\n\n// ------------LOCAL VARIABLES MEANING------\n//x_zh_global0 : random key\n//x_zh_global1 : category 1 achievements\n//x_zh_global2 : category 2 achievements\n//x_zh_global3 : category 3 achievements\n// x_zh_pro1 : total infections\n// x_zh_pro2 : total kills\n// x_zh_pro3 : total escapes\n// x_zh_pro4 : total jacksgun kills\n// x_zh_pro5 : total SSG kills\n\n/* Variables */\nint achv_score[3];\nbool values[ACHV_NUMBER];\nint progress[6];\n\nstr Achievements_list[ACHV_NUMBER] = {\n\t\"\\cqEpidemic!\",\n\t\"\\ckIt's not over yet!\",\n\t\"\\cvPreventive Infection!\",\n\t\"\\chRelapse!\",\n\t\"\\crInfection Madness!\",\n\t\"\\ckRoad Runner!\",\n\t\"Infection Milestone!\",\n\t\"Infection Milestone 2!\",\n\t\"Infection Milestone 3!\",\n\n\t\"\\cfI am a Pirate!\",\n\t\"\\crSupershotgun Supremacy!\",\n\t\"\\cmSurvival instinct!\",\n\t\"\\cdFirefighter!\",\n\t\"\\cvSky gazer!\",\n\t\"\\cqGravedigger!\",\n\t\"\\crDeath Priest!\",\n\t\"Hunter Milestone!\",\n\t\"Hunter Milestone 2!\",\n\t\"Hunter Milestone 3!\",\n\n\t\"\\cuHard to Kill!\",\n\t\"\\cuHard to Kill 2!\",\n\t\"\\ctIs It Safe?\",\n\t\"\\cnOnly ZE survivor!\",\n\t\"\\cnOnly ZM survivor!\",\n\t\"Survivor Milestone!\",\n\t\"Survivor Milestone 2!\"\n\t};\n\nstr Achievements_description[ACHV_NUMBER] = {\n\t\"As a mother zombie,\\ninfect everyone!\",\n\t\"Infect a human when only\\n10 seconds are remaining!\",\n\t\"Infect a human as soon\\nas you get selected\",\n\t\"Scratch a human that\\ngot Cured!\",\n\t\"Get more than 12 infections\\nin a single round!\",\n\t\"Infect a human \\nthat is panicking!\",\n\t\"Accumulate 100 \\nInfections\",\n\t\"Accumulate 500 \\nInfections\",\n\t\"Accumulate 1000 \\nInfections\",\n\n\t\"Accumulate 20 kills\\nwith Jacksgun\",\n\t\"Accumulate 5 kills\\nwith SuperShotgun\",\n\t\"Kill a zombie with\\nyour handgun!\",\n\t\"Accumulate 15 burning \\nzombie kills\",\n\t\"Kill a zombie in the\\nmid-air!\",\n\t\"Kill 5 zombies in a\\nsingle round!\",\n\t\"Kill 8 zombies in a\\nsingle round!\",\n\t\"Accumulate 30 zombie \\nkills\",\n\t\"Accumulate 100 zombie \\nkills\",\n\t\"Accumulate 250 zombie \\nkills\",\n\n\t\"survive 10 games \\nwithout dying!\",\n\t\"survive 20 games \\nwithout dying!\",\n\t\"In an escape map, \\nsurvive after having panicked\",\n\t\"Be the only human to\\nsurvive an escape map!\",\n\t\"Be the only human to\\nsurvive a regular zombie map!\",\n\t\"Accumulate 50 escapes\",\n\t\"Accumulate 100 escapes\"\n\t};\n\nstr Achievements_icons[ACHV_NUMBER] = {\n\t\"ACHV01\",\n\t\"ACHV02\",\n\t\"ACHV03\",\n\t\"ACHV04\",\n\t\"ACHV05\",\n\t\"ACHV20\",\n\t\"ACHV06\",\n\t\"ACHV07\",\n\t\"ACHV08\",\n\n\t\"ACHV09\",\n\t\"ACHV10\",\n\t\"ACHV11\",\n\t\"ACHV12\",\n\t\"ACHV13\",\n\t\"ACHV15\",\n\t\"ACHV01\",\n\t\"ACHV06\",\n\t\"ACHV07\",\n\t\"ACHV08\",\n\n\t\"ACHV18\",\n\t\"ACHV18\",\n\t\"ACHV20\",\n\t\"ACHV21\",\n\t\"ACHV21\",\n\t\"ACHV23\",\n\t\"ACHV24\",\n\t};\n\nfunction int CryptNumber(int num, int key, int type)\n{\n\treturn (num+key*key+3)*(6+type);\n}\n\nfunction int DecryptNumber(int code, int key, int type)\n{\n\t// Cheat checking\n\tif(code%(6+type) != 0)\n\t\treturn -1;\n\n\treturn code/(6+type)-key*key-3;\n}\n\nfunction void identifyAchievements(void)\n{\n\tint j = 0;\n\n\tif(GetCvar(\"x_zh_global0\")==0){\n\tSetCvar(\"x_zh_global0\", random(128,255));\n\tConsoleCommand(\"archivecvar x_zh_global0\");\n\t}\n\n\t// Acquisition\n\tachv_score[0] = DecryptNumber(GetCvar(\"x_zh_global1\"), GetCvar(\"x_zh_global0\"), ACHV_TYPE_1);\n\tachv_score[1] = DecryptNumber(GetCvar(\"x_zh_global2\"), GetCvar(\"x_zh_global0\"), ACHV_TYPE_2);\n\tachv_score[2] = DecryptNumber(GetCvar(\"x_zh_global3\"), GetCvar(\"x_zh_global0\"), ACHV_TYPE_3);\n\n\t// Calcul des valeurs - décryptage\n\tfor(int i=ACHV_TYPE1_NUMB-1; i>=0; i--, j++){\n\t\tif(achv_score[0]-pow(2,i) < 0)\n\t\t\tvalues[ACHV_TYPE1_NUMB-1-j]=0;\n\t\telse{\n\t\t\tvalues[ACHV_TYPE1_NUMB-1-j]=1;\n\t\t\tachv_score[0]=achv_score[0]-pow(2,i);\n\t\t}\n\t}\n\tfor(i=ACHV_TYPE2_NUMB-1, j=0; i>=0; i--, j++){\n\t\tif(achv_score[1]-pow(2,i) < 0)\n\t\t\tvalues[ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB-1-j]=0;\n\t\telse{\n\t\t\tvalues[ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB-1-j]=1;\n\t\t\tachv_score[1]=achv_score[1]-pow(2,i);\n\t\t}\n\t}\n\tfor(i=ACHV_TYPE3_NUMB-1, j=0; i>=0; i--, j++){\n\t\tif(achv_score[2]-pow(2,i) < 0)\n\t\t\tvalues[ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB+ACHV_TYPE3_NUMB-1-j]=0;\n\t\telse{\n\t\t\tvalues[ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB+ACHV_TYPE3_NUMB-1-j]=1;\n\t\t\tachv_score[2]=achv_score[2]-pow(2,i);\n\t\t}\n\t}\n\n\t// Cheat checking\n\tif(achv_score[0] || achv_score[1] || achv_score[2]){\n\t\tfor(i=0; i<ACHV_NUMBER; i++)\n\t\t\tvalues[i]=0;\n\t\twriteAchievements();\n\t}\n\n}\n\nfunction void writeAchievements(void)\n{\n\tint cvar1_value = 0;\n\tint cvar2_value = 0;\n\tint cvar3_value = 0;\n\n\tif(GetCvar(\"x_zh_global0\")==0){\n\t\tSetCvar(\"x_zh_global0\", random(128,255));\n\t\tConsoleCommand(\"archivecvar x_zh_global0\");\n\t}\n\n\tfor(int i=0; i<ACHV_TYPE1_NUMB; i++){\n\t\tcvar1_value=cvar1_value+values[i]*pow(2, i);\n\t}\n\n\tfor(i=ACHV_TYPE1_NUMB; i<ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB; i++){\n\t\tcvar2_value=cvar2_value+values[i]*pow(2, i-ACHV_TYPE1_NUMB);\n\t}\n\n\tfor(i=ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB; i<ACHV_TYPE1_NUMB+ACHV_TYPE2_NUMB+ACHV_TYPE3_NUMB; i++){\n\t\tcvar3_value=cvar3_value+values[i]*pow(2, i-ACHV_TYPE1_NUMB-ACHV_TYPE2_NUMB);\n\t}\n\n\tSetCvar(\"x_zh_global1\", CryptNumber(cvar1_value, GetCvar(\"x_zh_global0\"), ACHV_TYPE_1));\n\tSetCvar(\"x_zh_global2\", CryptNumber(cvar2_value, GetCvar(\"x_zh_global0\"), ACHV_TYPE_2));\n\tSetCvar(\"x_zh_global3\", CryptNumber(cvar3_value, GetCvar(\"x_zh_global0\"), ACHV_TYPE_3));\n\tConsoleCommand(\"archivecvar x_zh_global1\");\n\tConsoleCommand(\"archivecvar x_zh_global2\");\n\tConsoleCommand(\"archivecvar x_zh_global3\");\n\n}\n\nfunction int CryptProgress(int num, int key, int type)\n{\n\treturn (num+9)*(key+type);\n}\n\nfunction int DecryptProgress(int code, int key, int type)\n{\n\tif(key==0)\n\t\treturn 0;\n\n\tif(code%(key+type) != 0 || code==0)\n\t\treturn 0;\n\n\treturn code/(key+type)-9;\n}\n\nfunction void identifyProgress(void)\n{\n\tint key = GetCvar(\"x_zh_pro0\");\n\tprogress[PROGRESS_INFECTS] = DecryptProgress(GetCvar(\"x_zh_pro1\"), key, PROGRESS_INFECTS);\n\tprogress[PROGRESS_KILLS] = DecryptProgress(GetCvar(\"x_zh_pro2\"), key, PROGRESS_KILLS);\n\tprogress[PROGRESS_ESCAPES] = DecryptProgress(GetCvar(\"x_zh_pro3\"), key, PROGRESS_ESCAPES);\n\tprogress[PROGRESS_JACKSKILLS] = DecryptProgress(GetCvar(\"x_zh_pro4\"), key, PROGRESS_JACKSKILLS);\n\tprogress[PROGRESS_SSGKILLS] = DecryptProgress(GetCvar(\"x_zh_pro5\"), key, PROGRESS_SSGKILLS);\n\tprogress[PROGRESS_FIREFIGHT] = DecryptProgress(GetCvar(\"x_zh_pro6\"), key, PROGRESS_FIREFIGHT);\n\n}\n\nfunction void writeProgress(void)\n{\n\tint key = random(128, 255);\n\tSetCvar(\"x_zh_pro0\", key);\n\tSetCvar(\"x_zh_pro1\", CryptProgress(min(progress[PROGRESS_INFECTS], \t\t3000), \tkey, PROGRESS_INFECTS));\n\tSetCvar(\"x_zh_pro2\", CryptProgress(min(progress[PROGRESS_KILLS], \t\t3000), \tkey, PROGRESS_KILLS));\n\tSetCvar(\"x_zh_pro3\", CryptProgress(min(progress[PROGRESS_ESCAPES],\t\t3000), \tkey, PROGRESS_ESCAPES));\n\tSetCvar(\"x_zh_pro4\", CryptProgress(min(progress[PROGRESS_JACKSKILLS], \t3000),\tkey, PROGRESS_JACKSKILLS));\n\tSetCvar(\"x_zh_pro5\", CryptProgress(min(progress[PROGRESS_SSGKILLS], \t3000), \tkey, PROGRESS_SSGKILLS));\n\tSetCvar(\"x_zh_pro6\", CryptProgress(min(progress[PROGRESS_FIREFIGHT], \t3000), \tkey, PROGRESS_FIREFIGHT));\n\tConsoleCommand(\"archivecvar x_zh_pro0\");\n\tConsoleCommand(\"archivecvar x_zh_pro1\");\n\tConsoleCommand(\"archivecvar x_zh_pro2\");\n\tConsoleCommand(\"archivecvar x_zh_pro3\");\n\tConsoleCommand(\"archivecvar x_zh_pro4\");\n\tConsoleCommand(\"archivecvar x_zh_pro5\");\n\tConsoleCommand(\"archivecvar x_zh_pro6\");\n}\n\nfunction int checkSecurity(void)\n{\n\tbool bot_counter=0;\n\n\tif(DISABLE_SECURITY)\n\t\treturn SECURITY_SUCCESS;\n\n\tfor(int k=0; k<32; k++)\n\t{\n\t\tif(PlayerIsBot(k)){\n\t\t\tbot_counter=true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif(GetCvar(\"sv_cheats\") || GetCvar(\"survival\")==0 || bot_counter)\t\t// || PlayerCount()==1)\n\t\treturn SECURITY_FAIL;\n\n\treturn SECURITY_SUCCESS;\n}\n\n// For achievements that have to be triggered locally\nScript 799 (int achievement_number) NET\n{\n\tif(!CheckInventory(\"potentialAchievement\"))\n\t\tterminate;\n\n\tTakeInventory(\"potentialAchievement\", 1);\n\n\tAcs_ExecuteAlways(800, 0, PlayerNumber(), achievement_number, 0);\n}\n\n// For server sided achievements\nScript 800 (int who, int achievement_number)\n{\n\tSetActivator(PLAYER_TID+who);\n\n\tGiveInventory(\"hasEarnedAchievement\", 1);\n\n\tAcs_ExecuteAlways(801, 0, achievement_number, 0, 0);\n}\n\n/* Determines whether the achievement has already been unlocked or not */\nScript 801 (int achievement_number) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tif(values[achievement_number]==0) {\n\t\tSetCvar (\"x_achievementnumber\", achievement_number);\n\t\tConsoleCommand (\"puke -802 $x_achievementnumber\");\n\t}\n\n\telse\n\t\tConsoleCommand (\"puke 804\");\n\n}\n\n/* The Achievements script */\nScript 802 (int achievement_number) NET\n{\n\n\t// Cheats checking\n\tif(!CheckInventory(\"hasEarnedAchievement\"))\n\t\tterminate;\n\n\tif(checkSecurity()==SECURITY_FAIL)\n\t\tterminate;\n\n\tTakeInventory(\"hasEarnedAchievement\", 1);\n\n\t// Plays a sound\n\tActivatorSound(\"achievement/unlocked\", 100);\n\n\t// Small box - clientsided\n\tAcs_ExecuteAlways(814, 0, achievement_number, true, 0);\n\n\t// Tells everyone\n\tSetFont(\"CONFONT\");\n\tHudMessageBold(n:0, s:\" \\cJhas unlocked\\n\\cd\", s:Achievements_list[achievement_number];\n\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 899, CR_WHITE, ACHV_TXT_XPOS, ACHV_TXT_YPOS, 5.0, 0.5);\n\n\t// Update Cvars\n\tAcs_ExecuteAlways(806, 0, achievement_number, 0, 0);\n\n}\n\n\tint page_number = 1;\n\tint page_needed = 2;\n\n\tbool achv_alreadyshown[ACHV_NUMBER];\n\tint achv_upcoming[PROGRESS_TOTAL_NUMBER];\n\tint achv_upcoming_numb[PROGRESS_TOTAL_NUMBER] = {0, 0, 0, 20, 5, 15};\n\tstr achv_upcoming_img[PROGRESS_TOTAL_NUMBER] = {\n\t\t\"ACHV06-N\",\n\t\t\"ACHV06-N\",\n\t\t\"ACHV23-N\",\n\t\t\"ACHV09-N\",\n\t\t\"ACHV10-N\",\n\t\t\"ACHV12-N\"\n\t};\n\n/* Displays achievements */\nScript 803 (int show) NET CLIENTSIDE\n{\n\tint counter=0;\n\tint counter_progress=0;\n\tint display_space=0;\n\tint i;\n\n\tif(!PlayerInGame(PlayerNumber())){\n\t\tidentifyAchievements();\n\t\tidentifyProgress();\n\t}\n\n\tif(show)\n\t{\n\n\t\t// Affichage du background\n\t\tSetHudSize(640, 480, 0);\n\t\tSetFont(\"ACHV_BKD\");\n\t\tHudmessage(s:\"A\";\n\t\t\t\tHUDMSG_PLAIN, 898, CR_RED, 0.5, 0.5, 0.0);\n\t\tSetHudSize(0, 0, 0);\n\n\t\t// Counts how many achievements have been unlocked\n\t\tfor(i=0; i<ACHV_NUMBER; i++)\n\t\t\tif(values[i]) counter++;\n\n\t\t\t// Display\n\t\t\tif(counter>18)\n\t\t\t\tpage_needed = 4;\n\n\t\t\telse if(counter>9)\n\t\t\t\tpage_needed = 3;\n\n\t\t\telse\n\t\t\t\tpage_needed = 2;\n\n\t\t\tif(page_number!=page_needed)\n\t\t\t{\n\t\t\t\t// No achievement yet\n\t\t\t\tif(counter==0){\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudmessage(s:\"No achievement unlocked yet.\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 897, CR_WHITE, 0.5, 0.15, 0.0);\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSetHudSize(640, 480, 0);\n\n\t\t\t\t\tfor(i=0; i<ACHV_NUMBER && display_space<9; i++) //----------------------------------------- 1 page pleine = 9 achv\n\t\t\t\t\t\tif(values[i] && achv_alreadyshown[i]==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSetFont(Achievements_icons[i]);\n\n\t\t\t\t\t\t\tHudmessage(s:\"A\";\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-3*display_space, CR_RED, 218.1, 65.1+38.0*display_space, 0.0);\n\n\t\t\t\t\t\t\tSetFont(\"CONFONT\");\n\t\t\t\t\t\t\tHudmessage(s:Achievements_list[i];\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-1-3*display_space, CR_RED, 258.1, 65.1+38.0*display_space, 0.0);\n\n\t\t\t\t\t\t\tHudmessage(s:Achievements_description[i];\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-2-3*display_space, CR_WHITE, 258.1, 73.1+38.0*display_space, 0.0);\n\t\t\t\t\t\t\tdisplay_space++;\n\n\t\t\t\t\t\t\t// Several pages trick\n\t\t\t\t\t\t\tachv_alreadyshown[i]=1;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Upcoming achievements\n\t\t\telse if(page_number==page_needed)\n\t\t\t{\n\n\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\tHudmessage(s:\"In progress\";\n\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 860, CR_WHITE, 0.5, 0.12, 0.0);\n\t\t\t\t// Clears page number\n\t\t\t\tfor(i=0; i<ACHV_NUMBER; i++){\n\t\t\t\t\tachv_alreadyshown[i]=0;\n\t\t\t\t\tachv_upcoming[i]=0;\n\t\t\t\t}\n\n\t\t\t\t// Counts how many achv are in progress\n\n\t\t\t\t// infections\n\t\t\t\tif(progress[PROGRESS_INFECTS] && progress[PROGRESS_INFECTS]<100){\n\t\t\t\t\tachv_upcoming[PROGRESS_INFECTS] = ACHV_INFECT_MILE1;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_INFECTS]=100;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\telse if(progress[PROGRESS_INFECTS] && progress[PROGRESS_INFECTS]<500){\n\t\t\t\t\tachv_upcoming[PROGRESS_INFECTS] = ACHV_INFECT_MILE2;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_INFECTS]=500;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\telse if(progress[PROGRESS_INFECTS] && progress[PROGRESS_INFECTS]<1000){\n\t\t\t\t\tachv_upcoming[PROGRESS_INFECTS] = ACHV_INFECT_MILE3;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_INFECTS]=1000;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\t// Kills\n\t\t\t\tif(progress[PROGRESS_KILLS] && progress[PROGRESS_KILLS]<30){\n\t\t\t\t\tachv_upcoming[PROGRESS_KILLS] = ACHV_KILL_MILE1;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_KILLS]=30;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\telse if(progress[PROGRESS_KILLS] && progress[PROGRESS_KILLS]<100){\n\t\t\t\t\tachv_upcoming[PROGRESS_KILLS] = ACHV_KILL_MILE2;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_KILLS]=100;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\telse if(progress[PROGRESS_KILLS] && progress[PROGRESS_KILLS]<250){\n\t\t\t\t\tachv_upcoming[PROGRESS_KILLS] = ACHV_KILL_MILE3;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_KILLS]=250;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\t// escapes\n\t\t\t\tif(progress[PROGRESS_ESCAPES] && progress[PROGRESS_ESCAPES]<50){\n\t\t\t\t\tachv_upcoming[PROGRESS_ESCAPES] = ACHV_OTHER_MILE1;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_ESCAPES]=50;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\telse if(progress[PROGRESS_ESCAPES] && progress[PROGRESS_ESCAPES]<100){\n\t\t\t\t\tachv_upcoming[PROGRESS_ESCAPES] = ACHV_OTHER_MILE2;\n\t\t\t\t\tachv_upcoming_numb[PROGRESS_ESCAPES]=100;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\t// jacksgun kills\n\t\t\t\tif(progress[PROGRESS_JACKSKILLS] && progress[PROGRESS_JACKSKILLS]<20){\n\t\t\t\t\tachv_upcoming[PROGRESS_JACKSKILLS] = ACHV_KILL_PIRATE;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\t// SSG kills\n\t\t\t\tif(progress[PROGRESS_SSGKILLS] && progress[PROGRESS_SSGKILLS]<5){\n\t\t\t\t\tachv_upcoming[PROGRESS_SSGKILLS] = ACHV_KILL_SSG;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\t\t\t\t// Firefighter\n\t\t\t\tif(progress[PROGRESS_FIREFIGHT] && progress[PROGRESS_FIREFIGHT]<15){\n\t\t\t\t\tachv_upcoming[PROGRESS_FIREFIGHT] = ACHV_KILL_EFFICIENT;\n\t\t\t\t\tcounter_progress++;\n\t\t\t\t}\n\n\t\t\t\t// No achievement in progress\n\t\t\t\tif(counter_progress==0)\n\t\t\t\t\t{\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudmessage(s:\"Currently no achievement in progress.\";\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 897, CR_WHITE, 0.5, 0.15, 0.0);\n\t\t\t\t\t}\n\t\t\t\t// At least one achievement in progress\n\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\tSetHudSize(640, 480, 0);\n\n\t\t\t\t\tfor(i=0, display_space=0; i<PROGRESS_TOTAL_NUMBER; i++)\n\t\t\t\t\t\tif(achv_upcoming[i])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSetFont(achv_upcoming_img[i]);\n\n\t\t\t\t\t\t\tHudmessage(s:\"A\";\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-3*display_space, CR_RED, 218.1, 65.1+38.0*display_space, 0.0);\n\n\t\t\t\t\t\t\tSetFont(\"CONFONT\");\n\t\t\t\t\t\t\tHudmessage(s:Achievements_list[achv_upcoming[i]];\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-1-3*display_space, CR_RED, 258.1, 65.1+38.0*display_space, 0.0);\n\n\t\t\t\t\t\t\tHudmessage(d:progress[i], s:\" / \", d:achv_upcoming_numb[i];\n\t\t\t\t\t\t\t\t\t\tHUDMSG_PLAIN, 896-2-3*display_space, CR_WHITE, 258.1, 73.1+38.0*display_space, 0.0);\n\t\t\t\t\t\t\tdisplay_space++;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\tSetHudSize(0, 0, 0);\n\n\t\t// Display total\n\t\tSetFont(\"BIGFONT\");\n\t\tHudmessage(s:\"Total : \", d:counter, s:\" / \", d:ACHV_NUMBER;\n\t\t\t\tHUDMSG_PLAIN, 824, CR_WHITE, 0.5, 0.85, 0.0);\n\n\t\t// Page number\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(d:page_number, s:\"/\", d:page_needed;\n\t\t\t\tHUDMSG_PLAIN, 823, CR_WHITE, 0.65, 0.1, 0.0);\n\n\t\tpage_number=1+page_number%page_needed;\n\n\t}\n\n\telse {\n\t\t// Supprime l'affichage à l'écran\n\t\tfor(i=0; i<79; i++)\n\t\t\tHudMessage(s:\" \"; HUDMSG_PLAIN, 820+i, CR_GOLD, 0.5, 0.5, 1.0);\n\t}\n\n}\n\n/* This acheivement has already been unlocked */\nScript 804 (void) NET\n{\n\tTakeInventory(\"hasEarnedAchievement\", 1);\n}\n\nScript 805 Enter CLIENTSIDE\n{\n\tidentifyAchievements();\n\tidentifyProgress();\n\tConsoleCommand(\"puke 820\");\n}\n\nScript 806 (int achievement_number) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tvalues[achievement_number]=1;\n\n\twriteAchievements();\n\twriteProgress();\n}\n\nScript 809 (int who, int progress_number)\n{\n\tSetActivator(PLAYER_TID+who);\n\n\tGiveInventory(\"potentialAchievement\", 1);\n\n\tAcs_executeAlways(808, 0, progress_number, 0, 0);\n}\n\n// Kills, infections, escapes\nScript 808 (int which) CLIENTSIDE\n{\n\tbool new_achv_unlocked = false;\n\n\tif(checkSecurity()==SECURITY_FAIL)\n\t\tterminate;\n\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tswitch(which)\n\t{\n\t\tcase PROGRESS_INFECTS:\tprogress[PROGRESS_INFECTS]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_INFECTS]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_INFECTS, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_INFECTS]==100){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_INFECT_MILE1);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_INFECTS]==500){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_INFECT_MILE2);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_INFECTS]==1000){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_INFECT_MILE3);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\tcase PROGRESS_KILLS:\tprogress[PROGRESS_KILLS]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_KILLS]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_KILLS, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_KILLS]==30){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_MILE1);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_KILLS]==100){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_MILE2);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_KILLS]==250){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_MILE3);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\tcase PROGRESS_ESCAPES:\tprogress[PROGRESS_ESCAPES]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_ESCAPES]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_ESCAPES, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_ESCAPES]==50){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_OTHER_MILE1);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_ESCAPES]==100){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_OTHER_MILE2);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\tcase PROGRESS_JACKSKILLS:\tprogress[PROGRESS_JACKSKILLS]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_JACKSKILLS]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_JACKSKILLS, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_JACKSKILLS]==20){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_PIRATE);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\tcase PROGRESS_SSGKILLS:\tprogress[PROGRESS_SSGKILLS]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_SSGKILLS]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_SSGKILLS, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_SSGKILLS]==5){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_SSG);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\tcase PROGRESS_FIREFIGHT:progress[PROGRESS_FIREFIGHT]++;\n\t\t\t\t\t\t\t\tif(progress[PROGRESS_FIREFIGHT]==1){\n\t\t\t\t\t\t\t\t\tAcs_ExecuteAlways(814, 0, PROGRESS_FIREFIGHT, 0, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(progress[PROGRESS_FIREFIGHT]==15){\n\t\t\t\t\t\t\t\t\tSetCvar (\"x_achievementnumber\", ACHV_KILL_EFFICIENT);\n\t\t\t\t\t\t\t\t\tConsoleCommand (\"puke -799 $x_achievementnumber\");\n\t\t\t\t\t\t\t\t\tnew_achv_unlocked = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t}\n\n\t// Takes away the potentialachievement item\n\tif(new_achv_unlocked==false)\n\t\tConsoleCommand(\"puke 810\");\n\n}\n\nScript 810 (void) NET\n{\n\tTakeInventory(\"potentialAchievement\", 1);\n}\n\n// Vérifications en fin de round\nScript 811 (void)\n{\n\tint counter = 0;\n\tint who = 0;\n\tint i;\n\t//test param\n\t//int dum = 0;\n\n\tfor(i=0; i<32; i++) {\n\n\t\tif(CheckActorInventory(PLAYER_TID+i, \"RoundNumber\")==10)\n\t\t\tAcs_ExecuteAlways(800, 0, i, ACHV_OTHER_HARDTOKILL1, 0);\n\n\t\telse if(CheckActorInventory(PLAYER_TID+i, \"RoundNumber\")==20)\n\t\t\tAcs_ExecuteAlways(800, 0, i, ACHV_OTHER_HARDTOKILL2, 0);\n\n\t\tif(ACS_ExecuteWithResult(934, i, 0, 0)==1) {\n\n\t\t\tAcs_ExecuteAlways(809, 0, i, PROGRESS_ESCAPES, 0);\n\n\t\t\tif(CheckActorInventory(PLAYER_TID+i, \"hasalreadypanicked\") && !CheckActorInventory(PLAYER_TID+i, \"PanicSpeed\"))\n\t\t\t\tAcs_ExecuteAlways(800, 0, i, ACHV_OTHER_PANICWIN, 0);\n\t\t}\n\n\t}\n\n\t// Only survivor\n\tif(numberofhumans > 5 && !respawn_triggered) {\n\t\t//dum += 1;\n\t\tfor(i=0; i<32; i++) {\n\t\t\tif(PlayerInGame(i) && CheckActorInventory(PLAYER_TID+i, \"humanmaker\")) {\n\t\t\t\tcounter++;\n\t\t\t\twho=i;\n\t\t\t\t//dum += 100;\n\t\t\t}\n\t\t}\n\t\tif( counter == 1 ) {\n\t\t\t//dum += 4;\n\t\t\tif(ACS_ExecuteWithResult(933, 0, 0, 0)==ZE_GAME)\n\t\t\t\tAcs_ExecuteAlways(800, 0, who, ACHV_OTHER_ONLYSURVZE, 0);\n\n\t\t\telse\n\t\t\t\tAcs_ExecuteAlways(800, 0, who, ACHV_OTHER_ONLYSURVZM, 0);\n\t\t}\n\t}\n\n\t// write progress on disk\n\tfor(int k=0; k<32; k++)\n\t{\n\t\tif(PlayerInGame(k)) {\n\t\t\tSetActivator(PLAYER_TID+k);\n\t\t\tAcs_ExecuteAlways(813, 0);\n\t\t}\n\t}\n\n\t// debug\n\t/*\n\tHudMessageBold(s:\"debug mode\\n#######\\n\",\n\t\t\t s:\"humans : \", d:numberofhumans,\n\t\t\t s:\"\\nhum survivors : \", d:counter,\n\t\t\t s:\"\\nlast : \", d:who,\n\t\t\t s:\"\\ndum : \", d:dum;\n\t\t\t HUDMSG_PLAIN | HUDMSG_LOG, 0, 21, 0.05, 0.05, 0.0);\n\t*/\n}\n\nScript 812 DEATH\n{\n\tAcs_ExecuteAlways(813, 0);\n}\n\nScript 813 (void) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tdelay(5);\n\twriteProgress();\n}\n\n// Displays achievements in a small box\nScript 814 (int img_number, int real_achievement) CLIENTSIDE\n{\n\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tint queue_pos = ACS_ExecuteWithResult(815, 0, 0, 0);\n\n\tif(real_achievement)\n\t\t{\n\t\t// Displays the achievement image\n\t\tSetHudSize(640, 480, 0);\n\n\t\tSetFont(Achievements_icons[img_number]);\n\t\tHudmessage(s:\"A\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED, 603.1, 450.1-54.0*queue_pos, 5.0, 0.5);\n\n\t\tSetHudSize(0, 0, 0);\n\n\t\t// text\n\t\tSetFont(\"CONFONT\");\n\t\tHudMessage(s:\"Achievement\\n unlocked!\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_GOLD, 1.0, 0.93-0.12*queue_pos, 5.0, 0.5);\n\n\t\t}\n\n\telse\n\t\t{\n\t\t// Displays the achievement image\n\t\tSetHudSize(640, 480, 0);\n\n\t\tSetFont(achv_upcoming_img[img_number]);\n\t\tHudmessage(s:\"A\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED, 603.1, 450.1-54.0*queue_pos, 5.0, 0.5);\n\n\t\tSetHudSize(0, 0, 0);\n\n\t\t// text\n\t\tSetFont(\"CONFONT\");\n\t\tHudMessage(s:\"Achievement\\nin progress!\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 1.0, 0.93-0.12*queue_pos, 5.0, 0.5);\n\n\t\t}\n\n\t// Background\n\tSetHudSize(640, 480, 0);\n\n\tSetFont(\"ACHV_BK2\");\n\tHudmessage(s:\"A\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED, 0.1, 0.1-54.0*queue_pos, 5.0, 0.5);\n\n\tSetHudSize(0, 0, 0);\n\n}\n\n// Queued achievements script\nbool achv_queue[4] = {0, 0, 0, 0};\n\nScript 815 (void) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tfor(int i=0; i<4; i++)\n\t\tif(achv_queue[i]==false)\n\t\t\tbreak;\n\n\tSetResultValue(i);\n\n\tachv_queue[i] = true;\n\tdelay(35*5);\n\tachv_queue[i] = false;\n}"
},
{
"source": "pk3",
"name": "Source/ADMIN.txt",
"contents": "#library \"admin\"\n#Include \"Zcommon.acs\"\n#Include \"CONST.acs\"\n\nbool AdminPlayer[32];\n\n// ------------HUDMESSAGES TIDs-----------------\n// 801 : commands lists\n// 802 : close menu\n// 809 : infect\n// 810 : give\n// 811 : cure\n// 812 : timer changer\n// 813 : bonus for all\n\nScript 600 (int player) // Admins identification\n{\n\tif(PlayerInGame(player))\n\t\t{\n\t\tSetActivator(600+player);\n\t\tAdminPlayer[PlayerNumber()]=1;\n\n\t\t// Tells everyone\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(n:0, s:\" \\cJis an Admin\"; HUDMSG_PLAIN, 0, CR_WHITE, 0.5, 0.05, 3.0);\n\n\t\t// Console log\n\t\tLog(n:0, s:\" has been identified as an Admin Player.\");\n\n\t\t//Displays menu\n\t\tACS_Execute(601, 0, 0, 0, 0);\n\t\t}\n}\n\nScript 601 (void) // Commands menu\n{\n\tSetFont(\"SMALLFONT\");\n\tHudMessage(s:\"Commands List\\n----------------\";\n\t\t\tHUDMSG_PLAIN, 801, CR_GOLD, 0.94, 0.5, 0.0);\n\tHudMessage(s:\"Close Menu (602)\";\n\t\t\tHUDMSG_PLAIN, 802, CR_GREY, 0.94, 0.56, 0.0);\n\tHudMessage(s:\"Infect Player (609 + (id))\";\n\t\t\tHUDMSG_PLAIN, 809, CR_RED, 0.94, 0.59, 0.0);\n\tHudMessage(s:\"Give weapon (610 (TYPE) + (id))\";\n\t\t\tHUDMSG_PLAIN, 810, CR_GREEN, 0.94, 0.62, 0.0);\n\tHudMessage(s:\"Cure Player (611 + (id))\";\n\t\t\tHUDMSG_PLAIN, 811, CR_BLUE, 0.94, 0.65, 0.0);\n\tHudMessage(s:\"+-seconds on timer (613 + seconds) (ZM only)\";\n\t\t\tHUDMSG_PLAIN, 812, CR_ORANGE, 0.94, 0.68, 0.0);\n\tHudMessage(s:\"Bonus item for everyone (612)\";\n\t\t\tHUDMSG_PLAIN, 813, CR_LIGHTBLUE, 0.94, 0.71, 0.0);\n}\n\nScript 602 (void) NET // Close menu\n{\n\tIf(AdminPlayer[PlayerNumber()])\n\t\tfor(int i=1; i<14; i++)\n\t\t\tHudMessage(s:\" \"; HUDMSG_PLAIN, 800+i, CR_GOLD, 0.5, 0.5, 1.0);\n}\n\nScript 609 (int x) NET // Infect a player\n{\n\tIf(AdminPlayer[PlayerNumber()])\n\t\t{\n\t\tSetActivator(600+x);\n\t\tAcs_executeAlways(153, 0, 254, 0, 0);\n\t\t}\n}\n\nScript 610 (int x, int y) NET\n{\n\tIf(AdminPlayer[PlayerNumber()]) {\n\t\tswitch(x){\n\t\t\t\tcase 1 : if(CheckActorInventory(600+y, \"humanmaker\"))\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"DoomRadio\", 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2 : if(CheckActorInventory(600+y, \"humanmaker\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"HuntingShotgun\", 1);\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"Machinegun\", 1);\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"SniperRifle\", 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3 : if(CheckActorInventory(600+y, \"humanmaker\"))\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"FireGrenade\", 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tcase 4 : if(CheckActorInventory(600+y, \"humanmaker\"))\n\t\t\t\t\t\t\tGiveActorInventory(600+y, \"JacksGun\", 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tdefault :Print(s:\"DoomRadio(1), HSG-CG-SNP(2), FIREG(3), JCKSGUN(4) \");\n\t\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n}\n\nScript 611 (int x) NET // Cure a player\n{\n\tIf(AdminPlayer[PlayerNumber()])\n\t\t{\n\t\tSetActivator(600+x);\n\t\tAcs_executeAlways(163, 0, 0, 0, 0);\n\t\t}\n}\n\nScript 612 (void) NET\t// Bonus for everyone\n{\n\tIf(AdminPlayer[PlayerNumber()])\n\t{\n\t\t// Tells everyone\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(n:0, s:\" \\cJgave everyone a nice present!\"; HUDMSG_FADEOUT, 0, CR_WHITE, 0.5, 0.05, 3.0, 2.0);\n\n\t\tfor(int i=0; i<32; i++)\n\t\t\tif(PlayerInGame(i))\n\t\t\t\tAcs_executeAlways(164, 0, i, BONUS_CLASSIC, 0);\n\t}\n}\n\nScript 614 (int Gone) DISCONNECT\n{AdminPlayer[Gone]=False;}"
},
{
"source": "pk3",
"name": "Source/COMMON.txt",
"contents": "#library \"common\"\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"FUNCTION.acs\"\n#Import \"RADIO.acs\"\n#Import \"STATS.acs\"\n\n/* Variable for clientsided scripts */\nint ConsolePlayer = 99;\n\n/* Generic Game variables */\nint Game_info_mode;\nint Game_info_safetimer;\nint Game_info_finishtimer;\nint Game_info_zombie_tid = 0;\nint Game_info_zombie_2_tid = 0;\n\nint numberofplayers = 0;\nint numberofhumans = 0;\nint numberofquitters = 0;\n\n/* Needed to improve random selection */\nglobal int 1:last_zombie_tid;\nglobal int 2:last_zombie_2_tid;\nglobal int 3:global_time;\n\n/* Mission failed ? */\nbool respawn_triggered = false;\n\n/* Generic Arrays */\nbool Infected[32];\nbool Dead[32];\nint Infectors[32];\nint Killers[32];\n\n/* AFK cleanup */\nbool IsNotAfk[32];\n\n/* Inventory cleanup */\nbool inventories_cleaned = false;\n\n// ------------VICTORY MESSAGES-----------------\n\nstr HWinBig[2] = { \"\\chHuman \\cjteam \\chwins!\",\n\t\t\t\t\t\"\\chHuman \\cjteam \\chowns!\"};\nstr HWinSmall[2] = {\"Humanity is safe...for now!\",\n\t\t\t\t\t\"Don't mess with humans, bro!\"};\n\nstr ZWinBig[2] = { \"\\cgZombie \\cjteam \\cgwins!\",\n\t\t\t\t\t\"\\cgZombie \\cjteam \\cgrocks!\"};\nstr ZWinSmall[2] = {\"They have taken over the world!\",\n\t\t\t\t\t\"Earth is their new home now!\"};\n\nstr FailBig[2] = { \"Mission failed!\",\n\t\t\t\t\t\"Fission mailed!\"};\nstr FailSmall[2] = {\"How did you manage to do this?\",\n\t\t\t\t\t\"What the...?!\"};\n\n/* PANIC MODE */\nScript 963 (void) NET {\n\n\tif( !PlayerInGame(PlayerNumber()) )\n\t\tterminate;\n\n\tswitch(Game_info_mode)\n\t\t{\n\t\t\tcase MODE_SAFE:\n\t\t\t\tPrint(s:\"There is nothing to be afraid of!\");\n\n\t\t\tbreak;\n\n\t\t\tcase MODE_PLAYING:\n\t\t\t\tif(CheckInventory(\"humanmaker\"))\n\t\t\t\t{\n\t\t\t\t\t\tif(CheckInventory(\"hasalreadypanicked\"))\n\t\t\t\t\t\t\tPrint(s:\"You have already panicked this round!\");\n\n\t\t\t\t\t\telse if (CheckInventory(\"SprintEnergy\") != 1000)\n\t\t\t\t\t\t\tPrint(s:\"Panic mode requires a full energy bar\");\n\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Do things\n\t\t\t\t\t\t\tTakeInventory(\"SprintEnergy\", 1000);\n\t\t\t\t\t\t\tTakeInventory(\"EnergyDrinkEffect\", 1);\n\t\t\t\t\t\t\tGiveInventory(\"hasalreadypanicked\", 1);\n\t\t\t\t\t\t\tGiveInventory(\"PanicSpeed\", 1);\n\n\t\t\t\t\t\t\tTakeInventory(\"HuntingShotgun\", 1);\n\t\t\t\t\t\t\tTakeInventory(\"MachineGun\", 1);\n\t\t\t\t\t\t\tTakeInventory(\"SniperRifle\", 1);\n\t\t\t\t\t\t\tTakeInventory(\"DoubleShotgun\", 1);\n\n\t\t\t\t\t\t\tTakeInventory(\"ProtectionVest\", 1);\n\n\t\t\t\t\t\t\tGiveInventory(\"Handgun\", 1);\n\n\t\t\t\t\t\t\tAcs_executeAlways(964, 0);\t// Panic end sound\n\n\t\t\t\t\t\t\t// Tells everyone\n\t\t\t\t\t\t\tHudmessageBold(n:0, s:\" \\cJhas panicked!\";\n\t\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 110, CR_WHITE, 0.5, 0.43, 2.0);\n\n\t\t\t\t\t\t\t// Incr stats\n\t\t\t\t\t\t\tIncrementStatistic(STATS_PANIC_TIMES);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if(CheckInventory(\"zombiemaker\"))\n\t\t\t\t\tPrint(s:\"Zombies are fearless!\");\n\n\t\t\tbreak;\n\n\t\t\tcase MODE_FINISHED:\n\t\t\t\tPrint(s:\"The round is over!\");\n\n\t\t\tbreak;\n\t\t}\n}\n\nScript 964 (void)\t// The panic end sound\n{\n\twhile(CheckInventory(\"PanicSpeed\"))\n\t\tdelay(35);\n\n\t// Panic has ended\n\tif(PlayerInGame(PlayerNumber()) && !CheckInventory(\"zombiemaker\"))\n\t\tActivatorSound(\"sound/panicend\", 127);\n}\n\nScript 154 (void) // Random zombie sounds\n{\n\t\tDelay(35*random(15, 30));\n\t\twhile(PlayerInGame(PlayerNumber()) && Infected[PlayerNumber()]) {\n\t\t\tActivatorSound(\"zombie/sound\", 100);\n\t\t\tDelay(35*random(30, 60));\n\t\t}\n}\n\nstr slash_pic[4] = {\"SLASH\", \"SLASH2\", \"SLASH3\", \"SLASH4\"};\n\nScript 157 (void) CLIENTSIDE // Scratch Effect\n{\n\n\tSetHudSize(320, 200, 0);\n\tSetFont(slash_pic[random(0,3)]);\n\tHudmessage(s:\"A\"; HUDMSG_FADEINOUT, 0, CR_RED, 0.5, 0.5, 0.1, 0.2, 1.5);\n\tFadeTo (255, 0, 0, 1.0, 0.2);\n\tDelay(7);\n\tFadeTo (255, 0, 0, 0.0, 0.2);\n}\n\nScript 161 (void) // Updating the killers counter\n{\n\tSetActivator(-1);\n\tfor(int i = 0; i < 32; i++)\n\t{\n\t\tif(CheckActorInventory(PLAYER_TID+i,\"zkilled\"))\n\t\t{\n\t\t\tIncrementStatistic(STATS_KILLS);\n\t\t\tKillers[i]++;\n\t\t\tTakeActorInventory(PLAYER_TID+i, \"zkilled\", 1);\n\n\t\t\t// Give special item\n\t\t\tif(Killers[i]%2==0) Acs_ExecuteAlways(164, 0, i, BONUS_SUPER, 0);\n\n\t\t\t// Achievements\n\t\t\tif(Killers[i]==5)\n\t\t\t\tAcs_ExecuteAlways(800, 0, i, ACHV_KILL_DIGGER, 0);\n\n\t\t\telse if(Killers[i]==8)\n\t\t\t\tAcs_ExecuteAlways(800, 0, i, ACHV_KILL_PRIEST, 0);\n\n\t\t\tSetActivator(PLAYER_TID+i);\n\n\t\t\tAcs_ExecuteAlways(809, 0, i, PROGRESS_KILLS, 0);\n\n\t\t\tif(CheckWeapon(\"JacksGun\"))\n\t\t\t\tAcs_ExecuteAlways(809, 0, i, PROGRESS_JACKSKILLS, 0);\n\n\t\t\telse if(CheckWeapon(\"DoubleShotgun\"))\n\t\t\t\tAcs_ExecuteAlways(809, 0, i, PROGRESS_SSGKILLS, 0);\n\n\t\t\telse if(CheckWeapon(\"Handgun\"))\n\t\t\t\tAcs_ExecuteAlways(800, 0, PlayerNumber(), ACHV_KILL_PISTOL, 0);\n\t\t}\n\t}\n}\n\nScript 162 (void) // Human gets killed by zombie\n{\n\t\tSetFont(\"SMALLFONT\");\n\t\tPrintBold(s:\"\\cTSomeone has just been scratched to death by a Zombie!\");\n\t\tIncrementStatistic(STATS_HUM_KILLED_BY_ZOMB);\n}\n\nscript 820(void) NET CLIENTSIDE\n{\n\tConsolePlayer = PlayerNumber();\n}\n\nScript 991 Enter\n{\n\t\t// Assign TIDs\n\t\tThing_ChangeTID(0, PLAYER_TID+PlayerNumber());\n\t\t// Take away zombie stuff\n\t\tTakeInventory(\"ZombieImmune\", 1);\n\t\tTakeInventory(\"zombiemaker\", 1);\n\t\t// Human stuff\n\t\tGiveInventory(\"humanmaker\", 1);\n\t\tGiveInventory(\"HumanImmune\", 1);\n\t\t// Clears out weapons\n\t\tTakeInventory(\"Zombie_\", 1);\n\t\tGiveInventory(\"HuntingShotgun\", 1);\n\t\tGiveInventory(\"MachineGun\", 1);\n\t\tTakeInventory(\"ChaingunRage\", 800);\n\t\tGiveInventory(\"SniperRifle\", 1);\n\t\tGiveInventory(\"FireGrenade\", 1);\n\t\t//sprint\n\t\tGiveInventory(\"SprintEnergy\", 1000);\n}\n\nScript 992 RESPAWN // this script shouldn't be triggered in survival mode - except when mission fails or when telefrags occur at start\n{\n\t\tif(Game_info_mode == MODE_PLAYING)\n\t\t\trespawn_triggered = true;\n\n\t\tAcs_ExecuteAlways(991, 0, 0, 0, 0);\n}\n\nScript 993 Enter\t// Chaingun cooldown\n{\n\twhile(1)\n\t{\n\t\tif(!CheckWeapon(\"MachineGun\"))\n\t\t\tTakeInventory(\"ChaingunRage\", 105);\n\t\tdelay(35);\n\t}\n\n}\n\nScript 994 DEATH\n{\n\tint dead_number = PlayerNumber();\n\n\tDead[dead_number] = True;\n\n\t// Achievements\n\tbool burnt_ach=false;\n\tbool sky_achv=false;\n\n\tif(GetActorVelZ(0)<-1500000)\n\t\tsky_achv=true;\n\n\tif(CheckInventory(\"IsBurning\"))\n\t\tburnt_ach=true;\n\n\tif((burnt_ach || sky_achv) && SetActivatorToTarget(0)) {\n\n\t\tint who = PlayerNumber();\n\n\t\tif(dead_number != who && who != -1) {\n\n\t\t\tif(sky_achv && !CheckWeapon(\"Zombie_\"))\n\t\t\t\tAcs_ExecuteAlways(800, 0, who, ACHV_KILL_MIDAIR, 0);\n\n\t\t\tif(burnt_ach)\n\t\t\t{\n\t\t\t\tAcs_ExecuteAlways(809, 0, who, PROGRESS_FIREFIGHT, 0);\n\t\t\t\t// Incr stats\n\t\t\t\tIncrementStatistic(STATS_BURN_Z_KILLS);\n\t\t\t}\n\n\t\t}\n\t}\n\n}\n\nScript 996 (int Gone) DISCONNECT\n{\n\t// Quitters\n\tif(Game_info_mode == MODE_PLAYING)\n\t\tnumberofquitters++;\n\n\t// variables for random selection\n\tif(PLAYER_TID+Gone == Game_info_zombie_tid) last_zombie_tid = 0;\n\telse if(PLAYER_TID+Gone == Game_info_zombie_2_tid) last_zombie_2_tid = 0;\n\n\t// Checks if the last human/zombie leaves the game\n\tif(Dead[Gone] == False && ZombieCounter()<=0 && Game_info_mode==MODE_PLAYING)\n\t\t{\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessagebold(s:\"The last zombie ragequits.\"; 0, 104, CR_RED, 0.5, 0.37, 7.0);\n\t\tAmbientSound(\"announcer/rq\",127);\n\t\tIncrementStatistic(STATS_LAST_ZOMB_RQ_TIMES);\n\t\t}\n\n\telse if(Dead[Gone] == False && HumanCounter()<=0 && Game_info_mode==MODE_PLAYING)\n\t\t{\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessagebold(s:\"The humans got scared and left the game.\"; 0, 104, CR_BLUE, 0.5, 0.37, 7.0);\n\t\tIncrementStatistic(STATS_LAST_HUM_RQ_TIMES);\n\t\t}\n}\n\nScript 997 (void) // The syringe script\n{\n\tint act_tid = ActivatorTID();\n\n\tif(Game_info_mode != MODE_PLAYING){\n\t\tprint(s:\"This item cannot be used now\");\n\t\tterminate;\n\t}\n\n\tif(act_tid==Game_info_zombie_tid || act_tid==Game_info_zombie_2_tid){\n\t\tprint(s:\"Initial zombies cannot be cured\");\n\t\tterminate;\n\t}\n\n\tIncrementStatistic(STATS_SYRINGES_USED);\n\n\tif(CheckInventory(\"humanmaker\")){\n\t\tAcs_ExecuteAlways(153, 0, 255, 0, 0);\n\t\tterminate;\n\t}\n\n\tif(CheckInventory(\"zombiemaker\"))\n\t\tAcs_ExecuteAlways(163, 0, 0, 0, 0);\n\n\tTakeInventory(\"Syringe\", 1);\n\tGiveInventory(\"SyringeUsed\", 1);\n\n\tSetFont(\"SMALLFONT\");\n\tHudmessage(s:\"Note : You can no longer get infected.\";\n\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_LIGHTBLUE, 0.5, 0.03, 3.0, 1.0);\n}\n\n// Afk cleanup ----------------------------------------------------\n\nScript 860 Enter\t// The AFK-cleaup script\n{\n\tdelay(35+PlayerNumber());\n\n\twhile(IsNotAfk[PlayerNumber()] == false) {\n\n\t\tint vx = GetActorVelX(0);\n\t\tint vy = GetActorVelY(0);\n\t\tint vz = GetActorVelZ(0);\n\n\t\tif( vx || vy || vz ) {\n\t\t\tIsNotAfk[PlayerNumber()] = true;\n\t\t\t//print(s:\"no longer afk\");\n\t\t}\n\n\t\tdelay(5);\n\t}\n\n}\n\nScript 862 OPEN\n{\n\tint Afk_delay = GetCvar(\"zh_afk_cleanup_time\");\n\n\tif(Afk_delay == -1)\t// Feature is disabled\n\t\tterminate;\n\n\telse if(Afk_delay == 0)\t// Set a default value\n\t{\n\t\tAfk_delay = AFK_DEFAULT_CLEANUP_TIME;\n\t}\n\n\telse if(Afk_delay < AFK_MINIMAL_CLEANUP_TIME)\t// Cannot be lower than AFK_MINIMAL_CLEANUP_TIME\n\t{\n\t\tAfk_delay = AFK_MINIMAL_CLEANUP_TIME;\n\t}\n\n\tdelay(35*Afk_delay);\n\n\tfor(int i=0; i<32; i++)\n\t{\n\t\tif(!PlayerIsBot(i) && PlayerInGame(i) && IsNotAfk[i] == false && (PLAYER_TID+i) != Game_info_zombie_tid && (i+PLAYER_TID) != Game_info_zombie_2_tid)\n\t\t{\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudMessageBold(n:i+1, s:\" \\cDwas moved to spectators due to inactivity.\";\n\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_GREEN, 0.5, 0.03, 2.0, 1.0);\n\n\t\t\tSetActivator(PLAYER_TID+i);\n\t\t\tAcs_ExecuteAlways(863, 0);\n\t\t}\n\t}\n}\n\nScript 863 (void) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tConsoleCommand(\"Spectate\");\n}\n\n// This fixes CHANGEMAP oddities\nscript 646 UNLOADING\n{\n\t// Fixes CHANGEMAP oddities\n\tif(!inventories_cleaned)\n\t\tResetInventories();\n\n\t// Save timer value for next random\n\tglobal_time = Timer();\n}"
},
{
"source": "pk3",
"name": "Source/CONST.txt",
"contents": "#library \"const\"\n\n// Must not be touched\n#define PLAYER_TID 600\n\n#define ZM_INFECTION 0\n#define ZE_INFECTION 1\n\n#define ZM_GAME 0\n#define ZE_GAME 1\n\n#define ONE_ZOMBIE_GAME 0\n#define TWO_ZOMBIES_GAME 1\n\n#define MODE_SAFE 0\n#define MODE_PLAYING 1\n#define MODE_FINISHED 2\n\n// Touch all you want\n#define ZE_FIRST_ZOMBIE_HEALTH 5000\n#define ZE_OTHER_ZOMBIE_MAX_HEALTH 1500\n#define ZE_OTHER_ZOMBIE_MIN_HEALTH 750\n\n#define ZM_FIRST_ZOMBIE_HEALTH 4000\n#define ZM_OTHER_ZOMBIE_MAX_HEALTH 2000\n#define ZM_OTHER_ZOMBIE_MIN_HEALTH 1000\n\n#define ZOMBIE_SPEED 1.25\n\n// Do not touch\n#define ZE_OTHER_ZOMBIE_HEALTH_RANGE\t(ZE_OTHER_ZOMBIE_MAX_HEALTH - ZE_OTHER_ZOMBIE_MIN_HEALTH)\n#define ZM_OTHER_ZOMBIE_HEALTH_RANGE\t(ZM_OTHER_ZOMBIE_MAX_HEALTH - ZM_OTHER_ZOMBIE_MIN_HEALTH)\n\n// Achievements - do not touch\n#define ACHV_INFECT_EPIDEMIC\t \t0\n#define ACHV_INFECT_TIMING\t\t\t1\n#define ACHV_INFECT_PREVENTIVE\t\t2\n#define ACHV_INFECT_SYRINGE \t\t3\n#define ACHV_INFECT_MADNESS \t\t4\n#define ACHV_INFECT_ROADRUNNER\t\t5\n#define ACHV_INFECT_MILE1 \t\t\t6\n#define ACHV_INFECT_MILE2\t\t\t7\n#define ACHV_INFECT_MILE3\t\t\t8\n\n#define ACHV_KILL_PIRATE\t\t\t9\n#define ACHV_KILL_SSG\t\t\t\t10\n#define ACHV_KILL_PISTOL\t\t\t11\n#define ACHV_KILL_EFFICIENT\t\t\t12\n#define ACHV_KILL_MIDAIR\t\t\t13\n#define ACHV_KILL_DIGGER\t\t\t14\n#define ACHV_KILL_PRIEST\t\t\t15\n#define ACHV_KILL_MILE1\t\t\t\t16\n#define ACHV_KILL_MILE2\t\t\t\t17\n#define ACHV_KILL_MILE3\t\t\t\t18\n\n#define ACHV_OTHER_HARDTOKILL1\t\t19\n#define ACHV_OTHER_HARDTOKILL2\t\t20\n#define ACHV_OTHER_PANICWIN\t\t\t21\n#define ACHV_OTHER_ONLYSURVZE\t\t22\n#define ACHV_OTHER_ONLYSURVZM\t\t23\n#define ACHV_OTHER_MILE1\t\t\t24\n#define ACHV_OTHER_MILE2\t\t\t25\n\n#define PROGRESS_TOTAL_NUMBER 6\n\n#define PROGRESS_INFECTS \t0\n#define PROGRESS_KILLS \t\t1\n#define PROGRESS_ESCAPES \t2\n#define PROGRESS_JACKSKILLS 3\n#define PROGRESS_SSGKILLS \t4\n#define PROGRESS_FIREFIGHT \t5\n\n#define SECURITY_FAIL \t\t0\n#define SECURITY_SUCCESS \t1\n\n// Afk cleanup - touch all you want\n#define\tAFK_DEFAULT_CLEANUP_TIME\t25\n#define\tAFK_MINIMAL_CLEANUP_TIME\t5\n\n// Serverside stats - do not touch\n#define STATS_NUMBER\t\t\t\t20\n\n#define\tSTATS_KILLS\t\t\t\t\t0\n#define\tSTATS_INFECTIONS\t\t\t1\n#define\tSTATS_PANIC_TIMES\t\t\t2\n#define\tSTATS_BURN_Z_KILLS\t\t\t3\n#define\tSTATS_ZM_HUMANS_WINS\t\t4\n#define\tSTATS_ZE_HUMANS_WINS\t\t5\n#define\tSTATS_ZM_ZOMBIE_WINS\t\t6\n#define\tSTATS_ZE_ZOMBIE_WINS\t\t7\n#define\tSTATS_BONUSES_GOTTEN\t\t8\n#define\tSTATS_BONUSES_USED_BY_HUM\t9\n#define\tSTATS_BONUSES_USED_BY_ZOMB\t10\n#define\tSTATS_LAST_HUM_RQ_TIMES\t\t11\n#define\tSTATS_LAST_ZOMB_RQ_TIMES\t12\n#define\tSTATS_FULLSERVER_TIMES\t\t13\n#define\tSTATS_UNUSUALS_GOTTEN\t\t14\n#define\tSTATS_SYRINGES_USED\t\t\t15\n#define\tSTATS_HUM_KILLED_BY_ZOMB\t16\n#define\tSTATS_HCROSS_USED\t\t\t17\n#define\tSTATS_CRYSTAL_USED\t\t\t18\n#define\tSTATS_EMPTY_BONUSES\t\t\t19\n\n// Bonus items - do not touch\n#define BONUS_CLASSIC\t0\n#define BONUS_SUPER\t\t1"
},
{
"source": "pk3",
"name": "Source/FUNCTION.txt",
"contents": "#library \"function\"\n#Include \"Zcommon.acs\"\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n\nfunction int ZombieCounter (void)\n{\n int counter = 0;\n for(int i=0; i<32; i++) {\n if(PlayerInGame(i) && CheckActorInventory(PLAYER_TID+i, \"zombiemaker\")) counter++;\n }\n return counter;\n}\n\nfunction int HumanCounter (void)\n{\n int counter = 0;\n for(int i=0; i<32; i++) {\n if(PlayerInGame(i) && CheckActorInventory(PLAYER_TID+i, \"humanmaker\")) counter++;\n }\n return counter;\n}\n\nfunction void CheckInventories(void)\n{\n\tfor(int i=0; i<32; i++) {\n\t\tif(PlayerInGame(i) && CheckActorInventory(PLAYER_TID+i, \"humanmaker\") && CheckActorInventory(PLAYER_TID+i, \"zombiemaker\")) {\n\n\t\t\tif( CheckActorInventory(PLAYER_TID+i, \"HuntingShotgun\") || CheckActorInventory(PLAYER_TID+i, \"Handgun\") )\n\t\t\t\tTakeActorInventory(PLAYER_TID+i, \"zombiemaker\", 1);\n\n\t\t\telse\n\t\t\t\tTakeActorInventory(PLAYER_TID+i, \"humanmaker\", 1);\n\n\t\t}\n\t}\n}\n\nfunction void ZombieSelection(bool secondary, bool game_type)\n{\n\tbool ignore_newrandom = false;\n\n\t// needed to avoid a certain type of inf loops - im too lazy to explain\n\tif( PlayerCount()<=2 && last_zombie_tid && last_zombie_2_tid )\n\t\tignore_newrandom = true;\n\n\t// Selects one zombie\n\tWhile(1) {\n\t\tGame_info_zombie_tid = CustomRandom(PLAYER_TID, PLAYER_TID+31);\n\t\tif(PlayerInGame(Game_info_zombie_tid-PLAYER_TID)\n\t\t&& CheckactorInventory(Game_info_zombie_tid, \"humanmaker\")\n\t\t&& ( ignore_newrandom || !(Game_info_zombie_tid==last_zombie_tid || Game_info_zombie_tid==last_zombie_2_tid)) )\n\t\t{\n\t\t\t\t//infects player\n\t\t\t\tBecomesZombie(Game_info_zombie_tid-PLAYER_TID, true, game_type, 0);\n\n\t\t\t\t//tells everyone\n\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(n:(Game_info_zombie_tid-PLAYER_TID+1), s:\" \\cghas been turned into a zombie!\";\n\t\t\t\t\t\t\tHUDMSG_FADEOUT, 101, CR_RED, 0.5, 0.4, 1.0, 2.0);\n\n\t\t\t\tInfected[Game_info_zombie_tid-PLAYER_TID] = True;\n\n\t\t\t\tif(game_type==ZE_GAME)\n\t\t\t\t{\n\t\t\t\t\t// Teleports the zombie to another location\n\t\t\t\t\tTeleportOther(Game_info_zombie_tid, 500, 0);\n\t\t\t\t\t// Give immunities\n\t\t\t\t\tGiveActorInventory(Game_info_zombie_tid, \"ZeTempProtection\", 1);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Selects another zombie if needed\n\tWhile(secondary) {\n\t\tGame_info_zombie_2_tid = CustomRandom(PLAYER_TID, PLAYER_TID+31);\n\t\tif(PlayerInGame(Game_info_zombie_2_tid-PLAYER_TID)\n\t\t&& CheckactorInventory(Game_info_zombie_2_tid, \"humanmaker\")\n\t\t&& !(Game_info_zombie_2_tid==last_zombie_tid || Game_info_zombie_2_tid==last_zombie_2_tid) )\n\t\t{\n\t\t\t\t//infects player\n\t\t\t\tBecomesZombie(Game_info_zombie_2_tid-PLAYER_TID, true, game_type, 0);\n\n\t\t\t\t//tells everyone\n\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(n:(Game_info_zombie_2_tid-PLAYER_TID+1), s:\" \\cghas been turned into a zombie!\";\n\t\t\t\t\t\t\tHUDMSG_FADEOUT, 111, CR_RED, 0.5, 0.37, 1.0, 2.0);\n\n\t\t\t\tInfected[Game_info_zombie_2_tid-PLAYER_TID] = True;\n\n\t\t\t\tif(game_type==ZE_GAME)\n\t\t\t\t{\n\t\t\t\t\t// Teleports the zombie to another location\n\t\t\t\t\tTeleportOther(Game_info_zombie_2_tid, 501, 0);\n\t\t\t\t\t// Give immunities\n\t\t\t\t\tGiveActorInventory(Game_info_zombie_2_tid, \"ZeTempProtection\", 1);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tlast_zombie_tid = Game_info_zombie_tid;\n\tlast_zombie_2_tid = Game_info_zombie_2_tid;\n}\n\nfunction void ResetInventories(void) {\n\tfor(int i = 0; i < 32; i++) {\n\t\t// Player properties\n\t\tSetActorProperty(PLAYER_TID+i, APROP_HEALTH, 100);\n\t\tSetActorProperty(PLAYER_TID+i, APROP_SpawnHealth, 100);\n\t\tSetActorProperty(PLAYER_TID+i, APROP_SPEED, 1.0);\n\n\t\t// Take out weapons\n\t\tTakeActorInventory(PLAYER_TID+i, \"Handgun\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"Zombie_\", 1);\n\n\t\t// Give proper weapons\n\t\tGiveActorInventory(PLAYER_TID+i, \"HuntingShotgun\", 1);\n\t\tGiveActorInventory(PLAYER_TID+i, \"HShotgunClipIn\", 8);\n\t\tGiveActorInventory(PLAYER_TID+i, \"MachineGun\", 1);\n\t\tGiveActorInventory(PLAYER_TID+i, \"SniperRifle\", 1);\n\t\tGiveActorInventory(PLAYER_TID+i, \"FireGrenade\", 1);\n\n\t\t// Remove inventory items\n\t\tTakeActorInventory(PLAYER_TID+i, \"Flare\", 10);\n\n\t\t// Reset stamina\n\t\tTakeActorInventory(PLAYER_TID+i, \"hasalreadypanicked\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"isSprinting\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"PanicSpeed\", 1);\n\t\tGiveActorInventory(PLAYER_TID+i, \"SprintEnergy\", 1000);\n\n\t\t// Teleportations\n\t\tTakeActorInventory(PLAYER_TID+i, \"teleportations\", 3);\n\n\t\t// Becomes human again\n\t\tGiveActorInventory(PLAYER_TID+i, \"HumanImmune\", 1);\n\t\tGiveActorInventory(PLAYER_TID+i, \"humanmaker\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"zombiemaker\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"ZombieImmune\", 1);\n\n\t\t// Take away special abilities & upgrades\n\t\tTakeActorInventory(PLAYER_TID+i, \"SpeedUpgrade\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"FatigueSpeed\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"VulnarabilityUpgrade\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"WeaponsUpgrade\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"JumpUpgrade\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"Syringe\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"EnergyDrinkEffect\", 1);\n\n\t\t// Achievements related items\n\t\tTakeActorInventory(PLAYER_TID+i, \"SyringeUsed\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"IsBurning\", 32);\n\n\t\t// Unusual related items\n\t\tTakeActorInventory(PLAYER_TID+i, \"UnusualUsed\", 1);\n\t\tTakeActorInventory(PLAYER_TID+i, \"UnusualProtection\", 1);\n\t}\n}\n\nfunction void BecomesZombie(int who, bool first, bool infection_type, int hpfactor) {\n\tint health_to_give;\n\n\tSetActivator(600+who);\n\n\t// Spawns red fire only for secondary zombies\n\tif(!first) SpawnProjectile(600+who, \"InfectionFire\", 0, 0, 0, 0, 0);\n\n\t// Give proper makers\n\tTakeInventory(\"humanmaker\", 1);\n\tGiveInventory(\"zombiemaker\", 1);\n\n\t// Immunities\n\tTakeInventory(\"HumanImmune\", 1);\n\tGiveInventory(\"ZombieImmune\", 1);\n\n\t// Take away human weapons\n\tTakeInventory(\"FireGrenade\", 1);\n\tTakeInventory(\"Handgun\", 1);\n\tTakeInventory(\"HuntingShotgun\", 1);\n\tTakeInventory(\"MachineGun\", 1);\n\tTakeInventory(\"SniperRifle\", 1);\n\tTakeInventory(\"JacksGun\", 1);\n\tTakeInventory(\"DoomRadio\", 1);\n\n\t// Give zombie weapon(s)\n\tGiveInventory(\"Zombie_\", 1);\n\n\t// Remove useless inventory items\n\tTakeInventory(\"Flare\", 10);\n\n\t// Take away sprint\n\tTakeInventory(\"PanicSpeed\", 1);\n\n\t// Take away special items\n\tTakeInventory(\"DoubleShotgun\", 1);\n\tTakeInventory(\"QuadShotgun\", 1);\n\tTakeInventory(\"ProtectionVest\", 1);\n\tTakeInventory(\"Syringe\", 1);\n\tTakeInventory(\"FatigueSpeed\", 1);\n\tTakeInventory(\"EnergyDrinkEffect\", 1);\n\n\t// Set player properties\n\tSetActorProperty(0, APROP_SPEED, ZOMBIE_SPEED);\n\tif(first)\n\t{\n\t\tif(infection_type==ZM_INFECTION)\thealth_to_give = ZM_FIRST_ZOMBIE_HEALTH;\n\t\telse\t\t\t\t\t\t\t\thealth_to_give = ZE_FIRST_ZOMBIE_HEALTH;\n\t}\n\telse\n\t{\n\t\tif(infection_type==ZM_INFECTION)\thealth_to_give = ZM_OTHER_ZOMBIE_MIN_HEALTH + FixedMul(hpfactor, ZM_OTHER_ZOMBIE_HEALTH_RANGE);\n\t\telse\t\t\t\t\t\t\t\thealth_to_give = ZE_OTHER_ZOMBIE_MIN_HEALTH + FixedMul(hpfactor, ZE_OTHER_ZOMBIE_HEALTH_RANGE);\n\t}\n\tSetActorProperty(0, APROP_HEALTH, health_to_give);\n\tSetActorProperty(0, APROP_SpawnHealth, health_to_give);\n\n\t// Zombie sounds\n\tActivatorSound(\"zombie/wake\", 127);\n\tACS_ExecuteAlways(154, 0, 0, 0, 0);\n\n\t// Slash effect & grenade drop\n\tif(!first) {\n\t\t// Slash effect\n\t\tAcs_ExecuteAlways(157, 0, 0, 0, 0);\n\n\t\t// Drops a grenade if the player has one\n\t\tif(CheckInventory(\"HandGrenadeAmmo\")) {\n\t\t\tSpawn(\"FakeGrenade\",GetActorX(0),GetActorY(0),GetActorFloorZ(0)+8);\n\t\t\tTakeInventory(\"HandGrenadeAmmo\", 1);\n\t\t}\n\t}\n\n}\n\nfunction void BecomesHuman(void) {\n\n\tActivatorSound(\"bonus/esunaga\", 100);\n\tSpawnProjectile(0, \"CureZombieFire\", 0, 0, 0, 0, 0);\n\n\t// Cleaning out inventory\n\tTakeInventory(\"zombiemaker\", 1);\n\tGiveInventory(\"humanmaker\", 1);\n\n\t// Give human weapons\n\tGiveInventory(\"HuntingShotgun\", 1);\n\tGiveInventory(\"MachineGun\", 1);\n\tGiveInventory(\"SniperRifle\", 1);\n\tGiveInventory(\"HumanImmune\", 1);\n\n\t// Take away Zombie stuff\n\tTakeInventory(\"Zombie_\", 1);\n\tTakeInventory(\"ZombieImmune\", 1);\n\n\t// Sets properties\n\tSetActorProperty(0, APROP_HEALTH, 100);\n\tSetActorProperty(0, APROP_SpawnHealth, 100);\n\tSetActorProperty(0, APROP_SPEED, 1.0);\n\n\t// Take away special abilities\n\tTakeInventory(\"SpeedUpgrade\", 1);\n\tTakeInventory(\"VulnarabilityUpgrade\", 1);\n\tTakeInventory(\"WeaponsUpgrade\", 1);\n\tTakeInventory(\"JumpUpgrade\", 1);\n\n\t// Tells it to everyone\n\tSetFont(\"SMALLFONT\");\n\tHudmessagebold(n:0, s:\" \\cJhas miraculously been \\cNcured!\";\n\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 101, CR_BLUE, 0.5, 0.4, 1.0, 2.0);\n\n}\n\n// Stats functions\nfunction void IncrementStatistic(int stat)\n{\n\tAcs_ExecuteAlways(772, 0, stat, 0, 0);\n}\n\nfunction void SaveStatistics(void)\n{\n\tAcs_ExecuteAlways(771, 0);\n}\n\n// This function handles division by zero\nfunction int CustomDivide(int num, int den)\n{\n\tif(den == 0)\n\t\treturn 0;\n\treturn num/den;\n}\n\n// Math functions\n\nfunction int pow (int x, int n)\n{\n\tint y = 1;\n\twhile (n-- > 0) y *= x;\n\treturn y;\n}\n\nfunction int min (int a, int b)\n{\n\tif (a < b)\n\t\treturn a;\n\n\treturn b;\n}\n\nfunction int max (int a, int b)\n{\n\tif (a > b)\n\t\treturn a;\n\n\treturn b;\n}\n\n// New random function based on the current TICK\n// enable \"zh_old_random\" to use old method\nfunction int CustomRandom (int imin, int imax)\n{\n\tif( GetCvar(\"zh_old_random\") )\n\t\treturn random(imin, imax);\n\n\treturn (global_time+Timer()+random(imin,imax))%(imax-imin+1)+imin;\n\n}"
},
{
"source": "pk3",
"name": "Source/MODCVARS.txt",
"contents": "/////////////////////////////////////////////////\n//-----------------------------------------------\n//| /\\ /\\ /|_ _ MODCVARS (v2)\\_ /\\_ _/|\n//|/ |_/ \\/ |_/ \\_/ \\_/ \\_/ |_| |\n//-----------------------------------------------\n//a library for writing cvars in ACS.\n//===============================================\n//\n// SetCvar(str name, int value)\n//\n// - name: the name of the cvar, MUST start with \"x_\" prefix.\n// - value: value for the cvar, can range -999,999 to 999,999.\n//\n// Example:\n//\n// SetCvar(\"x_orangesleft\", 5);\n// GetCvar(\"x_orangesleft\"); //Returns 5\n//\n// You may only use letters and numbers and \"_\" for the cvar name.\n//\n//\n// Credits go to VirgiL for figuring out a way to\n// write strings with ConsoleCommand, I wouldn't\n// have realized how to do this otherwise!\n//\n// -worst\n//////////////////////////////////////////////////\n\n#library \"modcvars\"\n#include \"zcommon.acs\"\n\nfunction bool SetCvar(str name,int value)\n{\n\n //----------//\n //Cvar name //\n //----------//\n ConsoleCommand(\"set setcvar_str x_\"); //prefix must be added here, or bad things will happen.\n\n int len = StrLen(name);\n For(int i = 0; i < len; i++)\n {\n int chr = GetChar(name,i);\n\n if(\n ( (i == 0) && (chr != 'x' && chr != 'X') ) ||\n ( (i == 1) && (chr != '_') )\n )\n {\n PrintBold(s:\"SetCVAR: names must start with a x_ prefix!\");\n return FALSE; //failed\n }\n\n if(i < 2) continue; //dont add prefix twice.\n\n switch(chr)\n {\n case '0': ConsoleCommand(\"eval + $setcvar_str 0 setcvar_str\"); break;\n case '1': ConsoleCommand(\"eval + $setcvar_str 1 setcvar_str\"); break;\n case '2': ConsoleCommand(\"eval + $setcvar_str 2 setcvar_str\"); break;\n case '3': ConsoleCommand(\"eval + $setcvar_str 3 setcvar_str\"); break;\n case '4': ConsoleCommand(\"eval + $setcvar_str 4 setcvar_str\"); break;\n case '5': ConsoleCommand(\"eval + $setcvar_str 5 setcvar_str\"); break;\n case '6': ConsoleCommand(\"eval + $setcvar_str 6 setcvar_str\"); break;\n case '7': ConsoleCommand(\"eval + $setcvar_str 7 setcvar_str\"); break;\n case '8': ConsoleCommand(\"eval + $setcvar_str 8 setcvar_str\"); break;\n case '9': ConsoleCommand(\"eval + $setcvar_str 9 setcvar_str\"); break;\n case 'A': ConsoleCommand(\"eval + $setcvar_str A setcvar_str\"); break;\n case 'B': ConsoleCommand(\"eval + $setcvar_str B setcvar_str\"); break;\n case 'C': ConsoleCommand(\"eval + $setcvar_str C setcvar_str\"); break;\n case 'D': ConsoleCommand(\"eval + $setcvar_str D setcvar_str\"); break;\n case 'E': ConsoleCommand(\"eval + $setcvar_str E setcvar_str\"); break;\n case 'F': ConsoleCommand(\"eval + $setcvar_str F setcvar_str\"); break;\n case 'G': ConsoleCommand(\"eval + $setcvar_str G setcvar_str\"); break;\n case 'H': ConsoleCommand(\"eval + $setcvar_str H setcvar_str\"); break;\n case 'I': ConsoleCommand(\"eval + $setcvar_str I setcvar_str\"); break;\n case 'J': ConsoleCommand(\"eval + $setcvar_str J setcvar_str\"); break;\n case 'K': ConsoleCommand(\"eval + $setcvar_str K setcvar_str\"); break;\n case 'L': ConsoleCommand(\"eval + $setcvar_str L setcvar_str\"); break;\n case 'M': ConsoleCommand(\"eval + $setcvar_str M setcvar_str\"); break;\n case 'N': ConsoleCommand(\"eval + $setcvar_str N setcvar_str\"); break;\n case 'O': ConsoleCommand(\"eval + $setcvar_str O setcvar_str\"); break;\n case 'P': ConsoleCommand(\"eval + $setcvar_str P setcvar_str\"); break;\n case 'Q': ConsoleCommand(\"eval + $setcvar_str Q setcvar_str\"); break;\n case 'R': ConsoleCommand(\"eval + $setcvar_str R setcvar_str\"); break;\n case 'S': ConsoleCommand(\"eval + $setcvar_str S setcvar_str\"); break;\n case 'T': ConsoleCommand(\"eval + $setcvar_str T setcvar_str\"); break;\n case 'U': ConsoleCommand(\"eval + $setcvar_str U setcvar_str\"); break;\n case 'V': ConsoleCommand(\"eval + $setcvar_str V setcvar_str\"); break;\n case 'W': ConsoleCommand(\"eval + $setcvar_str W setcvar_str\"); break;\n case 'X': ConsoleCommand(\"eval + $setcvar_str X setcvar_str\"); break;\n case 'Y': ConsoleCommand(\"eval + $setcvar_str Y setcvar_str\"); break;\n case 'Z': ConsoleCommand(\"eval + $setcvar_str Z setcvar_str\"); break;\n case '_': ConsoleCommand(\"eval + $setcvar_str _ setcvar_str\"); break;\n case 'a': ConsoleCommand(\"eval + $setcvar_str a setcvar_str\"); break;\n case 'b': ConsoleCommand(\"eval + $setcvar_str b setcvar_str\"); break;\n case 'c': ConsoleCommand(\"eval + $setcvar_str c setcvar_str\"); break;\n case 'd': ConsoleCommand(\"eval + $setcvar_str d setcvar_str\"); break;\n case 'e': ConsoleCommand(\"eval + $setcvar_str e setcvar_str\"); break;\n case 'f': ConsoleCommand(\"eval + $setcvar_str f setcvar_str\"); break;\n case 'g': ConsoleCommand(\"eval + $setcvar_str g setcvar_str\"); break;\n case 'h': ConsoleCommand(\"eval + $setcvar_str h setcvar_str\"); break;\n case 'i': ConsoleCommand(\"eval + $setcvar_str i setcvar_str\"); break;\n case 'j': ConsoleCommand(\"eval + $setcvar_str j setcvar_str\"); break;\n case 'k': ConsoleCommand(\"eval + $setcvar_str k setcvar_str\"); break;\n case 'l': ConsoleCommand(\"eval + $setcvar_str l setcvar_str\"); break;\n case 'm': ConsoleCommand(\"eval + $setcvar_str m setcvar_str\"); break;\n case 'n': ConsoleCommand(\"eval + $setcvar_str n setcvar_str\"); break;\n case 'o': ConsoleCommand(\"eval + $setcvar_str o setcvar_str\"); break;\n case 'p': ConsoleCommand(\"eval + $setcvar_str p setcvar_str\"); break;\n case 'q': ConsoleCommand(\"eval + $setcvar_str q setcvar_str\"); break;\n case 'r': ConsoleCommand(\"eval + $setcvar_str r setcvar_str\"); break;\n case 's': ConsoleCommand(\"eval + $setcvar_str s setcvar_str\"); break;\n case 't': ConsoleCommand(\"eval + $setcvar_str t setcvar_str\"); break;\n case 'u': ConsoleCommand(\"eval + $setcvar_str u setcvar_str\"); break;\n case 'v': ConsoleCommand(\"eval + $setcvar_str v setcvar_str\"); break;\n case 'w': ConsoleCommand(\"eval + $setcvar_str w setcvar_str\"); break;\n case 'x': ConsoleCommand(\"eval + $setcvar_str x setcvar_str\"); break;\n case 'y': ConsoleCommand(\"eval + $setcvar_str y setcvar_str\"); break;\n case 'z': ConsoleCommand(\"eval + $setcvar_str z setcvar_str\"); break;\n }\n }\n\n //-----------//\n //Cvar value //\n //-----------//\n int val = value;\n\n //Eval only returns GetCvar -usable values if the CVAR is in the range -999,999 to 999,999.\n if (val > 999999) val = 999999;\n if (val < -999999) val = -999999;\n\n ConsoleCommand(\"set setcvar_int 0\");\n\n if(val >= 524288) { ConsoleCommand(\"eval + $setcvar_int 524288 setcvar_int\"); val -= 524288; } //2^19\n if(val >= 262144) { ConsoleCommand(\"eval + $setcvar_int 262144 setcvar_int\"); val -= 262144; } //2^18\n if(val >= 131072) { ConsoleCommand(\"eval + $setcvar_int 131072 setcvar_int\"); val -= 131072; } //2^17\n if(val >= 65536) { ConsoleCommand(\"eval + $setcvar_int 65536 setcvar_int\"); val -= 65536; } //2^16\n if(val >= 32768) { ConsoleCommand(\"eval + $setcvar_int 32768 setcvar_int\"); val -= 32768; } //2^15\n if(val >= 16384) { ConsoleCommand(\"eval + $setcvar_int 16384 setcvar_int\"); val -= 16384; } //2^14\n if(val >= 8192) { ConsoleCommand(\"eval + $setcvar_int 8192 setcvar_int\"); val -= 8192; } //2^13\n if(val >= 4096) { ConsoleCommand(\"eval + $setcvar_int 4096 setcvar_int\"); val -= 4096; } //2^12\n if(val >= 2048) { ConsoleCommand(\"eval + $setcvar_int 2048 setcvar_int\"); val -= 2048; } //2^11\n if(val >= 1024) { ConsoleCommand(\"eval + $setcvar_int 1024 setcvar_int\"); val -= 1024; } //2^10\n if(val >= 512) { ConsoleCommand(\"eval + $setcvar_int 512 setcvar_int\"); val -= 512; } //2^9\n if(val >= 256) { ConsoleCommand(\"eval + $setcvar_int 256 setcvar_int\"); val -= 256; } //2^8\n if(val >= 128) { ConsoleCommand(\"eval + $setcvar_int 128 setcvar_int\"); val -= 128; } //2^7\n if(val >= 64) { ConsoleCommand(\"eval + $setcvar_int 64 setcvar_int\"); val -= 64; } //2^6\n if(val >= 32) { ConsoleCommand(\"eval + $setcvar_int 32 setcvar_int\"); val -= 32; } //2^5\n if(val >= 16) { ConsoleCommand(\"eval + $setcvar_int 16 setcvar_int\"); val -= 16; } //2^4\n if(val >= 8) { ConsoleCommand(\"eval + $setcvar_int 8 setcvar_int\"); val -= 8; } //2^3\n if(val >= 4) { ConsoleCommand(\"eval + $setcvar_int 4 setcvar_int\"); val -= 4; } //2^2\n if(val >= 2) { ConsoleCommand(\"eval + $setcvar_int 2 setcvar_int\"); val -= 2; } //2^1\n if(val >= 1) { ConsoleCommand(\"eval + $setcvar_int 1 setcvar_int\"); val -= 1; } //2^0\n\n if(val <= -524288) { ConsoleCommand(\"eval - $setcvar_int 524288 setcvar_int\"); val += 524288; } //2^19\n if(val <= -262144) { ConsoleCommand(\"eval - $setcvar_int 262144 setcvar_int\"); val += 262144; } //2^18\n if(val <= -131072) { ConsoleCommand(\"eval - $setcvar_int 131072 setcvar_int\"); val += 131072; } //2^17\n if(val <= -65536) { ConsoleCommand(\"eval - $setcvar_int 65536 setcvar_int\"); val += 65536; } //2^16\n if(val <= -32768) { ConsoleCommand(\"eval - $setcvar_int 32768 setcvar_int\"); val += 32768; } //2^15\n if(val <= -16384) { ConsoleCommand(\"eval - $setcvar_int 16384 setcvar_int\"); val += 16384; } //2^14\n if(val <= -8192) { ConsoleCommand(\"eval - $setcvar_int 8192 setcvar_int\"); val += 8192; } //2^13\n if(val <= -4096) { ConsoleCommand(\"eval - $setcvar_int 4096 setcvar_int\"); val += 4096; } //2^12\n if(val <= -2048) { ConsoleCommand(\"eval - $setcvar_int 2048 setcvar_int\"); val += 2048; } //2^11\n if(val <= -1024) { ConsoleCommand(\"eval - $setcvar_int 1024 setcvar_int\"); val += 1024; } //2^10\n if(val <= -512) { ConsoleCommand(\"eval - $setcvar_int 512 setcvar_int\"); val += 512; } //2^9\n if(val <= -256) { ConsoleCommand(\"eval - $setcvar_int 256 setcvar_int\"); val += 256; } //2^8\n if(val <= -128) { ConsoleCommand(\"eval - $setcvar_int 128 setcvar_int\"); val += 128; } //2^7\n if(val <= -64) { ConsoleCommand(\"eval - $setcvar_int 64 setcvar_int\"); val += 64; } //2^6\n if(val <= -32) { ConsoleCommand(\"eval - $setcvar_int 32 setcvar_int\"); val += 32; } //2^5\n if(val <= -16) { ConsoleCommand(\"eval - $setcvar_int 16 setcvar_int\"); val += 16; } //2^4\n if(val <= -8) { ConsoleCommand(\"eval - $setcvar_int 8 setcvar_int\"); val += 8; } //2^3\n if(val <= -4) { ConsoleCommand(\"eval - $setcvar_int 4 setcvar_int\"); val += 4; } //2^2\n if(val <= -2) { ConsoleCommand(\"eval - $setcvar_int 2 setcvar_int\"); val += 2; } //2^1\n if(val <= -1) { ConsoleCommand(\"eval - $setcvar_int 1 setcvar_int\"); val += 1; } //2^0\n\n ConsoleCommand(\"set $setcvar_str $setcvar_int\");\n ConsoleCommand(\"archivecvar $setcvar_str\"); //Make it stay in the ini after closing the game.\n\n //cleanup\n ConsoleCommand(\"unset setcvar_str\");\n ConsoleCommand(\"unset setcvar_int\");\n\n return TRUE; //success\n}"
},
{
"source": "pk3",
"name": "Source/RADIO.txt",
"contents": "#library \"radio\"\n#Include \"Zcommon.acs\"\n#encryptstrings\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n#Import \"MODCVARS.acs\"\n\n// HudMessages TIDs\n// 750 : song name\n\n// Definitions\n#define SONGS_NUMBER\t4 + 1\t// 3 songs + 1 for the level's default music\n#define RADIO_COOLDOWN\t5\n\nstr Songs_list\t[SONGS_NUMBER] = {\"*\", \"TRACK1\", \"TRACK2\", \"ROUTE2\", \"TRACK3\"};\nstr Songs_titles[SONGS_NUMBER] = {\t\"Default Level music\",\n\t\t\t\t\t\t\t\t\t\"The Cardigans - \\\"My favourite game\\\"\",\n\t\t\t\t\t\t\t\t\t\"Michael Jackson - \\\"Beat it\\\"\",\n\t\t\t\t\t\t\t\t\t\"Pirates of the Caribbean - \\\"He's a pirate\\\"\",\n\t\t\t\t\t\t\t\t\t\"Deep Purple - \\\"Smoke on the Water\\\"\"};\n\nint song_index = 0;\n\n/* The main radio scripts\n * pass 1 to play a song\n * pass anything else browse the collection\n*/\nScript 750 (int selection) CLIENTSIDE\n{\n\tif(ConsolePlayer != PlayerNumber())\n\t\tterminate;\n\n\tif(selection == 1)\n\t{\n\t\tConsoleCommand (\"puke -751 $x_radioselection\");\n\t}\n\telse\n\t{\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage(s:Songs_titles[song_index];\n\t\t\t\t\t\tHUDMSG_FADEOUT, 750, CR_YELLOW, 0.5, 0.8, 2.0, 1.0);\n\t\tSetCvar (\"x_radioselection\", song_index);\n\t\tsong_index = (song_index+1)%SONGS_NUMBER;\n\t}\n}\n\nScript 751 (int index) NET\n{\n\tif(!CheckInventory(\"DoomRadio\"))\n\t\tterminate;\n\n\tAcs_Execute(752, 0, index, 0, 0);\t// We need to do this for the cooldown to be effective\n}\n\nScript 752 (int index)\n{\n\tint who = PlayerNumber();\n\tfor(int i=0; i<32; i++)\n\t{\n\t\tif(PlayerInGame(i))\n\t\t{\n\t\t\tSetActivator(i+PLAYER_TID);\n\t\t\tAcs_ExecuteAlways(753, 0, index, who, 0);\n\t\t}\n\t}\n\tdelay(35*RADIO_COOLDOWN);\n}\n\nScript 753 (int index, int who) CLIENTSIDE\n{\n\t// Checks whether the client has the effect of radio disabled\n\tif(GetCvar(\"x_zh_disableradio\"))\n\t\tterminate;\n\n\t// Play the custom song\n\tLocalSetMusic(Songs_list[index]);\n\n\t// Prints what is played by who\n\tSetFont(\"SMALLFONT\");\n\tHudMessage(n:(who+1), s:\" \\cJis now playing \\n\\n\\cI\", s:Songs_titles[index];\n\t\t\t\t\tHUDMSG_FADEOUT, 751, CR_YELLOW, 1.5, 0.09, 2.0, 1.0);\n}\n\nScript 754 (void) NET CLIENTSIDE\n{\n\tif(GetCvar(\"x_zh_disableradio\") == false)\n\t{\n\t\tSetCvar(\"x_zh_disableradio\", 1);\n\t\tprint(s:\"Radio effect \\cGdisabled\");\n\t\tLocalSetMusic(\"*\");\n\t}\n\telse\n\t{\n\t\tSetCvar(\"x_zh_disableradio\", 0);\n\t\tprint(s:\"Radio effect \\cDenabled\");\n\t}\n\tConsoleCommand(\"archivecvar x_zh_disableradio\");\n}"
},
{
"source": "pk3",
"name": "Source/SPECIAL.txt",
"contents": "#library \"special\"\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n#Import \"FUNCTION.acs\"\n\n#define BONUSXPOS 1.5\n#define BONUSYPOS 0.03\n\n/* ITEM GIVER */\nScript 164 (int who, int type) {\n\tif(GetCvar(\"zh_disablebonus\"))\n\t\tterminate;\n\n\tIncrementStatistic(STATS_BONUSES_GOTTEN);\n\tDelay(20);\n\tSetActivator(PLAYER_TID+who);\n\n\tif( type == BONUS_CLASSIC ) {\n\t\tGiveInventory(\"BonusItem\", 1);\n\t\tLocalAmbientSound(\"bonus/acquired\", 127);\n\t}\n\telse {\n\t\tGiveInventory(\"SuperBonusItem\", 1);\n\t\tLocalAmbientSound(\"bonus/acquired2\", 127);\n\t}\n\tSetFont(\"SMALLFONT\");\n\tHudMessage(s:\"You have been awarded with a bonus item\";\n\t\t\t\tHUDMSG_FADEOUT, 703, CR_GREEN, 0.5, 0.03, 2.0, 1.0);\n}\n\n// Type = 0 (classic bonus item)\n// Type = 1 (only 'good' bonuses)\nScript 998 (int type) {\n\tif(Game_info_mode == MODE_PLAYING && !CheckInventory(\"PanicSpeed\")) {\n\t\t// Classic item\n\t\tif(type == BONUS_CLASSIC) {\n\t\t\tAcs_executeAlways(999, 0, BONUS_CLASSIC, 0, 0);\n\t\t\tTakeInventory(\"BonusItem\", 1);\n\t\t}\n\t\t// Only good bonuses\n\t\telse {\n\t\t\tAcs_executeAlways(999, 0, BONUS_SUPER, 0, 0);\n\t\t\tTakeInventory(\"SuperBonusItem\", 1);\n\t\t}\n\t}\n\telse print(s:\"This item can't be used now.\");\n}\n\n/* THE BONUS ITEMS SCRIPT */\nScript 999 (int type) {\n\tDelay(1);\n\n\tint randNumber = CustomRandom(1,100);\n\tint act_tid = ActivatorTID();\n\n\tif(!PlayerInGame(PlayerNumber()))\n\t\tterminate;\n\n\t// Bonus items for humans\n\tif(CheckInventory(\"humanmaker\")) {\n\n\t\t\t\tif(randNumber <= 15)\n\t\t\t\t\t{\n\t\t\t\t\tif(CheckInventory(\"DoubleShotgun\"))\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"DoubleShotgun\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cQDouble Barreled Shotgun!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Double Barreled Shotgun!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_DARKGREEN, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 30)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"JacksGun\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received \\cSJack's gun!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Jack's gun!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_DARKBROWN, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 45)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"KEVLEQUI\", 100);\n\t\t\t\t\tGiveInventory(\"ProtectionVest\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cMKevlar Vest!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Kevlar Vest!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_BLACK, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 60)\n\t\t\t\t\t{\n\t\t\t\t\tif(CheckInventory(\"WeaponsUpgrade\"))\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"WeaponsUpgrade\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cKweapons upgrade!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_RED, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Weapons upgraded!\\nYour weapons are 1.3x more powerful now!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_YELLOW, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 70)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"FireCrystalItem\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cFFire Crystal!!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Fire Crystal!!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_GOLD, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tIncrementStatistic(STATS_CRYSTAL_USED);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 75)\n\t\t\t\t\t{\n\t\t\t\t\tif(CheckInventory(\"hasGotUnusual\") || GetCvar(\"zh_disableunusuals\") || type == BONUS_SUPER)\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tAcs_ExecuteAlways(915, 0, 0, 0, 0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 85)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"Holycross\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cVHoly Cross!!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"\\cVHoly Cross!!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_PURPLE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tIncrementStatistic(STATS_HCROSS_USED);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 90)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"EnergyDrink\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received an \\cIEnergy drink!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"\\cIEnergy Drink!\\n\\cIDrinking it will grant you unlimited sprint for 30 seconds!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_PURPLE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 95)\n\t\t\t\t\t{\n\t\t\t\t\tif( type == BONUS_SUPER )\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"FatigueSpeed\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(s:\"Unlucky \", n:0, s:\" \\cJhas received \\cGTiredness!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Tiredness!\\n\\cGYou will run slower for 60 seconds!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_RED, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\tif(randNumber <= 105)\n\t\t\t\t\t{\n\t\t\t\t\tif(CheckInventory(\"QuadShotgun\"))\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"QuadShotgun\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cQQuad Barreled Shotgun! Awesome!!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Quad Barreled Shotgun!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_DARKGREEN, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tif( type == BONUS_SUPER )\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessage(s:\"Nothing inside!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tIncrementStatistic(STATS_EMPTY_BONUSES);\n\t\t\t\t\t}\n\t\t\t\t\tIncrementStatistic(STATS_BONUSES_USED_BY_HUM);\n\t\t}\n\n\t// Bonus items for zombies\n\telse {\n\t\t\t\tif(randNumber <= 30)\n\t\t\t\t\t{\n\t\t\t\t\t// Initial zombies cannot use syringe\n\t\t\t\t\tif(act_tid==Game_info_zombie_tid || act_tid==Game_info_zombie_2_tid)\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"Syringe\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cNSyringe!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Syringe!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_LIGHTBLUE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 50)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"SpeedUpgrade\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cIspeed increase!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"\\cISpeed Increased!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_ORANGE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 70)\n\t\t\t\t\t{\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"JumpUpgrade\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(n:0, s:\" \\cJhas received a \\cUhigh jump device!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"High Jump!\\nYou will jump higher for 90 seconds\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_DARKGREY, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 80)\n\t\t\t\t\t{\n\t\t\t\t\tif(CheckInventory(\"hasGotUnusual\") || GetCvar(\"zh_disableunusuals\") || type == BONUS_SUPER)\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tAcs_ExecuteAlways(915, 0, 0, 0, 0);\n\t\t\t\t\t}\n\n\t\t\t\telse if(randNumber <= 90)\n\t\t\t\t\t{\n\t\t\t\t\tif( type == BONUS_SUPER )\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tActivatorSound(\"bonus/pickup\", 100);\n\t\t\t\t\tGiveInventory(\"VulnerabilityUpgrade\", 1);\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessageBold(s:\"Unlucky \", n:0, s:\" \\cJhas received \\cGvulnerability!\";\n\t\t\t\t\t\t\t\t\tHUDMSG_FADEOUT, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tHudMessage(s:\"Vulnerability!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_RED, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tif( type == BONUS_SUPER )\n\t\t\t\t\t\trestart;\n\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudMessage(s:\"Nothing inside!\"; HUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_WHITE, BONUSXPOS, BONUSYPOS, 2.0, 1.0);\n\t\t\t\t\tIncrementStatistic(STATS_EMPTY_BONUSES);\n\t\t\t\t\t}\n\n\t\t\t\t\tIncrementStatistic(STATS_BONUSES_USED_BY_ZOMB);\n\t\t\t}\n\n}"
},
{
"source": "pk3",
"name": "Source/SPRINT.txt",
"contents": "#library \"sprint\"\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n\nScript 960 Enter {\n\twhile(1) {\n\t\tif(!CheckInventory(\"zombiemaker\") && !CheckInventory(\"hasalreadypanicked\") && !CheckInventory(\"isSprinting\"))\n\t\t\tGiveInventory(\"SprintEnergy\", 10);\n\t\tdelay(100);\n\t}\n}\n\nscript 961 (int run) NET {\n\n\tif( !PlayerInGame(PlayerNumber()) )\n\t\tterminate;\n\n\tif(run)\n\t{\n\t\tif(GetCvar(\"zh_disablesprint\")) {\n\t\t\tprint(s:\"Sprint is disabled on this server\");\n\t\t\tterminate;\n\t\t}\n\n\t\telse if(CheckInventory(\"humanmaker\") && Game_info_mode == MODE_PLAYING)\n\t\t{\n\t\t\tGiveInventory(\"isSprinting\", 1);\n\t\t\tSetActorProperty(0, APROP_Speed, 1.3);\n\t\t\tAcs_ExecuteAlways(962, 0, 0, 0, 0);\n\t\t}\n\n\t\telse if(CheckInventory(\"humanmaker\"))\n\t\t\tprint(s:\"There is nothing to be afraid of!\");\n\t}\n\n\telse if(GetCvar(\"zh_disablesprint\")==0)\n\t\tTakeInventory(\"isSprinting\", 1);\n}\n\nScript 962 (void) {\n\twhile(CheckInventory(\"SprintEnergy\")>10 && CheckInventory(\"isSprinting\")) {\n\t\t\tif(!CheckInventory(\"EnergyDrinkEffect\"))\n\t\t\t\tTakeInventory(\"SprintEnergy\", 40);\n\t\t\tDelay(10);\n\t}\n\tif(CheckInventory(\"humanmaker\"))\n\t\tSetActorProperty(0, APROP_Speed, 1.0);\n}"
},
{
"source": "pk3",
"name": "Source/STATS.txt",
"contents": "#library \"stats\"\n#encryptstrings\n\n#Include \"CONST.acs\"\n#Include \"Zcommon.acs\"\n#Import \"MODCVARS.acs\"\n#Import \"FUNCTION.acs\"\n\nbool StatsSentToClient[32];\n\nint Server_Statistics[STATS_NUMBER];\n\nstr Server_StatsCvars[STATS_NUMBER] = {\t\"x_zh_stats_kills\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_infections\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_panictimes\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_burningkills\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_zm_h_wins\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_ze_h_wins\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_zm_z_wins\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_ze_z_wins\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_bonuses_gotten\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_bon_usd_h\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_bon_usd_z\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_hum_rq\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_zomb_rq\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_fullserv\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_unus_gotten\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_syringes\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_h_killedby_z\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_cross_used\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_fcryst_used\",\n\t\t\t\t\t\t\t\t\t\t\"x_zh_stats_empty_bonuses\"};\n\n// When map start, get old stats values\nScript 770 OPEN\n{\n\tfor(int i=0; i<STATS_NUMBER; i++)\n\t{\n\t\tServer_Statistics[i] = GetCvar(Server_StatsCvars[i]);\n\t}\n}\n\n// Save these values\nScript 771 (void)\n{\n\tfor(int i=0; i<STATS_NUMBER; i++)\n\t{\n\t\tSetCvar(Server_StatsCvars[i], Server_Statistics[i]);\n\t}\n\tConsoleCommand(\"archivecvar x_zh_stats_kills\");\n\tConsoleCommand(\"archivecvar x_zh_stats_infections\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_rnd_played\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_rnd_played\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_h_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_h_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_z_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_z_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bonuses_gotten\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bon_usd_h\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bon_usd_z\");\n\tConsoleCommand(\"archivecvar x_zh_stats_hum_rq\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zomb_rq\");\n\tConsoleCommand(\"archivecvar x_zh_stats_fullserv\");\n\tConsoleCommand(\"archivecvar x_zh_stats_unus_gotten\");\n\tConsoleCommand(\"archivecvar x_zh_stats_syringes\");\n\tConsoleCommand(\"archivecvar x_zh_stats_h_killedby_z\");\n\tConsoleCommand(\"archivecvar x_zh_stats_cross_used\");\n\tConsoleCommand(\"archivecvar x_zh_stats_fcryst_used\");\n\tConsoleCommand(\"archivecvar x_zh_stats_empty_bonuses\");\n}\n\n// Increment stat value passed as argument\nScript 772 (int stat)\n{\n\tSetActivator(-1);\n\n\tif( stat > STATS_NUMBER-1 || stat < 0 )\n\t\tterminate;\n\n\tServer_Statistics[stat]++;\n}\n\nScript 773 (int disp)\tNET\n{\n\t// To avoid huge net traffic, stats will be sent once per map\n\tif(!StatsSentToClient[PlayerNumber()])\n\t\tfor(int i=0; i<STATS_NUMBER; i++)\n\t\t\tAcs_executeAlways(774, 0, i, Server_Statistics[i], 0);\t// Send the stats values to client\n\n\tStatsSentToClient[PlayerNumber()] = true;\n\n\t// Display\n\tAcs_ExecuteAlways(775, 0, disp, 0, 0);\n\n}\n\nScript 774 (int stat, int value) CLIENTSIDE\n{\n\tServer_Statistics[stat] = value;\n}\n\nScript 775 (int disp) CLIENTSIDE\n{\n\tdelay(1);\n\n\tif(disp)\n\t{\n\t\tSetHudSize(640, 480, 0);\n\n\t\t// Cache variables\n\t\tint used_items \t\t=\tServer_Statistics[STATS_BONUSES_USED_BY_HUM]+Server_Statistics[STATS_BONUSES_USED_BY_ZOMB];\n\t\tint unusued_items \t= \tServer_Statistics[STATS_BONUSES_GOTTEN]-used_items;\n\t\tint zm_rounds_pld\t= \tServer_Statistics[STATS_ZM_HUMANS_WINS] + Server_Statistics[STATS_ZM_ZOMBIE_WINS];\n\t\tint ze_rounds_pld\t= \tServer_Statistics[STATS_ZE_HUMANS_WINS] + Server_Statistics[STATS_ZE_ZOMBIE_WINS];\n\n\t\t\t\t// Header\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(s:\"Since server was restarted\";\n\t\t\t\tHUDMSG_PLAIN, 1500, CR_WHITE, 320.4, 159.0, 0.0);\n\t\tSetFont(\"BIGFONT\");\n\t\tHudmessage(s:\"Server Statistics\";\n\t\t\t\tHUDMSG_PLAIN, 1501, CR_RED, 320.4, 144.0, 0.0);\n\n\t\tHudmessage(s:\"General\";\n\t\t\t\tHUDMSG_PLAIN, 1502, CR_RED, 100.4, 144.0, 0.0);\n\n\t\tHudmessage(s:\"Rounds\";\n\t\t\t\tHUDMSG_PLAIN, 1503, CR_RED, 320.4, 284.0, 0.0);\n\n\t\tHudmessage(s:\"Bonuses\";\n\t\t\t\tHUDMSG_PLAIN, 1504, CR_RED, 540.4, 144.0, 0.0);\n\n\t\t// Actual stats\n\t\t// General\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(\ts:\"\\cGZombies \\cJkilled : \", \t\t\t\t\t\t\t\td:Server_Statistics[STATS_KILLS],\n\t\t\t\t\ts:\"\\n\\n\\cI...while Burning \\cJ: \", \t\t\t\t\t\t\td:Server_Statistics[STATS_BURN_Z_KILLS],\ts:\" (\",\t\td:CustomDivide(100*Server_Statistics[STATS_BURN_Z_KILLS], Server_Statistics[STATS_KILLS]), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cHHumans \\cJinfected : \", \t\t\t\t\t\t\td:Server_Statistics[STATS_INFECTIONS],\n\t\t\t\t\ts:\"\\n\\n\\cGZombie \\cJragequits : \", \t\t\t\t\t\t\td:Server_Statistics[STATS_LAST_ZOMB_RQ_TIMES],\n\t\t\t\t\ts:\"\\n\\n\\cHHuman \\cJragequits : \", \t\t\t\t\t\t\td:Server_Statistics[STATS_LAST_HUM_RQ_TIMES],\n\t\t\t\t\ts:\"\\n\\n\\cGF\\cKu\\cDl\\cVl \\cHs\\cTe\\cGr\\cKv\\cDe\\cVr \\cJ: \", \td:Server_Statistics[STATS_FULLSERVER_TIMES], \t\ts:\" times\",\n\t\t\t\t\ts:\"\\n\\n\\cHHuman Panics \\cJ: \", \t\t\t\t\t\t\t\td:Server_Statistics[STATS_PANIC_TIMES],\n\t\t\t\t\ts:\"\\n\\n\\cTLethal scratches \\cJ: \",\t\t\t\t\td:Server_Statistics[STATS_HUM_KILLED_BY_ZOMB], \t\ts:\"\\n\\n\\n\\n\\n\";\t// pour faire autant que de bonus\n\t\t\t\tHUDMSG_PLAIN, 1505, CR_WHITE, 100.4, 235.0, 0.0);\n\n\t\t// Rounds\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(\ts:\"ZM rounds played : \", \t\t\t\td:zm_rounds_pld,\n\t\t\t\t\ts:\"\\n\\n\\cHHumans \\cJwon : \", \t\t\td:Server_Statistics[STATS_ZM_HUMANS_WINS],\t\ts:\" times (\", \t\td:CustomDivide(100*Server_Statistics[STATS_ZM_HUMANS_WINS], zm_rounds_pld), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cGZombies \\cJwon : \", \t\t\td:Server_Statistics[STATS_ZM_ZOMBIE_WINS],\t\ts:\" times (\",\t\td:CustomDivide(100*Server_Statistics[STATS_ZM_ZOMBIE_WINS], zm_rounds_pld), s:\"%)\",\n\n\t\t\t\t\ts:\"\\n\\n\\nZE rounds played : \", \t\t\td:ze_rounds_pld,\n\t\t\t\t\ts:\"\\n\\n\\cHHumans \\cJwon : \", \t\t\td:Server_Statistics[STATS_ZE_HUMANS_WINS],\t\ts:\" times (\",\t\td:CustomDivide(100*Server_Statistics[STATS_ZE_HUMANS_WINS], ze_rounds_pld), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cGZombies \\cJwon : \", \t\t\td:Server_Statistics[STATS_ZE_ZOMBIE_WINS],\t\ts:\" times (\",\t\td:CustomDivide(100*Server_Statistics[STATS_ZE_ZOMBIE_WINS], ze_rounds_pld), s:\"%)\";\n\t\t\t\tHUDMSG_PLAIN, 1506, CR_WHITE, 320.4, 350.0, 0.0);\n\n\t\t// Bonuses\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(\ts:\"\\cDBonus items \\cJawarded : \", \t\t\t\td:Server_Statistics[STATS_BONUSES_GOTTEN],\n\t\t\t\t\ts:\"\\n\\nunused : \", \t\t\t\t\t\t\t\td:unusued_items, \t\t\t\t\t\t\t\t\ts:\" (\", \td:CustomDivide(100*unusued_items, Server_Statistics[STATS_BONUSES_GOTTEN]), \ts:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cMempty items \\cJ: \", \t\t\t\t\td:Server_Statistics[STATS_EMPTY_BONUSES], \t\t\ts:\" (\", \td:CustomDivide(100*Server_Statistics[STATS_EMPTY_BONUSES], used_items), \ts:\"%)\",\n\t\t\t\t\ts:\"\\n\\nused by \\cHhumans \\cJ: \", \t\t\t\td:Server_Statistics[STATS_BONUSES_USED_BY_HUM],\t\ts:\" (\", \td:CustomDivide(100*Server_Statistics[STATS_BONUSES_USED_BY_HUM], used_items), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\nused by \\cGzombies \\cJ: \", \t\t\t\td:Server_Statistics[STATS_BONUSES_USED_BY_ZOMB],\ts:\" (\",\t\td:CustomDivide(100*Server_Statistics[STATS_BONUSES_USED_BY_ZOMB], used_items), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cTUnusuals \\cJobtained : \", \t\t\td:Server_Statistics[STATS_UNUSUALS_GOTTEN],\t\t\ts:\" (\",\t\td:CustomDivide(100*Server_Statistics[STATS_UNUSUALS_GOTTEN], used_items), s:\"%)\",\n\t\t\t\t\ts:\"\\n\\n\\cNSyringes \\cJused : \", \t\t\t\td:Server_Statistics[STATS_SYRINGES_USED],\n\t\t\t\t\ts:\"\\n\\n\\cVH. Crosses \\cJobtained : \", \t\t\td:Server_Statistics[STATS_HCROSS_USED],\n\t\t\t\t\ts:\"\\n\\n\\cFCrystals \\cJobtained : \", \t\t\td:Server_Statistics[STATS_CRYSTAL_USED];\n\t\t\t\tHUDMSG_PLAIN, 1507, CR_WHITE, 540.4, 226.0, 0.0);\n\n\t}\n\telse\n\t{\n\t\t// Clear the screen\n\t\tfor(int i=1500; i<1508; i++)\n\t\t\tHudmessage(s:\"\"; HUDMSG_PLAIN, i, CR_WHITE, 1.5, 0.0, 0.0);\n\t}\n}\n\n// reset server values (must be triggered with rcon)\nScript 777 (void)\n{\n\tfor(int i=0; i<STATS_NUMBER; i++)\n\t{\n\t\tServer_Statistics[i] = 0;\n\t\tSetCvar(Server_StatsCvars[i], 0);\n\t}\n\tConsoleCommand(\"archivecvar x_zh_stats_kills\");\n\tConsoleCommand(\"archivecvar x_zh_stats_infections\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_rnd_played\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_rnd_played\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_h_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_h_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zm_z_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_ze_z_wins\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bonuses_gotten\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bon_usd_h\");\n\tConsoleCommand(\"archivecvar x_zh_stats_bon_usd_z\");\n\tConsoleCommand(\"archivecvar x_zh_stats_hum_rq\");\n\tConsoleCommand(\"archivecvar x_zh_stats_zomb_rq\");\n\tConsoleCommand(\"archivecvar x_zh_stats_fullserv\");\n\tConsoleCommand(\"archivecvar x_zh_stats_unus_gotten\");\n\tConsoleCommand(\"archivecvar x_zh_stats_syringes\");\n\tConsoleCommand(\"archivecvar x_zh_stats_h_killedby_z\");\n\tConsoleCommand(\"archivecvar x_zh_stats_cross_used\");\n\tConsoleCommand(\"archivecvar x_zh_stats_fcryst_used\");\n\tConsoleCommand(\"archivecvar x_zh_stats_empty_bonuses\");\n}"
},
{
"source": "pk3",
"name": "Source/UNUSUALS.txt",
"contents": "#library \"unusuals\"\n#Include \"Zcommon.acs\"\n#encryptstrings\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n#Import \"FUNCTION.acs\"\n\n#define UNUSUAL_NUMB 9\n#define UNUSUALXPOS 0.5\n#define UNUSUALYPOS 0.03\n#define UNUSUALXPOS2 0.8\n#define UNUSUALYPOS2 0.92\n\nstr UnusualNames[UNUSUAL_NUMB] = {\t\"Invincible Star\",\n\t\t\t\t\t\t\t\t\t\"Steaming\",\n\t\t\t\t\t\t\t\t\t\"Mini-Arsenal\",\n\t\t\t\t\t\t\t\t\t\"Cloudy Full Moon\",\n\t\t\t\t\t\t\t\t\t\"Haunted Ghosts\",\n\t\t\t\t\t\t\t\t\t\"Circling Heart\",\n\t\t\t\t\t\t\t\t\t\"Circling Peace Sign\",\n\t\t\t\t\t\t\t\t\t\"Orbiting Planets\",\n\t\t\t\t\t\t\t\t\t\"Dark Storm\"\t};\n\nstr UnusualItems[UNUSUAL_NUMB] = {\t\"UnusualItem1\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem2\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem3\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem4\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem5\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem6\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem7\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem8\",\n\t\t\t\t\t\t\t\t\t\"UnusualItem9\"\t};\n\nstr particlesNames[4] = {\"SparkParticles\", \"CloudyFullMoonParticle\", \"CirclingHeartParticle\", \"CirclingPeaceSignParticle\"};\n\n/* THE UNUSUAL ITEMS SCRIPT */\nScript 915 (void) {\n\n\tIncrementStatistic(STATS_UNUSUALS_GOTTEN);\n\n\tint randNumber = random(0, UNUSUAL_NUMB-1);\n\n\tActivatorSound(\"bonus/pickup\", 100);\n\tGiveInventory(UnusualItems[randNumber], 1);\n\tGiveInventory(\"hasGotUnusual\", 1);\n\tSetFont(\"SMALLFONT\");\n\tHudMessageBold(n:0, s:\" \\cThas received an unusual : \", s:UnusualNames[randNumber], s:\"!\";\n\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 703, CR_WHITE, UNUSUALXPOS, UNUSUALYPOS, 4.0, 1.0);\n\tLog(n:0, s:\" \\cThas received an unusual : \", s:UnusualNames[randNumber]);\n}\n\n// Unusual particles script\nScript 916 (int effect, int id) CLIENTSIDE\n{\n\tint act_tid = ActivatorTID();\n\tint act_number = act_tid - PLAYER_TID;\n\tint angle;\n\tint x, y, z;\n\tint a,b,c,d,e,f;\n\n\t// Message display\n\tif(ConsolePlayer == PlayerNumber())\n\t{\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage(s:\"Effect : \", s:UnusualNames[id];\n\t\t\t\t\tHUDMSG_PLAIN, 0, CR_PURPLE, UNUSUALXPOS2, UNUSUALYPOS2, 0.0);\n\t}\n\n\t// Category 1 : Multiple particles circling ------------------------------\n\t// Orbiting planets\n\tif(effect == 200)\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\ta = (cos(angle) << 4);\n\t\t\tb = (sin(angle) << 4);\n\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 56.0;// + CheckWeapon(\"Zombie_\")*24.0;;\n\n\t\t\t// Angle\n\t\t\tangle+=1024;\n\t\t\tif(angle >= 65536)\n\t\t\t\tangle = 0;\n\n\t\t\t// Particles\n\t\t\tSpawn(\"OrbitingPlanetAParticle\", x+a, y+b, z-(a>>2) );\n\t\t\tSpawn(\"OrbitingPlanetBParticle\", x-a, y-b, z+(a>>2) );\n\t\t\tSpawn(\"OrbitingPlanetCParticle\", x+b, y+a, z+(b>>2) );\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n\t// Dark Storm\n\telse if(effect == 201)\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 68.0;// + CheckWeapon(\"Zombie_\")*24.0;;\n\n\t\t\t// Cloud\n\t\t\tSpawn(\"CloudAndRainParticle\", x, y, z);\n\t\t\t// Rain\n\t\t\tSpawn(\"RaindropParticle\", x + (random(-8,8) << 16), y + (random(-8,8) << 16), z + (random(-2,2) << 16));\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n\t// Haunted Ghosts\n\telse if(effect == 202)\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\ta = (cos(angle) << 4);\n\t\t\tb = (sin(angle) << 4);\n\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 56.0;// + CheckWeapon(\"Zombie_\")*24.0;;\n\n\t\t\t// Angle\n\t\t\tangle+=1024;\n\t\t\tif(angle >= 65536)\n\t\t\t\tangle = 0;\n\n\t\t\t// Particles\n\t\t\tSpawn(\"HauntedGhostParticle\", x+a, y+b, z-(a>>2) );\n\t\t\tSpawn(\"HauntedGhostParticle\", x-a, y-b, z+(a>>2) );\n\t\t\tSpawn(\"HauntedGhostParticle\", x+b, y+a, z+(b>>2) );\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n\t// Mini-Arsenal\n\telse if(effect == 203)\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\ta = (cos(angle) << 4);\n\t\t\tb = (sin(angle) << 4);\n\n\t\t\tc = (cos(angle + 21845) << 4);\n\t\t\td = (sin(angle + 21845) << 4);\n\n\t\t\te = (cos(angle + 43690) << 4);\n\t\t\tf = (sin(angle + 43690) << 4);\n\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 56.0;// + CheckWeapon(\"Zombie_\")*24.0;;\n\n\t\t\t// Angle\n\t\t\tangle+=1024;\n\t\t\tif(angle >= 65536)\n\t\t\t\tangle = 0;\n\n\t\t\t// Particles\n\t\t\tSpawn(\"Arsenal1Particle\", x+a, y+b, z );\n\t\t\tSpawn(\"Arsenal2Particle\", x+c, y+d, z );\n\t\t\tSpawn(\"Arsenal3Particle\", x+e, y+f, z );\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n\t// Steaming\n\telse if(effect == 204)\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 56.0;// + CheckWeapon(\"Zombie_\")*24.0;\n\n\t\t\t// Particles\n\t\t\tSpawn(\"UnusualSteamParticle\", x, y, z );\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\n\t}\n\n\t// Mario invincible\n\telse if(effect == 100)\n\t{\n\t\tCreateTranslation (1, 112:127=176:191);\n\t\tCreateTranslation (2, 112:127=112:127);\n\t\tCreateTranslation (3, 112:127=192:207);\n\t\tCreateTranslation (4, 112:127=208:223);\n\t\tCreateTranslation (5, 112:127=224:231);\n\t\tCreateTranslation (6, 112:127=250:254);\n\t\tCreateTranslation (7, 112:127=48:63);\n\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\t// Update position\n\t\t\tx = GetActorX(0);\n\t\t\ty = GetActorY(0);\n\t\t\tz = GetActorZ(0) + 56.0;// + CheckWeapon(\"Zombie_\")*24.0;\n\n\t\t\t// Translation\n\t\t\tThing_SetTranslation(0, random(1,7));\n\n\t\t\t// Particles\n\t\t\tSpawn(\"SparkParticles\", x+1.0*random(-8,8), y+1.0*random(-8,8), z+1.0*random(-50,0));\n\t\t\tSpawn(\"SparkParticles\", x+1.0*random(-8,8), y+1.0*random(-8,8), z+1.0*random(-50,0));\n\t\t\tSpawn(\"SparkParticles\", x+1.0*random(-8,8), y+1.0*random(-8,8), z+1.0*random(-50,0));\n\t\t\tSpawn(\"SparkParticles\", x+1.0*random(-8,8), y+1.0*random(-8,8), z+1.0*random(-50,0));\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n\t// Category 2 : One particle circling ------------------------------\n\telse\n\t{\n\t\twhile(PlayerInGame(act_number))\n\t\t{\n\t\t\t// Update position\n\t\t\tx = GetActorX(0) + (cos(angle) << 4);\n\t\t\ty = GetActorY(0) + (sin(angle) << 4);\n\t\t\tz = GetActorZ(0) + 56.0 + (cos(angle + 0xFFFF) << 2);// + CheckWeapon(\"Zombie_\")*24.0;;\n\n\t\t\t// Angle\n\t\t\tangle+=1024;\n\t\t\tif(angle >= 65536)\n\t\t\t\tangle = 0;\n\n\t\t\t// Particles\n\t\t\tSpawn(particlesNames[effect-100], x, y, z);\n\n\t\t\t// loop!\n\t\t\tdelay(1);\n\t\t}\n\t}\n\n}"
},
{
"source": "pk3",
"name": "Source/ZEGAME.txt",
"contents": "#library \"zegame\"\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n#Import \"ADMIN.acs\"\n#Import \"SPECIAL.acs\"\n#Import \"FUNCTION.acs\"\n#Import \"SPRINT.acs\"\n#Import \"MODCVARS.acs\"\n#Import \"ACHIEVEM.acs\"\n#Import \"UNUSUALS.acs\"\n\n#define SAFE_TIME 10\n#define FINISHED_TIME 6\n\n/* Escape maps only */\nbool Reached[32];\n\n// ------------HUDMESSAGES TIDs-----------------\n// 101 : infection messages (Y=0.40)\n// 102 : Victory message 1 (Y=0.30) /You Have Been Infected\n// 103 : Victory message 2 (Y=0.33)\n// 104 : Rage messages (Y=0.37)\n// 105 : humans counter\n// 106 : zombies counter\n// 107 : Timer (zm maps)\n// 108 : TIPs messages (Y=0.25)\n// 109 : On/Off music\n// 110 : Panic! (Y=0.43)\n// 700 : This game needs at least...\n// 701 : A zombie will be picked....\n\n// ------------TIPS-----------------\n\nstr ZTip[1] = {\"Don't let the Humans escape! Use your claws to turn them into zombies!\"};\n\nstr HTip[1] = {\"You are a Human, dont get infected by Zombies and reach the exit area!\"};\n\n// ------------FUNCTIONS-----------------\n\nfunction void EndZEGame (void)\n{\n\t\tfor(int i = 0; i < 32; i++) {\n\t\t\tif(!Reached[i]) Thing_Damage(PLAYER_TID+i, 10000, 20);\n\t\t}\n}\n\nfunction void ResistMessage (int restime)\n{\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(s:\"Resist for \\cJ\", d:restime, s:\" \\cGseconds\"; HUDMSG_FADEOUT, 999, CR_RED, 0.5, 0.2, 0.5, 0.5);\n}\n\nfunction void ResistMessage2 (int restime, str whyresist, str color)\n{\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(s:\"Resist for \\cJ\", d:restime, s:\" \\cDseconds\"; HUDMSG_FADEOUT, 999, color, 0.5, 0.2, 0.5, 0.5);\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessageBold(s:whyresist; HUDMSG_FADEOUT, 998, CR_WHITE, 0.5, 0.17, 1.5, 0.5);\n}\n\nfunction void ResistMessage3 (int restime, str whyresist) // RED\n{\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(s:\"\\cGResist for \\cJ\", d:restime, s:\" \\cGseconds\"; HUDMSG_FADEOUT, 999, CR_RED, 0.5, 0.2, 0.5, 0.5);\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessageBold(s:whyresist; HUDMSG_FADEOUT, 998, CR_WHITE, 0.5, 0.17, 1.5, 0.5);\n}\n\nfunction void ResistMessage4 (int restime, str whyresist) // PURPLE\n{\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold(s:\"\\cTResist for \\cJ\", d:restime, s:\" \\cTseconds\"; HUDMSG_FADEOUT, 999, CR_RED, 0.5, 0.2, 0.5, 0.5);\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessageBold(s:whyresist; HUDMSG_FADEOUT, 998, CR_WHITE, 0.5, 0.17, 1.5, 0.5);\n}\n\nfunction void SetGameMode(int which)\n{\n switch(which)\n {\n case MODE_SAFE:\n Game_info_mode = MODE_SAFE;\n SetPlayerProperty(1, 0, PROP_TOTALLYFROZEN);\n\t\t\t\t\tSetPlayerProperty(1, 0, PROP_INVULNERABILITY);\n Game_info_safetimer = SAFE_TIME;\n break;\n\n case MODE_PLAYING:\n Game_info_mode = MODE_PLAYING;\n // Variables values\n\t\t\t\t\tnumberofplayers = PlayerCount();\n\n\t\t\t\t\t// Set two zombies if there are more than 17 humans\n\t\t\t\t\tif(numberofplayers>=18) {\n\t\t\t\t\t\tZombieSelection(TWO_ZOMBIES_GAME, ZE_GAME);\n\t\t\t\t\t\tnumberofhumans=numberofplayers-2;\n\t\t\t\t\t}\n\t\t\t\t\t// Otherwise, set one zombie\n\t\t\t\t\telse {\n\t\t\t\t\t\tZombieSelection(ONE_ZOMBIE_GAME, ZE_GAME);\n\t\t\t\t\t\tnumberofhumans=numberofplayers-1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Tips & round number\n\t\t\t\t\tfor(int k=0; k<32; k++) {\n\t\t\t\t\t\tif(PlayerInGame(k)) {\n\t\t\t\t\t\t\tSetActivator(PLAYER_TID+k);\n\t\t\t\t\t\t\tGiveInventory(\"RoundNumber\", 1);\n\t\t\t\t\t\t\tAcs_ExecuteAlways(990, 0, 0, 0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tSetActivator(-1);\n\n\t\t\t\t\t// Check if the server is full\n\t\t\t\t\tif(numberofplayers>=30) {\n\t\t\t\t\t\tIncrementStatistic(STATS_FULLSERVER_TIMES);\n\t\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\t\tHudmessageBold(s:\"\\cGF \\cKu \\cDl \\cVl \\cHs \\cTe \\cGr \\cKv \\cDe \\cVr \\cG! \\cJFree item for everyone!\";\n\t\t\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 0, CR_LIGHTBLUE, 0.5, 0.09, 30.0, 2.0);\n\n\t\t\t\t\t\tfor(int i=0; i<32; i++)\n\t\t\t\t\t\t\tif(PlayerInGame(i))\n\t\t\t\t\t\t\t\tAcs_executeAlways(164, 0, i, BONUS_CLASSIC, 0);\n\n\t\t\t\t\t}\n break;\n\n case MODE_FINISHED:\n Game_info_mode = MODE_FINISHED;\n\t\t\t\t\tSetPlayerProperty(1, 1, PROP_TOTALLYFROZEN);\n\t\t\t\t\tSetPlayerProperty(1, 2, PROP_INVULNERABILITY);\n\t\t\t\t\t// Displays the round stats\n\t\t\t\t\tAcs_Execute(159, 0, 0, 0, 0);\n // sets the reset timer\n Game_info_finishtimer = FINISHED_TIME;\n\t\t\t\t\t// Rewards random survivor\n\t\t\t\t\tRewardRandomSurvivor();\n\t\t\t\t\t// Achievements\n\t\t\t\t\tAcs_Execute(811, 0);\n break;\n }\n}\n\nfunction void GiveImmuneZE(void) // Used only in ZE09 - this can be used for delayed zombie starts\n{\n\t// Makes zombies invulnerable to firegrenades during 5 secs\n\tGiveActorInventory(Game_info_zombie_tid, \"ZeTempProtection\", 1);\n\n\tif(numberofplayers>=18)\n\t\tGiveActorInventory(Game_info_zombie_2_tid, \"ZeTempProtection\", 1);\n}\n\nfunction void RewardRandomSurvivor (void)\n{\n\tint counter = 0;\n\tint who = random(0, 31);\n\n\t// Checks if there is a survivor\n\tfor(int i=0; i<32; i++) {\n\t\tif(Reached[i] && PlayerInGame(i)) {\n\t\t\tcounter = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Rewards random survivor if there is one\n\tWhile(counter) {\n\t\tif(Reached[who] && PlayerInGame(who)) {\n\t\t\tAcs_executeAlways(164, 0, who, BONUS_CLASSIC, 0);\n\t\t\tbreak;\n\t\t}\n\t\twho = random(0, 31);\n\t}\n}\n\n// ------------CODE-----------------\n\nscript 901 OPEN // This script constantly checks the state of the game going-on\n{\n\tSetGameMode(MODE_SAFE);\n while(1) {\n\t\t// this games needs at least two players\n\t\tif(playercount() > 1)\n\t\t\tGame_info_safetimer--;\n\n\t\telse\n\t\t{\n\t\t\tSetGameMode(MODE_SAFE);\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(s:\"This game needs at least two players. Please spectate.\";\n\t\t\t\t\t\tHUDMSG_FADEOUT, 700, CR_WHITE, 0.5, 0.3, 3.0, 0.5);\n\t\t}\n\n\t\t// timer reaches 0\n\t\tif(Game_info_safetimer <= 0)\n\t\t{\n\t\t\tSetGameMode(MODE_PLAYING);\n\t\t\tbreak;\n\t\t}\n\n\t\t// Displays timer\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessagebold(s:\"A zombie will be picked in... \", d:Game_info_safetimer, s:\" s\";\n\t\t\t\t\tHUDMSG_FADEOUT, 701, CR_WHITE, 0.5, 0.88, 1.0, 1.0);\n\t\tdelay(35);\n\t}\n\n\twhile(1) {\n\t\t// Fixes the humanmaker + zombiemaker bug\n\t\tCheckInventories();\n\n\t\t// displays the counter\n\t\tint zombieNumber = ZombieCounter();\n\t\tint humanNumber = HumanCounter();\n\t\tSetFont(\"CONFONT\");\n\t\tHudMessageBold(s:\"Humans Counter \\cJ: \",d:humanNumber;\n\t\t\t\t\tHUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 0.0);\n\t\tHudMessageBold(s:\"Zombies Counter \\cJ: \",d:zombieNumber;\n\t\t\t\t\tHUDMSG_PLAIN, 106, CR_DARKRED, 0.03, 0.73, 0.0);\n\n\t\t// Fission mailed ?\n\t\tif(respawn_triggered && GetCVar(\"survival\")) {\n\t\t\t// Makes the counter disapear\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\n\t\t\t// Displays victory messages\n\t\t\tsetfont(\"BIGFONT\");\n\t\t\tHudmessagebold(s:FailBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_PURPLE, 0.5, 0.3, 8.0, 2.0);\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(s:FailSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_PURPLE, 0.5, 0.33, 8.0, 2.0);\n\n\t\t\t// put the game in finished mode\n\t\t\tSetGameMode(MODE_FINISHED);\n\t\t\tSetPlayerProperty(1, 0, PROP_TOTALLYFROZEN);\n\t\t\tbreak;\n\t\t}\n\n\t\t// check if there still is one zombie alive\n\t\telse if(zombieNumber <= 0) {\n\t\t\t// Makes the counter disapear\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\n\t\t\t// Displays victory messages\n\t\t\tsetfont(\"BIGFONT\");\n\t\t\tHudmessagebold(s:HWinBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_BLUE, 0.5, 0.3, 6.5, 2.0);\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(s:HWinSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_BLUE, 0.5, 0.33, 6.5, 2.0);\n\n\t\t\t// Displays the % of survivors\n\t\t\tint survivorpercent = 100*humanNumber/numberofhumans;\n\t\t\tif(survivorpercent>100) survivorpercent=100;\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(d:survivorpercent, s:\" % survived\"; HUDMSG_FADEOUT, 0, CR_WHITE, 0.5, 0.4, 5.5, 2.0);\n\n\t\t\t// Incr stats\n\t\t\tIncrementStatistic(STATS_ZE_HUMANS_WINS);\n\n\t\t\t// put the game in finished mode\n\t\t\tSetGameMode(MODE_FINISHED);\n\n\t\t\tbreak;\n\t\t}\n\n\t\t// check if there still is one human alive\n\t\telse if(humanNumber <= 0) {\n\t\t\t// Makes the counter disapear\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\n\t\t\t// tell everyone that there is no human in this game\n\t\t\tSetFont(\"BIGFONT\");\n\t\t\tHudmessagebold(s:ZWinBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 6.5, 2.0);\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(s:ZWinSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_RED, 0.5, 0.33, 6.5, 2.0);\n\n\t\t\t// Incr stats\n\t\t\tIncrementStatistic(STATS_ZE_ZOMBIE_WINS);\n\n\t\t\t// put the game back in finished mode\n\t\t\tSetGameMode(MODE_FINISHED);\n\n\t\t\tbreak;\n\t\t}\n\t\tdelay(35);\n\t}\n\n\twhile(1) {\n\t\tGame_info_finishtimer--;\n\n\t\t// timer reaches 0\n\t\tif(Game_info_finishtimer <= 0) {\n\t\t\t// Clears players inventories\n\t\t\tResetInventories();\n\t\t\tinventories_cleaned = true;\n\t\t\t// Save stats\n\t\t\tSaveStatistics();\n\t\t\tDelay(5);\n\t\t\tExit_Normal(0);\n\t\t}\n\n\t\tdelay(35);\n\t}\n}\n\nscript 990 (void) CLIENTSIDE /* Tips messages at start */\n{\n\tif(CheckInventory(\"humanmaker\")) {\n\t\t// tips for humans\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(s:HTip[0]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n\t}\n\n\telse if(CheckInventory(\"zombiemaker\")) {\n\t\t// tips for the zombie\n\t\tSetFont(\"BIGFONT\");\n\t\tHudmessage(s:\"You have been infected!\"; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 2.0, 2.0);\n\t\tDelay(35*3);\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(s:ZTip[0]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n\t}\n}\n\n/* Infection script */\nScript 153 (int number)\n{\n\tif(!CheckInventory(\"humanmaker\"))\n\t\tterminate;\n\n\tif(PlayerNumber() == -1)\n\t\tterminate;\n\n\t// Check whether the human has a kevlar\n\tif(CheckInventory(\"ProtectionVest\")) {\n\t\t// Play a sound\n\t\tActivatorSound(\"KEVLGONE\", 100);\n\t\t// Take it away\n\t\tTakeInventory(\"ProtectionVest\", 1);\n\t\t// Slash effect\n\t\tAcs_ExecuteAlways(157, 0, 0, 0, 0);\n\t\tterminate;\n\t}\n\n\t// Check whether the human is immune to infection\n\tif(CheckInventory(\"SyringeUsed\")) {\n\t\t\t// Pain sound\n\t\t\tActivatorSound(\"DSPLPAI2\", 100);\n\t\t\t// Achievement \"Relapse\"\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_SYRINGE, 0);\n\t\t\t// Slash effect\n\t\t\tAcs_ExecuteAlways(157, 0, 0, 0, 0);\n\t\t\t// terminate\n\t\t\tterminate;\n\t}\n\n\t// Determines how much health has to be given\n\tint hpfactor;\n\n\tif(number < 32 && number >=0)\n\t{\n\t\thpfactor = FixedDiv(GetActorProperty(number+PLAYER_TID, Aprop_Health), GetActorProperty(number+PLAYER_TID, Aprop_SpawnHealth));\n\t}\n\telse\n\t{\n\t\thpfactor = 1.0;\n\t}\n\n\t// Make sure of this\n\tif( hpfactor > 1.0 )\n\t\thpfactor = 1.0;\n\telse if ( hpfactor < 0.0 )\n\t\thpfactor = 0.0;\n\n\tbool isPanicking = CheckInventory(\"PanicSpeed\");\n\n\t// Turn them into zombie\n\tBecomesZombie(PlayerNumber(), false, ZE_INFECTION, hpfactor);\n\n\t// Rewarding infector\n\tif(number<32){\n\t\tIncrementStatistic(STATS_INFECTIONS);\n\t\tInfectors[number]++;\n\t\tif(Infectors[number]%5==0) Acs_ExecuteAlways(164, 0, number, BONUS_CLASSIC, 0);\n\t\t// Achievements\n\t\tAcs_ExecuteAlways(809, 0, number, PROGRESS_INFECTS, 0);\n\t\tif(Infectors[number]==numberofhumans && numberofhumans>=6)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_EPIDEMIC, 0);\n\t\tif(Infectors[number]==12)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_MADNESS, 0);\n\t\t//if(CheckInventory(\"SyringeUsed\"))\n\t\t//\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_SYRINGE, 0);\n\t\tif(isPanicking)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_ROADRUNNER, 0);\n\t}\n\n\t// Upgrading the proper counters\n\tInfected[PlayerNumber()] = True;\n\n\t// Messages\n\tSetFont(\"SMALLFONT\");\n\tif(number == 255)\n\t\tHudmessagebold(s:\"Unlucky \", n:0, s:\" \\cGhas received an infected syringe!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 101, CR_RED, 0.5, 0.4, 1.0, 2.0);\n\n\telse if (number == 254)\n\t\tHudmessagebold(n:0, s:\" \\cGhas been infected by an \\cKadmin!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 101, CR_RED, 0.5, 0.4, 1.0, 2.0);\n\n\telse\n\t\tHudmessagebold(n:0, s:\" \\cGhas been infected by \\cK\", n:(1+number), s:\"\\cG!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT, 101, CR_WHITE, 0.5, 0.4, 1.0, 2.0);\n\n\tSetfont(\"BIGFONT\");\n\tHudmessage(s:\"You have been infected!\"; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 2.0, 2.0);\n\tSetFont(\"SMALLFONT\");\n\tHudmessage(s:ZTip[0]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n}\n\nScript 158 (void) // Burning zombies\n{\n\tGiveInventory(\"IsBurning\", 1);\n\tfor(int burnt = 0; burnt <= 20; burnt++) {\n\t\tSpawnProjectile(0, \"BurningFire\", 0, 0, 0, 0, 0);\n\t\tThing_Damage(0, 10, 0);\n\t\tDelay(10);\n\t}\n\tTakeInventory(\"IsBurning\", 1);\n}\n\nScript 159 (void) /* Round stats */\n{\n\tint j = 0;\n\tint l = 0;\n\tint n = 0;\n\n\tSetFont(\"BIGFONT\");\n\tHudmessageBold(s:\"Round Stats\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED, 0.5, 0.53, 5.0, 2.0);\n\n\tSetFont(\"SMALLFONT\");\n\tif(Game_info_zombie_2_tid==0) {\n\t\tHudmessageBold(s:\"Initial zombie\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.60, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_tid-PLAYER_TID+1);\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.63, 5.0, 2.0);\n\t}\n\n\telse {\n\t\tHudmessageBold(s:\"Initial zombies\";\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.60, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_tid-PLAYER_TID+1);\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.63, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_2_tid-PLAYER_TID+1);\n\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.66, 5.0, 2.0);\n\t}\n\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Infectors\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.35, 0.60, 5.0, 2.0);\n\tfor(int m = 0; m < 32; m++) {\n\t\tif(Infectors[m]) {\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessageBold(n:(m+1), s:\"\\cJ : \", d:Infectors[m];\n\t\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.35, 0.63+(0.03*n), 5.0, 2.0);\n\t\t\tn++;\n\t\t}\n\t}\n\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Zombies Killers\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.65, 0.60, 5.0, 2.0);\n\tfor(int i = 0; i < 32; i++) {\n\t\tif(Killers[i]) {\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessageBold(n:(i+1), s:\"\\cJ : \", d:Killers[i];\n\t\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.65, 0.63+(0.03*j), 5.0, 2.0);\n\t\t\tj++;\n\t\t}\n\t}\n\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Survivors\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.90, 0.60, 5.0, 2.0);\n\tfor(int k = 0; k < 32; k++) {\n\t\tif(Reached[k]) {\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessageBold(n:(k+1);\n\t\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.90, 0.63+(0.03*l), 5.0, 2.0);\n\t\t\tl++;\n\t\t}\n\t}\n\n\t// ragequits\n\tint ragequitpercentage = 100*numberofquitters/numberofplayers;\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Disconnects \";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.70, 5.0, 2.0);\n\tHudmessageBold(d:ragequitpercentage, s:\" %\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.13, 0.73, 5.0, 2.0);\n}\n\nScript 190 DEATH\n{\n\tReached[PlayerNumber()] = False;\n}\n\nScript 191 (int Gone) DISCONNECT\n{\n\tReached[Gone] = false;\n}\n\nScript 163 (void) // Zombie gets CURED\n{\n\tif(!CheckInventory(\"zombiemaker\"))\n\t\tterminate;\n\n\tBecomesHuman();\n\n\t// Upgrading the proper counters\n\tInfected[PlayerNumber()] = False;\n}\n\nScript 201 (void) net // !ZTELE\n{\n\tif( !PlayerInGame(PlayerNumber()) )\n\t\tterminate;\n\n\tPrint(s:\"Ztele does not work on escape maps.\");\n}\n\n// Achievements related --------------------------------------------\nScript 933 (void)\n{\n\tSetResultValue(ZE_GAME);\n}\n//Checks if the player has reached the safety room\nScript 934 (int who)\n{\n\tSetResultValue(1);\n\n\tif(Reached[who]==0 || Infected[who])\n\t\tSetResultValue(0);\n}"
},
{
"source": "pk3",
"name": "Source/ZMGAME.txt",
"contents": "#library \"zmgame\"\n#Include \"Zcommon.acs\"\n\n#Include \"CONST.acs\"\n#Import \"COMMON.acs\"\n#Import \"ADMIN.acs\"\n#Import \"SPECIAL.acs\"\n#Import \"FUNCTION.acs\"\n#Import \"SPRINT.acs\"\n#Import \"MODCVARS.acs\"\n#Import \"ACHIEVEM.acs\"\n#Import \"UNUSUALS.acs\"\n\n#define SAFE_TIME 30\n#define ROUND_TIME 420\n#define FINISHED_TIME 6\n\n/* Specific variables */\nint Game_info_round_timer;\nint numberofinfected = 0;\nbool heart_mode = false;\n\n// ------------HUDMESSAGES TIDs-----------------\n// 101 : infection messages (Y=0.40)\n// 102 : Victory message 1 (Y=0.30) /You Have Been Infected\n// 103 : Victory message 2 (Y=0.33)\n// 104 : Rage messages (Y=0.37)\n// 105 : humans counter\n// 106 : zombies counter\n// 107 : Timer (zm maps)\n// 108 : TIPs messages (Y=0.25)\n// 110 : Panic! (Y=0.43)\n// 111 : A second zombie has been picked\n// 700 : This game needs at least...\n// 701 : A zombie will be picked....\n\n// ------------TIPS-----------------\n\nstr ZTip[4] = { \"You are a Zombie, use your claws to infect Humans!\",\n \"You run faster than Humans. Take profit of such a capability!\",\n \"Watch out for fire grenades! Zombies hate fire!\",\n \"Work together! Crouching will help your zombie mates reach high spots!\"};\n\nstr HTip[5] = { \"You are a Human, dont get infected by Zombies!\",\n \"Each weapon has its strenght, the chaingun is more useful than you think!\",\n \"Your footsteps will make you easy to spot. Stop moving when you hide!\",\n \"Use the barrels and other items to block paths!\",\n \"Sticking together will make your team stronger!\"};\n\n// ------------FUNCTIONS-----------------\n\nfunction void SetGameMode(int which)\n{\n switch(which)\n {\n case MODE_SAFE:\n Game_info_mode = MODE_SAFE;\n SetPlayerProperty(1, 0, PROP_TOTALLYFROZEN);\n\t\t\t\t\tSetPlayerProperty(1, 0, PROP_INVULNERABILITY);\n Game_info_safetimer = SAFE_TIME;\n break;\n\n case MODE_PLAYING:\n Game_info_mode = MODE_PLAYING;\n // start the round timer\n Game_info_round_timer = ROUND_TIME;\n\t\t\t\t\tAcs_Execute(905, 0, 0, 0, 0);\n\t\t\t\t\t// Variables\n\t\t\t\t\tnumberofplayers = PlayerCount();\n\n\t\t\t\t\t// Set two zombies if there are more than 17 humans\n\t\t\t\t\tif(numberofplayers>=18) {\n\t\t\t\t\t\tZombieSelection(TWO_ZOMBIES_GAME, ZM_GAME);\n\t\t\t\t\t\tnumberofhumans=numberofplayers-2;\n\t\t\t\t\t}\n\t\t\t\t\t// Otherwise, set one zombie\n\t\t\t\t\telse {\n\t\t\t\t\t\tZombieSelection(ONE_ZOMBIE_GAME, ZM_GAME);\n\t\t\t\t\t\tnumberofhumans=numberofplayers-1;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Tips & round number\n\t\t\t\t\tfor(int k=0; k<32; k++) {\n\t\t\t\t\t\tif(PlayerInGame(k)) {\n\t\t\t\t\t\t\tSetActivator(PLAYER_TID+k);\n\t\t\t\t\t\t\tGiveInventory(\"RoundNumber\", 1);\n\t\t\t\t\t\t\tAcs_ExecuteAlways(990, 0, 0, 0, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tSetActivator(-1);\n\n\t\t\t\t\t// Check if the server is full\n\t\t\t\t\tif(numberofplayers>=30) {\n\t\t\t\t\t\tSetMusic(\"FULLSERV\");\n\t\t\t\t\t\tIncrementStatistic(STATS_FULLSERVER_TIMES);\n\t\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\t\tHudmessageBold(s:\"\\cGF \\cKu \\cDl \\cVl \\cHs \\cTe \\cGr \\cKv \\cDe \\cVr \\cG! \\cJFree item for everyone!\";\n\t\t\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 0, CR_LIGHTBLUE, 0.5, 0.09, 30.0, 2.0);\n\n\t\t\t\t\t\tfor(int i=0; i<32; i++)\n\t\t\t\t\t\t\tif(PlayerInGame(i))\n\t\t\t\t\t\t\t\tAcs_executeAlways(164, 0, i, BONUS_CLASSIC, 0);\n\n\t\t\t\t\t}\n\n break;\n\n case MODE_FINISHED:\n Game_info_mode = MODE_FINISHED;\n\t\t\t\t\tSetPlayerProperty(1, 1, PROP_TOTALLYFROZEN);\n\t\t\t\t\tSetPlayerProperty(1, 2, PROP_INVULNERABILITY);\n\t\t\t\t\t// Displays the round stats\n\t\t\t\t\tAcs_Execute(159, 0, 0, 0, 0);\n\t\t\t\t\t// Stops the round timer\n\t\t\t\t\tAcs_Terminate(905, 0);\n // Sets the reset timer\n Game_info_finishtimer = FINISHED_TIME;\n\t\t\t\t\t// Achievements\n\t\t\t\t\tAcs_Execute(811, 0);\n break;\n }\n}\n\n// ------------CODE-----------------\n\nscript 901 OPEN // This script constantly checks the state of the game going-on\n{\n\tSetGameMode(MODE_SAFE);\n while(1) {\n\t\t// this games needs at least two players\n\t\tif(playercount() > 1)\n\t\t\tGame_info_safetimer--;\n\n\t\telse\n\t\t{\n\t\t\tSetGameMode(MODE_SAFE);\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessagebold(s:\"This game needs at least two players. Please spectate.\";\n\t\t\t\t\t\tHUDMSG_FADEOUT, 700, CR_WHITE, 0.5, 0.3, 3.0, 0.5);\n\t\t}\n\n\t\t// timer reaches 0\n\t\tif(Game_info_safetimer <= 0)\n\t\t{\n\t\t\tSetGameMode(MODE_PLAYING);\n\t\t\tbreak;\n\t\t}\n\n\t\t// Displays timer\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessagebold(s:\"A zombie will be picked in... \", d:Game_info_safetimer, s:\" s\";\n\t\t\t\t\tHUDMSG_FADEOUT, 701, CR_WHITE, 0.5, 0.88, 1.0, 1.0);\n\t\tdelay(35);\n\t}\n while(1) {\n\t\t// Fixes the humanmaker + zombiemaker bug\n\t\tCheckInventories();\n\n\t\t// displays the counter\n\t\tint zombieNumber = ZombieCounter();\n\t\tint humanNumber = HumanCounter();\n\t\tSetFont(\"CONFONT\");\n\t\tHudMessageBold(s:\"Humans Counter \\cJ: \",d:humanNumber;\n\t\t\t\t\tHUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 0.0);\n\t\tHudMessageBold(s:\"Zombies Counter \\cJ: \",d:zombieNumber;\n\t\t\t\t\tHUDMSG_PLAIN, 106, CR_DARKRED, 0.03, 0.73, 0.0);\n\n\t\t// Heart beat mode\n\t\tif(heart_mode==false && humanNumber==1 && zombieNumber)\n\t\t\tAcs_Execute(906, 0, 0, 0, 0);\n\n\t\t// Fission mailed ?\n\t\telse if(respawn_triggered && GetCVar(\"survival\"))\n\t\t\t{\n\t\t\t\t// Makes the counter disapear\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\n\t\t\t\t// Displays victory messages\n\t\t\t\tsetfont(\"BIGFONT\");\n\t\t\t\tHudmessagebold(s:FailBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_PURPLE, 0.5, 0.3, 8.0, 2.0);\n\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(s:FailSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_PURPLE, 0.5, 0.33, 8.0, 2.0);\n\n\t\t\t\t// put the game in finished mode\n\t\t\t\tSetGameMode(MODE_FINISHED);\n\t\t\t\tSetPlayerProperty(1, 0, PROP_TOTALLYFROZEN);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t// check if there still is one zombie alive\n\t\telse if(zombieNumber <= 0)\n\t\t\t{\n\t\t\t\t// Makes the counter disapear\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\t\t\t\t// tell everyone that there is no zombie in this game\n\t\t\t\tsetfont(\"BIGFONT\");\n\t\t\t\tHudmessagebold(s:HWinBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_BLUE, 0.5, 0.3, 6.5, 2.0);\n\t\t\t\tsetfont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(s:HWinSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_BLUE, 0.5, 0.33, 6.5, 2.0);\n\t\t\t\t// Displays the % of survivors\n\t\t\t\tint survivorpercent = 100*humanNumber/numberofhumans;\n\t\t\t\tif(survivorpercent>100) survivorpercent=100;\t// needed if the first zombie uses cure\n\t\t\t\tsetfont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(d:survivorpercent, s:\" % survived\"; HUDMSG_FADEOUT, 0, CR_WHITE, 0.5, 0.4, 5.5, 2.0);\n\t\t\t\t// Incr stats\n\t\t\t\tIncrementStatistic(STATS_ZM_HUMANS_WINS);\n\t\t\t\t// put the game in finished mode\n\t\t\t\tSetGameMode(MODE_FINISHED);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t// check if there still is one human alive\n\t\telse if(humanNumber <= 0)\n\t\t\t{\n\t\t\t\t// Makes the counter disapear\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 105, CR_BLUE, 0.03, 0.7, 1.0);\n\t\t\t\tHudMessageBold(s:\"\"; HUDMSG_PLAIN, 106, CR_RED, 0.03, 0.73, 1.0);\n\t\t\t\t// tell everyone that there is no human in this game\n\t\t\t\tsetfont(\"BIGFONT\");\n\t\t\t\tHudmessagebold(s:ZWinBig[random(0,1)]; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 6.5, 2.0);\n\t\t\t\tsetfont(\"SMALLFONT\");\n\t\t\t\tHudmessagebold(s:ZWinSmall[random(0,1)]; HUDMSG_FADEOUT, 103, CR_RED, 0.5, 0.33, 6.5, 2.0);\n\t\t\t\t// Incr stats\n\t\t\t\tIncrementStatistic(STATS_ZM_ZOMBIE_WINS);\n\t\t\t\t// put the game back in finished mode\n\t\t\t\tSetGameMode(MODE_FINISHED);\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdelay(35);\n\t}\n\twhile(1) {\n\t\tGame_info_finishtimer--;\n\n\t\t// timer reaches 0\n\t\tif(Game_info_finishtimer <= 0) {\n\t\t\t// Clears players inventories\n\t\t\tResetInventories();\n\t\t\tinventories_cleaned = true;\n\t\t\t// Save stats\n\t\t\tSaveStatistics();\n\t\t\tDelay(5);\n\t\t\tExit_Normal(0);\n\t\t}\n\n\t\tdelay(35);\n\t}\n}\n\nScript 905 (void) // ROUND TIMER\n{\n\t\twhile(Game_info_round_timer>0)\n\t\t{\n\t\t\tGame_info_round_timer--;\n\t\t\tSetFont(\"BIGFONT\");\n\t\t\tHudmessagebold(s:\"ROUND ENDS IN... \", d:Game_info_round_timer/60, s:\" : \", d:(Game_info_round_timer%60)/10, d:Game_info_round_timer%10;\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 107, CR_WHITE, 0.5, 0.97, 1.5);\n\n\t\t\tif(Game_info_round_timer<=10) {\n\t\t\t\tHudmessagebold(s:\"ROUND ENDS IN... \", d:Game_info_round_timer/60, s:\" : \", d:(Game_info_round_timer%60)/10, d:Game_info_round_timer%10;\n\t\t\t\t\t\t\t\tHUDMSG_FADEINOUT, 0, CR_RED, 0.5, 0.97, 0.0, 0.1, 0.6);\n\t\t\t\tAmbientSound(\"timer/one\", 100);\n\t\t\t}\n\n\t\t\tdelay(35);\n\t\t}\n\n\t\tAmbientSound(\"timer/end\", 100);\n\n\t\t// Kills every zombified player\n\t\tfor(int i = 0; i < 32; i++) {\n\t\t\t\tif(Infected[i]) Thing_Damage(PLAYER_TID+i, 10000, 0);\n\t\t}\n}\n\nScript 906 (void) { // Heart Beat\n\tint who;\n\theart_mode = true;\n\n\t//while(Game_info_round_timer>60) delay(35);\n\n\t// Finds the last human\n\tfor(int i=0; i<32; i++)\n\t\tif(CheckActorInventory(PLAYER_TID+i, \"humanmaker\"))\n\t\t{\n\t\t\twho=i;\n\t\t\tbreak;\n\t\t}\n\t// Changes activator and plays a sound\n\tSetActivator(PLAYER_TID+who);\n\twhile(Game_info_mode==MODE_PLAYING)\n\t{\n\t\tActivatorSound(\"sound/heartbeat\", 127);\n\t\tDelay(35*12);\n\t}\n}\n\nscript 990 (void) CLIENTSIDE /* Tips messages at start */\n{\n\tif(CheckInventory(\"humanmaker\")){\n\t\t// tips for humans\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(s:HTip[random(0,4)]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n\t}\n\n\telse if(CheckInventory(\"zombiemaker\")){\n\t\t// tips for the zombie\n\t\tsetfont(\"BIGFONT\");\n\t\tHudmessage(s:\"You have been infected!\"; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 2.0, 2.0);\n\t\t// Tips\n\t\tDelay(35*3);\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudmessage(s:ZTip[random(0,3)]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n\t}\n}\n\n/* Infection script */\nScript 153 (int number)\n{\n\tif(!CheckInventory(\"humanmaker\"))\n\t\tterminate;\n\n\tif(PlayerNumber() == -1)\n\t\tterminate;\n\n\t// Check whether the human has a kevlar\n\tif(CheckInventory(\"ProtectionVest\")) {\n\t\t// Play a sound\n\t\tActivatorSound(\"KEVLGONE\", 100);\n\t\t// Take it away\n\t\tTakeInventory(\"ProtectionVest\", 1);\n\t\t// Slash effect\n\t\tAcs_ExecuteAlways(157, 0, 0, 0, 0);\n\t\tterminate;\n\t}\n\n\t// Check whether the human is immune to infection\n\tif(CheckInventory(\"SyringeUsed\")) {\n\t\t\t// Pain sound\n\t\t\tActivatorSound(\"DSPLPAI2\", 127);\n\t\t\t// Achievement \"Relapse\"\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_SYRINGE, 0);\n\t\t\t// Slash effect\n\t\t\tAcs_ExecuteAlways(157, 0, 0, 0, 0);\n\t\t\t// terminate\n\t\t\tterminate;\n\t}\n\n\t// Determines how much health has to be given\n\tint hpfactor;\n\n\tif(number < 32 && number >=0)\n\t{\n\t\thpfactor = FixedDiv(GetActorProperty(number+PLAYER_TID, Aprop_Health), GetActorProperty(number+PLAYER_TID, Aprop_SpawnHealth));\n\t}\n\telse\n\t{\n\t\thpfactor = 1.0;\n\t}\n\n\t// Make sure of this\n\tif( hpfactor > 1.0 )\n\t\thpfactor = 1.0;\n\telse if ( hpfactor < 0.0 )\n\t\thpfactor = 0.0;\n\n\tbool isPanicking = CheckInventory(\"PanicSpeed\");\n\n\tBecomesZombie(PlayerNumber(), false, ZM_INFECTION, hpfactor);\n\n\t// Rewarding infector\n\tif(number<32){\n\t\tIncrementStatistic(STATS_INFECTIONS);\n\t\tInfectors[number]++;\n\t\tif(Infectors[number]%5==0) Acs_ExecuteAlways(164, 0, number, BONUS_CLASSIC, 0);\n\t\t// Achievements\n\t\tAcs_ExecuteAlways(809, 0, number, PROGRESS_INFECTS, 0);\n\t\tif(Infectors[number]==numberofhumans && numberofhumans>=6)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_EPIDEMIC, 0);\n\t\tif(Infectors[number]==12)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_MADNESS, 0);\n\t\tif(ROUND_TIME-Game_info_round_timer<=1)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_PREVENTIVE, 0);\n\t\tif(Game_info_round_timer<=10 && Game_info_mode==MODE_PLAYING)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_TIMING, 0);\n\t\t//if(CheckInventory(\"SyringeUsed\"))\n\t\t//\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_SYRINGE, 0);\n\t\tif(isPanicking)\n\t\t\tAcs_ExecuteAlways(800, 0, number, ACHV_INFECT_ROADRUNNER, 0);\n\t}\n\n\t// Upgrading the proper counters\n\tInfected[PlayerNumber()] = True;\n\tnumberofinfected++;\n\n\t// Messages\n\tSetFont(\"SMALLFONT\");\n\tif(number == 255)\n\t\tHudmessagebold(s:\"Unlucky \", n:0, s:\" \\cGhas received an infected syringe!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 101, CR_RED, 0.5, 0.4, 1.0, 2.0);\n\n\telse if (number == 254)\n\t\tHudmessagebold(n:0, s:\" \\cGhas been infected by an \\cKadmin!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT | HUDMSG_LOG, 101, CR_RED, 0.5, 0.4, 1.0, 2.0);\n\n\telse\n\t\tHudmessagebold(n:0, s:\" \\cGhas been infected by \\cK\", n:(1+number), s:\"\\cG!\";\n\t\t\t\t\t\tHUDMSG_FADEOUT, 101, CR_WHITE, 0.5, 0.4, 1.0, 2.0);\n\n\tSetfont(\"BIGFONT\");\n\tHudmessage(s:\"You have been infected!\"; HUDMSG_FADEOUT, 102, CR_RED, 0.5, 0.3, 2.0, 2.0);\n\tSetFont(\"SMALLFONT\");\n\tHudmessage(s:ZTip[random(0, 3)]; HUDMSG_fADEOUT, 108, CR_GREEN, 0.5, 0.25, 5.0);\n}\n\nScript 158 (void) // Burning zombies\n{\n\tGiveInventory(\"IsBurning\", 1);\n\tfor(int burnt = 0; burnt <= 20; burnt++) {\n\t\tSpawnProjectile(0, \"BurningFire\", 0, 0, 0, 0, 0);\n\t\tThing_Damage(0, 20, 0);\n\t\tDelay(10);\n\t}\n\tTakeInventory(\"IsBurning\", 1);\n}\n\nScript 159 (void) /* Round stats */\n{\n\tint j = 0;\n\tint k = 0;\n\n\tSetFont(\"BIGFONT\");\n\tHudmessageBold(s:\"Round Stats\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED, 0.5, 0.53, 5.0, 2.0);\n\n\t// Initial zombie(s)\n\tSetFont(\"SMALLFONT\");\n\tif(Game_info_zombie_2_tid==0) {\n\t\tHudmessageBold(s:\"Initial zombie\"; HUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.60, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_tid-PLAYER_TID+1); HUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.63, 5.0, 2.0);\n\t}\n\n\telse {\n\t\tHudmessageBold(s:\"Initial zombies\"; HUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.60, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_tid-PLAYER_TID+1); HUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.63, 5.0, 2.0);\n\t\tHudmessageBold(n:(Game_info_zombie_2_tid-PLAYER_TID+1); HUDMSG_FADEOUT, 0, CR_WHITE, 0.1, 0.66, 5.0, 2.0);\n\t}\n\n\t// infectors\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Infectors\"; HUDMSG_FADEOUT, 0, CR_YELLOW, 0.35, 0.60, 5.0, 2.0);\n\tfor(int l = 0; l < 32; l++) {\n\t\tif(Infectors[l]) {\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessageBold(n:(l+1), s:\"\\cJ : \", d:Infectors[l];\n\t\t\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.35, 0.63+(0.03*k), 5.0, 2.0);\n\t\t\tk++;\n\t\t}\n\t}\n\n\t// Zombie killers\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Zombies Killers\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.65, 0.60, 5.0, 2.0);\n\tfor(int i = 0; i < 32; i++) {\n\t\tif(Killers[i]) {\n\t\t\tSetFont(\"SMALLFONT\");\n\t\t\tHudmessageBold(n:(i+1), s:\"\\cJ : \", d:Killers[i]; HUDMSG_FADEOUT, 0, CR_WHITE, 0.65, 0.63+(0.03*j), 5.0, 2.0);\n\t\t\tj++;\n\t\t}\n\t}\n\n\t// % of survivors\n\tint infectedpeoplepencentage = 100*numberofinfected/numberofhumans;\n\n\t// Just making sure of this\n\tif( infectedpeoplepencentage < 0 )\n\t\tinfectedpeoplepencentage = 0;\n\n\telse if( infectedpeoplepencentage > 100 )\n\t\tinfectedpeoplepencentage = 100;\n\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Infected people\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.90, 0.60, 5.0, 2.0);\n\tHudmessageBold(d:infectedpeoplepencentage, s:\" %\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.83, 0.63, 5.0, 2.0);\n\n\t// ragequits\n\tint ragequitpercentage = 100*numberofquitters/numberofplayers;\n\tSetFont(\"SMALLFONT\");\n\tHudmessageBold(s:\"Disconnects \";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.10, 0.70, 5.0, 2.0);\n\tHudmessageBold(d:ragequitpercentage, s:\" %\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.13, 0.73, 5.0, 2.0);\n}\n\nScript 163 (void) // Zombie gets CURED\n{\n\tif(!CheckInventory(\"zombiemaker\"))\n\t\tterminate;\n\n\tBecomesHuman();\n\n\t// Upgrading the proper counters\n\tInfected[PlayerNumber()] = False;\n\tnumberofinfected--;\n\n}\n\nScript 201 (void) NET // !ZTELE\n{\n\tif( !PlayerInGame(PlayerNumber()) )\n\t\tterminate;\n\n\tif(Game_info_mode==MODE_PLAYING) {\n\t\tif(CheckInventory(\"zombiemaker\"))\n\t\t{\n\t\t\t\tif(CheckInventory(\"teleportations\")>=3)\n\t\t\t\t\tPrint(s:\"You can only teleport 3 times per round!\");\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tGiveInventory(\"teleportations\", 1);\n\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudmessage(s:\"You will be teleported at start in 3 seconds\";\n\t\t\t\t\t\t\t\tHUDMSG_fADEOUT, 0, CR_YELLOW, 0.5, 0.8, 2.0, 1.0);\n\n\t\t\t\t\tDelay(35*3);\n\t\t\t\t\tTeleport(501);\n\n\t\t\t\t\tSetFont(\"SMALLFONT\");\n\t\t\t\t\tHudmessage(s:\"Teleportation(s) left : \", d:(3-CheckInventory(\"teleportations\"));\n\t\t\t\t\t\t\t\tHUDMSG_fADEOUT, 0, CR_YELLOW, 0.5, 0.8, 1.0, 1.0);\n\t\t\t\t}\n\t\t}\n\t\telse if(CheckInventory(\"humanmaker\"))\n\t\t\tPrint(s:\"Ztele is for zombies only.\");\n\t}\n}\n\n// Change timer ---------------------------------------------------\nScript 613 (int seconds) NET {\n\tif(AdminPlayer[PlayerNumber()] && Game_info_mode == MODE_PLAYING)\n\t\tGame_info_round_timer=Game_info_round_timer+seconds;\n}\n\n// Achievements related\nScript 933 (void)\n{\n\tSetResultValue(ZM_GAME);\n}\n\nScript 934 (int who)\n{\n\tSetResultValue(0);\n}\n\n// Gl defauts ---------------------------------------------------\n/*\t// Not yet\nScript 866 OPEN\n{\n\tconsolecommand(\"set sv_forcegldefaults 1\");\n}\n\nScript 867 UNLOADING\n{\n\tconsolecommand(\"set sv_forcegldefaults 0\");\n}\n*/"
}
]
},
"maps": []
}