Advertisement
Chdata

k&r_saxtonhale.sp

Nov 29th, 2013
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 307.91 KB | None | 0 0
  1. //===VS Saxton Hale Mode===
  2. //Created by Rainbolt Dash (formerly Dr.Eggman): programmer, model-maker, mapper.
  3. //Notoriously famous for creating plugins with terrible code and then abandoning them
  4. //Maintained by FlaminSarge
  5. //He makes cool things. He improves on terrible things until they're good.
  6. //
  7. //Plugin thread on AlliedMods: http://forums.alliedmods.net/showthread.php?t=146884
  8. //New thread coming soon, maybe.
  9.  
  10. //Ok seriously this plugin is messy as all hell.
  11.  
  12. //Plugin reformated by MitsuInuSushi of TF2Data
  13. //k&r version
  14. //switch case's are tabbed a little strangely
  15.  
  16. #pragma semicolon 1
  17. #include <sourcemod>
  18. #include <sdktools>
  19. #include <sdkhooks>
  20. #include <tf2_stocks>
  21. #include <morecolors>
  22. #include <nextmap>
  23. #include <tf2items>
  24. #include <clientprefs>
  25. #undef REQUIRE_EXTENSIONS
  26. #tryinclude <steamtools>
  27. #define REQUIRE_EXTENSIONS
  28.  
  29. #define ME 2048
  30.  
  31. #define EF_BONEMERGE (1 << 0)
  32. #define EF_BONEMERGE_FASTCULL (1 << 7)
  33.  
  34. #define PLUGIN_VERSION "1.42"
  35.  
  36. #define HALEHHH_TELEPORTCHARGETIME 2
  37. #define HALE_JUMPCHARGETIME 1
  38.  
  39. #define HALEHHH_TELEPORTCHARGE (25 * HALEHHH_TELEPORTCHARGETIME)
  40. #define HALE_JUMPCHARGE (25 * HALE_JUMPCHARGETIME)
  41.  
  42. #define CBS_MAX_ARROWS 3
  43.  
  44. //#define EASTER_BUNNY_ON
  45. #define BunnyModel "models/player/saxton_hale/easter_demo.mdl"
  46. #define BunnyModelPrefix "models/player/saxton_hale/easter_demo"
  47. #define EggModel "models/player/saxton_hale/w_easteregg.mdl"
  48. #define EggModelPrefix "models/player/saxton_hale/w_easteregg"
  49. #define ReloadEggModel "models/player/saxton_hale/c_easter_cannonball.mdl"
  50. #define ReloadEggModelPrefix "models/player/saxton_hale/c_easter_cannonball"
  51.  
  52. static const String:BunnyWin[][] = {
  53. "vo/demoman_gibberish01.wav",
  54. "vo/demoman_gibberish12.wav",
  55. "vo/demoman_cheers02.wav",
  56. "vo/demoman_cheers03.wav",
  57. "vo/demoman_cheers06.wav",
  58. "vo/demoman_cheers07.wav",
  59. "vo/demoman_cheers08.wav",
  60. "vo/taunts/demoman_taunts12.wav"
  61. };
  62. static const String:BunnyJump[][] = {
  63. "vo/demoman_gibberish07.wav",
  64. "vo/demoman_gibberish08.wav",
  65. "vo/demoman_laughshort01.wav",
  66. "vo/demoman_positivevocalization04.wav"
  67. };
  68. static const String:BunnyRage[][] = {
  69. "vo/demoman_positivevocalization03.wav",
  70. "vo/demoman_dominationscout05.wav",
  71. "vo/demoman_cheers02.wav"
  72. };
  73. static const String:BunnyFail[][] = {
  74. "vo/demoman_gibberish04.wav",
  75. "vo/demoman_gibberish10.wav",
  76. "vo/demoman_jeers03.wav",
  77. "vo/demoman_jeers06.wav",
  78. "vo/demoman_jeers07.wav",
  79. "vo/demoman_jeers08.wav"
  80. };
  81. static const String:BunnyKill[][] = {
  82. "vo/demoman_gibberish09.wav",
  83. "vo/demoman_cheers02.wav",
  84. "vo/demoman_cheers07.wav",
  85. "vo/demoman_positivevocalization03.wav"
  86. };
  87. static const String:BunnySpree[][] = {
  88. "vo/demoman_gibberish05.wav",
  89. "vo/demoman_gibberish06.wav",
  90. "vo/demoman_gibberish09.wav",
  91. "vo/demoman_gibberish11.wav",
  92. "vo/demoman_gibberish13.wav",
  93. "vo/demoman_autodejectedtie01.wav"
  94. };
  95. static const String:BunnyLast[][] = {
  96. "vo/taunts/demoman_taunts05.wav",
  97. "vo/taunts/demoman_taunts04.wav",
  98. "vo/demoman_specialcompleted07.wav"
  99. };
  100. static const String:BunnyPain[][] = {
  101. "vo/demoman_sf12_badmagic01.wav",
  102. "vo/demoman_sf12_badmagic07.wav",
  103. "vo/demoman_sf12_badmagic10.wav"
  104. };
  105. static const String:BunnyStart[][] = {
  106. "vo/demoman_gibberish03.wav",
  107. "vo/demoman_gibberish11.wav"
  108. };
  109. static const String:BunnyRandomVoice[][] = {
  110. "vo/demoman_positivevocalization03.wav",
  111. "vo/demoman_jeers08.wav",
  112. "vo/demoman_gibberish03.wav",
  113. "vo/demoman_cheers07.wav",
  114. "vo/demoman_sf12_badmagic01.wav",
  115. "vo/burp02.wav",
  116. "vo/burp03.wav",
  117. "vo/burp04.wav",
  118. "vo/burp05.wav",
  119. "vo/burp06.wav",
  120. "vo/burp07.wav"
  121. };
  122.  
  123. #define HaleModel "models/player/saxton_hale/saxton_hale.mdl"
  124. #define HaleModelPrefix "models/player/saxton_hale/saxton_hale"
  125. #define CBSModel "models/player/saxton_hale/cbs_v4.mdl"
  126. #define CBSModelPrefix "models/player/saxton_hale/cbs_v4"
  127. #define HaleYellName "saxton_hale/saxton_hale_responce_1a.wav"
  128. #define HaleRageSoundB "saxton_hale/saxton_hale_responce_1b.wav"
  129. #define HaleComicArmsFallSound "saxton_hale/saxton_hale_responce_2.wav"
  130. #define HaleLastB "vo/announcer_am_lastmanalive"
  131. #define HaleEnabled QueuePanelH(Handle:0, MenuAction:0, 9001, 0)
  132. #define HaleKSpree "saxton_hale/saxton_hale_responce_3.wav"
  133. #define HaleKSpree2 "saxton_hale/saxton_hale_responce_4.wav" //this line is broken and unused
  134. #define VagineerModel "models/player/saxton_hale/vagineer_v134.mdl"
  135. #define VagineerModelPrefix "models/player/saxton_hale/vagineer_v134"
  136. #define VagineerLastA "saxton_hale/lolwut_0.wav"
  137. #define VagineerRageSound "saxton_hale/lolwut_2.wav"
  138. #define VagineerStart "saxton_hale/lolwut_1.wav"
  139. #define VagineerKSpree "saxton_hale/lolwut_3.wav"
  140. #define VagineerKSpree2 "saxton_hale/lolwut_4.wav"
  141. #define VagineerHit "saxton_hale/lolwut_5.wav"
  142. #define WrenchModel "models/weapons/w_models/w_wrench.mdl"
  143. #define ShivModel "models/weapons/c_models/c_wood_machete/c_wood_machete.mdl"
  144. #define HHHModel "models/player/saxton_hale/hhh_jr_mk3.mdl"
  145. #define HHHModelPrefix "models/player/saxton_hale/hhh_jr_mk3"
  146. #define AxeModel "models/weapons/c_models/c_headtaker/c_headtaker.mdl"
  147. #define HHHLaught "vo/halloween_boss/knight_laugh"
  148. #define HHHRage "vo/halloween_boss/knight_attack01.wav"
  149. #define HHHRage2 "vo/halloween_boss/knight_alert.wav"
  150. #define HHHAttack "vo/halloween_boss/knight_attack"
  151. #define CBS0 "vo/sniper_specialweapon08.wav"
  152. #define CBS1 "vo/taunts/sniper_taunts02.wav"
  153. #define CBS2 "vo/sniper_award"
  154. #define CBS3 "vo/sniper_battlecry03.wav"
  155. #define CBS4 "vo/sniper_domination"
  156. #define HHHTheme "ui/holiday/gamestartup_halloween.mp3"
  157. #define CBSTheme "saxton_hale/the_millionaires_holiday.mp3"
  158. #define CBSJump1 "vo/sniper_specialcompleted02.wav"
  159.  
  160. //===New responces===
  161. #define HaleRoundStart "saxton_hale/saxton_hale_responce_start" //1-5
  162. #define HaleJump "saxton_hale/saxton_hale_responce_jump" //1-2
  163. #define HaleRageSound "saxton_hale/saxton_hale_responce_rage" //1-4
  164. #define HaleKillMedic "saxton_hale/saxton_hale_responce_kill_medic.wav"
  165. #define HaleKillSniper1 "saxton_hale/saxton_hale_responce_kill_sniper1.wav"
  166. #define HaleKillSniper2 "saxton_hale/saxton_hale_responce_kill_sniper2.wav"
  167. #define HaleKillSpy1 "saxton_hale/saxton_hale_responce_kill_spy1.wav"
  168. #define HaleKillSpy2 "saxton_hale/saxton_hale_responce_kill_spy2.wav"
  169. #define HaleKillEngie1 "saxton_hale/saxton_hale_responce_kill_eggineer1.wav"
  170. #define HaleKillEngie2 "saxton_hale/saxton_hale_responce_kill_eggineer2.wav"
  171. #define HaleKSpreeNew "saxton_hale/saxton_hale_responce_spree" //1-5
  172. #define HaleWin "saxton_hale/saxton_hale_responce_win" //1-2
  173. #define HaleLastMan "saxton_hale/saxton_hale_responce_lastman" //1-5
  174. //#define HaleLastMan2Fixed "saxton_hale/saxton_hale_responce_lastman2.wav"
  175. #define HaleFail "saxton_hale/saxton_hale_responce_fail" //1-3
  176.  
  177. //===1.32 responces===
  178. #define HaleJump132 "saxton_hale/saxton_hale_132_jump_" //1-2
  179. #define HaleStart132 "saxton_hale/saxton_hale_132_start_" //1-5
  180. #define HaleKillDemo132 "saxton_hale/saxton_hale_132_kill_demo.wav"
  181. #define HaleKillEngie132 "saxton_hale/saxton_hale_132_kill_engie_" //1-2
  182. #define HaleKillHeavy132 "saxton_hale/saxton_hale_132_kill_heavy.wav"
  183. #define HaleKillScout132 "saxton_hale/saxton_hale_132_kill_scout.wav"
  184. #define HaleKillSpy132 "saxton_hale/saxton_hale_132_kill_spie.wav"
  185. #define HaleKillPyro132 "saxton_hale/saxton_hale_132_kill_w_and_m1.wav"
  186. #define HaleSappinMahSentry132 "saxton_hale/saxton_hale_132_kill_toy.wav"
  187. #define HaleKillKSpree132 "saxton_hale/saxton_hale_132_kspree_" //1-2
  188. #define HaleKillLast132 "saxton_hale/saxton_hale_132_last.wav"
  189. #define HaleStubbed132 "saxton_hale/saxton_hale_132_stub_" //1-4
  190.  
  191. //===New Vagineer's responces===
  192. #define VagineerRoundStart "saxton_hale/vagineer_responce_intro.wav"
  193. #define VagineerJump "saxton_hale/vagineer_responce_jump_" //1-2
  194. #define VagineerRageSound2 "saxton_hale/vagineer_responce_rage_" //1-4
  195. #define VagineerKSpreeNew "saxton_hale/vagineer_responce_taunt_" //1-5
  196. #define VagineerFail "saxton_hale/vagineer_responce_fail_" //1-2
  197. #define SOUNDEXCEPT_MUSIC 0
  198. #define SOUNDEXCEPT_VOICE 1
  199. #if defined _steamtools_included
  200. new bool:steamtools = false;
  201. #endif
  202. new OtherTeam = 2;
  203. new HaleTeam = 3;
  204. new VSHRoundState = -1;
  205. new playing;
  206. new healthcheckused;
  207. new RedAlivePlayers;
  208. new RoundCount;
  209. new Special;
  210. new Incoming;
  211.  
  212. enum
  213. {
  214. VSHSpecial_None = -1,
  215. VSHSpecial_Hale,
  216. VSHSpecial_Vagineer,
  217. VSHSpecial_HHH,
  218. VSHSpecial_CBS,
  219. VSHSpecial_Bunny //ohgodwhy
  220. }
  221. new Damage[MAXPLAYERS + 1];
  222. new curHelp[MAXPLAYERS + 1];
  223. new uberTarget[MAXPLAYERS + 1];
  224. #define VSHFLAG_HELPED (1 << 0)
  225. #define VSHFLAG_UBERREADY (1 << 1)
  226. #define VSHFLAG_NEEDSTODUCK (1 << 2)
  227. #define VSHFLAG_BOTRAGE (1 << 3)
  228. #define VSHFLAG_CLASSHELPED (1 << 4)
  229. #define VSHFLAG_HASONGIVED (1 << 5)
  230. new VSHFlags[MAXPLAYERS + 1];
  231. new Hale = -1;
  232. new HaleHealthMax;
  233. new HaleHealth;
  234. new HaleHealthLast;
  235. new HaleCharge = 0;
  236. new HaleRage;
  237. new NextHale;
  238. new Float:Stabbed;
  239. new Float:HPTime;
  240. new Float:KSpreeTimer;
  241. new Float:WeighDownTimer;
  242. new KSpreeCount = 1;
  243. new Float:UberRageCount;
  244. new Float:GlowTimer;
  245. new bool:bEnableSuperDuperJump;
  246. new Handle:cvarVersion;
  247. new Handle:cvarHaleSpeed;
  248. new Handle:cvarPointDelay;
  249. new Handle:cvarRageDMG;
  250. new Handle:cvarRageDist;
  251. new Handle:cvarAnnounce;
  252. new Handle:cvarSpecials;
  253. new Handle:cvarEnabled;
  254. new Handle:cvarAliveToEnable;
  255. new Handle:cvarPointType;
  256. new Handle:cvarCrits;
  257. new Handle:cvarRageSentry;
  258. new Handle:cvarFirstRound;
  259. new Handle:cvarCircuitStun;
  260. new Handle:cvarForceSpecToHale;
  261. new Handle:cvarEnableEurekaEffect;
  262. new Handle:cvarForceHaleTeam;
  263. new Handle:PointCookie;
  264. new Handle:MusicCookie;
  265. new Handle:VoiceCookie;
  266. new Handle:ClasshelpinfoCookie;
  267. new Handle:doorchecktimer;
  268. new Handle:jumpHUD;
  269. new Handle:rageHUD;
  270. new Handle:healthHUD;
  271. new bool:Enabled = false;
  272. new bool:Enabled2 = false;
  273. new Float:HaleSpeed = 340.0;
  274. new PointDelay = 6;
  275. new RageDMG = 3500;
  276. new Float:RageDist = 800.0;
  277. new Float:Announce = 120.0;
  278. new bSpecials = true;
  279. new AliveToEnable = 5;
  280. new PointType = 0;
  281. new bool:haleCrits = true;
  282. new bool:newRageSentry = true;
  283. new Float:circuitStun = 0.0;
  284. new Handle:MusicTimer;
  285. new TeamRoundCounter;
  286. new botqueuepoints = 0;
  287. new String:currentmap[99];
  288. new bool:checkdoors = false;
  289. new tf_arena_use_queue;
  290. new mp_teams_unbalance_limit;
  291. new tf_arena_first_blood;
  292. new mp_forcecamera;
  293. new Float:tf_scout_hype_pep_max;
  294. new defaulttakedamagetype;
  295.  
  296. static const String:haleversiontitles[][] = //the last line of this is what determines the displayed plugin version
  297. {
  298. "1.0",
  299. "1.1",
  300. "1.11",
  301. "1.12",
  302. "1.2",
  303. "1.22",
  304. "1.23",
  305. "1.24",
  306. "1.25",
  307. "1.26",
  308. "Christian Brutal Sniper",
  309. "1.28",
  310. "1.29",
  311. "1.30",
  312. "1.31",
  313. "1.32",
  314. "1.33",
  315. "1.34",
  316. "1.35",
  317. "1.35_3",
  318. "1.36",
  319. "1.36",
  320. "1.36",
  321. "1.36",
  322. "1.36",
  323. "1.36",
  324. "1.362",
  325. "1.363",
  326. "1.364",
  327. "1.365",
  328. "1.366",
  329. "1.367",
  330. "1.368",
  331. "1.369",
  332. "1.369",
  333. "1.369",
  334. "1.37",
  335. "1.37b", //15 Nov 2011
  336. "1.38",
  337. "1.38",
  338. "1.39beta",
  339. "1.39beta",
  340. "1.39beta",
  341. "1.39c",
  342. "1.39c",
  343. "1.39c",
  344. "1.40",
  345. "1.41",
  346. "1.42",
  347. };
  348. static const String:haleversiondates[][] =
  349. {
  350. "--",
  351. "--",
  352. "--",
  353. "--",
  354. "--",
  355. "--",
  356. "--",
  357. "--",
  358. "--",
  359. "--",
  360. "--",
  361. "--",
  362. "--",
  363. "--",
  364. "--",
  365. "--",
  366. "--",
  367. "--",
  368. "--",
  369. "--",
  370. "--",
  371. "--",
  372. "--",
  373. "--",
  374. "--",
  375. "--",
  376. "--",
  377. "--",
  378. "--",
  379. "--",
  380. "--",
  381. "25 Aug 2011",
  382. "26 Aug 2011",
  383. "09 Oct 2011",
  384. "09 Oct 2011",
  385. "09 Oct 2011",
  386. "15 Nov 2011",
  387. "15 Nov 2011",
  388. "17 Dec 2011",
  389. "17 Dec 2011",
  390. "05 Mar 2012",
  391. "05 Mar 2012",
  392. "05 Mar 2012",
  393. "16 Jul 2012",
  394. "16 Jul 2012",
  395. "16 Jul 2012",
  396. "10 Oct 2012",
  397. "25 Feb 2013",
  398. "30 Mar 2013"
  399. };
  400. static const maxversion = (sizeof(haleversiontitles)-1);
  401. new Handle:OnHaleJump;
  402. new Handle:OnHaleRage;
  403. new Handle:OnHaleWeighdown;
  404. new Handle:OnMusic;
  405.  
  406. new Handle:hEquipWearable;
  407. new Handle:hSetAmmoVelocity;
  408.  
  409. /*new Handle:OnIsVSHMap;
  410. new Handle:OnIsEnabled;
  411. new Handle:OnGetHale;
  412. new Handle:OnGetTeam;
  413. new Handle:OnGetSpecial;
  414. new Handle:OnGetHealth;
  415. new Handle:OnGetHealthMax;
  416. new Handle:OnGetDamage;
  417. new Handle:OnGetRoundState;*/
  418.  
  419. //new bool:ACH_Enabled;
  420. public Plugin:myinfo = {
  421. name = "VS Saxton Hale",
  422. author = "Chdata",
  423. description = "Hexy.",
  424. version = PLUGIN_VERSION,
  425. url = "http://forums.alliedmods.net/showthread.php?t=146884",
  426. };
  427.  
  428. public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
  429. {
  430. MarkNativeAsOptional("GetUserMessageType");
  431. MarkNativeAsOptional("PbSetInt");
  432. MarkNativeAsOptional("PbSetBool");
  433. MarkNativeAsOptional("PbSetString");
  434. MarkNativeAsOptional("PbAddString");
  435. /* CreateNative("VSH_IsSaxtonHaleModeMap", Native_IsVSHMap);
  436. OnIsVSHMap = CreateGlobalForward("VSH_OnIsSaxtonHaleModeMap", ET_Hook, Param_CellByRef);
  437.  
  438. CreateNative("VSH_IsSaxtonHaleModeEnabled", Native_IsEnabled);
  439. OnIsEnabled = CreateGlobalForward("VSH_OnIsSaxtonHaleModeEnabled", ET_Hook, Param_CellByRef);
  440.  
  441. CreateNative("VSH_GetSaxtonHaleUserId", Native_GetHale);
  442. OnGetHale = CreateGlobalForward("VSH_OnGetSaxtonHaleUserId", ET_Hook, Param_CellByRef);
  443.  
  444. CreateNative("VSH_GetSaxtonHaleTeam", Native_GetTeam);
  445. OnGetTeam = CreateGlobalForward("VSH_OnGetSaxtonHaleTeam", ET_Hook, Param_CellByRef);
  446.  
  447. CreateNative("VSH_GetSpecialRoundIndex", Native_GetSpecial);
  448. OnGetSpecial = CreateGlobalForward("VSH_OnGetSpecialRoundIndex", ET_Hook, Param_CellByRef);
  449.  
  450. CreateNative("VSH_GetSaxtonHaleHealth", Native_GetHealth);
  451. OnGetHealth = CreateGlobalForward("VSH_OnGetSaxtonHaleHealth", ET_Hook, Param_CellByRef);
  452.  
  453. CreateNative("VSH_GetSaxtonHaleHealthMax", Native_GetHealthMax);
  454. OnGetHealthMax = CreateGlobalForward("VSH_OnGetSaxtonHaleHealthMax", ET_Hook, Param_CellByRef);
  455.  
  456. CreateNative("VSH_GetClientDamage", Native_GetDamage);
  457. OnGetDamage = CreateGlobalForward("VSH_OnGetClientDamage", ET_Hook, Param_Cell,Param_CellByRef);
  458.  
  459. CreateNative("VSH_GetRoundState", Native_GetRoundState);
  460. OnGetRoundState = CreateGlobalForward("VSH_OnGetRoundState", ET_Hook, Param_CellByRef);*/
  461.  
  462. CreateNative("VSH_IsSaxtonHaleModeMap", Native_IsVSHMap);
  463. CreateNative("VSH_IsSaxtonHaleModeEnabled", Native_IsEnabled);
  464. CreateNative("VSH_GetSaxtonHaleUserId", Native_GetHale);
  465. CreateNative("VSH_GetSaxtonHaleTeam", Native_GetTeam);
  466. CreateNative("VSH_GetSpecialRoundIndex", Native_GetSpecial);
  467. CreateNative("VSH_GetSaxtonHaleHealth", Native_GetHealth);
  468. CreateNative("VSH_GetSaxtonHaleHealthMax", Native_GetHealthMax);
  469. CreateNative("VSH_GetClientDamage", Native_GetDamage);
  470. CreateNative("VSH_GetRoundState", Native_GetRoundState);
  471. OnHaleJump = CreateGlobalForward("VSH_OnDoJump", ET_Hook, Param_CellByRef);
  472. OnHaleRage = CreateGlobalForward("VSH_OnDoRage", ET_Hook, Param_FloatByRef);
  473. OnHaleWeighdown = CreateGlobalForward("VSH_OnDoWeighdown", ET_Hook);
  474. OnMusic = CreateGlobalForward("VSH_OnMusic", ET_Hook, Param_String, Param_FloatByRef);
  475. RegPluginLibrary("saxtonhale");
  476. #if defined _steamtools_included
  477. MarkNativeAsOptional("Steam_SetGameDescription");
  478. #endif
  479. return APLRes_Success;
  480. }
  481.  
  482. InitGamedata()
  483. {
  484. #if defined EASTER_BUNNY_ON
  485. new Handle:hGameConf = LoadGameConfigFile("saxtonhale");
  486.  
  487. if (hGameConf == INVALID_HANDLE)
  488. {
  489. SetFailState("[VSH] Unable to load gamedata file 'saxtonhale.txt'");
  490. return;
  491. }
  492. /* StartPrepSDKCall(SDKCall_Player);
  493. PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "CTFPlayer::EquipWearable");
  494. PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
  495. hEquipWearable = EndPrepSDKCall();
  496. if (hEquipWearable == INVALID_HANDLE)
  497. {
  498. SetFailState("[VSH] Failed to initialize call to CTFPlayer::EquipWearable");
  499. return;
  500. }*/
  501. StartPrepSDKCall(SDKCall_Entity);
  502. PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CTFAmmoPack::SetInitialVelocity");
  503. PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_Pointer);
  504. hSetAmmoVelocity = EndPrepSDKCall();
  505.  
  506. if (hSetAmmoVelocity == INVALID_HANDLE)
  507. {
  508. SetFailState("[VSH] Failed to initialize call to CTFAmmoPack::SetInitialVelocity");
  509. CloseHandle(hGameConf);
  510. return;
  511. }
  512.  
  513. CloseHandle(hGameConf);
  514. #endif
  515. }
  516.  
  517. /*public Action:Command_Eggs(client, args)
  518. {
  519. SpawnManyAmmoPacks(client, EggModel, 1);
  520. }*/
  521. public OnPluginStart()
  522. {
  523. InitGamedata();
  524. // RegAdminCmd("hale_eggs", Command_Eggs, ADMFLAG_ROOT); //WILL CRASH.
  525. //ACH_Enabled=LibraryExists("hale_achievements");
  526. LogMessage("===VS Saxton Hale Initializing - v.%s===", haleversiontitles[maxversion]);
  527. cvarVersion = CreateConVar("hale_version", haleversiontitles[maxversion], "VS Saxton Hale Version", FCVAR_NOTIFY | FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_DONTRECORD);
  528. cvarHaleSpeed = CreateConVar("hale_speed", "340.0", "Speed of Saxton Hale", FCVAR_PLUGIN);
  529. cvarPointType = CreateConVar("hale_point_type", "0", "Select condition to enable point (0 - alive players, 1 - time)", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  530. cvarPointDelay = CreateConVar("hale_point_delay", "6", "Addition (for each player) delay before point's activation.", FCVAR_PLUGIN);
  531. cvarAliveToEnable = CreateConVar("hale_point_alive", "5", "Enable control points when there are X people left alive.", FCVAR_PLUGIN);
  532. cvarRageDMG = CreateConVar("hale_rage_damage", "1900", "Damage required for Hale to gain rage", FCVAR_PLUGIN, true, 0.0);
  533. cvarRageDist = CreateConVar("hale_rage_dist", "800.0", "Distance to stun in Hale's rage. Vagineer and CBS are /3 (/2 for sentries)", FCVAR_PLUGIN, true, 0.0);
  534. cvarAnnounce = CreateConVar("hale_announce", "120.0", "Info about mode will show every X seconds. Must be greater than 1.0 to show.", FCVAR_PLUGIN, true, 0.0);
  535. cvarSpecials = CreateConVar("hale_specials", "1", "Enable Special Rounds (Vagineer, HHH, CBS)", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  536. cvarEnabled = CreateConVar("hale_enabled", "1", "Do you really want set it to 0?", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  537. cvarCrits = CreateConVar("hale_crits", "1", "Can Hale get crits?", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  538. cvarRageSentry = CreateConVar("hale_ragesentrydamagemode", "1", "If 0, to repair a sentry that has been damaged by rage, the Engineer must pick it up and put it back down.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  539. cvarFirstRound = CreateConVar("hale_first_round", "0", "Disable(0) or Enable(1) VSH in 1st round.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  540. cvarCircuitStun = CreateConVar("hale_circuit_stun", "0", "0 to disable Short Circuit stun, >0 to make it stun Hale for x seconds", FCVAR_PLUGIN, true, 0.0);
  541. cvarForceSpecToHale = CreateConVar("hale_spec_force_boss", "0", "1- if a spectator is up next, will force them to Hale + spectators will gain queue points, else spectators are ignored by plugin", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  542. cvarEnableEurekaEffect = CreateConVar("hale_enable_eureka", "0", "1- allow Eureka Effect, else disallow", FCVAR_PLUGIN, true, 0.0, true, 1.0);
  543. cvarForceHaleTeam = CreateConVar("hale_force_team", "0", "0- Use plugin logic, 1- random team, 2- red, 3- blue", FCVAR_PLUGIN, true, 0.0, true, 3.0);
  544. HookEvent("teamplay_round_start", event_round_start);
  545. HookEvent("teamplay_round_win", event_round_end);
  546. HookEvent("player_changeclass", event_changeclass);
  547. HookEvent("player_spawn", event_player_spawn);
  548. HookEvent("player_death", event_player_death, EventHookMode_Pre);
  549. HookEvent("player_chargedeployed", event_uberdeployed);
  550. HookEvent("player_hurt", event_hurt, EventHookMode_Pre);
  551. HookEvent("object_destroyed", event_destroy, EventHookMode_Pre);
  552. HookEvent("object_deflected", event_deflect, EventHookMode_Pre);
  553. HookUserMessage(GetUserMessageId("PlayerJarated"), event_jarate);
  554. HookConVarChange(cvarEnabled, CvarChange);
  555. HookConVarChange(cvarHaleSpeed, CvarChange);
  556. HookConVarChange(cvarRageDMG, CvarChange);
  557. HookConVarChange(cvarRageDist, CvarChange);
  558. HookConVarChange(cvarAnnounce, CvarChange);
  559. HookConVarChange(cvarSpecials, CvarChange);
  560. HookConVarChange(cvarPointType, CvarChange);
  561. HookConVarChange(cvarPointDelay, CvarChange);
  562. HookConVarChange(cvarAliveToEnable, CvarChange);
  563. HookConVarChange(cvarCrits, CvarChange);
  564. HookConVarChange(cvarRageSentry, CvarChange);
  565. HookConVarChange(cvarCircuitStun, CvarChange);
  566. RegConsoleCmd("hale", HalePanel);
  567. RegConsoleCmd("hale_hp", Command_GetHPCmd);
  568. RegConsoleCmd("halehp", Command_GetHPCmd);
  569. RegConsoleCmd("hale_next", QueuePanelCmd);
  570. RegConsoleCmd("halenext", QueuePanelCmd);
  571. RegConsoleCmd("hale_help", HelpPanelCmd);
  572. RegConsoleCmd("halehelp", HelpPanelCmd);
  573. RegConsoleCmd("hale_class", HelpPanel2Cmd);
  574. RegConsoleCmd("haleclass", HelpPanel2Cmd);
  575. RegConsoleCmd("hale_classinfotoggle", ClasshelpinfoCmd);
  576. RegConsoleCmd("haleclassinfotoggle", ClasshelpinfoCmd);
  577. RegConsoleCmd("hale_new", NewPanelCmd);
  578. RegConsoleCmd("halenew", NewPanelCmd);
  579. // RegConsoleCmd("hale_me", SkipHalePanelCmd);
  580. // RegConsoleCmd("haleme", SkipHalePanelCmd);
  581. RegConsoleCmd("halemusic", MusicTogglePanelCmd);
  582. RegConsoleCmd("hale_music", MusicTogglePanelCmd);
  583. RegConsoleCmd("halevoice", VoiceTogglePanelCmd);
  584. RegConsoleCmd("hale_voice", VoiceTogglePanelCmd);
  585. RegAdminCmd("hale_resetqueuepoints", ResetQueuePointsCmd, 0);
  586. RegAdminCmd("hale_resetq", ResetQueuePointsCmd, 0);
  587. AddCommandListener(DoTaunt, "taunt");
  588. AddCommandListener(DoTaunt, "+taunt");
  589. AddCommandListener(DoSuicide, "explode");
  590. AddCommandListener(DoSuicide, "kill");
  591. AddCommandListener(Destroy, "destroy");
  592. RegAdminCmd("hale_select", Command_HaleSelect, ADMFLAG_CHEATS, "hale_select <target> - Select a player to be next boss");
  593. RegAdminCmd("hale_special", Command_MakeNextSpecial, ADMFLAG_CHEATS, "Call a special to next round.");
  594. RegAdminCmd("hale_addpoints", Command_Points, ADMFLAG_CHEATS, "hale_addpoints <target> <points> - Add queue points to user.");
  595. RegAdminCmd("hale_point_enable", Command_Point_Enable, ADMFLAG_CHEATS, "Enable CP. Only with hale_point_type = 0");
  596. RegAdminCmd("hale_point_disable", Command_Point_Disable, ADMFLAG_CHEATS, "Disable CP. Only with hale_point_type = 0");
  597. RegAdminCmd("hale_stop_music", Command_StopMusic, ADMFLAG_CHEATS, "Stop any currently playing Boss music.");
  598. AutoExecConfig(true, "SaxtonHale");
  599. PointCookie = RegClientCookie("hale_queuepoints1", "Amount of VSH Queue points player has", CookieAccess_Protected);
  600. MusicCookie = RegClientCookie("hale_music_setting", "HaleMusic setting", CookieAccess_Public);
  601. VoiceCookie = RegClientCookie("hale_voice_setting", "HaleVoice setting", CookieAccess_Public);
  602. ClasshelpinfoCookie = RegClientCookie("hale_classinfo", "HaleClassinfo setting", CookieAccess_Public);
  603. jumpHUD = CreateHudSynchronizer();
  604. rageHUD = CreateHudSynchronizer();
  605. healthHUD = CreateHudSynchronizer();
  606.  
  607. LoadTranslations("saxtonhale.phrases");
  608. #if defined EASTER_BUNNY_ON
  609. LoadTranslations("saxtonhale_bunny.phrases");
  610. #endif
  611. LoadTranslations("common.phrases");
  612. for (new client = 0; client <= MaxClients; client++)
  613. {
  614. VSHFlags[client] = 0;
  615. Damage[client] = 0;
  616. uberTarget[client] = -1;
  617. if (IsValidClient(client, false)) SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  618. }
  619. AddNormalSoundHook(HookSound);
  620. #if defined _steamtools_included
  621. steamtools = LibraryExists("SteamTools");
  622. #endif
  623. AddMultiTargetFilter("@hale", HaleTargetFilter, "the current Boss", false);
  624. AddMultiTargetFilter("@!hale", HaleTargetFilter, "all non-Boss players", false);
  625. }
  626.  
  627. public bool:HaleTargetFilter(const String:pattern[], Handle:clients)
  628. {
  629. new bool:non = StrContains(pattern, "!", false) != -1;
  630. for (new client = 1; client <= MaxClients; client++)
  631. {
  632. if (IsValidClient(client) && FindValueInArray(clients, client) == -1)
  633. {
  634. if (Enabled && client == Hale)
  635. {
  636. if (!non)
  637. {
  638. PushArrayCell(clients, client);
  639. }
  640. }
  641. else if (non)
  642. {
  643. PushArrayCell(clients, client);
  644. }
  645. }
  646. }
  647.  
  648. return true;
  649. }
  650.  
  651. public OnLibraryAdded(const String:name[])
  652. {
  653. #if defined _steamtools_included
  654. if (strcmp(name, "SteamTools", false) == 0)
  655. steamtools = true;
  656. #endif
  657. // if (strcmp(name, "hale_achievements", false) == 0)
  658. // ACH_Enabled = true;
  659. }
  660.  
  661. public OnLibraryRemoved(const String:name[])
  662. {
  663. #if defined _steamtools_included
  664. if (strcmp(name, "SteamTools", false) == 0)
  665. steamtools = false;
  666. #endif
  667. // if (strcmp(name, "hale_achievements", false) == 0)
  668. // ACH_Enabled = false;
  669. }
  670.  
  671. public OnConfigsExecuted()
  672. {
  673. decl String:oldversion[64];
  674. GetConVarString(cvarVersion, oldversion, sizeof(oldversion));
  675.  
  676. if (strcmp(oldversion, haleversiontitles[maxversion], false) != 0)
  677. {
  678. LogError("[VS Saxton Hale] Warning: your config may be outdated. Back up your tf/cfg/sourcemod/SaxtonHale.cfg file and delete it, and this plugin will generate a new one that you can then modify to your original values.");
  679. }
  680.  
  681. SetConVarString(FindConVar("hale_version"), haleversiontitles[maxversion]);
  682. HaleSpeed = GetConVarFloat(cvarHaleSpeed);
  683. RageDMG = GetConVarInt(cvarRageDMG);
  684. RageDist = GetConVarFloat(cvarRageDist);
  685. Announce = GetConVarFloat(cvarAnnounce);
  686. bSpecials = GetConVarBool(cvarSpecials);
  687. PointType = GetConVarInt(cvarPointType);
  688. PointDelay = GetConVarInt(cvarPointDelay);
  689.  
  690. if (PointDelay < 0)
  691. {
  692. PointDelay *= -1;
  693. }
  694.  
  695. AliveToEnable = GetConVarInt(cvarAliveToEnable);
  696. haleCrits = GetConVarBool(cvarCrits);
  697. newRageSentry = GetConVarBool(cvarRageSentry);
  698. circuitStun = GetConVarFloat(cvarCircuitStun);
  699.  
  700. if (IsSaxtonHaleMap() && GetConVarBool(cvarEnabled))
  701. {
  702. tf_arena_use_queue = GetConVarInt(FindConVar("tf_arena_use_queue"));
  703. mp_teams_unbalance_limit = GetConVarInt(FindConVar("mp_teams_unbalance_limit"));
  704. tf_arena_first_blood = GetConVarInt(FindConVar("tf_arena_first_blood"));
  705. mp_forcecamera = GetConVarInt(FindConVar("mp_forcecamera"));
  706. tf_scout_hype_pep_max = GetConVarFloat(FindConVar("tf_scout_hype_pep_max"));
  707. SetConVarInt(FindConVar("tf_arena_use_queue"), 0);
  708. SetConVarInt(FindConVar("mp_teams_unbalance_limit"), 0);
  709. SetConVarInt(FindConVar("tf_arena_first_blood"), 0);
  710. SetConVarInt(FindConVar("mp_forcecamera"), 0);
  711. SetConVarFloat(FindConVar("tf_scout_hype_pep_max"), 100.0);
  712.  
  713. #if defined _steamtools_included
  714. if (steamtools)
  715. {
  716. decl String:gameDesc[64];
  717. Format(gameDesc, sizeof(gameDesc), "VS Saxton Hale %s", haleversiontitles[maxversion]);
  718. Steam_SetGameDescription(gameDesc);
  719. }
  720. #endif
  721.  
  722. Enabled = true;
  723. Enabled2 = true;
  724.  
  725. if (Announce > 1.0)
  726. {
  727. CreateTimer(Announce, Timer_Announce, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  728. }
  729. }
  730. else
  731. {
  732. Enabled2 = false;
  733. Enabled = false;
  734. }
  735. }
  736. public OnMapStart()
  737. {
  738. HPTime = 0.0;
  739. KSpreeTimer = 0.0;
  740. MusicTimer = INVALID_HANDLE;
  741. TeamRoundCounter = 0;
  742. doorchecktimer = INVALID_HANDLE;
  743. Hale = -1;
  744. for (new i = 1; i <= MaxClients; i++)
  745. {
  746. VSHFlags[i] = 0;
  747. }
  748. if (IsSaxtonHaleMap(true))
  749. {
  750. AddToDownload();
  751. IsDecemberHoliday(true);
  752. MapHasMusic(true);
  753. CheckToChangeMapDoors();
  754. }
  755. RoundCount = 0;
  756. }
  757. public OnMapEnd()
  758. {
  759. if (Enabled2 || Enabled)
  760. {
  761. SetConVarInt(FindConVar("tf_arena_use_queue"), tf_arena_use_queue);
  762. SetConVarInt(FindConVar("mp_teams_unbalance_limit"), mp_teams_unbalance_limit);
  763. SetConVarInt(FindConVar("tf_arena_first_blood"), tf_arena_first_blood);
  764. SetConVarInt(FindConVar("mp_forcecamera"), mp_forcecamera);
  765. SetConVarFloat(FindConVar("tf_scout_hype_pep_max"), tf_scout_hype_pep_max);
  766. #if defined _steamtools_included
  767. if (steamtools)
  768. {
  769. Steam_SetGameDescription("Team Fortress");
  770. }
  771. #endif
  772. }
  773. if (MusicTimer != INVALID_HANDLE)
  774. {
  775. KillTimer(MusicTimer);
  776. MusicTimer = INVALID_HANDLE;
  777. }
  778. }
  779.  
  780. public OnPluginEnd()
  781. {
  782. OnMapEnd();
  783. }
  784.  
  785. public AddToDownload()
  786. {
  787. decl String:s[PLATFORM_MAX_PATH];
  788. new String:extensions[][] = { ".mdl", ".dx80.vtx", ".dx90.vtx", ".sw.vtx", ".vvd", ".phy" };
  789. new String:extensionsb[][] = { ".vtf", ".vmt" };
  790. decl i;
  791. for (i = 0; i < sizeof(extensions); i++)
  792. {
  793. Format(s, PLATFORM_MAX_PATH, "%s%s", HaleModelPrefix, extensions[i]);
  794. if (FileExists(s, true))
  795. {
  796. AddFileToDownloadsTable(s);
  797. }
  798.  
  799. if (bSpecials)
  800. {
  801. Format(s, PLATFORM_MAX_PATH, "%s%s", VagineerModelPrefix, extensions[i]);
  802. if (FileExists(s, true))
  803. {
  804. AddFileToDownloadsTable(s);
  805. }
  806.  
  807. Format(s, PLATFORM_MAX_PATH, "%s%s", HHHModelPrefix, extensions[i]);
  808. if (FileExists(s, true))
  809. {
  810. AddFileToDownloadsTable(s);
  811. }
  812.  
  813. Format(s, PLATFORM_MAX_PATH, "%s%s", CBSModelPrefix, extensions[i]);
  814. if (FileExists(s, true))
  815. {
  816. AddFileToDownloadsTable(s);
  817. }
  818.  
  819. #if defined EASTER_BUNNY_ON
  820. Format(s, PLATFORM_MAX_PATH, "%s%s", BunnyModelPrefix, extensions[i]);
  821. if (FileExists(s, true))
  822. {
  823. AddFileToDownloadsTable(s);
  824. }
  825. Format(s, PLATFORM_MAX_PATH, "%s%s", EggModelPrefix, extensions[i]);
  826. if (FileExists(s, true))
  827. {
  828. AddFileToDownloadsTable(s);
  829. }
  830. // Format(s, PLATFORM_MAX_PATH, "%s%s", ReloadEggModelPrefix, extensions[i]);
  831. // if (FileExists(s, true)) AddFileToDownloadsTable(s);
  832. #endif
  833. }
  834. }
  835. PrecacheModel(HaleModel, true);
  836. if (bSpecials)
  837. {
  838. PrecacheModel(VagineerModel, true);
  839. PrecacheModel(HHHModel, true);
  840. PrecacheModel(CBSModel, true);
  841. #if defined EASTER_BUNNY_ON
  842. PrecacheModel(BunnyModel, true);
  843. PrecacheModel(EggModel, true);
  844. // PrecacheModel(ReloadEggModel, true);
  845. AddFileToDownloadsTable("materials/models/player/easter_demo/demoman_head_red.vmt");
  846. AddFileToDownloadsTable("materials/models/player/easter_demo/easter_body.vmt");
  847. AddFileToDownloadsTable("materials/models/player/easter_demo/easter_body.vtf");
  848. AddFileToDownloadsTable("materials/models/player/easter_demo/easter_rabbit.vmt");
  849. AddFileToDownloadsTable("materials/models/player/easter_demo/easter_rabbit.vtf");
  850. AddFileToDownloadsTable("materials/models/player/easter_demo/easter_rabbit_normal.vtf");
  851. AddFileToDownloadsTable("materials/models/props_easteregg/c_easteregg.vmt");
  852. AddFileToDownloadsTable("materials/models/props_easteregg/c_easteregg.vtf");
  853. AddFileToDownloadsTable("materials/models/props_easteregg/c_easteregg_gold.vmt");
  854. AddFileToDownloadsTable("materials/models/player/easter_demo/eyeball_r.vmt");
  855. #endif
  856. }
  857. for (i = 0; i < sizeof(extensionsb); i++)
  858. {
  859. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/eye%s", extensionsb[i]);
  860. AddFileToDownloadsTable(s);
  861. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/hale_head%s", extensionsb[i]);
  862. AddFileToDownloadsTable(s);
  863. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/hale_body%s", extensionsb[i]);
  864. AddFileToDownloadsTable(s);
  865. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/hale_misc%s", extensionsb[i]);
  866. AddFileToDownloadsTable(s);
  867. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/sniper_red%s", extensionsb[i]);
  868. AddFileToDownloadsTable(s);
  869. Format(s, PLATFORM_MAX_PATH, "materials/models/player/saxton_hale/sniper_lens%s", extensionsb[i]);
  870. AddFileToDownloadsTable(s);
  871. }
  872.  
  873. AddFileToDownloadsTable("materials/models/player/saxton_hale/sniper_head.vtf");
  874. AddFileToDownloadsTable("materials/models/player/saxton_hale/sniper_head_red.vmt");
  875. AddFileToDownloadsTable("materials/models/player/saxton_hale/hale_misc_normal.vtf");
  876. AddFileToDownloadsTable("materials/models/player/saxton_hale/hale_body_normal.vtf");
  877. AddFileToDownloadsTable("materials/models/player/saxton_hale/eyeball_l.vmt");
  878. AddFileToDownloadsTable("materials/models/player/saxton_hale/eyeball_r.vmt");
  879. AddFileToDownloadsTable("materials/models/player/saxton_hale/hale_egg.vtf");
  880. AddFileToDownloadsTable("materials/models/player/saxton_hale/hale_egg.vmt");
  881.  
  882. PrecacheSound(HaleComicArmsFallSound, true);
  883. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleComicArmsFallSound);
  884. AddFileToDownloadsTable(s);
  885. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKSpree);
  886. PrecacheSound(HaleKSpree, true);
  887. AddFileToDownloadsTable(s);
  888. PrecacheSound("saxton_hale/9000.wav", true);
  889. AddFileToDownloadsTable("sound/saxton_hale/9000.wav");
  890.  
  891. for (i = 1; i <= 4; i++)
  892. {
  893. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HaleLastB, i);
  894. PrecacheSound(s, true);
  895. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HHHLaught, i);
  896. PrecacheSound(s, true);
  897. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HHHAttack, i);
  898. PrecacheSound(s, true);
  899. }
  900. if (bSpecials)
  901. {
  902. PrecacheSound("ui/halloween_boss_summoned_fx.wav", true);
  903. PrecacheSound("ui/halloween_boss_defeated_fx.wav", true);
  904. PrecacheSound(VagineerLastA, true);
  905. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerLastA);
  906. AddFileToDownloadsTable(s);
  907. PrecacheSound(VagineerStart, true);
  908. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerStart);
  909. AddFileToDownloadsTable(s);
  910. PrecacheSound(VagineerRageSound, true);
  911. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerRageSound);
  912. AddFileToDownloadsTable(s);
  913. PrecacheSound(VagineerKSpree, true);
  914. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerKSpree);
  915. AddFileToDownloadsTable(s);
  916. PrecacheSound(VagineerKSpree2, true);
  917. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerKSpree2);
  918. AddFileToDownloadsTable(s);
  919. PrecacheSound(VagineerHit, true);
  920. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerHit);
  921. AddFileToDownloadsTable(s);
  922. PrecacheSound(HHHRage, true);
  923. PrecacheSound(HHHRage2, true);
  924. PrecacheSound(CBS0, true);
  925. PrecacheSound(CBS1, true);
  926. PrecacheSound(HHHTheme, true);
  927. PrecacheSound(CBSTheme, true);
  928. AddFileToDownloadsTable("sound/saxton_hale/the_millionaires_holiday.mp3");
  929. PrecacheSound(CBSJump1, true);
  930.  
  931. for (i = 1; i <= 25; i++)
  932. {
  933. if (i <= 9)
  934. {
  935. Format(s, PLATFORM_MAX_PATH, "%s%02i.wav", CBS2, i);
  936. PrecacheSound(s, true);
  937. }
  938. Format(s, PLATFORM_MAX_PATH, "%s%02i.wav", CBS4, i);
  939. PrecacheSound(s, true);
  940. }
  941. }
  942.  
  943. PrecacheSound(HaleKillMedic, true);
  944. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillMedic);
  945. AddFileToDownloadsTable(s);
  946. PrecacheSound(HaleKillSniper1, true);
  947. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillSniper1);
  948. AddFileToDownloadsTable(s);
  949. PrecacheSound(HaleKillSniper2, true);
  950. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillSniper2);
  951. AddFileToDownloadsTable(s);
  952. PrecacheSound(HaleKillSpy1, true);
  953. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillSpy1);
  954. AddFileToDownloadsTable(s);
  955. PrecacheSound(HaleKillSpy2, true);
  956. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillSpy2);
  957. AddFileToDownloadsTable(s);
  958. PrecacheSound(HaleKillEngie1, true);
  959. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillEngie1);
  960. AddFileToDownloadsTable(s);
  961. PrecacheSound(HaleKillEngie2, true);
  962. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillEngie2);
  963. AddFileToDownloadsTable(s);
  964. PrecacheSound(HaleKillDemo132, true);
  965. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillDemo132);
  966. AddFileToDownloadsTable(s);
  967. PrecacheSound(HaleKillHeavy132, true);
  968. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillHeavy132);
  969. AddFileToDownloadsTable(s);
  970. PrecacheSound(HaleKillScout132, true);
  971. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillScout132);
  972. AddFileToDownloadsTable(s);
  973. PrecacheSound(HaleKillSpy132, true);
  974. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillSpy132);
  975. AddFileToDownloadsTable(s);
  976. PrecacheSound(HaleKillPyro132, true);
  977. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillPyro132);
  978. AddFileToDownloadsTable(s);
  979. PrecacheSound(HaleSappinMahSentry132, true);
  980. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleSappinMahSentry132);
  981. AddFileToDownloadsTable(s);
  982. PrecacheSound(HaleKillLast132, true);
  983. Format(s, PLATFORM_MAX_PATH, "sound/%s", HaleKillLast132);
  984. AddFileToDownloadsTable(s);
  985. PrecacheSound("vo/announcer_am_capincite01.wav", true);
  986. PrecacheSound("vo/announcer_am_capincite03.wav", true);
  987. PrecacheSound("vo/announcer_am_capenabled02.wav", true);
  988.  
  989. for (i = 1; i <= 5; i++)
  990. {
  991. if (i <= 2)
  992. {
  993. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleJump, i);
  994. PrecacheSound(s, true);
  995. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  996. AddFileToDownloadsTable(s);
  997.  
  998. if (bSpecials)
  999. {
  1000. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerJump, i);
  1001. PrecacheSound(s, true);
  1002. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1003. AddFileToDownloadsTable(s);
  1004. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerRageSound2, i);
  1005. PrecacheSound(s, true);
  1006. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1007. AddFileToDownloadsTable(s);
  1008. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerFail, i);
  1009. PrecacheSound(s, true);
  1010. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1011. AddFileToDownloadsTable(s);
  1012. }
  1013.  
  1014. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleWin, i);
  1015. PrecacheSound(s, true);
  1016. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1017. AddFileToDownloadsTable(s);
  1018. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleJump132, i);
  1019. PrecacheSound(s, true);
  1020. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1021. AddFileToDownloadsTable(s);
  1022. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKillEngie132, i);
  1023. PrecacheSound(s, true);
  1024. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1025. AddFileToDownloadsTable(s);
  1026. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKillKSpree132, i);
  1027. PrecacheSound(s, true);
  1028. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1029. AddFileToDownloadsTable(s);
  1030. }
  1031.  
  1032. if (i <= 3)
  1033. {
  1034. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleFail, i);
  1035. PrecacheSound(s, true);
  1036. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1037. AddFileToDownloadsTable(s);
  1038. }
  1039.  
  1040. if (i <= 4)
  1041. {
  1042. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleRageSound, i);
  1043. PrecacheSound(s, true);
  1044. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1045. AddFileToDownloadsTable(s);
  1046. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleStubbed132, i);
  1047. PrecacheSound(s, true);
  1048. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1049. AddFileToDownloadsTable(s);
  1050. }
  1051.  
  1052. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleRoundStart, i);
  1053. PrecacheSound(s, true);
  1054. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1055. AddFileToDownloadsTable(s);
  1056.  
  1057. if (bSpecials)
  1058. {
  1059. PrecacheSound(VagineerRoundStart, true);
  1060. Format(s, PLATFORM_MAX_PATH, "sound/%s", VagineerRoundStart);
  1061. AddFileToDownloadsTable(s);
  1062. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerKSpreeNew, i);
  1063. PrecacheSound(s, true);
  1064. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1065. AddFileToDownloadsTable(s);
  1066. }
  1067.  
  1068. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKSpreeNew, i);
  1069. PrecacheSound(s, true);
  1070. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1071. AddFileToDownloadsTable(s);
  1072. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleLastMan, i);
  1073. PrecacheSound(s, true);
  1074. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1075. AddFileToDownloadsTable(s);
  1076. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleStart132, i);
  1077. PrecacheSound(s, true);
  1078. Format(s, PLATFORM_MAX_PATH, "sound/%s", s);
  1079. AddFileToDownloadsTable(s);
  1080. }
  1081.  
  1082. PrecacheSound("vo/engineer_no01.wav", true);
  1083. PrecacheSound("vo/engineer_jeers02.wav", true);
  1084. PrecacheSound("vo/sniper_dominationspy04.wav", true);
  1085. PrecacheSound("vo/halloween_boss/knight_pain01.wav", true);
  1086. PrecacheSound("vo/halloween_boss/knight_pain02.wav", true);
  1087. PrecacheSound("vo/halloween_boss/knight_pain03.wav", true);
  1088. PrecacheSound("vo/halloween_boss/knight_death01.wav", true);
  1089. PrecacheSound("vo/halloween_boss/knight_death02.wav", true);
  1090. PrecacheSound("weapons/barret_arm_zap.wav", true);
  1091. #if defined EASTER_BUNNY_ON
  1092. for (i = 0; i < sizeof(BunnyWin); i++)
  1093. {
  1094. PrecacheSound(BunnyWin[i], true);
  1095. }
  1096. for (i = 0; i < sizeof(BunnyJump); i++)
  1097. {
  1098. PrecacheSound(BunnyJump[i], true);
  1099. }
  1100. for (i = 0; i < sizeof(BunnyRage); i++)
  1101. {
  1102. PrecacheSound(BunnyRage[i], true);
  1103. }
  1104. for (i = 0; i < sizeof(BunnyFail); i++)
  1105. {
  1106. PrecacheSound(BunnyFail[i], true);
  1107. }
  1108. for (i = 0; i < sizeof(BunnyKill); i++)
  1109. {
  1110. PrecacheSound(BunnyKill[i], true);
  1111. }
  1112. for (i = 0; i < sizeof(BunnySpree); i++)
  1113. {
  1114. PrecacheSound(BunnySpree[i], true);
  1115. }
  1116. for (i = 0; i < sizeof(BunnyLast); i++)
  1117. {
  1118. PrecacheSound(BunnyLast[i], true);
  1119. }
  1120. for (i = 0; i < sizeof(BunnyPain); i++)
  1121. {
  1122. PrecacheSound(BunnyPain[i], true);
  1123. }
  1124. for (i = 0; i < sizeof(BunnyStart); i++)
  1125. {
  1126. PrecacheSound(BunnyStart[i], true);
  1127. }
  1128.  
  1129. #endif
  1130. }
  1131.  
  1132. public CvarChange(Handle:convar, const String:oldValue[], const String:newValue[])
  1133. {
  1134. if (convar == cvarHaleSpeed)
  1135. {
  1136. HaleSpeed = GetConVarFloat(convar);
  1137. }
  1138. else if (convar == cvarPointDelay)
  1139. {
  1140. PointDelay = GetConVarInt(convar);
  1141. if (PointDelay < 0)
  1142. {
  1143. PointDelay *= -1;
  1144. }
  1145. }
  1146. else if (convar == cvarRageDMG)
  1147. {
  1148. RageDMG = GetConVarInt(convar);
  1149. }
  1150. else if (convar == cvarRageDist)
  1151. {
  1152. RageDist = GetConVarFloat(convar);
  1153. }
  1154. else if (convar == cvarAnnounce)
  1155. {
  1156. Announce = GetConVarFloat(convar);
  1157. }
  1158. else if (convar == cvarSpecials)
  1159. {
  1160. bSpecials = GetConVarBool(convar);
  1161. }
  1162. else if (convar == cvarPointType)
  1163. {
  1164. PointType = GetConVarInt(convar);
  1165. }
  1166. else if (convar == cvarAliveToEnable)
  1167. {
  1168. AliveToEnable = GetConVarInt(convar);
  1169. }
  1170. else if (convar == cvarCrits)
  1171. {
  1172. haleCrits = GetConVarBool(convar);
  1173. }
  1174. else if (convar == cvarRageSentry)
  1175. {
  1176. newRageSentry = GetConVarBool(convar);
  1177. }
  1178. else if (convar == cvarCircuitStun)
  1179. {
  1180. circuitStun = GetConVarFloat(convar);
  1181. }
  1182. else if (convar == cvarEnabled)
  1183. {
  1184. if (GetConVarBool(convar) && IsSaxtonHaleMap())
  1185. {
  1186. Enabled2 = true;
  1187. #if defined _steamtools_included
  1188. if (steamtools)
  1189. {
  1190. decl String:gameDesc[64];
  1191. Format(gameDesc, sizeof(gameDesc), "VS Saxton Hale (%s)", haleversiontitles[maxversion]);
  1192. Steam_SetGameDescription(gameDesc);
  1193. }
  1194. #endif
  1195. }
  1196. }
  1197. }
  1198.  
  1199. public Action:Timer_Announce(Handle:hTimer)
  1200. {
  1201. static announcecount = -1;
  1202. announcecount++;
  1203. if (Announce > 1.0 && Enabled2)
  1204. {
  1205. switch (announcecount)
  1206. {
  1207. case 1:
  1208. {
  1209. CPrintToChatAll("{olive}[VSH]{default} Join the group:\n{lightgreen}http://steamcommunity.com/groups/tf2data{default}");
  1210. }
  1211. case 3:
  1212. {
  1213. CPrintToChatAll("{olive}[VSH]{default} VS Saxton Hale {olive}%s{default} by {olive}FlaminSarge{default} & {olive}Rainbolt Dash{default}.", haleversiontitles[maxversion]);
  1214. }
  1215. case 5:
  1216. {
  1217. announcecount = 0;
  1218. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_last_update", haleversiontitles[maxversion], haleversiondates[maxversion]);
  1219. }
  1220. default:
  1221. {
  1222. // if (ACH_Enabled)
  1223. // CPrintToChatAll("{olive}[VSH]{default} %t\n%t (experimental)", "vsh_open_menu", "vsh_open_ach");
  1224. // else
  1225. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_open_menu");
  1226. }
  1227. }
  1228. }
  1229. return Plugin_Continue;
  1230. }
  1231.  
  1232. /*public Action:OnGetGameDescription(String:gameDesc[64])
  1233. {
  1234. if (Enabled2)
  1235. {
  1236. Format(gameDesc, sizeof(gameDesc), "VSH:Data %s", haleversiontitles[maxversion]);
  1237. return Plugin_Changed;
  1238. }
  1239. return Plugin_Continue;
  1240. }*/
  1241.  
  1242. stock bool:IsSaxtonHaleMap(bool:forceRecalc = false)
  1243. {
  1244. static bool:found = false;
  1245. static bool:isVSHMap = false;
  1246.  
  1247. if (forceRecalc)
  1248. {
  1249. isVSHMap = false;
  1250. found = false;
  1251. }
  1252.  
  1253. if (!found)
  1254. {
  1255. decl String:s[PLATFORM_MAX_PATH];
  1256. GetCurrentMap(currentmap, sizeof(currentmap));
  1257.  
  1258. if (FileExists("bNextMapToHale"))
  1259. {
  1260. isVSHMap = true;
  1261. found = true;
  1262. return true;
  1263. }
  1264.  
  1265. BuildPath(Path_SM, s, PLATFORM_MAX_PATH, "configs/saxton_hale/saxton_hale_maps.cfg");
  1266.  
  1267. if (!FileExists(s))
  1268. {
  1269. LogError("[VSH] Unable to find %s, disabling plugin.", s);
  1270. isVSHMap = false;
  1271. found = true;
  1272. return false;
  1273. }
  1274.  
  1275. new Handle:fileh = OpenFile(s, "r");
  1276.  
  1277. if (fileh == INVALID_HANDLE)
  1278. {
  1279. LogError("[VSH] Error reading maps from %s, disabling plugin.", s);
  1280. isVSHMap = false;
  1281. found = true;
  1282. return false;
  1283. }
  1284.  
  1285. new pingas = 0;
  1286.  
  1287. while (!IsEndOfFile(fileh) && ReadFileLine(fileh, s, sizeof(s)) && (pingas < 100))
  1288. {
  1289. pingas++;
  1290. if (pingas == 100)
  1291. LogError("[VS Saxton Hale] Breaking infinite loop when trying to check the map.");
  1292. Format(s, strlen(s) - 1, s);
  1293. if (strncmp(s, "//", 2, false) == 0) continue;
  1294. if ((StrContains(currentmap, s, false) != -1) || (StrContains(s, "all", false) == 0))
  1295. {
  1296. CloseHandle(fileh);
  1297. isVSHMap = true;
  1298. found = true;
  1299. return true;
  1300. }
  1301. }
  1302.  
  1303. CloseHandle(fileh);
  1304. }
  1305.  
  1306. return isVSHMap;
  1307. }
  1308.  
  1309. stock bool:MapHasMusic(bool:forceRecalc = false)
  1310. {
  1311. static bool:hasMusic;
  1312. static bool:found = false;
  1313.  
  1314. if (forceRecalc)
  1315. {
  1316. found = false;
  1317. hasMusic = false;
  1318. }
  1319.  
  1320. if (!found)
  1321. {
  1322. new i = -1;
  1323. decl String:name[64];
  1324.  
  1325. while ((i = FindEntityByClassname2(i, "info_target")) != -1)
  1326. {
  1327. GetEntPropString(i, Prop_Data, "m_iName", name, sizeof(name));
  1328. if (strcmp(name, "hale_no_music", false) == 0) hasMusic = true;
  1329. }
  1330. found = true;
  1331. }
  1332.  
  1333. return hasMusic;
  1334. }
  1335.  
  1336. stock bool:CheckToChangeMapDoors()
  1337. {
  1338. decl String:s[PLATFORM_MAX_PATH];
  1339. GetCurrentMap(currentmap, sizeof(currentmap));
  1340. checkdoors = false;
  1341.  
  1342. BuildPath(Path_SM, s, PLATFORM_MAX_PATH, "configs/saxton_hale/saxton_hale_doors.cfg");
  1343.  
  1344. if (!FileExists(s))
  1345. {
  1346. if (strncmp(currentmap, "vsh_lolcano_pb1", 15, false) == 0)
  1347. {
  1348. checkdoors = true;
  1349. }
  1350. return;
  1351. }
  1352.  
  1353. new Handle:fileh = OpenFile(s, "r");
  1354.  
  1355. if (fileh == INVALID_HANDLE)
  1356. {
  1357. if (strncmp(currentmap, "vsh_lolcano_pb1", 15, false) == 0)
  1358. {
  1359. checkdoors = true;
  1360. }
  1361. return;
  1362. }
  1363.  
  1364. while (!IsEndOfFile(fileh) && ReadFileLine(fileh, s, sizeof(s)))
  1365. {
  1366. Format(s, strlen(s) - 1, s);
  1367. if (strncmp(s, "//", 2, false) == 0)
  1368. {
  1369. continue;
  1370. }
  1371.  
  1372. if (StrContains(currentmap, s, false) != -1 || StrContains(s, "all", false) == 0)
  1373. {
  1374. CloseHandle(fileh);
  1375. checkdoors = true;
  1376. return;
  1377. }
  1378. }
  1379.  
  1380. CloseHandle(fileh);
  1381. }
  1382.  
  1383. stock bool:CheckNextSpecial()
  1384. {
  1385. if (!bSpecials)
  1386. {
  1387. Special = VSHSpecial_Hale;
  1388. return true;
  1389. }
  1390.  
  1391. if (Incoming != VSHSpecial_None)
  1392. {
  1393. Special = Incoming;
  1394. Incoming = VSHSpecial_None;
  1395. return true;
  1396. }
  1397.  
  1398. while (Incoming == VSHSpecial_None || (Special && Special == Incoming))
  1399. {
  1400. Incoming = GetRandomInt(0, 8);
  1401. if (Special != VSHSpecial_Hale && !GetRandomInt(0, 5))
  1402. {
  1403. Incoming = VSHSpecial_Hale;
  1404. }
  1405. else
  1406. {
  1407. switch (Incoming)
  1408. {
  1409. case 1:
  1410. Incoming = VSHSpecial_Vagineer;
  1411. case 2:
  1412. Incoming = VSHSpecial_HHH;
  1413. case 3:
  1414. Incoming = VSHSpecial_CBS;
  1415. #if defined EASTER_BUNNY_ON
  1416. case 4:
  1417. Incoming = VSHSpecial_Bunny;
  1418. #endif
  1419. default:
  1420. Incoming = VSHSpecial_Hale;
  1421. }
  1422. if (IsDecemberHoliday() && !GetRandomInt(0, 7))
  1423. {
  1424. Incoming = VSHSpecial_CBS;
  1425. }
  1426. #if defined EASTER_BUNNY_ON
  1427. if (IsEasterHoliday() && !GetRandomInt(0, 7))
  1428. {
  1429. Incoming = VSHSpecial_Bunny;
  1430. }
  1431. #endif
  1432. }
  1433. }
  1434.  
  1435. Special = Incoming;
  1436. Incoming = VSHSpecial_None;
  1437.  
  1438. return true; //OH GOD WHAT AM I DOING THIS ALWAYS RETURNS TRUE (still better than using QueuePanelH as a dummy)
  1439. }
  1440.  
  1441. stock bool:IsEasterHoliday(bool:forceRecalc = false)
  1442. {
  1443. static iMonth;
  1444. static iDate;
  1445. static bool:found = false;
  1446.  
  1447. if (forceRecalc)
  1448. {
  1449. found = false;
  1450. iMonth = 0;
  1451. iDate = 0;
  1452. }
  1453.  
  1454. if (!found)
  1455. {
  1456. new timestamp = GetTime();
  1457. decl String:month[32], String:date[32];
  1458.  
  1459. FormatTime(month, sizeof(month), "%m", timestamp);
  1460. FormatTime(date, sizeof(date), "%d", timestamp);
  1461.  
  1462. iMonth = StringToInt(month);
  1463. iDate = StringToInt(date);
  1464. found = true;
  1465. }
  1466.  
  1467. return (iMonth == 3 && iDate >= 25) || (iMonth == 4 && iDate < 20);
  1468. }
  1469.  
  1470. stock bool:IsDecemberHoliday(bool:forceRecalc = false)
  1471. {
  1472. static iMonth;
  1473. static iDate;
  1474. static bool:found = false;
  1475.  
  1476. if (forceRecalc)
  1477. {
  1478. found = false;
  1479. iMonth = 0;
  1480. iDate = 0;
  1481. }
  1482.  
  1483. if (!found)
  1484. {
  1485. new timestamp = GetTime();
  1486. decl String:month[32], String:date[32];
  1487.  
  1488. FormatTime(month, sizeof(month), "%m", timestamp);
  1489. FormatTime(date, sizeof(date), "%d", timestamp);
  1490.  
  1491. iMonth = StringToInt(month);
  1492. iDate = StringToInt(date);
  1493. found = true;
  1494. }
  1495.  
  1496. return (iMonth == 12 && iDate >= 15);
  1497. }
  1498.  
  1499. public Action:event_round_start(Handle:event, const String:name[], bool:dontBroadcast)
  1500. {
  1501. if (!GetConVarBool(cvarEnabled))
  1502. {
  1503. #if defined _steamtools_included
  1504. if (Enabled2 && steamtools)
  1505. {
  1506. Steam_SetGameDescription("Team Fortress");
  1507. }
  1508. #endif
  1509. Enabled2 = false;
  1510. }
  1511.  
  1512. Enabled = Enabled2;
  1513.  
  1514. if (CheckNextSpecial() && !Enabled)
  1515. { //QueuePanelH(Handle:0, MenuAction:0, 9001, 0) is HaleEnabled
  1516. return Plugin_Continue;
  1517. }
  1518.  
  1519. if (FileExists("bNextMapToHale"))
  1520. {
  1521. DeleteFile("bNextMapToHale");
  1522. }
  1523.  
  1524. if (MusicTimer != INVALID_HANDLE)
  1525. {
  1526. KillTimer(MusicTimer);
  1527. MusicTimer = INVALID_HANDLE;
  1528. }
  1529.  
  1530. KSpreeCount = 0;
  1531.  
  1532. CheckArena();
  1533. GetCurrentMap(currentmap, sizeof(currentmap));
  1534.  
  1535. new bool:bBluHale;
  1536. new convarsetting = GetConVarInt(cvarForceHaleTeam);
  1537.  
  1538. switch (convarsetting)
  1539. {
  1540. case 3:
  1541. bBluHale = true;
  1542. case 2:
  1543. bBluHale = false;
  1544. case 1:
  1545. bBluHale = GetRandomInt(0, 1) == 1;
  1546. default:
  1547. {
  1548. if (strncmp(currentmap, "vsh_", 4, false) == 0)
  1549. {
  1550. bBluHale = true;
  1551. }
  1552. else if (TeamRoundCounter >= 3 && GetRandomInt(0, 1))
  1553. {
  1554. bBluHale = (HaleTeam != 3);
  1555. TeamRoundCounter = 0;
  1556. }
  1557. else
  1558. {
  1559. bBluHale = (HaleTeam == 3);
  1560. }
  1561. }
  1562. }
  1563.  
  1564. if (bBluHale)
  1565. {
  1566. new score1 = GetTeamScore(OtherTeam);
  1567. new score2 = GetTeamScore(HaleTeam);
  1568.  
  1569. SetTeamScore(2, score1);
  1570. SetTeamScore(3, score2);
  1571.  
  1572. OtherTeam = 2;
  1573. HaleTeam = 3;
  1574. bBluHale = false;
  1575. }
  1576. else
  1577. {
  1578. new score1 = GetTeamScore(HaleTeam);
  1579. new score2 = GetTeamScore(OtherTeam);
  1580.  
  1581. SetTeamScore(2, score1);
  1582. SetTeamScore(3, score2);
  1583.  
  1584. HaleTeam = 2;
  1585. OtherTeam = 3;
  1586. bBluHale = true;
  1587. }
  1588.  
  1589. playing = 0;
  1590.  
  1591. for (new ionplay = 1; ionplay <= MaxClients; ionplay++)
  1592. {
  1593. Damage[ionplay] = 0;
  1594. uberTarget[ionplay] = -1;
  1595.  
  1596. if (IsValidClient(ionplay))
  1597. {
  1598. StopHaleMusic(ionplay);
  1599. if (GetClientTeam(ionplay) > _:TFTeam_Spectator)
  1600. {
  1601. playing++;
  1602. }
  1603. }
  1604. }
  1605.  
  1606. if (GetClientCount() <= 1 || playing < 2)
  1607. {
  1608. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_needmoreplayers");
  1609. Enabled = false;
  1610. VSHRoundState = -1;
  1611. SetControlPoint(true);
  1612. return Plugin_Continue;
  1613. }
  1614. else if (RoundCount > 0)
  1615. {
  1616. Enabled = true;
  1617. }
  1618. else if (!GetConVarBool(cvarFirstRound))
  1619. {
  1620. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_first_round");
  1621.  
  1622. Enabled = false;
  1623. VSHRoundState = -1;
  1624. SetArenaCapEnableTime(60.0);
  1625.  
  1626. CreateTimer(71.0, Timer_EnableCap, _, TIMER_FLAG_NO_MAPCHANGE);
  1627.  
  1628. return Plugin_Continue;
  1629. }
  1630.  
  1631. if (GetTeamPlayerCount(TFTeam_Blue) <= 0 || GetTeamPlayerCount(TFTeam_Red) <= 0)
  1632. {
  1633. if (IsValidClient(Hale))
  1634. {
  1635. if (GetClientTeam(Hale) != HaleTeam)
  1636. {
  1637. SetEntProp(Hale, Prop_Send, "m_lifeState", 2);
  1638. ChangeClientTeam(Hale, HaleTeam);
  1639. SetEntProp(Hale, Prop_Send, "m_lifeState", 0);
  1640. TF2_RespawnPlayer(Hale);
  1641. }
  1642. }
  1643.  
  1644. for (new i = 1; i <= MaxClients; i++)
  1645. {
  1646. if (IsValidClient(i) && i != Hale && GetClientTeam(i) != _:TFTeam_Spectator && GetClientTeam(i) != _:TFTeam_Unassigned)
  1647. {
  1648. if (GetClientTeam(i) != OtherTeam)
  1649. {
  1650. SetEntProp(i, Prop_Send, "m_lifeState", 2);
  1651. ChangeClientTeam(i, OtherTeam);
  1652. SetEntProp(i, Prop_Send, "m_lifeState", 0);
  1653. TF2_RespawnPlayer(i);
  1654. }
  1655. }
  1656. }
  1657. return Plugin_Continue;
  1658. }
  1659.  
  1660. for (new i = 1; i <= MaxClients; i++)
  1661. {
  1662. if (!IsValidClient(i) || !IsPlayerAlive(i))
  1663. {
  1664. continue;
  1665. }
  1666.  
  1667. if (!(VSHFlags[i] & VSHFLAG_HASONGIVED))
  1668. {
  1669. TF2_RespawnPlayer(i);
  1670. }
  1671. }
  1672.  
  1673. new bool:see[MAXPLAYERS + 1];
  1674. new tHale = FindNextHale(see);
  1675.  
  1676. if (tHale == -1)
  1677. {
  1678. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_needmoreplayers");
  1679.  
  1680. Enabled = false;
  1681. VSHRoundState = -1;
  1682. SetControlPoint(true);
  1683.  
  1684. return Plugin_Continue;
  1685. }
  1686.  
  1687. if (NextHale > 0)
  1688. {
  1689. Hale = NextHale;
  1690. NextHale = -1;
  1691. }
  1692. else
  1693. {
  1694. Hale = tHale;
  1695. }
  1696.  
  1697. CreateTimer(9.1, StartHaleTimer);
  1698. CreateTimer(3.5, StartResponceTimer);
  1699. CreateTimer(9.6, MessageTimer, 9001);
  1700.  
  1701. HaleRage = 0;
  1702. Stabbed = 0.0;
  1703.  
  1704. new ent = -1;
  1705.  
  1706. decl Float:pos[3];
  1707.  
  1708. while ((ent = FindEntityByClassname2(ent, "func_regenerate")) != -1)
  1709. {
  1710. AcceptEntityInput(ent, "Disable");
  1711. }
  1712.  
  1713. ent = -1;
  1714.  
  1715. while ((ent = FindEntityByClassname2(ent, "func_respawnroomvisualizer")) != -1)
  1716. {
  1717. AcceptEntityInput(ent, "Disable");
  1718. }
  1719.  
  1720. ent = -1;
  1721.  
  1722. while ((ent = FindEntityByClassname2(ent, "obj_dispenser")) != -1)
  1723. {
  1724. SetVariantInt(OtherTeam);
  1725. AcceptEntityInput(ent, "SetTeam");
  1726. AcceptEntityInput(ent, "skin");
  1727. SetEntProp(ent, Prop_Send, "m_nSkin", OtherTeam - 2);
  1728. }
  1729.  
  1730. ent = -1;
  1731.  
  1732. while ((ent = FindEntityByClassname2(ent, "mapobj_cart_dispenser")) != -1)
  1733. {
  1734. SetVariantInt(OtherTeam);
  1735. AcceptEntityInput(ent, "SetTeam");
  1736. AcceptEntityInput(ent, "skin");
  1737. }
  1738.  
  1739. new bool:foundAmmo = false, bool:foundHealth = false;
  1740.  
  1741. ent = -1;
  1742.  
  1743. while ((ent = FindEntityByClassname2(ent, "item_ammopack_full")) != -1)
  1744. {
  1745. GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos);
  1746. AcceptEntityInput(ent, "Kill");
  1747. new ent2 = CreateEntityByName("item_ammopack_small");
  1748. TeleportEntity(ent2, pos, NULL_VECTOR, NULL_VECTOR);
  1749. DispatchSpawn(ent2);
  1750. foundAmmo = true;
  1751. }
  1752.  
  1753. ent = -1;
  1754.  
  1755. while ((ent = FindEntityByClassname2(ent, "item_ammopack_medium")) != -1)
  1756. {
  1757. GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos);
  1758. AcceptEntityInput(ent, "Kill");
  1759. new ent2 = CreateEntityByName("item_ammopack_small");
  1760. TeleportEntity(ent2, pos, NULL_VECTOR, NULL_VECTOR);
  1761. DispatchSpawn(ent2);
  1762. foundAmmo = true;
  1763. }
  1764.  
  1765. ent = -1;
  1766.  
  1767. while ((ent = FindEntityByClassname2(ent, "item_healthkit_small")) != -1)
  1768. {
  1769. foundHealth = true;
  1770. }
  1771.  
  1772. ent = -1;
  1773.  
  1774. while ((ent = FindEntityByClassname2(ent, "item_healthkit_medium")) != -1)
  1775. {
  1776. foundHealth = true;
  1777. }
  1778.  
  1779. ent = -1;
  1780.  
  1781. while ((ent = FindEntityByClassname2(ent, "item_healthkit_large")) != -1)
  1782. {
  1783. foundHealth = true;
  1784. }
  1785.  
  1786. if (!foundAmmo)
  1787. {
  1788. SpawnRandomAmmo();
  1789. }
  1790.  
  1791. if (!foundHealth)
  1792. {
  1793. SpawnRandomHealth();
  1794. }
  1795.  
  1796. CreateTimer(0.2, Timer_GogoHale);
  1797.  
  1798. healthcheckused = 0;
  1799. VSHRoundState = 0;
  1800.  
  1801. return Plugin_Continue;
  1802. }
  1803.  
  1804. stock SpawnRandomAmmo()
  1805. {
  1806. }
  1807.  
  1808. stock SpawnRandomHealth()
  1809. {
  1810. }
  1811.  
  1812. public Action:Timer_EnableCap(Handle:timer)
  1813. {
  1814. if (VSHRoundState == -1)
  1815. {
  1816. SetControlPoint(true);
  1817.  
  1818. if (checkdoors)
  1819. {
  1820. new ent = -1;
  1821. while ((ent = FindEntityByClassname2(ent, "func_door")) != -1)
  1822. {
  1823. AcceptEntityInput(ent, "Open");
  1824. AcceptEntityInput(ent, "Unlock");
  1825. }
  1826.  
  1827. if (doorchecktimer == INVALID_HANDLE)
  1828. {
  1829. doorchecktimer = CreateTimer(5.0, Timer_CheckDoors, _, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
  1830. }
  1831. }
  1832. }
  1833. }
  1834.  
  1835. stock GetTeamPlayerCount(TFTeam:team)
  1836. {
  1837. new count = 0;
  1838. for (new i = 1; i <= MaxClients; i++)
  1839. {
  1840. if (IsValidClient(i) && GetClientTeam(i) == _:team)
  1841. count++;
  1842. }
  1843. return count;
  1844. }
  1845.  
  1846. public Action:Timer_GogoHale(Handle:hTimer)
  1847. {
  1848. CreateTimer(0.1, MakeHale);
  1849. }
  1850.  
  1851. public Action:Timer_CheckDoors(Handle:hTimer)
  1852. {
  1853. if (!checkdoors)
  1854. {
  1855. doorchecktimer = INVALID_HANDLE;
  1856. return Plugin_Stop;
  1857. }
  1858.  
  1859. if ((!Enabled && VSHRoundState != -1) || (Enabled && VSHRoundState != 1))
  1860. {
  1861. return Plugin_Continue;
  1862. }
  1863.  
  1864. new ent = -1;
  1865.  
  1866. while ((ent = FindEntityByClassname2(ent, "func_door")) != -1)
  1867. {
  1868. AcceptEntityInput(ent, "Open");
  1869. AcceptEntityInput(ent, "Unlock");
  1870. }
  1871.  
  1872. return Plugin_Continue;
  1873. }
  1874.  
  1875. public CheckArena()
  1876. {
  1877. if (PointType)
  1878. {
  1879. SetArenaCapEnableTime(float(45 + PointDelay * (playing - 1)));
  1880. }
  1881. else
  1882. {
  1883. SetArenaCapEnableTime(0.0);
  1884. SetControlPoint(false);
  1885. }
  1886. }
  1887.  
  1888. public numHaleKills = 0; //See if the Hale was boosting his buddies or afk
  1889.  
  1890. public Action:event_round_end(Handle:event, const String:name[], bool:dontBroadcast)
  1891. {
  1892. new String:s[265];
  1893. decl String:s2[265];
  1894. new bool:see = false;
  1895.  
  1896. GetNextMap(s, 64);
  1897.  
  1898. if (!strncmp(s, "Hale ", 5, false))
  1899. {
  1900. see = true;
  1901. strcopy(s2, sizeof(s2), s[5]);
  1902. }
  1903. else if (!strncmp(s, "(Hale) ", 7, false))
  1904. {
  1905. see = true;
  1906. strcopy(s2, sizeof(s2), s[7]);
  1907. }
  1908. else if (!strncmp(s, "(Hale)", 6, false))
  1909. {
  1910. see = true;
  1911. strcopy(s2, sizeof(s2), s[6]);
  1912. }
  1913.  
  1914. if (see)
  1915. {
  1916. new Handle:fileh = OpenFile("bNextMapToHale", "w");
  1917. WriteFileString(fileh, s2, false);
  1918. CloseHandle(fileh);
  1919. SetNextMap(s2);
  1920. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_nextmap", s2);
  1921. }
  1922.  
  1923. RoundCount++;
  1924.  
  1925. if (!Enabled)
  1926. {
  1927. return Plugin_Continue;
  1928. }
  1929.  
  1930. VSHRoundState = 2;
  1931. TeamRoundCounter++;
  1932.  
  1933. if (GetEventInt(event, "team") == HaleTeam)
  1934. {
  1935. switch (Special)
  1936. {
  1937. case VSHSpecial_Hale:
  1938. {
  1939. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleWin, GetRandomInt(1, 2));
  1940. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1941. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1942. }
  1943. case VSHSpecial_Vagineer:
  1944. {
  1945. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerKSpreeNew, GetRandomInt(1, 5));
  1946. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1947. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1948. }
  1949. case VSHSpecial_Bunny:
  1950. {
  1951. strcopy(s, PLATFORM_MAX_PATH, BunnyWin[GetRandomInt(0, sizeof(BunnyWin)-1)]);
  1952. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1953. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, _, NULL_VECTOR, false, 0.0);
  1954. }
  1955. }
  1956. }
  1957.  
  1958. for (new i = 1; i <= MaxClients; i++)
  1959. {
  1960. if (!IsValidClient(i))
  1961. {
  1962. continue;
  1963. }
  1964. StopHaleMusic(i);
  1965. }
  1966.  
  1967. if (MusicTimer != INVALID_HANDLE)
  1968. {
  1969. KillTimer(MusicTimer);
  1970. MusicTimer = INVALID_HANDLE;
  1971. }
  1972.  
  1973. if (IsValidClient(Hale))
  1974. {
  1975. SetEntProp(Hale, Prop_Send, "m_bGlowEnabled", 0);
  1976. GlowTimer = 0.0;
  1977.  
  1978. if (IsPlayerAlive(Hale))
  1979. {
  1980. decl String:translation[32];
  1981. switch (Special)
  1982. {
  1983. case VSHSpecial_Bunny:
  1984. strcopy(translation, sizeof(translation), "vsh_bunny_is_alive");
  1985. case VSHSpecial_Vagineer:
  1986. strcopy(translation, sizeof(translation), "vsh_vagineer_is_alive");
  1987. case VSHSpecial_HHH:
  1988. strcopy(translation, sizeof(translation), "vsh_hhh_is_alive");
  1989. case VSHSpecial_CBS:
  1990. strcopy(translation, sizeof(translation), "vsh_cbs_is_alive");
  1991. default:
  1992. strcopy(translation, sizeof(translation), "vsh_hale_is_alive");
  1993. }
  1994.  
  1995. CPrintToChatAll("{olive}[VSH]{default} %t", translation, Hale, HaleHealth, HaleHealthMax);
  1996. SetHudTextParams(-1.0, 0.2, 10.0, 255, 255, 255, 255);
  1997.  
  1998. for (new i = 1; i <= MaxClients; i++)
  1999. {
  2000. if (IsValidClient(i))
  2001. {
  2002. ShowHudText(i, -1, "%T", translation, i, Hale, HaleHealth, HaleHealthMax);
  2003. }
  2004. }
  2005. }
  2006. else
  2007. {
  2008. if (GetClientTeam(Hale) != HaleTeam)
  2009. {
  2010. SetEntProp(Hale, Prop_Send, "m_lifeState", 2);
  2011. ChangeClientTeam(Hale, HaleTeam);
  2012. SetEntProp(Hale, Prop_Send, "m_lifeState", 0);
  2013. TF2_RespawnPlayer(Hale);
  2014. }
  2015. }
  2016.  
  2017. new top[3];
  2018. Damage[0] = 0;
  2019.  
  2020. for (new i = 0; i <= MaxClients; i++)
  2021. {
  2022. if (Damage[i] >= Damage[top[0]])
  2023. {
  2024. top[2] = top[1];
  2025. top[1] = top[0];
  2026. top[0] = i;
  2027. }
  2028. else if (Damage[i] >= Damage[top[1]])
  2029. {
  2030. top[2] = top[1];
  2031. top[1] = i;
  2032. }
  2033. else if (Damage[i] >= Damage[top[2]])
  2034. {
  2035. top[2] = i;
  2036. }
  2037. }
  2038.  
  2039. if (Damage[top[0]] > 9000)
  2040. {
  2041. CreateTimer(1.0, Timer_NineThousand, _, TIMER_FLAG_NO_MAPCHANGE);
  2042. }
  2043.  
  2044. decl String:s1[80];
  2045.  
  2046. if (IsValidClient(top[0]) && (GetClientTeam(top[0]) >= 1))
  2047. {
  2048. GetClientName(top[0], s, 80);
  2049. }
  2050. else
  2051. {
  2052. Format(s, 80, "---");
  2053. top[0] = 0;
  2054. }
  2055.  
  2056. if (IsValidClient(top[1]) && (GetClientTeam(top[1]) >= 1))
  2057. {
  2058. GetClientName(top[1], s1, 80);
  2059. }
  2060. else
  2061. {
  2062. Format(s1, 80, "---");
  2063. top[1] = 0;
  2064. }
  2065.  
  2066. if (IsValidClient(top[2]) && (GetClientTeam(top[2]) >= 1))
  2067. {
  2068. GetClientName(top[2], s2, 80);
  2069. }
  2070. else
  2071. {
  2072. Format(s2, 80, "---");
  2073. top[2] = 0;
  2074. }
  2075.  
  2076. SetHudTextParams(-1.0, 0.3, 10.0, 255, 255, 255, 255);
  2077. PrintCenterTextAll(""); //Should clear center text
  2078.  
  2079. for (new i = 1; i <= MaxClients; i++)
  2080. {
  2081. if (IsValidClient(i))
  2082. {
  2083. SetGlobalTransTarget(i);
  2084. // if (numHaleKills < 2 && false) ShowHudText(i, -1, "%t\n1)%i - %s\n2)%i - %s\n3)%i - %s\n\n%t %i\n%t %i", "vsh_top_3", Damage[top[0]], s, Damage[top[1]], s1, Damage[top[2]], s2, "vsh_damage_fx", Damage[i], "vsh_scores", RoundFloat(Damage[i] / 600.0));
  2085. // else
  2086. ShowHudText(i, -1, "%t\n1)%i - %s\n2)%i - %s\n3)%i - %s\n\n%t %i\n%t %i", "vsh_top_3", Damage[top[0]], s, Damage[top[1]], s1, Damage[top[2]], s2, "vsh_damage_fx", Damage[i], "vsh_scores", RoundFloat(Damage[i] / 600.0));
  2087. }
  2088. }
  2089. }
  2090.  
  2091. CreateTimer(3.0, Timer_CalcScores, _, TIMER_FLAG_NO_MAPCHANGE); //CalcScores();
  2092.  
  2093. return Plugin_Continue;
  2094. }
  2095.  
  2096. public Action:Timer_NineThousand(Handle:timer)
  2097. {
  2098. EmitSoundToAll("saxton_hale/9000.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 1.0, 100, _, _, NULL_VECTOR, false, 0.0);
  2099. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, "saxton_hale/9000.wav", _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 1.0, 100, _, _, NULL_VECTOR, false, 0.0);
  2100. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, "saxton_hale/9000.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 1.0, 100, _, _, NULL_VECTOR, false, 0.0);
  2101. }
  2102.  
  2103. public Action:Timer_CalcScores(Handle:timer)
  2104. {
  2105. CalcScores();
  2106. }
  2107.  
  2108. stock CalcScores()
  2109. {
  2110. decl j, damage;
  2111. new bool:spec = GetConVarBool(cvarForceSpecToHale);
  2112. botqueuepoints += 5;
  2113.  
  2114. for (new i = 1; i <= MaxClients; i++)
  2115. {
  2116. if (IsValidClient(i))
  2117. {
  2118. damage = Damage[i];
  2119.  
  2120. new Handle:aevent = CreateEvent("player_escort_score", true);
  2121.  
  2122. SetEventInt(aevent, "player", i);
  2123.  
  2124. for (j = 0; damage - 600 > 0; damage -= 600, j++) {}
  2125.  
  2126. SetEventInt(aevent, "points", j);
  2127. FireEvent(aevent);
  2128.  
  2129. if (i == Hale)
  2130. {
  2131. if (IsFakeClient(Hale))
  2132. {
  2133. botqueuepoints = 0;
  2134. }
  2135. else
  2136. {
  2137. SetClientQueuePoints(i, 0);
  2138. }
  2139. }
  2140. else if (!IsFakeClient(i) && (GetClientTeam(i) > _:TFTeam_Spectator || spec))
  2141. {
  2142. CPrintToChat(i, "{olive}[VSH]{default} %t", "vsh_add_points", 10);
  2143. SetClientQueuePoints(i, GetClientQueuePoints(i) + 10);
  2144. }
  2145. }
  2146. }
  2147. }
  2148.  
  2149. public Action:StartResponceTimer(Handle:hTimer)
  2150. {
  2151. decl String:s[PLATFORM_MAX_PATH];
  2152. decl Float:pos[3];
  2153.  
  2154. switch (Special)
  2155. {
  2156. case VSHSpecial_Bunny:
  2157. {
  2158. strcopy(s, PLATFORM_MAX_PATH, BunnyStart[GetRandomInt(0, sizeof(BunnyStart)-1)]);
  2159. }
  2160. case VSHSpecial_Vagineer:
  2161. {
  2162. if (!GetRandomInt(0, 1))
  2163. strcopy(s, PLATFORM_MAX_PATH, VagineerStart);
  2164. else
  2165. strcopy(s, PLATFORM_MAX_PATH, VagineerRoundStart);
  2166. }
  2167. case VSHSpecial_HHH:
  2168. Format(s, PLATFORM_MAX_PATH, "ui/halloween_boss_summoned_fx.wav");
  2169. case VSHSpecial_CBS:
  2170. strcopy(s, PLATFORM_MAX_PATH, CBS0);
  2171. default:
  2172. {
  2173. if (!GetRandomInt(0, 1))
  2174. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleRoundStart, GetRandomInt(1, 5));
  2175. else
  2176. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleStart132, GetRandomInt(1, 5));
  2177. }
  2178. }
  2179.  
  2180. EmitSoundToAll(s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, false, 0.0);
  2181. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, false, 0.0);
  2182.  
  2183. if (Special == VSHSpecial_CBS)
  2184. {
  2185. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, pos, NULL_VECTOR, false, 0.0);
  2186. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, pos, NULL_VECTOR, false, 0.0);
  2187. }
  2188.  
  2189. return Plugin_Continue;
  2190. }
  2191.  
  2192. public Action:StartHaleTimer(Handle:hTimer)
  2193. {
  2194. CreateTimer(0.1, GottamTimer);
  2195.  
  2196. if (!IsValidClient(Hale))
  2197. {
  2198. VSHRoundState = 2;
  2199. return Plugin_Continue;
  2200. }
  2201.  
  2202. if (!IsPlayerAlive(Hale))
  2203. {
  2204. TF2_RespawnPlayer(Hale);
  2205. }
  2206.  
  2207. playing = 0;
  2208.  
  2209. for (new client = 1; client <= MaxClients; client++)
  2210. {
  2211. if (IsValidClient(client) && (client != Hale) && IsPlayerAlive(client))
  2212. {
  2213. playing++;
  2214. CreateTimer(0.15, MakeNoHale, GetClientUserId(client));
  2215. }
  2216. }
  2217.  
  2218. if (playing < 5)
  2219. {
  2220. playing += 2;
  2221. }
  2222.  
  2223. HaleHealthMax = RoundFloat(Pow(((760.0 + playing)*(playing - 1)), 1.04));
  2224.  
  2225. if (HaleHealthMax == 0)
  2226. {
  2227. HaleHealthMax = 1322;
  2228. }
  2229.  
  2230. SetEntProp(Hale, Prop_Data, "m_iMaxHealth", HaleHealthMax);
  2231. // SetEntProp(Hale, Prop_Data, "m_iHealth", HaleHealthMax);
  2232. // SetEntProp(Hale, Prop_Send, "m_iHealth", HaleHealthMax);
  2233. SetHaleHealthFix(Hale, HaleHealthMax);
  2234. HaleHealth = HaleHealthMax;
  2235. HaleHealthLast = HaleHealth;
  2236. CreateTimer(0.2, CheckAlivePlayers);
  2237. CreateTimer(0.2, HaleTimer, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  2238. CreateTimer(0.2, StartRound);
  2239. CreateTimer(0.2, ClientTimer, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  2240.  
  2241. if (!PointType)
  2242. {
  2243. SetControlPoint(false);
  2244. }
  2245.  
  2246. if (VSHRoundState == 0)
  2247. {
  2248. CreateTimer(2.0, Timer_MusicPlay, _, TIMER_FLAG_NO_MAPCHANGE);
  2249. }
  2250.  
  2251. return Plugin_Continue;
  2252. }
  2253.  
  2254. public Action:Timer_MusicPlay(Handle:timer)
  2255. {
  2256. if (VSHRoundState != 1)
  2257. {
  2258. return Plugin_Stop;
  2259. }
  2260.  
  2261. new String:sound[PLATFORM_MAX_PATH] = "";
  2262. new Float:time = -1.0;
  2263.  
  2264. if (MusicTimer != INVALID_HANDLE)
  2265. {
  2266. KillTimer(MusicTimer);
  2267. MusicTimer = INVALID_HANDLE;
  2268. }
  2269.  
  2270. if (MapHasMusic())
  2271. {
  2272. strcopy(sound, sizeof(sound), "");
  2273. time = -1.0;
  2274. }
  2275. else
  2276. {
  2277. switch (Special)
  2278. {
  2279. case VSHSpecial_CBS:
  2280. {
  2281. strcopy(sound, sizeof(sound), CBSTheme);
  2282. time = 137.0;
  2283. }
  2284. case VSHSpecial_HHH:
  2285. {
  2286. strcopy(sound, sizeof(sound), HHHTheme);
  2287. time = 87.0;
  2288. }
  2289. }
  2290. }
  2291.  
  2292. new Action:act = Plugin_Continue;
  2293.  
  2294. Call_StartForward(OnMusic);
  2295.  
  2296. decl String:sound2[PLATFORM_MAX_PATH];
  2297. new Float:time2 = time;
  2298.  
  2299. strcopy(sound2, PLATFORM_MAX_PATH, sound);
  2300.  
  2301. Call_PushStringEx(sound2, PLATFORM_MAX_PATH, 0, SM_PARAM_COPYBACK);
  2302. Call_PushFloatRef(time2);
  2303. Call_Finish(act);
  2304.  
  2305. switch (act)
  2306. {
  2307. case Plugin_Stop, Plugin_Handled:
  2308. {
  2309. strcopy(sound, sizeof(sound), "");
  2310. time = -1.0;
  2311. }
  2312. case Plugin_Changed:
  2313. {
  2314. strcopy(sound, PLATFORM_MAX_PATH, sound2);
  2315. time = time2;
  2316. }
  2317. }
  2318.  
  2319. if (sound[0] != '\0')
  2320. {
  2321. // Format(sound, sizeof(sound), "#%s", sound);
  2322. EmitSoundToAllExcept(SOUNDEXCEPT_MUSIC, sound, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  2323. }
  2324.  
  2325. if (time != -1.0)
  2326. {
  2327. new Handle:pack;
  2328.  
  2329. MusicTimer = CreateDataTimer(time, Timer_MusicTheme, pack, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
  2330. WritePackString(pack, sound);
  2331. WritePackFloat(pack, time);
  2332. }
  2333.  
  2334. return Plugin_Continue;
  2335. }
  2336.  
  2337. public Action:Timer_MusicTheme(Handle:timer, any:pack)
  2338. {
  2339. decl String:sound[PLATFORM_MAX_PATH];
  2340. ResetPack(pack);
  2341. ReadPackString(pack, sound, sizeof(sound));
  2342. new Float:time = ReadPackFloat(pack);
  2343.  
  2344. if (Enabled && VSHRoundState == 1)
  2345. {
  2346. /* new String:sound[PLATFORM_MAX_PATH] = "";
  2347. switch (Special)
  2348. {
  2349. case VSHSpecial_CBS:
  2350. strcopy(sound, sizeof(sound), CBSTheme);
  2351. case VSHSpecial_HHH:
  2352. strcopy(sound, sizeof(sound), HHHTheme);
  2353. }*/
  2354.  
  2355. new Action:act = Plugin_Continue;
  2356. Call_StartForward(OnMusic);
  2357. decl String:sound2[PLATFORM_MAX_PATH];
  2358. new Float:time2 = time;
  2359. strcopy(sound2, PLATFORM_MAX_PATH, sound);
  2360. Call_PushStringEx(sound2, PLATFORM_MAX_PATH, 0, SM_PARAM_COPYBACK);
  2361. Call_PushFloatRef(time2);
  2362. Call_Finish(act);
  2363.  
  2364. switch (act)
  2365. {
  2366. case Plugin_Stop, Plugin_Handled:
  2367. {
  2368. strcopy(sound, sizeof(sound), "");
  2369. time = -1.0;
  2370. MusicTimer = INVALID_HANDLE;
  2371. return Plugin_Stop;
  2372. }
  2373. case Plugin_Changed:
  2374. {
  2375. strcopy(sound, PLATFORM_MAX_PATH, sound2);
  2376. if (time2 != time)
  2377. {
  2378. time = time2;
  2379. if (MusicTimer != INVALID_HANDLE)
  2380. {
  2381. KillTimer(MusicTimer);
  2382. MusicTimer = INVALID_HANDLE;
  2383. }
  2384. if (time != -1.0)
  2385. {
  2386. new Handle:datapack;
  2387. MusicTimer = CreateDataTimer(time, Timer_MusicTheme, datapack, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
  2388. WritePackString(datapack, sound);
  2389. WritePackFloat(datapack, time);
  2390. }
  2391. }
  2392. }
  2393. }
  2394.  
  2395. if (sound[0] != '\0')
  2396. {
  2397. // Format(sound, sizeof(sound), "#%s", sound);
  2398. EmitSoundToAllExcept(SOUNDEXCEPT_MUSIC, sound, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  2399. }
  2400. }
  2401. else
  2402. {
  2403. MusicTimer = INVALID_HANDLE;
  2404. return Plugin_Stop;
  2405. }
  2406.  
  2407. return Plugin_Continue;
  2408. }
  2409.  
  2410. stock EmitSoundToAllExcept(exceptiontype = SOUNDEXCEPT_MUSIC, const String:sample[],
  2411. entity = SOUND_FROM_PLAYER,
  2412. channel = SNDCHAN_AUTO,
  2413. level = SNDLEVEL_NORMAL,
  2414. flags = SND_NOFLAGS,
  2415. Float:volume = SNDVOL_NORMAL,
  2416. pitch = SNDPITCH_NORMAL,
  2417. speakerentity = -1,
  2418. const Float:origin[3] = NULL_VECTOR,
  2419. const Float:dir[3] = NULL_VECTOR,
  2420. bool:updatePos = true,
  2421. Float:soundtime = 0.0)
  2422. {
  2423.  
  2424. new clients[MaxClients];
  2425. new total = 0;
  2426.  
  2427. for (new i = 1; i <= MaxClients; i++)
  2428. {
  2429. if (IsClientInGame(i) && CheckSoundException(i, exceptiontype))
  2430. {
  2431. clients[total++] = i;
  2432. }
  2433. }
  2434.  
  2435. if (!total)
  2436. {
  2437. return;
  2438. }
  2439.  
  2440. EmitSound(clients, total, sample, entity, channel,
  2441. level, flags, volume, pitch, speakerentity,
  2442. origin, dir, updatePos, soundtime);
  2443. }
  2444.  
  2445. stock bool:CheckSoundException(client, excepttype)
  2446. {
  2447. if (!IsValidClient(client))
  2448. {
  2449. return false;
  2450. }
  2451.  
  2452. if (IsFakeClient(client) || !AreClientCookiesCached(client))
  2453. {
  2454. return true;
  2455. }
  2456.  
  2457. decl String:strCookie[32];
  2458.  
  2459. if (excepttype == SOUNDEXCEPT_VOICE)
  2460. {
  2461. GetClientCookie(client, VoiceCookie, strCookie, sizeof(strCookie));
  2462. }
  2463. else
  2464. {
  2465. GetClientCookie(client, MusicCookie, strCookie, sizeof(strCookie));
  2466. }
  2467.  
  2468. if (strCookie[0] == 0)
  2469. {
  2470. return true;
  2471. }
  2472. else
  2473. {
  2474. return bool:StringToInt(strCookie);
  2475. }
  2476. }
  2477.  
  2478. SetClientSoundOptions(client, excepttype, bool:on)
  2479. {
  2480. if (!IsValidClient(client) || IsFakeClient(client) || !AreClientCookiesCached(client))
  2481. {
  2482. return;
  2483. }
  2484.  
  2485. new String:strCookie[32];
  2486.  
  2487. if (on)
  2488. {
  2489. strCookie = "1";
  2490. }
  2491. else
  2492. {
  2493. strCookie = "0";
  2494. }
  2495.  
  2496. if (excepttype == SOUNDEXCEPT_VOICE)
  2497. {
  2498. SetClientCookie(client, VoiceCookie, strCookie);
  2499. }
  2500. else
  2501. {
  2502. SetClientCookie(client, MusicCookie, strCookie);
  2503. }
  2504. }
  2505.  
  2506. public Action:GottamTimer(Handle:hTimer)
  2507. {
  2508. for (new i = 1; i <= MaxClients; i++)
  2509. {
  2510. if (IsValidClient(i) && IsPlayerAlive(i))
  2511. {
  2512. SetEntityMoveType(i, MOVETYPE_WALK);
  2513. }
  2514. }
  2515. }
  2516.  
  2517. public Action:StartRound(Handle:hTimer)
  2518. {
  2519. VSHRoundState = 1;
  2520.  
  2521. if (IsValidClient(Hale))
  2522. {
  2523. if (!IsPlayerAlive(Hale) && TFTeam:GetClientTeam(Hale) != TFTeam_Spectator && TFTeam:GetClientTeam(Hale) != TFTeam_Unassigned)
  2524. {
  2525. TF2_RespawnPlayer(Hale);
  2526. }
  2527.  
  2528. if (GetClientTeam(Hale) != HaleTeam)
  2529. {
  2530. SetEntProp(Hale, Prop_Send, "m_lifeState", 2);
  2531. ChangeClientTeam(Hale, HaleTeam);
  2532. SetEntProp(Hale, Prop_Send, "m_lifeState", 0);
  2533. TF2_RespawnPlayer(Hale);
  2534. }
  2535.  
  2536. if (GetClientTeam(Hale) == HaleTeam)
  2537. {
  2538. new bool:pri = IsValidEntity(GetPlayerWeaponSlot(Hale, TFWeaponSlot_Primary));
  2539. new bool:sec = IsValidEntity(GetPlayerWeaponSlot(Hale, TFWeaponSlot_Secondary));
  2540. new bool:mel = IsValidEntity(GetPlayerWeaponSlot(Hale, TFWeaponSlot_Melee));
  2541.  
  2542. TF2_RemovePlayerDisguise(Hale);
  2543.  
  2544. if (pri || sec || !mel)
  2545. {
  2546. CreateTimer(0.05, Timer_ReEquipSaxton, _, TIMER_FLAG_NO_MAPCHANGE);
  2547. }
  2548. //EquipSaxton(Hale);
  2549. }
  2550. }
  2551.  
  2552. CreateTimer(10.0, Timer_SkipHalePanel);
  2553.  
  2554. return Plugin_Continue;
  2555. }
  2556.  
  2557. public Action:Timer_ReEquipSaxton(Handle:timer)
  2558. {
  2559. if (IsValidClient(Hale))
  2560. {
  2561. EquipSaxton(Hale);
  2562. }
  2563. }
  2564.  
  2565. public Action:Timer_SkipHalePanel(Handle:hTimer)
  2566. {
  2567. new bool:added[MAXPLAYERS + 1];
  2568. new i, j;
  2569. new client = Hale;
  2570.  
  2571. do
  2572. {
  2573. client = FindNextHale(added);
  2574.  
  2575. if (client >= 0)
  2576. {
  2577. added[client] = true;
  2578. }
  2579.  
  2580. if (IsValidClient(client) && client != Hale)
  2581. {
  2582. if (!IsFakeClient(client))
  2583. {
  2584. CPrintToChat(client, "{olive}[VSH]{default} %t", "vsh_to0_near");
  2585.  
  2586. if (i == 0)
  2587. {
  2588. SkipHalePanelNotify(client);
  2589. }
  2590. }
  2591.  
  2592. i++;
  2593. }
  2594.  
  2595. j++;
  2596. }
  2597. while (i < 3 && j < MAXPLAYERS + 1);
  2598. }
  2599.  
  2600. //new rightchoice[MAXPLAYERS + 1] = { 0, ... };
  2601. stock SkipHalePanelNotify(client, bool:newchoice = true)
  2602. {
  2603. if (!Enabled || !IsValidClient(client) || IsVoteInProgress())
  2604. {
  2605. return;
  2606. }
  2607.  
  2608. new Handle:panel = CreatePanel();
  2609. decl String:s[256];
  2610.  
  2611. SetPanelTitle(panel, "[VSH] You're Hale next!");
  2612. Format(s, sizeof(s), "%t\nAlternatively, use !hale_resetq.", "vsh_to0_near");
  2613. CRemoveTags(s, sizeof(s));
  2614.  
  2615. // ReplaceString(s, sizeof(s), "{olive}", "");
  2616. // ReplaceString(s, sizeof(s), "{default}", "");
  2617. /* DrawPanelText(panel, s);
  2618. DrawPanelText(panel, "");
  2619. DrawPanelText(panel, ">I've read this.");
  2620. if (newchoice) rightchoice[client] = GetRandomInt(0, 3);
  2621. for (new i = 0; i < 4; i++)
  2622. {
  2623. DrawPanelItem(panel, (i == rightchoice[client]) ? "Yes":"No");
  2624. }
  2625. SendPanelToClient(panel, client, SkipHalePanelH, 30);
  2626. CloseHandle(panel);
  2627. }
  2628. public SkipHalePanelH(Handle:menu, MenuAction:action, param1, param2)
  2629. {
  2630. if (param2-1 != rightchoice[param1] && param1 == FindNextHaleEx())
  2631. {
  2632. SkipHalePanelNotify(param1, false);
  2633. }
  2634. return;*/
  2635. }
  2636.  
  2637. public Action:EnableSG(Handle:hTimer, any:iid)
  2638. {
  2639. new i = EntRefToEntIndex(iid);
  2640. if (VSHRoundState == 1 && IsValidEdict(i) && i > MaxClients)
  2641. {
  2642. decl String:s[64];
  2643. GetEdictClassname(i, s, 64);
  2644.  
  2645. if (StrEqual(s, "obj_sentrygun"))
  2646. {
  2647. SetEntProp(i, Prop_Send, "m_bDisabled", 0);
  2648.  
  2649. for (new ent = MaxClients + 1; ent < ME; ent++)
  2650. {
  2651. if (IsValidEdict(ent))
  2652. {
  2653. new String:s2[64];
  2654.  
  2655. GetEdictClassname(ent, s2, 64);
  2656.  
  2657. if (StrEqual(s2, "info_particle_system") && (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") == i))
  2658. {
  2659. AcceptEntityInput(ent, "Kill");
  2660. }
  2661. }
  2662. }
  2663. }
  2664. }
  2665.  
  2666. return Plugin_Continue;
  2667. }
  2668.  
  2669. public Action:RemoveEnt(Handle:timer, any:entid)
  2670. {
  2671. new ent = EntRefToEntIndex(entid);
  2672.  
  2673. if (ent > 0 && IsValidEntity(ent))
  2674. {
  2675. AcceptEntityInput(ent, "Kill");
  2676. }
  2677.  
  2678. return Plugin_Continue;
  2679. }
  2680.  
  2681. public Action:MessageTimer(Handle:hTimer, any:client)
  2682. {
  2683. if (!IsValidClient(Hale) || ((client != 9001) && !IsValidClient(client)))
  2684. {
  2685. return Plugin_Continue;
  2686. }
  2687.  
  2688. if (checkdoors)
  2689. {
  2690. new ent = -1;
  2691.  
  2692. while ((ent = FindEntityByClassname2(ent, "func_door")) != -1)
  2693. {
  2694. AcceptEntityInput(ent, "Open");
  2695. AcceptEntityInput(ent, "Unlock");
  2696. }
  2697.  
  2698. if (doorchecktimer == INVALID_HANDLE)
  2699. {
  2700. doorchecktimer = CreateTimer(5.0, Timer_CheckDoors, _, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
  2701. }
  2702. }
  2703.  
  2704. decl String:translation[32];
  2705.  
  2706. switch (Special)
  2707. {
  2708. case VSHSpecial_Bunny:
  2709. strcopy(translation, sizeof(translation), "vsh_start_bunny");
  2710. case VSHSpecial_Vagineer:
  2711. strcopy(translation, sizeof(translation), "vsh_start_vagineer");
  2712. case VSHSpecial_HHH:
  2713. strcopy(translation, sizeof(translation), "vsh_start_hhh");
  2714. case VSHSpecial_CBS:
  2715. strcopy(translation, sizeof(translation), "vsh_start_cbs");
  2716. default:
  2717. strcopy(translation, sizeof(translation), "vsh_start_hale");
  2718. }
  2719.  
  2720. SetHudTextParams(-1.0, 0.4, 10.0, 255, 255, 255, 255);
  2721.  
  2722. if (client != 9001)
  2723. {
  2724. ShowHudText(client, -1, "%T", translation, client, Hale, HaleHealthMax);
  2725. }
  2726. else
  2727. {
  2728. for (new i = 1; i <= MaxClients; i++)
  2729. {
  2730. if (IsValidClient(i))
  2731. {
  2732. ShowHudText(i, -1, "%T", translation, i, Hale, HaleHealthMax);
  2733. }
  2734. }
  2735. }
  2736.  
  2737. return Plugin_Continue;
  2738. }
  2739.  
  2740. public Action:MakeModelTimer(Handle:hTimer)
  2741. {
  2742. if (!IsValidClient(Hale) || !IsPlayerAlive(Hale) || VSHRoundState == 2)
  2743. {
  2744. return Plugin_Stop;
  2745. }
  2746.  
  2747. new body = 0;
  2748.  
  2749. switch (Special)
  2750. {
  2751. case VSHSpecial_Bunny:
  2752. {
  2753. SetVariantString(BunnyModel);
  2754. }
  2755. case VSHSpecial_Vagineer:
  2756. {
  2757. SetVariantString(VagineerModel);
  2758. // SetEntProp(Hale, Prop_Send, "m_nSkin", GetClientTeam(Hale)-2);
  2759. }
  2760. case VSHSpecial_HHH:
  2761. SetVariantString(HHHModel);
  2762. case VSHSpecial_CBS:
  2763. SetVariantString(CBSModel);
  2764. default:
  2765. {
  2766. SetVariantString(HaleModel);
  2767. // decl String:steamid[32];
  2768. // GetClientAuthString(Hale, steamid, sizeof(steamid));
  2769. if (GetUserFlagBits(Hale) & ADMFLAG_CUSTOM1)
  2770. {
  2771. body = (1 << 0) | (1 << 1);
  2772. }
  2773. }
  2774. }
  2775. // DispatchKeyValue(Hale, "targetname", "hale");
  2776. AcceptEntityInput(Hale, "SetCustomModel");
  2777.  
  2778. SetEntProp(Hale, Prop_Send, "m_bUseClassAnimations", 1);
  2779. SetEntProp(Hale, Prop_Send, "m_nBody", body);
  2780.  
  2781. return Plugin_Continue;
  2782. }
  2783.  
  2784. EquipSaxton(client)
  2785. {
  2786. bEnableSuperDuperJump = false;
  2787. new SaxtonWeapon;
  2788.  
  2789. TF2_RemoveAllWeapons(client);
  2790. HaleCharge = 0;
  2791.  
  2792. switch (Special)
  2793. {
  2794. case VSHSpecial_Bunny:
  2795. {
  2796. SaxtonWeapon = SpawnWeapon(client, "tf_weapon_bottle", 1, 100, 5, "68 ; 2.0 ; 2 ; 3.0 ; 259 ; 1.0 ; 326 ; 1.3");
  2797. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SaxtonWeapon);
  2798. }
  2799. case VSHSpecial_Vagineer:
  2800. {
  2801. SaxtonWeapon = SpawnWeapon(client, "tf_weapon_wrench", 197, 100, 5, "68 ; 2.0 ; 2 ; 3.1 ; 259 ; 1.0 ; 436 ; 1.0");
  2802. SetEntProp(SaxtonWeapon, Prop_Send, "m_iWorldModelIndex", -1);
  2803. SetEntProp(SaxtonWeapon, Prop_Send, "m_nModelIndexOverrides", -1, _, 0);
  2804. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SaxtonWeapon);
  2805. }
  2806. case VSHSpecial_HHH:
  2807. {
  2808. SaxtonWeapon = SpawnWeapon(client, "tf_weapon_sword", 266, 100, 5, "68 ; 2.0 ; 2 ; 3.1 ; 259 ; 1.0 ; 252 ; 0.6");
  2809. SetEntProp(SaxtonWeapon, Prop_Send, "m_iWorldModelIndex", -1);
  2810. SetEntProp(SaxtonWeapon, Prop_Send, "m_nModelIndexOverrides", -1, _, 0);
  2811. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SaxtonWeapon);
  2812. HaleCharge = -500;
  2813. }
  2814. case VSHSpecial_CBS:
  2815. {
  2816. SaxtonWeapon = SpawnWeapon(client, "tf_weapon_club", 171, 100, 5, "68 ; 2.0 ; 2 ; 3.1 ; 259 ; 1.0");
  2817. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SaxtonWeapon);
  2818. SetEntProp(client, Prop_Send, "m_nBody", 0);
  2819. SetEntProp(SaxtonWeapon, Prop_Send, "m_nModelIndexOverrides", GetEntProp(SaxtonWeapon, Prop_Send, "m_iWorldModelIndex"), _, 0);
  2820. }
  2821. default:
  2822. {
  2823. decl String:attribs[64];
  2824. Format(attribs, sizeof(attribs), "68 ; 2.0 ; 2 ; 3.1 ; 259 ; 1.0 ; 252 ; 0.6 ; 214 ; %d", GetRandomInt(9999, 99999));
  2825. SaxtonWeapon = SpawnWeapon(client, "tf_weapon_shovel", 5, 100, 4, attribs);
  2826. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SaxtonWeapon);
  2827. }
  2828. }
  2829. }
  2830. public Action:MakeHale(Handle:hTimer)
  2831. {
  2832. if (!IsValidClient(Hale))
  2833. {
  2834. return Plugin_Continue;
  2835. }
  2836.  
  2837. switch (Special)
  2838. {
  2839. case VSHSpecial_Hale:
  2840. TF2_SetPlayerClass(Hale, TFClass_Soldier, _, false);
  2841. case VSHSpecial_Vagineer:
  2842. TF2_SetPlayerClass(Hale, TFClass_Engineer, _, false);
  2843. case VSHSpecial_HHH, VSHSpecial_Bunny:
  2844. TF2_SetPlayerClass(Hale, TFClass_DemoMan, _, false);
  2845. case VSHSpecial_CBS:
  2846. TF2_SetPlayerClass(Hale, TFClass_Sniper, _, false);
  2847. }
  2848.  
  2849. TF2_RemovePlayerDisguise(Hale);
  2850.  
  2851. if (GetClientTeam(Hale) != HaleTeam)
  2852. {
  2853. SetEntProp(Hale, Prop_Send, "m_lifeState", 2);
  2854. ChangeClientTeam(Hale, HaleTeam);
  2855. SetEntProp(Hale, Prop_Send, "m_lifeState", 0);
  2856. TF2_RespawnPlayer(Hale);
  2857. }
  2858.  
  2859. if (VSHRoundState < 0)
  2860. {
  2861. return Plugin_Continue;
  2862. }
  2863.  
  2864. if (!IsPlayerAlive(Hale))
  2865. {
  2866. if (VSHRoundState == 0)
  2867. {
  2868. TF2_RespawnPlayer(Hale);
  2869. }
  2870. else
  2871. {
  2872. return Plugin_Continue;
  2873. }
  2874. }
  2875.  
  2876. new iFlags = GetCommandFlags("r_screenoverlay");
  2877.  
  2878. SetCommandFlags("r_screenoverlay", iFlags & ~FCVAR_CHEAT);
  2879. ClientCommand(Hale, "r_screenoverlay \"\"");
  2880. SetCommandFlags("r_screenoverlay", iFlags);
  2881. CreateTimer(0.2, MakeModelTimer, _);
  2882. CreateTimer(20.0, MakeModelTimer, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  2883.  
  2884. new ent = -1;
  2885.  
  2886. while ((ent = FindEntityByClassname2(ent, "tf_wearable")) != -1)
  2887. {
  2888. if (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") == Hale)
  2889. {
  2890. new index = GetEntProp(ent, Prop_Send, "m_iItemDefinitionIndex");
  2891.  
  2892. switch (index)
  2893. {
  2894. case 438, 463, 167, 477, 493, 233, 234, 241, 280, 281, 282, 283, 284, 286, 288, 362, 364, 365, 536, 542, 577, 599, 673, 729, 791, 839, 1015, 5607: {}
  2895. default:
  2896. AcceptEntityInput(ent, "kill");
  2897. }
  2898. }
  2899. }
  2900.  
  2901. ent = -1;
  2902.  
  2903. while ((ent = FindEntityByClassname2(ent, "tf_powerup_bottle")) != -1)
  2904. {
  2905. if (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") == Hale)
  2906. {
  2907. new index = GetEntProp(ent, Prop_Send, "m_iItemDefinitionIndex");
  2908.  
  2909. switch (index)
  2910. {
  2911. case 438, 463, 167, 477, 493, 233, 234, 241, 280, 281, 282, 283, 284, 286, 288, 362, 364, 365, 536, 542, 577, 599, 673, 729, 791, 839, 1015, 5607: {}
  2912. default:
  2913. AcceptEntityInput(ent, "kill");
  2914. }
  2915. }
  2916. }
  2917.  
  2918. ent = -1;
  2919.  
  2920. while ((ent = FindEntityByClassname2(ent, "tf_wearable_demoshield")) != -1)
  2921. {
  2922. if (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") == Hale)
  2923. {
  2924. AcceptEntityInput(ent, "kill");
  2925. }
  2926. }
  2927.  
  2928. EquipSaxton(Hale);
  2929. HintPanel(Hale);
  2930.  
  2931. return Plugin_Continue;
  2932. }
  2933.  
  2934. public Action:TF2Items_OnGiveNamedItem(client, String:classname[], iItemDefinitionIndex, &Handle:hItem)
  2935. {
  2936. if (!Enabled)
  2937. {
  2938. return Plugin_Continue;
  2939. }
  2940.  
  2941. // if (client == Hale) return Plugin_Continue;
  2942. // if (hItem != INVALID_HANDLE) return Plugin_Continue;
  2943.  
  2944. switch (iItemDefinitionIndex)
  2945. {
  2946. case 39, 351:
  2947. {
  2948. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "25 ; 0.5 ; 207 ; 1.33 ; 144 ; 1.0 ; 58 ; 3.2", true);
  2949.  
  2950. if (hItemOverride != INVALID_HANDLE)
  2951. {
  2952. hItem = hItemOverride;
  2953.  
  2954. return Plugin_Changed;
  2955. }
  2956. }
  2957. case 40:
  2958. {
  2959. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "165 ; 1.0");
  2960.  
  2961. if (hItemOverride != INVALID_HANDLE)
  2962. {
  2963. hItem = hItemOverride;
  2964.  
  2965. return Plugin_Changed;
  2966. }
  2967. }
  2968. case 648:
  2969. {
  2970. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "279 ; 2.0");
  2971.  
  2972. if (hItemOverride != INVALID_HANDLE)
  2973. {
  2974. hItem = hItemOverride;
  2975.  
  2976. return Plugin_Changed;
  2977. }
  2978. }
  2979. case 444:
  2980. {
  2981. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "58 ; 1.8");
  2982.  
  2983. if (hItemOverride != INVALID_HANDLE)
  2984. {
  2985. hItem = hItemOverride;
  2986.  
  2987. return Plugin_Changed;
  2988. }
  2989. }
  2990. case 448:
  2991. {
  2992. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "179 ; 1");
  2993.  
  2994. if (hItemOverride != INVALID_HANDLE)
  2995. {
  2996. hItem = hItemOverride;
  2997.  
  2998. return Plugin_Changed;
  2999. }
  3000. }
  3001. case 220:
  3002. {
  3003. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "328 ; 1.0", true);
  3004.  
  3005. if (hItemOverride != INVALID_HANDLE)
  3006. {
  3007. hItem = hItemOverride;
  3008.  
  3009. return Plugin_Changed;
  3010. }
  3011. }
  3012. case 226:
  3013. {
  3014. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "140 ; 22.0 ; 252 ; 0.25");
  3015.  
  3016. if (hItemOverride != INVALID_HANDLE)
  3017. {
  3018. hItem = hItemOverride;
  3019.  
  3020. return Plugin_Changed;
  3021. }
  3022. }
  3023. case 305:
  3024. {
  3025. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "17 ; 0.16 ; 2 ; 1.2"); // ; 266 ; 1.0");
  3026.  
  3027. if (hItemOverride != INVALID_HANDLE)
  3028. {
  3029. hItem = hItemOverride;
  3030.  
  3031. return Plugin_Changed;
  3032. }
  3033. }
  3034. case 56, 1005:
  3035. {
  3036. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "2 ; 1.5");
  3037.  
  3038. if (hItemOverride != INVALID_HANDLE)
  3039. {
  3040. hItem = hItemOverride;
  3041.  
  3042. return Plugin_Changed;
  3043. }
  3044. }
  3045. case 38, 457:
  3046. {
  3047. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "", true);
  3048.  
  3049. if (hItemOverride != INVALID_HANDLE)
  3050. {
  3051. hItem = hItemOverride;
  3052.  
  3053. return Plugin_Changed;
  3054. }
  3055. }
  3056. // case 132, 266, 482:
  3057. // {
  3058. // new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "202 ; 0.5 ; 125 ; -15", true);
  3059. // if (hItemOverride != INVALID_HANDLE)
  3060. // {
  3061. // hItem = hItemOverride;
  3062. // return Plugin_Changed;
  3063. // }
  3064. // }
  3065. case 43, 239:
  3066. {
  3067. new Handle:hItemOverride = PrepareItemHandle(hItem, _, 239, "107 ; 1.5 ; 1 ; 0.5 ; 128 ; 1 ; 191 ; -7", true);
  3068.  
  3069. if (hItemOverride != INVALID_HANDLE)
  3070. {
  3071. hItem = hItemOverride;
  3072.  
  3073. return Plugin_Changed;
  3074. }
  3075. }
  3076. case 415:
  3077. {
  3078. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "265 ; 99999.0 ; 178 ; 0.6 ; 2 ; 1.1 ; 3 ; 0.5", true);
  3079.  
  3080. if (hItemOverride != INVALID_HANDLE)
  3081. {
  3082. hItem = hItemOverride;
  3083.  
  3084. return Plugin_Changed;
  3085. }
  3086. }
  3087. case 19, 206, 308, 1007, 996:
  3088. {
  3089. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "135 ; 0.52 ; 265 ; 99999.0", true);
  3090.  
  3091. if (hItemOverride != INVALID_HANDLE)
  3092. {
  3093. hItem = hItemOverride;
  3094.  
  3095. return Plugin_Changed;
  3096. }
  3097. }
  3098. case 20, 207, 130, 661, 797, 806, 886, 895, 904, 913, 962, 971:
  3099. {
  3100. new Handle:hItemOverride = PrepareItemHandle(hItem, _, _, "265 ; 99999.0", true);
  3101.  
  3102. if (hItemOverride != INVALID_HANDLE)
  3103. {
  3104. hItem = hItemOverride;
  3105.  
  3106. return Plugin_Changed;
  3107. }
  3108. }
  3109. // case 526:
  3110. }
  3111.  
  3112. if (TF2_GetPlayerClass(client) == TFClass_Soldier && (strncmp(classname, "tf_weapon_rocketlauncher", 24, false) == 0 || strncmp(classname, "tf_weapon_shotgun", 17, false) == 0))
  3113. {
  3114. new Handle:hItemOverride;
  3115.  
  3116. if (iItemDefinitionIndex == 127)
  3117. {
  3118. hItemOverride = PrepareItemHandle(hItem, _, _, "265 ; 99999.0 ; 179 ; 1.0");
  3119. }
  3120. else
  3121. {
  3122. hItemOverride = PrepareItemHandle(hItem, _, _, "265 ; 99999.0");
  3123. }
  3124.  
  3125. if (hItemOverride != INVALID_HANDLE)
  3126. {
  3127. hItem = hItemOverride;
  3128.  
  3129. return Plugin_Changed;
  3130. }
  3131. }
  3132.  
  3133. return Plugin_Continue;
  3134. }
  3135.  
  3136. stock Handle:PrepareItemHandle(Handle:hItem, String:name[] = "", index = -1, const String:att[] = "", bool:dontpreserve = false)
  3137. {
  3138. static Handle:hWeapon;
  3139. new addattribs = 0;
  3140.  
  3141. new String:weaponAttribsArray[32][32];
  3142. new attribCount = ExplodeString(att, " ; ", weaponAttribsArray, 32, 32);
  3143.  
  3144. new flags = OVERRIDE_ATTRIBUTES;
  3145. if (!dontpreserve)
  3146. {
  3147. flags |= PRESERVE_ATTRIBUTES;
  3148. }
  3149.  
  3150. if (hWeapon == INVALID_HANDLE)
  3151. {
  3152. hWeapon = TF2Items_CreateItem(flags);
  3153. }
  3154. else
  3155. {
  3156. TF2Items_SetFlags(hWeapon, flags);
  3157. }
  3158.  
  3159. // new Handle:hWeapon = TF2Items_CreateItem(flags); //INVALID_HANDLE;
  3160.  
  3161. if (hItem != INVALID_HANDLE)
  3162. {
  3163. addattribs = TF2Items_GetNumAttributes(hItem);
  3164.  
  3165. if (addattribs > 0)
  3166. {
  3167. for (new i = 0; i < 2 * addattribs; i += 2)
  3168. {
  3169. new bool:dontAdd = false;
  3170. new attribIndex = TF2Items_GetAttributeId(hItem, i);
  3171.  
  3172. for (new z = 0; z < attribCount + i; z += 2)
  3173. {
  3174. if (StringToInt(weaponAttribsArray[z]) == attribIndex)
  3175. {
  3176. dontAdd = true;
  3177.  
  3178. break;
  3179. }
  3180. }
  3181.  
  3182. if (!dontAdd)
  3183. {
  3184. IntToString(attribIndex, weaponAttribsArray[i + attribCount], 32);
  3185. FloatToString(TF2Items_GetAttributeValue(hItem, i), weaponAttribsArray[i + 1 + attribCount], 32);
  3186. }
  3187. }
  3188.  
  3189. attribCount += 2 * addattribs;
  3190. }
  3191.  
  3192. CloseHandle(hItem); //probably returns false but whatever
  3193. }
  3194.  
  3195. if (name[0] != '\0')
  3196. {
  3197. flags |= OVERRIDE_CLASSNAME;
  3198. TF2Items_SetClassname(hWeapon, name);
  3199. }
  3200.  
  3201. if (index != -1)
  3202. {
  3203. flags |= OVERRIDE_ITEM_DEF;
  3204. TF2Items_SetItemIndex(hWeapon, index);
  3205. }
  3206.  
  3207. if (attribCount > 0)
  3208. {
  3209. TF2Items_SetNumAttributes(hWeapon, (attribCount / 2));
  3210. new i2 = 0;
  3211.  
  3212. for (new i = 0; i < attribCount && i < 32; i += 2)
  3213. {
  3214. TF2Items_SetAttribute(hWeapon, i2, StringToInt(weaponAttribsArray[i]), StringToFloat(weaponAttribsArray[i + 1]));
  3215. i2++;
  3216. }
  3217. }
  3218. else
  3219. {
  3220. TF2Items_SetNumAttributes(hWeapon, 0);
  3221. }
  3222.  
  3223. TF2Items_SetFlags(hWeapon, flags);
  3224.  
  3225. return hWeapon;
  3226. }
  3227.  
  3228. public Action:MakeNoHale(Handle:hTimer, any:clientid)
  3229. {
  3230. new client = GetClientOfUserId(clientid);
  3231.  
  3232. if (!IsValidClient(client) || !IsPlayerAlive(client) || VSHRoundState == 2 || client == Hale)
  3233. {
  3234. return Plugin_Continue;
  3235. }
  3236.  
  3237. // SetVariantString("");
  3238. // AcceptEntityInput(client, "SetCustomModel");
  3239.  
  3240. if (GetClientTeam(client) != OtherTeam)
  3241. {
  3242. SetEntProp(client, Prop_Send, "m_lifeState", 2);
  3243. ChangeClientTeam(client, OtherTeam);
  3244. SetEntProp(client, Prop_Send, "m_lifeState", 0);
  3245. TF2_RespawnPlayer(client);
  3246. }
  3247.  
  3248. // SetEntityRenderColor(client, 255, 255, 255, 255);
  3249.  
  3250. if (!VSHRoundState && GetClientClasshelpinfoCookie(client) && !(VSHFlags[client] & VSHFLAG_CLASSHELPED))
  3251. {
  3252. HelpPanel2(client);
  3253. }
  3254.  
  3255. new weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary);
  3256. new index = -1;
  3257.  
  3258. if (weapon > MaxClients && IsValidEdict(weapon))
  3259. {
  3260. index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  3261.  
  3262. switch (index)
  3263. {
  3264. case 41:
  3265. {
  3266. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  3267. weapon = SpawnWeapon(client, "tf_weapon_minigun", 15, 1, 0, "");
  3268. }
  3269. case 402:
  3270. {
  3271. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  3272. SpawnWeapon(client, "tf_weapon_sniperrifle", 14, 1, 0, "");
  3273. }
  3274. case 237:
  3275. {
  3276. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  3277. weapon = SpawnWeapon(client, "tf_weapon_rocketlauncher", 18, 1, 0, "265 ; 99999.0");
  3278. SetAmmo(client, 0, 20);
  3279. }
  3280. case 17, 204, 36, 412:
  3281. {
  3282. if (GetEntProp(weapon, Prop_Send, "m_iEntityQuality") != 10)
  3283. {
  3284. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  3285. SpawnWeapon(client, "tf_weapon_syringegun_medic", 17, 1, 10, "17 ; 0.05 ; 144 ; 1");
  3286. }
  3287. }
  3288. }
  3289. }
  3290.  
  3291. weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  3292.  
  3293. if (weapon > MaxClients && IsValidEdict(weapon))
  3294. {
  3295. index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  3296.  
  3297. switch (index)
  3298. {
  3299. // case 226:
  3300. // {
  3301. // TF2_RemoveWeaponSlot(client, 1);
  3302. // weapon = SpawnWeapon(client, "tf_weapon_shotgun_soldier", 10, 1, 0, "");
  3303. // }
  3304. case 57: //Replacelist
  3305. {
  3306. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Secondary);
  3307. weapon = SpawnWeapon(client, "tf_weapon_smg", 16, 1, 0, "");
  3308. }
  3309. case 265:
  3310. {
  3311. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Secondary);
  3312. weapon = SpawnWeapon(client, "tf_weapon_pipebomblauncher", 20, 1, 0, "");
  3313. SetAmmo(client, 1, 24);
  3314. }
  3315. // case 39, 351:
  3316. // {
  3317. // if (GetEntProp(weapon, Prop_Send, "m_iEntityQuality") != 10)
  3318. // {
  3319. // TF2_RemoveWeaponSlot(client, TFWeaponSlot_Secondary);
  3320. // weapon = SpawnWeapon(client, "tf_weapon_flaregun", 39, 5, 10, "25 ; 0.5 ; 207 ; 1.33 ; 144 ; 1.0 ; 58 ; 3.2")
  3321. // }
  3322. // }
  3323. }
  3324. }
  3325.  
  3326. if (IsValidEntity(FindPlayerBack(client, { 57 }, 2)))
  3327. {
  3328. RemovePlayerBack(client, { 57 }, 2);
  3329. weapon = SpawnWeapon(client, "tf_weapon_smg", 16, 1, 0, "");
  3330. }
  3331.  
  3332. if (IsValidEntity(FindPlayerBack(client, { 642 }, 1)))
  3333. {
  3334. weapon = SpawnWeapon(client, "tf_weapon_smg", 16, 1, 6, "149 ; 1.5 ; 15 ; 0.0 ; 1 ; 0.85");
  3335. }
  3336.  
  3337. weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee);
  3338.  
  3339. if (weapon > MaxClients && IsValidEdict(weapon))
  3340. {
  3341. index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  3342.  
  3343. switch (index)
  3344. {
  3345. case 331:
  3346. {
  3347. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Melee);
  3348. weapon = SpawnWeapon(client, "tf_weapon_fists", 195, 1, 6, "");
  3349. }
  3350. case 357:
  3351. {
  3352. CreateTimer(1.0, Timer_NoHonorBound, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
  3353. }
  3354. case 589:
  3355. {
  3356. if (!GetConVarBool(cvarEnableEurekaEffect))
  3357. {
  3358. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Melee);
  3359. weapon = SpawnWeapon(client, "tf_weapon_wrench", 7, 1, 0, "");
  3360. }
  3361. }
  3362. }
  3363. }
  3364.  
  3365. weapon = GetPlayerWeaponSlot(client, 4);
  3366.  
  3367. if (weapon > MaxClients && IsValidEdict(weapon) && GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex") == 60)
  3368. {
  3369. TF2_RemoveWeaponSlot(client, 4);
  3370. weapon = SpawnWeapon(client, "tf_weapon_invis", 30, 1, 0, "");
  3371. }
  3372.  
  3373. if (TF2_GetPlayerClass(client) == TFClass_Medic)
  3374. {
  3375. weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  3376. new mediquality = (weapon > MaxClients && IsValidEdict(weapon) ? GetEntProp(weapon, Prop_Send, "m_iEntityQuality"):-1);
  3377.  
  3378. if (mediquality != 10)
  3379. {
  3380. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Secondary);
  3381. weapon = SpawnWeapon(client, "tf_weapon_medigun", 35, 5, 10, "10 ; 1.25 ; 178 ; 0.75 ; 144 ; 2.0 ; 11 ; 1.5"); //200 ; 1 for area of effect healing // ; 178 ; 0.75 ; 128 ; 1.0 Faster switch-to
  3382.  
  3383. if (GetIndexOfWeaponSlot(client, TFWeaponSlot_Melee) == 142)
  3384. {
  3385. SetEntityRenderMode(weapon, RENDER_TRANSCOLOR);
  3386. SetEntityRenderColor(weapon, 255, 255, 255, 75);
  3387. }
  3388.  
  3389. SetEntPropFloat(weapon, Prop_Send, "m_flChargeLevel", 0.41);
  3390. }
  3391. }
  3392.  
  3393. return Plugin_Continue;
  3394. }
  3395.  
  3396. public Action:Timer_NoHonorBound(Handle:timer, any:userid)
  3397. {
  3398. new client = GetClientOfUserId(userid);
  3399.  
  3400. if (IsValidClient(client) && IsPlayerAlive(client))
  3401. {
  3402. new weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee);
  3403. new index = ((IsValidEntity(weapon) && weapon > MaxClients) ? GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"):-1);
  3404. new active = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  3405. new String:classname[64];
  3406.  
  3407. if (IsValidEdict(active))
  3408. {
  3409. GetEdictClassname(active, classname, sizeof(classname));
  3410. }
  3411.  
  3412. if (index == 357 && active == weapon && strcmp(classname, "tf_weapon_katana", false) == 0)
  3413. {
  3414. SetEntProp(weapon, Prop_Send, "m_bIsBloody", 1);
  3415.  
  3416. if (GetEntProp(client, Prop_Send, "m_iKillCountSinceLastDeploy") < 1)
  3417. {
  3418. SetEntProp(client, Prop_Send, "m_iKillCountSinceLastDeploy", 1);
  3419. }
  3420. }
  3421. }
  3422. }
  3423.  
  3424. stock RemovePlayerTarge(client)
  3425. {
  3426. new edict = MaxClients + 1;
  3427. while ((edict = FindEntityByClassname2(edict, "tf_wearable_demoshield")) != -1)
  3428. {
  3429. new idx = GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex");
  3430.  
  3431. if ((idx == 131 || idx == 406) && GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(edict, Prop_Send, "m_bDisguiseWearable"))
  3432. {
  3433. AcceptEntityInput(edict, "Kill");
  3434. }
  3435. }
  3436. }
  3437.  
  3438. stock RemovePlayerBack(client, indices[], len)
  3439. {
  3440. if (len <= 0)
  3441. {
  3442. return;
  3443. }
  3444.  
  3445. new edict = MaxClients + 1;
  3446.  
  3447. while ((edict = FindEntityByClassname2(edict, "tf_wearable")) != -1)
  3448. {
  3449. decl String:netclass[32];
  3450.  
  3451. if (GetEntityNetClass(edict, netclass, sizeof(netclass)) && StrEqual(netclass, "CTFWearable"))
  3452. {
  3453. new idx = GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex");
  3454.  
  3455. if (GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(edict, Prop_Send, "m_bDisguiseWearable"))
  3456. {
  3457. for (new i = 0; i < len; i++)
  3458. {
  3459. if (idx == indices[i])
  3460. {
  3461. AcceptEntityInput(edict, "Kill");
  3462. }
  3463. }
  3464. }
  3465. }
  3466. }
  3467.  
  3468. edict = MaxClients + 1;
  3469.  
  3470. while ((edict = FindEntityByClassname2(edict, "tf_powerup_bottle")) != -1)
  3471. {
  3472. decl String:netclass[32];
  3473.  
  3474. if (GetEntityNetClass(edict, netclass, sizeof(netclass)) && StrEqual(netclass, "CTFPowerupBottle"))
  3475. {
  3476. new idx = GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex");
  3477.  
  3478. if (GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(edict, Prop_Send, "m_bDisguiseWearable"))
  3479. {
  3480. for (new i = 0; i < len; i++)
  3481. {
  3482. if (idx == indices[i])
  3483. {
  3484. AcceptEntityInput(edict, "Kill");
  3485. }
  3486. }
  3487. }
  3488. }
  3489. }
  3490. }
  3491.  
  3492. stock FindPlayerBack(client, indices[], len)
  3493. {
  3494. if (len <= 0)
  3495. {
  3496. return -1;
  3497. }
  3498.  
  3499. new edict = MaxClients + 1;
  3500.  
  3501. while ((edict = FindEntityByClassname2(edict, "tf_wearable")) != -1)
  3502. {
  3503. decl String:netclass[32];
  3504.  
  3505. if (GetEntityNetClass(edict, netclass, sizeof(netclass)) && StrEqual(netclass, "CTFWearable"))
  3506. {
  3507. new idx = GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex");
  3508.  
  3509. if (GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(edict, Prop_Send, "m_bDisguiseWearable"))
  3510. {
  3511. for (new i = 0; i < len; i++)
  3512. {
  3513. if (idx == indices[i])
  3514. {
  3515. return edict;
  3516. }
  3517. }
  3518. }
  3519. }
  3520. }
  3521.  
  3522. edict = MaxClients + 1;
  3523.  
  3524. while ((edict = FindEntityByClassname2(edict, "tf_powerup_bottle")) != -1)
  3525. {
  3526. decl String:netclass[32];
  3527.  
  3528. if (GetEntityNetClass(edict, netclass, sizeof(netclass)) && StrEqual(netclass, "CTFPowerupBottle"))
  3529. {
  3530. new idx = GetEntProp(edict, Prop_Send, "m_iItemDefinitionIndex");
  3531.  
  3532. if (GetEntPropEnt(edict, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(edict, Prop_Send, "m_bDisguiseWearable"))
  3533. {
  3534. for (new i = 0; i < len; i++)
  3535. {
  3536. if (idx == indices[i])
  3537. {
  3538. return edict;
  3539. }
  3540. }
  3541. }
  3542. }
  3543. }
  3544.  
  3545. return -1;
  3546. }
  3547.  
  3548. public Action:event_destroy(Handle:event, const String:name[], bool:dontBroadcast)
  3549. {
  3550. if (Enabled)
  3551. {
  3552. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  3553. new customkill = GetEventInt(event, "customkill");
  3554.  
  3555. if (attacker == Hale) /* || (attacker == Companion)*/
  3556. {
  3557. if (Special == VSHSpecial_Hale)
  3558. {
  3559. if (customkill != TF_CUSTOM_BOOTS_STOMP)
  3560. {
  3561. SetEventString(event, "weapon", "fists");
  3562. }
  3563.  
  3564. if (!GetRandomInt(0, 4))
  3565. {
  3566. decl String:s[PLATFORM_MAX_PATH];
  3567. strcopy(s, PLATFORM_MAX_PATH, HaleSappinMahSentry132);
  3568.  
  3569. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  3570. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  3571. }
  3572. }
  3573. }
  3574. }
  3575.  
  3576. return Plugin_Continue;
  3577. }
  3578.  
  3579. public Action:event_changeclass(Handle:event, const String:name[], bool:dontBroadcast)
  3580. {
  3581. if (!Enabled)
  3582. {
  3583. return Plugin_Continue;
  3584. }
  3585.  
  3586. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  3587.  
  3588. if (client == Hale)
  3589. {
  3590. switch (Special)
  3591. {
  3592. case VSHSpecial_Hale:
  3593. if (TF2_GetPlayerClass(client) != TFClass_Soldier)
  3594. {
  3595. TF2_SetPlayerClass(client, TFClass_Soldier, _, false);
  3596. }
  3597. case VSHSpecial_Vagineer:
  3598. if (TF2_GetPlayerClass(client) != TFClass_Engineer)
  3599. {
  3600. TF2_SetPlayerClass(client, TFClass_Engineer, _, false);
  3601. }
  3602. case VSHSpecial_HHH, VSHSpecial_Bunny:
  3603. if (TF2_GetPlayerClass(client) != TFClass_DemoMan)
  3604. {
  3605. TF2_SetPlayerClass(client, TFClass_DemoMan, _, false);
  3606. }
  3607. case VSHSpecial_CBS:
  3608. if (TF2_GetPlayerClass(client) != TFClass_Sniper)
  3609. {
  3610. TF2_SetPlayerClass(client, TFClass_Sniper, _, false);
  3611. }
  3612. }
  3613.  
  3614. TF2_RemovePlayerDisguise(client);
  3615. }
  3616.  
  3617. return Plugin_Continue;
  3618. }
  3619.  
  3620. public Action:event_uberdeployed(Handle:event, const String:name[], bool:dontBroadcast)
  3621. {
  3622. if (!Enabled)
  3623. {
  3624. return Plugin_Continue;
  3625. }
  3626.  
  3627. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  3628. new String:s[64];
  3629.  
  3630. if (IsValidClient(client) && IsPlayerAlive(client))
  3631. {
  3632. new medigun = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  3633.  
  3634. if (IsValidEntity(medigun))
  3635. {
  3636. GetEdictClassname(medigun, s, sizeof(s));
  3637.  
  3638. if (strcmp(s, "tf_weapon_medigun", false) == 0)
  3639. {
  3640. TF2_AddCondition(client, TFCond_HalloweenCritCandy, 0.5, client);
  3641.  
  3642. new target = GetHealingTarget(client);
  3643.  
  3644. if (IsValidClient(target, false) && IsPlayerAlive(target))
  3645. {
  3646. TF2_AddCondition(target, TFCond_HalloweenCritCandy, 0.5, client);
  3647. uberTarget[client] = target;
  3648. }
  3649. else
  3650. {
  3651. uberTarget[client] = -1;
  3652. }
  3653.  
  3654. SetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel", 1.51);
  3655. CreateTimer(0.4, Timer_Lazor, EntIndexToEntRef(medigun), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  3656. }
  3657. }
  3658. }
  3659.  
  3660. return Plugin_Continue;
  3661. }
  3662.  
  3663. public Action:Timer_Lazor(Handle:hTimer, any:medigunid)
  3664. {
  3665. new medigun = EntRefToEntIndex(medigunid);
  3666.  
  3667. if (medigun && IsValidEntity(medigun) && VSHRoundState == 1)
  3668. {
  3669. new client = GetEntPropEnt(medigun, Prop_Send, "m_hOwnerEntity");
  3670. new Float:charge = GetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel");
  3671.  
  3672. if (IsValidClient(client, false) && IsPlayerAlive(client) && GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon") == medigun)
  3673. {
  3674. new target = GetHealingTarget(client);
  3675.  
  3676. if (charge > 0.05)
  3677. {
  3678. TF2_AddCondition(client, TFCond_HalloweenCritCandy, 0.5);
  3679.  
  3680. if (IsValidClient(target, false) && IsPlayerAlive(target))
  3681. {
  3682. TF2_AddCondition(target, TFCond_HalloweenCritCandy, 0.5);
  3683. uberTarget[client] = target;
  3684. }
  3685. else
  3686. {
  3687. uberTarget[client] = -1;
  3688. }
  3689. }
  3690. }
  3691.  
  3692. if (charge <= 0.05)
  3693. {
  3694. CreateTimer(3.0, Timer_Lazor2, EntIndexToEntRef(medigun));
  3695. VSHFlags[client] &= ~VSHFLAG_UBERREADY;
  3696.  
  3697. return Plugin_Stop;
  3698. }
  3699. }
  3700. else
  3701. {
  3702. return Plugin_Stop;
  3703. }
  3704.  
  3705. return Plugin_Continue;
  3706. }
  3707.  
  3708. public Action:Timer_Lazor2(Handle:hTimer, any:medigunid)
  3709. {
  3710. new medigun = EntRefToEntIndex(medigunid);
  3711.  
  3712. if (IsValidEntity(medigun))
  3713. {
  3714. SetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel", GetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel") + 0.31);
  3715. }
  3716.  
  3717. return Plugin_Continue;
  3718. }
  3719.  
  3720. public Action:Command_GetHPCmd(client, args)
  3721. {
  3722. if (!IsValidClient(client))
  3723. {
  3724. return Plugin_Continue;
  3725. }
  3726.  
  3727. Command_GetHP(client);
  3728.  
  3729. return Plugin_Handled;
  3730. }
  3731.  
  3732. public Action:Command_GetHP(client)
  3733. {
  3734. if (!Enabled || VSHRoundState != 1)
  3735. {
  3736. return Plugin_Continue;
  3737. }
  3738.  
  3739. if (client == Hale)
  3740. {
  3741. switch (Special)
  3742. {
  3743. case VSHSpecial_Bunny:
  3744. PrintCenterTextAll("%t", "vsh_bunny_show_hp", HaleHealth, HaleHealthMax);
  3745. case VSHSpecial_Vagineer:
  3746. PrintCenterTextAll("%t", "vsh_vagineer_show_hp", HaleHealth, HaleHealthMax);
  3747. case VSHSpecial_HHH:
  3748. PrintCenterTextAll("%t", "vsh_hhh_show_hp", HaleHealth, HaleHealthMax);
  3749. case VSHSpecial_CBS:
  3750. PrintCenterTextAll("%t", "vsh_cbs_show_hp", HaleHealth, HaleHealthMax);
  3751. default:
  3752. PrintCenterTextAll("%t", "vsh_hale_show_hp", HaleHealth, HaleHealthMax);
  3753. }
  3754.  
  3755. HaleHealthLast = HaleHealth;
  3756.  
  3757. return Plugin_Continue;
  3758. }
  3759.  
  3760. if (GetGameTime() >= HPTime)
  3761. {
  3762. healthcheckused++;
  3763.  
  3764. switch (Special)
  3765. {
  3766. case VSHSpecial_Bunny:
  3767. {
  3768. PrintCenterTextAll("%t", "vsh_bunny_hp", HaleHealth, HaleHealthMax);
  3769. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_bunny_hp", HaleHealth, HaleHealthMax);
  3770. }
  3771. case VSHSpecial_Vagineer:
  3772. {
  3773. PrintCenterTextAll("%t", "vsh_vagineer_hp", HaleHealth, HaleHealthMax);
  3774. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_vagineer_hp", HaleHealth, HaleHealthMax);
  3775. }
  3776. case VSHSpecial_HHH:
  3777. {
  3778. PrintCenterTextAll("%t", "vsh_hhh_hp", HaleHealth, HaleHealthMax);
  3779. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_hhh_hp", HaleHealth, HaleHealthMax);
  3780. }
  3781. case VSHSpecial_CBS:
  3782. {
  3783. PrintCenterTextAll("%t", "vsh_cbs_hp", HaleHealth, HaleHealthMax);
  3784. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_cbs_hp", HaleHealth, HaleHealthMax);
  3785. }
  3786. default:
  3787. {
  3788. PrintCenterTextAll("%t", "vsh_hale_hp", HaleHealth, HaleHealthMax);
  3789. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_hale_hp", HaleHealth, HaleHealthMax);
  3790. }
  3791. }
  3792.  
  3793. HaleHealthLast = HaleHealth;
  3794. HPTime = GetGameTime() + (healthcheckused < 3 ? 20.0:80.0);
  3795.  
  3796. }
  3797. else if (RedAlivePlayers == 1)
  3798. {
  3799. CPrintToChat(client, "{olive}[VSH]{default} %t", "vsh_already_see");
  3800. }
  3801. else
  3802. {
  3803. CPrintToChat(client, "{olive}[VSH]{default} %t", "vsh_wait_hp", RoundFloat(HPTime - GetGameTime()), HaleHealthLast);
  3804. }
  3805.  
  3806. return Plugin_Continue;
  3807. }
  3808.  
  3809. public Action:Command_MakeNextSpecial(client, args)
  3810. {
  3811. decl String:arg[32];
  3812. decl String:name[64];
  3813.  
  3814. if (!bSpecials)
  3815. {
  3816. ReplyToCommand(client, "[VSH] This server isn't set up to use special bosses! Set the cvar hale_specials 1 in the VSH config to enable on next map!");
  3817. return Plugin_Handled;
  3818. }
  3819.  
  3820. if (args < 1)
  3821. {
  3822. ReplyToCommand(client, "[VSH] Usage: hale_special <hale, vagineer, hhh, christian>");
  3823. return Plugin_Handled;
  3824. }
  3825.  
  3826. GetCmdArgString(arg, sizeof(arg));
  3827.  
  3828. if (StrContains(arg, "hal", false) != -1)
  3829. {
  3830. Incoming = VSHSpecial_Hale;
  3831. name = "Saxton Hale";
  3832. }
  3833. else if (StrContains(arg, "vag", false) != -1)
  3834. {
  3835. Incoming = VSHSpecial_Vagineer;
  3836. name = "the Vagineer";
  3837. }
  3838. else if (StrContains(arg, "hhh", false) != -1)
  3839. {
  3840. Incoming = VSHSpecial_HHH;
  3841. name = "the Horseless Headless Horsemann Jr.";
  3842. }
  3843. else if (StrContains(arg, "chr", false) != -1 || StrContains(arg, "cbs", false) != -1)
  3844. {
  3845. Incoming = VSHSpecial_CBS;
  3846. name = "the Christian Brutal Sniper";
  3847. }
  3848. #if defined EASTER_BUNNY_ON
  3849. else if (StrContains(arg, "bun", false) != -1 || StrContains(arg, "eas", false) != -1)
  3850. {
  3851. Incoming = VSHSpecial_Bunny;
  3852. name = "the Easter Bunny";
  3853. }
  3854. #endif
  3855. else
  3856. {
  3857. ReplyToCommand(client, "[VSH] Usage: hale_special <hale, vagineer, hhh, christian>");
  3858. return Plugin_Handled;
  3859. }
  3860.  
  3861. ReplyToCommand(client, "[VSH] Set the next Special to %s", name);
  3862.  
  3863. return Plugin_Handled;
  3864. }
  3865.  
  3866. public Action:Command_NextHale(client, args)
  3867. {
  3868. if (Enabled)
  3869. {
  3870. CreateTimer(0.2, MessageTimer);
  3871. }
  3872.  
  3873. return Plugin_Continue;
  3874. }
  3875.  
  3876. public Action:Command_HaleSelect(client, args)
  3877. {
  3878. if (!Enabled2)
  3879. {
  3880. return Plugin_Continue;
  3881. }
  3882.  
  3883. if (args < 1)
  3884. {
  3885. ReplyToCommand(client, "[VSH] Usage: hale_select <target> [\"hidden\"]");
  3886.  
  3887. return Plugin_Handled;
  3888. }
  3889.  
  3890. decl String:s2[80];
  3891. decl String:targetname[32];
  3892.  
  3893. GetCmdArg(1, targetname, sizeof(targetname));
  3894. GetCmdArg(2, s2, sizeof(s2));
  3895.  
  3896. if (strcmp(targetname, "@me", false) == 0 && IsValidClient(client))
  3897. {
  3898. ForceHale(client, client, StrContains(s2, "hidden", false) > 0);
  3899. }
  3900. else
  3901. {
  3902. new target = FindTarget(client, targetname);
  3903.  
  3904. if (IsValidClient(target))
  3905. {
  3906. ForceHale(client, target, StrContains(s2, "hidden", false) >= 0);
  3907. }
  3908. }
  3909.  
  3910. return Plugin_Handled;
  3911. }
  3912.  
  3913. public Action:Command_Points(client, args)
  3914. {
  3915. if (!Enabled2)
  3916. {
  3917. return Plugin_Continue;
  3918. }
  3919.  
  3920. if (args != 2)
  3921. {
  3922. ReplyToCommand(client, "[VSH] Usage: hale_addpoints <target> <points>");
  3923.  
  3924. return Plugin_Handled;
  3925. }
  3926.  
  3927. decl String:s2[80];
  3928. decl String:targetname[PLATFORM_MAX_PATH];
  3929.  
  3930. GetCmdArg(1, targetname, sizeof(targetname));
  3931. GetCmdArg(2, s2, sizeof(s2));
  3932.  
  3933. new points = StringToInt(s2);
  3934. /**
  3935. * target_name - stores the noun identifying the target(s)
  3936. * target_list - array to store clients
  3937. * target_count - variable to store number of clients
  3938. * tn_is_ml - stores whether the noun must be translated
  3939. */
  3940. new String:target_name[MAX_TARGET_LENGTH];
  3941. new target_list[MAXPLAYERS], target_count;
  3942. new bool:tn_is_ml;
  3943.  
  3944. if ((target_count = ProcessTargetString(
  3945. targetname,
  3946. client,
  3947. target_list,
  3948. MAXPLAYERS,
  3949. 0,
  3950. target_name,
  3951. sizeof(target_name),
  3952. tn_is_ml)) <= 0)
  3953. {
  3954. /* This function replies to the admin with a failure message */
  3955. ReplyToTargetError(client, target_count);
  3956.  
  3957. return Plugin_Handled;
  3958. }
  3959.  
  3960. for (new i = 0; i < target_count; i++)
  3961. {
  3962. SetClientQueuePoints(target_list[i], GetClientQueuePoints(target_list[i]) + points);
  3963. LogAction(client, target_list[i], "\"%L\" added %d VSH queue points to \"%L\"", client, points, target_list[i]);
  3964. }
  3965.  
  3966. ReplyToCommand(client, "[VSH] Added %d queue points to %s", points, target_name);
  3967.  
  3968. return Plugin_Handled;
  3969. }
  3970.  
  3971. stock StopHaleMusic(client)
  3972. {
  3973. if (!IsValidClient(client))
  3974. {
  3975. return;
  3976. }
  3977.  
  3978. StopSound(client, SNDCHAN_AUTO, HHHTheme);
  3979. StopSound(client, SNDCHAN_AUTO, CBSTheme);
  3980. }
  3981.  
  3982. public Action:Command_StopMusic(client, args)
  3983. {
  3984. if (!Enabled2)
  3985. {
  3986. return Plugin_Continue;
  3987. }
  3988.  
  3989. for (new i = 1; i <= MaxClients; i++)
  3990. {
  3991. if (!IsValidClient(i))
  3992. {
  3993. continue;
  3994. }
  3995.  
  3996. StopHaleMusic(i);
  3997. }
  3998.  
  3999. ReplyToCommand(client, "[VSH] Stopped boss music.");
  4000.  
  4001. return Plugin_Handled;
  4002. }
  4003.  
  4004. public Action:Command_Point_Disable(client, args)
  4005. {
  4006. if (Enabled)
  4007. {
  4008. SetControlPoint(false);
  4009. }
  4010.  
  4011. return Plugin_Handled;
  4012. }
  4013.  
  4014. public Action:Command_Point_Enable(client, args)
  4015. {
  4016. if (Enabled)
  4017. {
  4018. SetControlPoint(true);
  4019. }
  4020.  
  4021. return Plugin_Handled;
  4022. }
  4023.  
  4024. stock SetControlPoint(bool:enable)
  4025. {
  4026. new CPm = -1; //CP = -1;
  4027.  
  4028. while ((CPm = FindEntityByClassname2(CPm, "team_control_point")) != -1)
  4029. {
  4030. if (CPm > MaxClients && IsValidEdict(CPm))
  4031. {
  4032. AcceptEntityInput(CPm, (enable ? "ShowModel":"HideModel"));
  4033. SetVariantInt(enable ? 0:1);
  4034. AcceptEntityInput(CPm, "SetLocked");
  4035. }
  4036. }
  4037. }
  4038.  
  4039. stock SetArenaCapEnableTime(Float:time)
  4040. {
  4041. new ent = -1;
  4042. decl String:strTime[32];
  4043. FloatToString(time, strTime, sizeof(strTime));
  4044.  
  4045. if ((ent = FindEntityByClassname2(-1, "tf_logic_arena")) != -1 && IsValidEdict(ent))
  4046. {
  4047. DispatchKeyValue(ent, "CapEnableDelay", strTime);
  4048. }
  4049. }
  4050.  
  4051. stock ForceHale(admin, client, bool:hidden, bool:forever = false)
  4052. {
  4053. if (forever)
  4054. {
  4055. Hale = client;
  4056. }
  4057. else
  4058. {
  4059. NextHale = client;
  4060. }
  4061.  
  4062. if (!hidden)
  4063. {
  4064. CPrintToChatAllEx(client, "{olive}[VSH] {teamcolor}%N {default}%t", client, "vsh_hale_select_text");
  4065. }
  4066. }
  4067.  
  4068. public OnClientPutInServer(client)
  4069. {
  4070. VSHFlags[client] = 0;
  4071. // MusicDisabled[client] = false;
  4072. // VoiceDisabled[client] = false;
  4073. SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  4074. //bSkipNextHale[client] = false;
  4075. Damage[client] = 0;
  4076. uberTarget[client] = -1;
  4077. }
  4078.  
  4079. public OnClientDisconnect(client)
  4080. {
  4081. Damage[client] = 0;
  4082. uberTarget[client] = -1;
  4083. VSHFlags[client] = 0;
  4084.  
  4085. if (Enabled)
  4086. {
  4087. if (client == Hale)
  4088. {
  4089. if (VSHRoundState == 1 || VSHRoundState == 2)
  4090. {
  4091. decl String:authid[32];
  4092. GetClientAuthString(client, authid, sizeof(authid));
  4093.  
  4094. new Handle:pack;
  4095.  
  4096. CreateDataTimer(3.0, Timer_SetDisconQueuePoints, pack, TIMER_FLAG_NO_MAPCHANGE);
  4097. WritePackString(pack, authid);
  4098.  
  4099. new bool:see[MAXPLAYERS + 1];
  4100.  
  4101. see[Hale] = true;
  4102.  
  4103. new tHale = FindNextHale(see);
  4104.  
  4105. if (NextHale > 0)
  4106. {
  4107. tHale = NextHale;
  4108. }
  4109.  
  4110. if (IsValidClient(tHale))
  4111. {
  4112. if (GetClientTeam(tHale) != HaleTeam)
  4113. {
  4114. SetEntProp(tHale, Prop_Send, "m_lifeState", 2);
  4115. ChangeClientTeam(tHale, HaleTeam);
  4116. SetEntProp(tHale, Prop_Send, "m_lifeState", 0);
  4117. TF2_RespawnPlayer(tHale);
  4118. }
  4119. }
  4120. }
  4121.  
  4122. if (VSHRoundState == 1)
  4123. {
  4124. ForceTeamWin(OtherTeam);
  4125. }
  4126.  
  4127. if (VSHRoundState == 0)
  4128. {
  4129. new bool:see[MAXPLAYERS + 1];
  4130. see[Hale] = true;
  4131. new tHale = FindNextHale(see);
  4132.  
  4133. if (NextHale > 0)
  4134. {
  4135. tHale = NextHale;
  4136. NextHale = -1;
  4137. }
  4138.  
  4139. if (IsValidClient(tHale))
  4140. {
  4141. Hale = tHale;
  4142.  
  4143. if (GetClientTeam(Hale) != HaleTeam)
  4144. {
  4145. SetEntProp(Hale, Prop_Send, "m_lifeState", 2);
  4146. ChangeClientTeam(Hale, HaleTeam);
  4147. SetEntProp(Hale, Prop_Send, "m_lifeState", 0);
  4148. TF2_RespawnPlayer(Hale);
  4149. }
  4150.  
  4151. CreateTimer(0.1, MakeHale);
  4152. CPrintToChat(Hale, "{olive}[VSH]{default} Surprise! You're on NOW!");
  4153. }
  4154. }
  4155. CPrintToChatAll("{olive}[VSH]{default} %t", "vsh_hale_disconnected");
  4156. }
  4157. else
  4158. {
  4159. if (IsClientInGame(client))
  4160. {
  4161. if (IsPlayerAlive(client))
  4162. {
  4163. CheckAlivePlayers(INVALID_HANDLE);
  4164. }
  4165.  
  4166. if (client == FindNextHaleEx())
  4167. {
  4168. CreateTimer(1.0, Timer_SkipHalePanel, _, TIMER_FLAG_NO_MAPCHANGE);
  4169. }
  4170. }
  4171.  
  4172. if (client == NextHale)
  4173. {
  4174. NextHale = -1;
  4175. }
  4176. }
  4177. }
  4178. }
  4179.  
  4180. public Action:Timer_SetDisconQueuePoints(Handle:timer, Handle:pack)
  4181. {
  4182. ResetPack(pack);
  4183. decl String:authid[32];
  4184. ReadPackString(pack, authid, sizeof(authid));
  4185. SetAuthIdQueuePoints(authid, 0);
  4186. }
  4187.  
  4188. public Action:Timer_RegenPlayer(Handle:timer, any:userid)
  4189. {
  4190. new client = GetClientOfUserId(userid);
  4191. if (client > 0 && client <= MaxClients && IsClientInGame(client) && IsPlayerAlive(client))
  4192. {
  4193. TF2_RegeneratePlayer(client);
  4194. }
  4195. }
  4196.  
  4197. public Action:event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
  4198. {
  4199. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  4200.  
  4201. if (!IsValidClient(client, false) || !Enabled)
  4202. {
  4203. return Plugin_Continue;
  4204. }
  4205.  
  4206. SetVariantString("");
  4207. AcceptEntityInput(client, "SetCustomModel");
  4208.  
  4209. if (client == Hale && VSHRoundState < 2 && VSHRoundState != -1)
  4210. {
  4211. CreateTimer(0.1, MakeHale);
  4212. }
  4213. else if (VSHRoundState >= 0)
  4214. {
  4215. if (!(VSHFlags[client] & VSHFLAG_HASONGIVED))
  4216. {
  4217. VSHFlags[client] |= VSHFLAG_HASONGIVED;
  4218.  
  4219. RemovePlayerBack(client, { 57, 133, 231, 405, 444, 608, 642 }, 7);
  4220. RemovePlayerTarge(client);
  4221.  
  4222. TF2_RemoveAllWeapons(client);
  4223. TF2_RegeneratePlayer(client);
  4224.  
  4225. CreateTimer(0.1, Timer_RegenPlayer, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
  4226. }
  4227.  
  4228. CreateTimer(0.2, MakeNoHale, GetClientUserId(client));
  4229. }
  4230.  
  4231. if (!(VSHFlags[client] & VSHFLAG_HELPED))
  4232. {
  4233. HelpPanel(client);
  4234. VSHFlags[client] |= VSHFLAG_HELPED;
  4235. }
  4236.  
  4237. VSHFlags[client] &= ~VSHFLAG_UBERREADY;
  4238. VSHFlags[client] &= ~VSHFLAG_CLASSHELPED;
  4239.  
  4240. return Plugin_Continue;
  4241. }
  4242.  
  4243. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  4244. {
  4245. if (Enabled && client == Hale)
  4246. {
  4247. if (Special == VSHSpecial_HHH)
  4248. {
  4249. if (VSHFlags[client] & VSHFLAG_NEEDSTODUCK)
  4250. {
  4251. buttons |= IN_DUCK;
  4252. }
  4253.  
  4254. if (HaleCharge >= 47 && (buttons & IN_ATTACK))
  4255. {
  4256. buttons &= ~IN_ATTACK;
  4257.  
  4258. return Plugin_Changed;
  4259. }
  4260. }
  4261.  
  4262. if (Special == VSHSpecial_Bunny)
  4263. {
  4264. if (GetPlayerWeaponSlot(client, TFWeaponSlot_Primary) == GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"))
  4265. {
  4266. buttons &= ~IN_ATTACK;
  4267.  
  4268. return Plugin_Changed;
  4269. }
  4270. }
  4271. }
  4272.  
  4273. return Plugin_Continue;
  4274. }
  4275.  
  4276. public Action:ClientTimer(Handle:hTimer)
  4277. {
  4278. if (VSHRoundState > 1 || VSHRoundState == -1)
  4279. {
  4280. return Plugin_Stop;
  4281. }
  4282.  
  4283. decl String:wepclassname[32];
  4284. new i = -1;
  4285.  
  4286. for (new client = 1; client <= MaxClients; client++)
  4287. {
  4288. if (IsValidClient(client) && client != Hale && GetClientTeam(client) == OtherTeam)
  4289. {
  4290. SetHudTextParams(-1.0, 0.88, 0.35, 90, 255, 90, 255, 0, 0.35, 0.0, 0.1);
  4291.  
  4292. if (!IsPlayerAlive(client))
  4293. {
  4294. new obstarget = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
  4295.  
  4296. if (IsValidClient(obstarget) && obstarget != Hale && obstarget != client)
  4297. {
  4298. ShowSyncHudText(client, rageHUD, "Damage: %d - %N's Damage: %d", Damage[client], obstarget, Damage[obstarget]);
  4299. }
  4300. else
  4301. {
  4302. ShowSyncHudText(client, rageHUD, "Damage: %d", Damage[client]);
  4303. }
  4304. continue;
  4305. }
  4306.  
  4307. ShowSyncHudText(client, rageHUD, "Damage: %d", Damage[client]);
  4308.  
  4309. new TFClassType:class = TF2_GetPlayerClass(client);
  4310. new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  4311.  
  4312. if (weapon <= MaxClients || !IsValidEntity(weapon) || !GetEdictClassname(weapon, wepclassname, sizeof(wepclassname)))
  4313. {
  4314. strcopy(wepclassname, sizeof(wepclassname), "");
  4315. }
  4316.  
  4317. new bool:validwep = (strncmp(wepclassname, "tf_wea", 6, false) == 0);
  4318. new index = (validwep ? GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"):-1);
  4319.  
  4320. if (TF2_IsPlayerInCondition(client, TFCond_Cloaked))
  4321. {
  4322. if (GetClientCloakIndex(client) == 59)
  4323. {
  4324. if (TF2_IsPlayerInCondition(client, TFCond_DeadRingered))
  4325. {
  4326. TF2_RemoveCondition(client, TFCond_DeadRingered);
  4327. }
  4328. }
  4329. else TF2_AddCondition(client, TFCond_DeadRingered, 0.3);
  4330. }
  4331.  
  4332. // if (TF2_IsPlayerInCondition(client, TFCond_DefenseBuffed)) TF2_AddCondition(client, TFCond_Ubercharged, 0.3);
  4333. if (class == TFClass_Medic)
  4334. {
  4335. if (weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Primary))
  4336. {
  4337. new medigun = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  4338. decl String:mediclassname[64];
  4339.  
  4340. if (IsValidEdict(medigun) && GetEdictClassname(medigun, mediclassname, sizeof(mediclassname)) && strcmp(mediclassname, "tf_weapon_medigun", false) == 0)
  4341. {
  4342. SetHudTextParams(-1.0, 0.83, 0.35, 255, 255, 255, 255, 0, 0.2, 0.0, 0.1);
  4343.  
  4344. new charge = RoundToFloor(GetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel") * 100);
  4345.  
  4346. ShowSyncHudText(client, jumpHUD, "%T: %i", "vsh_uber-charge", client, charge);
  4347.  
  4348. if (charge == 100 && !(VSHFlags[client] & VSHFLAG_UBERREADY))
  4349. {
  4350. FakeClientCommandEx(client, "voicemenu 1 7");
  4351. VSHFlags[client] |= VSHFLAG_UBERREADY;
  4352. }
  4353. }
  4354. }
  4355.  
  4356. if (weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary))
  4357. {
  4358. new healtarget = GetHealingTarget(client);
  4359.  
  4360. if (IsValidClient(healtarget) && TF2_GetPlayerClass(healtarget) == TFClass_Scout)
  4361. {
  4362. TF2_AddCondition(client, TFCond_SpeedBuffAlly, 0.3);
  4363. }
  4364. }
  4365. }
  4366. // else if (AirBlastReload[client]>0)
  4367. // {
  4368. // SetHudTextParams(-1.0, 0.83, 0.15, 255, 255, 255, 255, 0, 0.2, 0.0, 0.1);
  4369. // ShowHudText(client, -1, "%t", "vsh_airblast", RoundFloat(AirBlastReload[client])+1);
  4370. // AirBlastReload[client]-=0.2;
  4371. // }
  4372.  
  4373. if (RedAlivePlayers == 1 && !TF2_IsPlayerInCondition(client, TFCond_Cloaked))
  4374. {
  4375. TF2_AddCondition(client, TFCond_HalloweenCritCandy, 0.3);
  4376. new primary = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary);
  4377.  
  4378. if (class == TFClass_Engineer && weapon == primary && StrEqual(wepclassname, "tf_weapon_sentry_revenge", false))
  4379. {
  4380. SetEntProp(client, Prop_Send, "m_iRevengeCrits", 3);
  4381. }
  4382.  
  4383. TF2_AddCondition(client, TFCond_Buffed, 0.3);
  4384.  
  4385. continue;
  4386. }
  4387.  
  4388. if (RedAlivePlayers == 2 && !TF2_IsPlayerInCondition(client, TFCond_Cloaked))
  4389. {
  4390. TF2_AddCondition(client, TFCond_Buffed, 0.3);
  4391. }
  4392.  
  4393. new TFCond:cond = TFCond_HalloweenCritCandy;
  4394.  
  4395. if (TF2_IsPlayerInCondition(client, TFCond_CritCola) && (class == TFClass_Scout || class == TFClass_Heavy))
  4396. {
  4397. TF2_AddCondition(client, cond, 0.3);
  4398.  
  4399. continue;
  4400. }
  4401.  
  4402. new bool:addmini = false;
  4403.  
  4404. for (i = 1; i <= MaxClients; i++)
  4405. {
  4406. if (IsValidClient(i) && IsPlayerAlive(i) && GetHealingTarget(i) == client)
  4407. {
  4408. addmini = true;
  4409.  
  4410. break;
  4411. }
  4412. }
  4413.  
  4414. new bool:addthecrit = false;
  4415.  
  4416. if (validwep && weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Melee)) //&& index != 4 && index != 194 && index != 225 && index != 356 && index != 461 && index != 574) addthecrit = true; //class != TFClass_Spy
  4417. {
  4418. //slightly longer check but makes sure that any weapon that can backstab will not crit (e.g. Saxxy)
  4419. if (strcmp(wepclassname, "tf_weapon_knife", false) != 0)
  4420. {
  4421. addthecrit = true;
  4422. }
  4423. }
  4424.  
  4425. switch (index)
  4426. {
  4427. case 305, 56, 16, 203, 58, 1005, 812, 833, 997: addthecrit = true; //Critlist
  4428. case 22, 23, 160, 209, 294, 449, 773: //Minicritlist
  4429. {
  4430. addthecrit = true;
  4431. if (class == TFClass_Scout && cond == TFCond_HalloweenCritCandy) cond = TFCond_Buffed;
  4432. }
  4433. case 656:
  4434. {
  4435. addthecrit = true;
  4436. cond = TFCond_Buffed;
  4437. }
  4438. }
  4439.  
  4440. if (index == 16 && addthecrit && IsValidEntity(FindPlayerBack(client, { 642 }, 1)))
  4441. {
  4442. addthecrit = false;
  4443. }
  4444.  
  4445. if (class == TFClass_DemoMan && !IsValidEntity(GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary)))
  4446. {
  4447. addthecrit = true;
  4448. }
  4449.  
  4450. /* if (Special != VSHSpecial_HHH && index != 56 && index != 1005 && weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Primary))
  4451. {
  4452. new meleeindex = GetIndexOfWeaponSlot(client, TFWeaponSlot_Melee);
  4453. // new melee = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee);
  4454. // if (melee <= MaxClients || !IsValidEntity(melee) || !GetEdictClassname(melee, wepclassname, sizeof(wepclassname))) strcopy(wepclassname, sizeof(wepclassname), "");
  4455. // new meleeindex = ((strncmp(wepclassname, "tf_wea", 6, false) == 0) ? GetEntProp(melee, Prop_Send, "m_iItemDefinitionIndex"):-1);
  4456. if (meleeindex == 232) addthecrit = false;
  4457. } */
  4458.  
  4459. if (addthecrit)
  4460. {
  4461. TF2_AddCondition(client, cond, 0.3);
  4462.  
  4463. if (addmini && cond != TFCond_Buffed)
  4464. {
  4465. TF2_AddCondition(client, TFCond_Buffed, 0.3);
  4466. }
  4467. }
  4468.  
  4469. if (class == TFClass_Spy && validwep && weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Primary))
  4470. {
  4471. if (!TF2_IsPlayerCritBuffed(client) && !TF2_IsPlayerInCondition(client, TFCond_Buffed) && !TF2_IsPlayerInCondition(client, TFCond_Cloaked) && !TF2_IsPlayerInCondition(client, TFCond_Disguised) && !GetEntProp(client, Prop_Send, "m_bFeignDeathReady"))
  4472. {
  4473. TF2_AddCondition(client, TFCond_CritCola, 0.3);
  4474. }
  4475. }
  4476.  
  4477. if (class == TFClass_Engineer && weapon == GetPlayerWeaponSlot(client, TFWeaponSlot_Primary) && StrEqual(wepclassname, "tf_weapon_sentry_revenge", false))
  4478. {
  4479. new sentry = FindSentry(client);
  4480.  
  4481. if (IsValidEntity(sentry) && GetEntPropEnt(sentry, Prop_Send, "m_hEnemy") == Hale)
  4482. {
  4483. SetEntProp(client, Prop_Send, "m_iRevengeCrits", 3);
  4484. TF2_AddCondition(client, TFCond_Kritzkrieged, 0.3);
  4485. }
  4486. else
  4487. {
  4488. if (GetEntProp(client, Prop_Send, "m_iRevengeCrits"))
  4489. {
  4490. SetEntProp(client, Prop_Send, "m_iRevengeCrits", 0);
  4491. }
  4492. else if (TF2_IsPlayerInCondition(client, TFCond_Kritzkrieged) && !TF2_IsPlayerInCondition(client, TFCond_Healing))
  4493. {
  4494. TF2_RemoveCondition(client, TFCond_Kritzkrieged);
  4495. }
  4496. }
  4497. }
  4498. }
  4499. }
  4500.  
  4501. return Plugin_Continue;
  4502. }
  4503.  
  4504. stock FindSentry(client)
  4505. {
  4506. new i = -1;
  4507.  
  4508. while ((i = FindEntityByClassname2(i, "obj_sentrygun")) != -1)
  4509. {
  4510. if (GetEntPropEnt(i, Prop_Send, "m_hBuilder") == client)
  4511. {
  4512. return i;
  4513. }
  4514. }
  4515.  
  4516. return -1;
  4517. }
  4518.  
  4519. public Action:HaleTimer(Handle:hTimer)
  4520. {
  4521. if (VSHRoundState == 2)
  4522. {
  4523. if (IsValidClient(Hale, false) && IsPlayerAlive(Hale))
  4524. {
  4525. TF2_AddCondition(Hale, TFCond_SpeedBuffAlly, 14.0);
  4526. }
  4527.  
  4528. return Plugin_Stop;
  4529. }
  4530.  
  4531. if (!IsValidClient(Hale))
  4532. {
  4533. return Plugin_Continue;
  4534. }
  4535.  
  4536. if (TF2_IsPlayerInCondition(Hale, TFCond_Jarated))
  4537. {
  4538. TF2_RemoveCondition(Hale, TFCond_Jarated);
  4539. }
  4540.  
  4541. if (TF2_IsPlayerInCondition(Hale, TFCond_MarkedForDeath))
  4542. {
  4543. TF2_RemoveCondition(Hale, TFCond_MarkedForDeath);
  4544. }
  4545.  
  4546. if (TF2_IsPlayerInCondition(Hale, TFCond_Disguised))
  4547. {
  4548. TF2_RemoveCondition(Hale, TFCond_Disguised);
  4549. }
  4550.  
  4551. if (TF2_IsPlayerInCondition(Hale, TFCond:42) && TF2_IsPlayerInCondition(Hale, TFCond_Dazed))
  4552. {
  4553. TF2_RemoveCondition(Hale, TFCond_Dazed);
  4554. }
  4555.  
  4556. new Float:speed = HaleSpeed + 0.7 * (100 - HaleHealth * 100 / HaleHealthMax);
  4557. SetEntPropFloat(Hale, Prop_Send, "m_flMaxspeed", speed);
  4558.  
  4559. // SetEntProp(Hale, Prop_Data, "m_iHealth", HaleHealth);
  4560. // SetEntProp(Hale, Prop_Send, "m_iHealth", HaleHealth);
  4561. if (HaleHealth <= 0 && IsPlayerAlive(Hale))
  4562. {
  4563. HaleHealth = 1;
  4564. }
  4565.  
  4566. SetHaleHealthFix(Hale, HaleHealth);
  4567. SetHudTextParams(-1.0, 0.77, 0.35, 255, 255, 255, 255);
  4568. SetGlobalTransTarget(Hale);
  4569. ShowSyncHudText(Hale, healthHUD, "%t", "vsh_health", HaleHealth, HaleHealthMax);
  4570.  
  4571. if (HaleRage / RageDMG >= 1)
  4572. {
  4573. if (IsFakeClient(Hale) && !(VSHFlags[Hale] & VSHFLAG_BOTRAGE))
  4574. {
  4575. CreateTimer(1.0, Timer_BotRage, _, TIMER_FLAG_NO_MAPCHANGE);
  4576. VSHFlags[Hale] |= VSHFLAG_BOTRAGE;
  4577. }
  4578. else
  4579. {
  4580. SetHudTextParams(-1.0, 0.83, 0.35, 255, 64, 64, 255);
  4581. ShowSyncHudText(Hale, rageHUD, "%t", "vsh_do_rage");
  4582. }
  4583. }
  4584. else
  4585. {
  4586. SetHudTextParams(-1.0, 0.83, 0.35, 255, 255, 255, 255);
  4587. ShowSyncHudText(Hale, rageHUD, "%t", "vsh_rage_meter", HaleRage * 100 / RageDMG);
  4588. }
  4589.  
  4590. SetHudTextParams(-1.0, 0.88, 0.35, 255, 255, 255, 255);
  4591.  
  4592. if (GlowTimer <= 0.0)
  4593. {
  4594. SetEntProp(Hale, Prop_Send, "m_bGlowEnabled", 0);
  4595. GlowTimer = 0.0;
  4596. }
  4597. else
  4598. {
  4599. GlowTimer -= 0.2;
  4600. }
  4601.  
  4602. if (bEnableSuperDuperJump)
  4603. {
  4604. if (HaleCharge <= 0)
  4605. {
  4606. HaleCharge = 0;
  4607. ShowSyncHudText(Hale, jumpHUD, "%t", "vsh_super_duper_jump");
  4608. }
  4609.  
  4610. SetHudTextParams(-1.0, 0.88, 0.35, 255, 64, 64, 255);
  4611. }
  4612.  
  4613. new buttons = GetClientButtons(Hale);
  4614.  
  4615. if (((buttons & IN_DUCK) || (buttons & IN_ATTACK2)) && (HaleCharge >= 0) && !(buttons & IN_JUMP))
  4616. {
  4617. if (Special == VSHSpecial_HHH)
  4618. {
  4619. if (HaleCharge + 5 < HALEHHH_TELEPORTCHARGE)
  4620. {
  4621. HaleCharge += 5;
  4622. }
  4623. else
  4624. {
  4625. HaleCharge = HALEHHH_TELEPORTCHARGE;
  4626. }
  4627.  
  4628. ShowSyncHudText(Hale, jumpHUD, "%t", "vsh_teleport_status", HaleCharge * 2);
  4629. }
  4630. else
  4631. {
  4632. if (HaleCharge + 5 < HALE_JUMPCHARGE)
  4633. {
  4634. HaleCharge += 5;
  4635. }
  4636. else
  4637. {
  4638. HaleCharge = HALE_JUMPCHARGE;
  4639. }
  4640.  
  4641. ShowSyncHudText(Hale, jumpHUD, "%t", "vsh_jump_status", HaleCharge * 4);
  4642. }
  4643. }
  4644. else if (HaleCharge < 0)
  4645. {
  4646. HaleCharge += 5;
  4647.  
  4648. if (Special == VSHSpecial_HHH)
  4649. {
  4650. ShowSyncHudText(Hale, jumpHUD, "%t %i", "vsh_teleport_status_2", -HaleCharge / 20);
  4651. }
  4652. else
  4653. {
  4654. ShowSyncHudText(Hale, jumpHUD, "%t %i", "vsh_jump_status_2", -HaleCharge / 20);
  4655. }
  4656. }
  4657. else
  4658. {
  4659. decl Float:ang[3];
  4660. GetClientEyeAngles(Hale, ang);
  4661.  
  4662. if ((ang[0] < -45.0) && (HaleCharge > 1))
  4663. {
  4664. new Action:act = Plugin_Continue;
  4665. new bool:super = bEnableSuperDuperJump;
  4666.  
  4667. Call_StartForward(OnHaleJump);
  4668. Call_PushCellRef(super);
  4669. Call_Finish(act);
  4670.  
  4671. if (act != Plugin_Continue && act != Plugin_Changed)
  4672. {
  4673. return Plugin_Continue;
  4674. }
  4675.  
  4676. if (act == Plugin_Changed)
  4677. {
  4678. bEnableSuperDuperJump = super;
  4679. }
  4680.  
  4681. decl Float:pos[3];
  4682.  
  4683. if (Special == VSHSpecial_HHH && (HaleCharge == HALEHHH_TELEPORTCHARGE || bEnableSuperDuperJump))
  4684. {
  4685. decl target;
  4686.  
  4687. do
  4688. {
  4689. target = GetRandomInt(1, MaxClients);
  4690. }
  4691. while ((RedAlivePlayers > 0) && (!IsValidClient(target, false) || (target == Hale) || !IsPlayerAlive(target) || GetClientTeam(target) != OtherTeam));
  4692.  
  4693. if (IsValidClient(target))
  4694. {
  4695. GetClientAbsOrigin(target, pos);
  4696. SetEntPropFloat(Hale, Prop_Send, "m_flNextAttack", GetGameTime() + (bEnableSuperDuperJump ? 4.0:2.0));
  4697.  
  4698. if (GetEntProp(target, Prop_Send, "m_bDucked"))
  4699. {
  4700. VSHFlags[Hale] |= VSHFLAG_NEEDSTODUCK;
  4701. decl Float:collisionvec[3];
  4702.  
  4703. collisionvec[0] = 24.0;
  4704. collisionvec[1] = 24.0;
  4705. collisionvec[2] = 62.0;
  4706.  
  4707. SetEntPropVector(Hale, Prop_Send, "m_vecMaxs", collisionvec);
  4708. SetEntProp(Hale, Prop_Send, "m_bDucked", 1);
  4709. SetEntityFlags(Hale, GetEntityFlags(Hale) | FL_DUCKING);
  4710.  
  4711. new Handle:timerpack;
  4712.  
  4713. CreateDataTimer(0.2, Timer_StunHHH, timerpack, TIMER_FLAG_NO_MAPCHANGE);
  4714. WritePackCell(timerpack, bEnableSuperDuperJump);
  4715. WritePackCell(timerpack, GetClientUserId(target));
  4716.  
  4717. }
  4718. else
  4719. {
  4720. TF2_StunPlayer(Hale, (bEnableSuperDuperJump ? 4.0:2.0), 0.0, TF_STUNFLAGS_GHOSTSCARE | TF_STUNFLAG_NOSOUNDOREFFECT, target);
  4721. }
  4722.  
  4723. TeleportEntity(Hale, pos, NULL_VECTOR, NULL_VECTOR);
  4724. SetEntProp(Hale, Prop_Send, "m_bGlowEnabled", 0);
  4725.  
  4726. GlowTimer = 0.0;
  4727.  
  4728. CreateTimer(3.0, RemoveEnt, EntIndexToEntRef(AttachParticle(Hale, "ghost_appearation")));
  4729. CreateTimer(3.0, RemoveEnt, EntIndexToEntRef(AttachParticle(Hale, "ghost_appearation", _, false)));
  4730.  
  4731. HaleCharge = -1100;
  4732. }
  4733.  
  4734. if (bEnableSuperDuperJump)
  4735. {
  4736. bEnableSuperDuperJump = false;
  4737. }
  4738. }
  4739. else if (Special != VSHSpecial_HHH)
  4740. {
  4741. decl Float:vel[3];
  4742. GetEntPropVector(Hale, Prop_Data, "m_vecVelocity", vel);
  4743.  
  4744. if (bEnableSuperDuperJump)
  4745. {
  4746. vel[2] = 750 + HaleCharge * 13.0 + 2000;
  4747. bEnableSuperDuperJump = false;
  4748. }
  4749. else
  4750. {
  4751. vel[2] = 750 + HaleCharge * 13.0;
  4752. }
  4753.  
  4754. SetEntProp(Hale, Prop_Send, "m_bJumping", 1);
  4755.  
  4756. vel[0] *= (1 + Sine(float(HaleCharge) * FLOAT_PI / 50));
  4757. vel[1] *= (1 + Sine(float(HaleCharge) * FLOAT_PI / 50));
  4758.  
  4759. TeleportEntity(Hale, NULL_VECTOR, NULL_VECTOR, vel);
  4760.  
  4761. HaleCharge = -120;
  4762.  
  4763. new String:s[PLATFORM_MAX_PATH];
  4764.  
  4765. switch (Special)
  4766. {
  4767. case VSHSpecial_Vagineer:
  4768. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerJump, GetRandomInt(1, 2));
  4769. case VSHSpecial_CBS:
  4770. strcopy(s, PLATFORM_MAX_PATH, CBSJump1);
  4771. case VSHSpecial_Bunny:
  4772. strcopy(s, PLATFORM_MAX_PATH, BunnyJump[GetRandomInt(0, sizeof(BunnyJump)-1)]);
  4773. case VSHSpecial_Hale:
  4774. {
  4775. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", GetRandomInt(0, 1) ? HaleJump:HaleJump132, GetRandomInt(1, 2));
  4776. }
  4777. }
  4778.  
  4779. if (s[0] != '\0')
  4780. {
  4781. GetEntPropVector(Hale, Prop_Send, "m_vecOrigin", pos);
  4782. EmitSoundToAll(s, Hale, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, true, 0.0);
  4783. EmitSoundToAll(s, Hale, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, true, 0.0);
  4784.  
  4785. for (new i = 1; i <= MaxClients; i++)
  4786. {
  4787. if (IsValidClient(i) && (i != Hale))
  4788. {
  4789. EmitSoundToClient(i, s, Hale, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, true, 0.0);
  4790. EmitSoundToClient(i, s, Hale, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, true, 0.0);
  4791. }
  4792. }
  4793. }
  4794. }
  4795. }
  4796. else
  4797. {
  4798. HaleCharge = 0;
  4799. }
  4800. }
  4801.  
  4802. if (RedAlivePlayers == 1)
  4803. {
  4804. switch (Special)
  4805. {
  4806. case VSHSpecial_Bunny:
  4807. PrintCenterTextAll("%t", "vsh_bunny_hp", HaleHealth, HaleHealthMax);
  4808. case VSHSpecial_Vagineer:
  4809. PrintCenterTextAll("%t", "vsh_vagineer_hp", HaleHealth, HaleHealthMax);
  4810. case VSHSpecial_HHH:
  4811. PrintCenterTextAll("%t", "vsh_hhh_hp", HaleHealth, HaleHealthMax);
  4812. case VSHSpecial_CBS:
  4813. PrintCenterTextAll("%t", "vsh_cbs_hp", HaleHealth, HaleHealthMax);
  4814. default:
  4815. PrintCenterTextAll("%t", "vsh_hale_hp", HaleHealth, HaleHealthMax);
  4816. }
  4817. }
  4818.  
  4819. if (OnlyScoutsLeft())
  4820. {
  4821. new Float:rage = 0.001*RageDMG;
  4822. HaleRage += RoundToCeil(rage);
  4823.  
  4824. if (HaleRage > RageDMG)
  4825. {
  4826. HaleRage = RageDMG;
  4827. }
  4828. }
  4829.  
  4830. if (!(GetEntityFlags(Hale) & FL_ONGROUND))
  4831. {
  4832. WeighDownTimer += 0.2;
  4833. }
  4834. else
  4835. {
  4836. WeighDownTimer = 0.0;
  4837. }
  4838.  
  4839. if (WeighDownTimer >= 4.0 && buttons & IN_DUCK && GetEntityGravity(Hale) != 6.0)
  4840. {
  4841. decl Float:ang[3];
  4842. GetClientEyeAngles(Hale, ang);
  4843.  
  4844. if ((ang[0] > 60.0))
  4845. {
  4846. new Action:act = Plugin_Continue;
  4847.  
  4848. Call_StartForward(OnHaleWeighdown);
  4849. Call_Finish(act);
  4850.  
  4851. if (act != Plugin_Continue)
  4852. {
  4853. return Plugin_Continue;
  4854. }
  4855.  
  4856. new Float:fVelocity[3];
  4857.  
  4858. GetEntPropVector(Hale, Prop_Data, "m_vecVelocity", fVelocity);
  4859. fVelocity[2] = -1000.0;
  4860. TeleportEntity(Hale, NULL_VECTOR, NULL_VECTOR, fVelocity);
  4861. SetEntityGravity(Hale, 6.0);
  4862. CreateTimer(2.0, Timer_GravityCat, GetClientUserId(Hale), TIMER_FLAG_NO_MAPCHANGE);
  4863. CPrintToChat(Hale, "{olive}[VSH]{default} %t", "vsh_used_weighdown");
  4864. WeighDownTimer = 0.0;
  4865. }
  4866. }
  4867.  
  4868. return Plugin_Continue;
  4869. }
  4870.  
  4871. public Action:Timer_StunHHH(Handle:timer, Handle:pack)
  4872. {
  4873. if (!IsValidClient(Hale, false))
  4874. {
  4875. return;
  4876. }
  4877.  
  4878. ResetPack(pack);
  4879.  
  4880. new superduper = ReadPackCell(pack);
  4881. new targetid = ReadPackCell(pack);
  4882. new target = GetClientOfUserId(targetid);
  4883.  
  4884. if (!IsValidClient(target, false))
  4885. {
  4886. target = 0;
  4887. }
  4888.  
  4889. VSHFlags[Hale] &= ~VSHFLAG_NEEDSTODUCK;
  4890. TF2_StunPlayer(Hale, (superduper ? 4.0:2.0), 0.0, TF_STUNFLAGS_GHOSTSCARE | TF_STUNFLAG_NOSOUNDOREFFECT, target);
  4891. }
  4892.  
  4893. public Action:Timer_BotRage(Handle:timer)
  4894. {
  4895. if (!IsValidClient(Hale, false))
  4896. {
  4897. return;
  4898. }
  4899.  
  4900. if (!TF2_IsPlayerInCondition(Hale, TFCond_Taunting))
  4901. {
  4902. FakeClientCommandEx(Hale, "taunt");
  4903. }
  4904. }
  4905.  
  4906. stock OnlyScoutsLeft()
  4907. {
  4908. for (new client = 1; client <= MaxClients; client++)
  4909. {
  4910. if (IsValidClient(client) && IsPlayerAlive(client) && client != Hale && TF2_GetPlayerClass(client) != TFClass_Scout)
  4911. {
  4912. return false;
  4913. }
  4914. }
  4915.  
  4916. return true;
  4917. }
  4918.  
  4919. public Action:Timer_GravityCat(Handle:timer, any:userid)
  4920. {
  4921. new client = GetClientOfUserId(userid);
  4922.  
  4923. if (IsValidClient(client))
  4924. {
  4925. SetEntityGravity(client, 1.0);
  4926. }
  4927. }
  4928.  
  4929. public Action:Destroy(client, const String:command[], argc)
  4930. {
  4931. if (!Enabled || client == Hale)
  4932. {
  4933. return Plugin_Continue;
  4934. }
  4935.  
  4936. if (IsValidClient(client) && TF2_GetPlayerClass(client) == TFClass_Engineer && TF2_IsPlayerInCondition(client, TFCond_Taunting) && GetIndexOfWeaponSlot(client, TFWeaponSlot_Melee) == 589)
  4937. {
  4938. return Plugin_Handled;
  4939. }
  4940.  
  4941. return Plugin_Continue;
  4942. }
  4943.  
  4944. stock GetIndexOfWeaponSlot(client, slot)
  4945. {
  4946. new weapon = GetPlayerWeaponSlot(client, slot);
  4947.  
  4948. return (weapon > MaxClients && IsValidEntity(weapon) ? GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"):-1);
  4949. }
  4950.  
  4951. public TF2_OnConditionRemoved(client, TFCond:condition)
  4952. {
  4953. if (TF2_GetPlayerClass(client) == TFClass_Scout && condition == TFCond_CritHype)
  4954. {
  4955. TF2_AddCondition(client, TFCond_SpeedBuffAlly, 0.01); //recalc their speed
  4956. }
  4957. }
  4958.  
  4959. public Action:DoTaunt(client, const String:command[], argc)
  4960. {
  4961. if (!Enabled || (client != Hale))
  4962. {
  4963. return Plugin_Continue;
  4964. }
  4965.  
  4966. decl String:s[PLATFORM_MAX_PATH];
  4967.  
  4968. if (HaleRage / RageDMG >= 1)
  4969. {
  4970. decl Float:pos[3];
  4971.  
  4972. GetEntPropVector(client, Prop_Send, "m_vecOrigin", pos);
  4973.  
  4974. pos[2] += 20.0;
  4975.  
  4976. new Action:act = Plugin_Continue;
  4977.  
  4978. Call_StartForward(OnHaleRage);
  4979.  
  4980. new Float:dist;
  4981. new Float:newdist;
  4982.  
  4983. switch (Special)
  4984. {
  4985. case VSHSpecial_Vagineer:
  4986. dist = RageDist / (1.5);
  4987. case VSHSpecial_Bunny:
  4988. dist = RageDist / (1.5);
  4989. case VSHSpecial_CBS:
  4990. dist = RageDist / (2.5);
  4991. default:
  4992. dist = RageDist;
  4993. }
  4994.  
  4995. newdist = dist;
  4996.  
  4997. Call_PushFloatRef(newdist);
  4998. Call_Finish(act);
  4999.  
  5000. if (act != Plugin_Continue && act != Plugin_Changed)
  5001. {
  5002. return Plugin_Continue;
  5003. }
  5004.  
  5005. if (act == Plugin_Changed)
  5006. {
  5007. dist = newdist;
  5008. }
  5009.  
  5010. TF2_AddCondition(Hale, TFCond:42, 4.0);
  5011.  
  5012. switch (Special)
  5013. {
  5014. case VSHSpecial_Vagineer:
  5015. {
  5016. if (GetRandomInt(0, 2))
  5017. strcopy(s, PLATFORM_MAX_PATH, VagineerRageSound);
  5018. else
  5019. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerRageSound2, GetRandomInt(1, 2));
  5020. TF2_AddCondition(Hale, TFCond_Ubercharged, 99.0);
  5021. UberRageCount = 0.0;
  5022.  
  5023. CreateTimer(0.6, UseRage, dist);
  5024. CreateTimer(0.1, UseUberRage, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
  5025. }
  5026. case VSHSpecial_HHH:
  5027. {
  5028. Format(s, PLATFORM_MAX_PATH, "%s", HHHRage2);
  5029. CreateTimer(0.6, UseRage, dist);
  5030. }
  5031. case VSHSpecial_Bunny:
  5032. {
  5033. strcopy(s, PLATFORM_MAX_PATH, BunnyRage[GetRandomInt(1, sizeof(BunnyRage)-1)]);
  5034. EmitSoundToAll(s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, pos, NULL_VECTOR, false, 0.0);
  5035. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  5036. new weapon = SpawnWeapon(client, "tf_weapon_grenadelauncher", 19, 100, 5, "6 ; 0.1 ; 411 ; 150.0 ; 413 ; 1.0 ; 37 ; 0.0 ; 280 ; 17 ; 477 ; 1.0 ; 467 ; 1.0 ; 181 ; 2.0");
  5037. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
  5038. SetEntProp(weapon, Prop_Send, "m_iClip1", 50);
  5039. // new vm = CreateVM(client, ReloadEggModel);
  5040. // SetEntPropEnt(vm, Prop_Send, "m_hWeaponAssociatedWith", weapon);
  5041. // SetEntPropEnt(weapon, Prop_Send, "m_hExtraWearableViewModel", vm);
  5042. SetAmmo(client, TFWeaponSlot_Primary, 0);
  5043. //add charging?
  5044. CreateTimer(0.6, UseRage, dist);
  5045. }
  5046. case VSHSpecial_CBS:
  5047. {
  5048. if (GetRandomInt(0, 1))
  5049. Format(s, PLATFORM_MAX_PATH, "%s", CBS1);
  5050. else
  5051. Format(s, PLATFORM_MAX_PATH, "%s", CBS3);
  5052. EmitSoundToAll(s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, pos, NULL_VECTOR, false, 0.0);
  5053. TF2_RemoveWeaponSlot(client, TFWeaponSlot_Primary);
  5054. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", SpawnWeapon(client, "tf_weapon_compound_bow", 1005, 100, 5, "2 ; 2.1 ; 6 ; 0.5 ; 37 ; 0.0 ; 280 ; 19"));
  5055. SetAmmo(client, TFWeaponSlot_Primary, ((RedAlivePlayers >= CBS_MAX_ARROWS) ? CBS_MAX_ARROWS:RedAlivePlayers));
  5056. CreateTimer(0.6, UseRage, dist);
  5057. CreateTimer(0.1, UseBowRage);
  5058. }
  5059. default:
  5060. {
  5061. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleRageSound, GetRandomInt(1, 4));
  5062. CreateTimer(0.6, UseRage, dist);
  5063. }
  5064. }
  5065.  
  5066. EmitSoundToAll(s, client, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, pos, NULL_VECTOR, true, 0.0);
  5067. EmitSoundToAll(s, client, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, pos, NULL_VECTOR, true, 0.0);
  5068.  
  5069. for (new i = 1; i <= MaxClients; i++)
  5070. {
  5071. if (IsValidClient(i) && i != Hale)
  5072. {
  5073. EmitSoundToClient(i, s, client, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, pos, NULL_VECTOR, true, 0.0);
  5074. EmitSoundToClient(i, s, client, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, pos, NULL_VECTOR, true, 0.0);
  5075. }
  5076. }
  5077.  
  5078. HaleRage = 0;
  5079. VSHFlags[Hale] &= ~VSHFLAG_BOTRAGE;
  5080. }
  5081.  
  5082. return Plugin_Continue;
  5083. }
  5084.  
  5085. public Action:DoSuicide(client, const String:command[], argc)
  5086. {
  5087. if (Enabled && client == Hale && VSHRoundState == 0)
  5088. {
  5089. return Plugin_Handled;
  5090. }
  5091.  
  5092. return Plugin_Continue;
  5093. }
  5094.  
  5095. public Action:UseRage(Handle:hTimer, any:dist)
  5096. {
  5097. decl Float:pos[3];
  5098. decl Float:pos2[3];
  5099. decl i;
  5100. decl Float:distance;
  5101.  
  5102. if (!IsValidClient(Hale, false))
  5103. {
  5104. return Plugin_Continue;
  5105. }
  5106.  
  5107. if (!GetEntProp(Hale, Prop_Send, "m_bIsReadyToHighFive") && !IsValidEntity(GetEntPropEnt(Hale, Prop_Send, "m_hHighFivePartner")))
  5108. {
  5109. TF2_RemoveCondition(Hale, TFCond_Taunting);
  5110. MakeModelTimer(INVALID_HANDLE); // should reset Hale's animation
  5111. }
  5112.  
  5113. GetEntPropVector(Hale, Prop_Send, "m_vecOrigin", pos);
  5114.  
  5115. for (i = 1; i <= MaxClients; i++)
  5116. {
  5117. if (IsValidClient(i) && IsPlayerAlive(i) && (i != Hale))
  5118. {
  5119. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos2);
  5120. distance = GetVectorDistance(pos, pos2);
  5121.  
  5122. if (!TF2_IsPlayerInCondition(i, TFCond_Ubercharged) && distance < dist)
  5123. {
  5124. new flags = TF_STUNFLAGS_GHOSTSCARE;
  5125.  
  5126. if (Special != VSHSpecial_HHH)
  5127. {
  5128. flags |= TF_STUNFLAG_NOSOUNDOREFFECT;
  5129. CreateTimer(5.0, RemoveEnt, EntIndexToEntRef(AttachParticle(i, "yikes_fx", 75.0)));
  5130. }
  5131.  
  5132. if (VSHRoundState != 0)
  5133. {
  5134. TF2_StunPlayer(i, 5.0, _, flags, (Special == VSHSpecial_HHH ? 0:Hale));
  5135. }
  5136. }
  5137. }
  5138. }
  5139.  
  5140. i = -1;
  5141.  
  5142. while ((i = FindEntityByClassname2(i, "obj_sentrygun")) != -1)
  5143. {
  5144. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos2);
  5145. distance = GetVectorDistance(pos, pos2);
  5146.  
  5147. if (dist <= RageDist / 3)
  5148. {
  5149. dist = RageDist / 2;
  5150. }
  5151.  
  5152. if (distance < dist) //(!mode && (distance < RageDist)) || (mode && (distance < RageDist/2)))
  5153. {
  5154. SetEntProp(i, Prop_Send, "m_bDisabled", 1);
  5155. AttachParticle(i, "yikes_fx", 75.0);
  5156.  
  5157. if (newRageSentry)
  5158. {
  5159. SetVariantInt(GetEntProp(i, Prop_Send, "m_iHealth") / 2);
  5160. AcceptEntityInput(i, "RemoveHealth");
  5161. }
  5162. else
  5163. {
  5164. SetEntProp(i, Prop_Send, "m_iHealth", GetEntProp(i, Prop_Send, "m_iHealth") / 2);
  5165. }
  5166.  
  5167. CreateTimer(8.0, EnableSG, EntIndexToEntRef(i));
  5168. }
  5169. }
  5170.  
  5171. i = -1;
  5172.  
  5173. while ((i = FindEntityByClassname2(i, "obj_dispenser")) != -1)
  5174. {
  5175. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos2);
  5176. distance = GetVectorDistance(pos, pos2);
  5177.  
  5178. if (dist <= RageDist / 3)
  5179. {
  5180. dist = RageDist / 2;
  5181. }
  5182.  
  5183. if (distance < dist) //(!mode && (distance < RageDist)) || (mode && (distance < RageDist/2)))
  5184. {
  5185. SetVariantInt(1);
  5186. AcceptEntityInput(i, "RemoveHealth");
  5187. }
  5188. }
  5189.  
  5190. i = -1;
  5191.  
  5192. while ((i = FindEntityByClassname2(i, "obj_teleporter")) != -1)
  5193. {
  5194. GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos2);
  5195. distance = GetVectorDistance(pos, pos2);
  5196.  
  5197. if (dist <= RageDist / 3)
  5198. {
  5199. dist = RageDist / 2;
  5200. }
  5201.  
  5202. if (distance < dist) //(!mode && (distance < RageDist)) || (mode && (distance < RageDist/2)))
  5203. {
  5204. SetVariantInt(1);
  5205. AcceptEntityInput(i, "RemoveHealth");
  5206. }
  5207. }
  5208.  
  5209. return Plugin_Continue;
  5210. }
  5211.  
  5212. public Action:UseUberRage(Handle:hTimer, any:param)
  5213. {
  5214. if (!IsValidClient(Hale))
  5215. {
  5216. return Plugin_Stop;
  5217. }
  5218.  
  5219. if (UberRageCount == 1)
  5220. {
  5221. if (!GetEntProp(Hale, Prop_Send, "m_bIsReadyToHighFive") && !IsValidEntity(GetEntPropEnt(Hale, Prop_Send, "m_hHighFivePartner")))
  5222. {
  5223. TF2_RemoveCondition(Hale, TFCond_Taunting);
  5224. MakeModelTimer(INVALID_HANDLE); // should reset Hale's animation
  5225. }
  5226. // TF2_StunPlayer(Hale, 0.0, _, TF_STUNFLAG_NOSOUNDOREFFECT);
  5227. }
  5228. else if (UberRageCount >= 100)
  5229. {
  5230. if (defaulttakedamagetype == 0)
  5231. {
  5232. defaulttakedamagetype = 2;
  5233. }
  5234.  
  5235. SetEntProp(Hale, Prop_Data, "m_takedamage", defaulttakedamagetype);
  5236. defaulttakedamagetype = 0;
  5237. TF2_RemoveCondition(Hale, TFCond_Ubercharged);
  5238.  
  5239. return Plugin_Stop;
  5240. }
  5241. else if (UberRageCount >= 85 && !TF2_IsPlayerInCondition(Hale, TFCond_UberchargeFading))
  5242. {
  5243. TF2_AddCondition(Hale, TFCond_UberchargeFading, 3.0);
  5244. }
  5245.  
  5246. if (!defaulttakedamagetype)
  5247. {
  5248. defaulttakedamagetype = GetEntProp(Hale, Prop_Data, "m_takedamage");
  5249.  
  5250. if (defaulttakedamagetype == 0)
  5251. {
  5252. defaulttakedamagetype = 2;
  5253. }
  5254. }
  5255.  
  5256. SetEntProp(Hale, Prop_Data, "m_takedamage", 0);
  5257. UberRageCount += 1.0;
  5258.  
  5259. return Plugin_Continue;
  5260. }
  5261.  
  5262. public Action:UseBowRage(Handle:hTimer)
  5263. {
  5264. if (!GetEntProp(Hale, Prop_Send, "m_bIsReadyToHighFive") && !IsValidEntity(GetEntPropEnt(Hale, Prop_Send, "m_hHighFivePartner")))
  5265. {
  5266. TF2_RemoveCondition(Hale, TFCond_Taunting);
  5267. MakeModelTimer(INVALID_HANDLE); // should reset Hale's animation
  5268. }
  5269.  
  5270. // TF2_StunPlayer(Hale, 0.0, _, TF_STUNFLAG_NOSOUNDOREFFECT);
  5271. // UberRageCount = 9.0;
  5272.  
  5273. SetAmmo(Hale, 0, ((RedAlivePlayers >= CBS_MAX_ARROWS) ? CBS_MAX_ARROWS:RedAlivePlayers));
  5274.  
  5275. return Plugin_Continue;
  5276. }
  5277.  
  5278. public Action:event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
  5279. {
  5280. decl String:s[PLATFORM_MAX_PATH];
  5281.  
  5282. if (!Enabled)
  5283. {
  5284. return Plugin_Continue;
  5285. }
  5286.  
  5287. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  5288.  
  5289. if (!IsValidClient(client))
  5290. {
  5291. return Plugin_Continue;
  5292. }
  5293.  
  5294. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  5295. new deathflags = GetEventInt(event, "death_flags");
  5296. new customkill = GetEventInt(event, "customkill");
  5297.  
  5298. if (attacker == Hale && Special == VSHSpecial_Bunny && VSHRoundState == 1)
  5299. {
  5300. SpawnManyAmmoPacks(client, EggModel, 1, 5, 120.0);
  5301. }
  5302.  
  5303. if (attacker == Hale && VSHRoundState == 1 && (deathflags & TF_DEATHFLAG_DEADRINGER))
  5304. {
  5305. numHaleKills++;
  5306.  
  5307. if (customkill != TF_CUSTOM_BOOTS_STOMP)
  5308. {
  5309. if (Special == VSHSpecial_Hale)
  5310. {
  5311. SetEventString(event, "weapon", "fists");
  5312. }
  5313. }
  5314.  
  5315. return Plugin_Continue;
  5316. }
  5317.  
  5318. if (GetClientHealth(client) > 0)
  5319. {
  5320. return Plugin_Continue;
  5321. }
  5322.  
  5323. CreateTimer(0.1, CheckAlivePlayers);
  5324.  
  5325. if (client != Hale && VSHRoundState == 1)
  5326. {
  5327. CreateTimer(1.0, Timer_Damage, GetClientUserId(client));
  5328. }
  5329.  
  5330. if (client == Hale && VSHRoundState == 1)
  5331. {
  5332. switch (Special)
  5333. {
  5334. case VSHSpecial_HHH:
  5335. {
  5336. Format(s, PLATFORM_MAX_PATH, "vo/halloween_boss/knight_death0%d.wav", GetRandomInt(1, 2));
  5337. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5338. EmitSoundToAll("ui/halloween_boss_defeated_fx.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5339. // CreateTimer(0.1, Timer_ChangeRagdoll, any:GetEventInt(event, "userid"));
  5340. }
  5341. case VSHSpecial_Hale:
  5342. {
  5343. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleFail, GetRandomInt(1, 3));
  5344. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5345. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5346. // CreateTimer(0.1, Timer_ChangeRagdoll, any:GetEventInt(event, "userid"));
  5347. }
  5348. case VSHSpecial_Vagineer:
  5349. {
  5350. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerFail, GetRandomInt(1, 2));
  5351. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5352. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5353. // CreateTimer(0.1, Timer_ChangeRagdoll, any:GetEventInt(event, "userid"));
  5354. }
  5355. case VSHSpecial_Bunny:
  5356. {
  5357. strcopy(s, PLATFORM_MAX_PATH, BunnyFail[GetRandomInt(0, sizeof(BunnyFail)-1)]);
  5358. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5359. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, client, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5360. // CreateTimer(0.1, Timer_ChangeRagdoll, any:GetEventInt(event, "userid"));
  5361. SpawnManyAmmoPacks(client, EggModel, 1);
  5362. }
  5363. }
  5364.  
  5365. if (HaleHealth < 0)
  5366. {
  5367. HaleHealth = 0;
  5368. }
  5369.  
  5370. ForceTeamWin(OtherTeam);
  5371.  
  5372. return Plugin_Continue;
  5373. }
  5374.  
  5375. if (attacker == Hale && VSHRoundState == 1)
  5376. {
  5377. numHaleKills++;
  5378.  
  5379. switch (Special)
  5380. {
  5381. case VSHSpecial_Hale:
  5382. {
  5383. if (customkill != TF_CUSTOM_BOOTS_STOMP)
  5384. {
  5385. SetEventString(event, "weapon", "fists");
  5386. }
  5387.  
  5388. if (!GetRandomInt(0, 2) && RedAlivePlayers != 1)
  5389. {
  5390. strcopy(s, PLATFORM_MAX_PATH, "");
  5391. new TFClassType:playerclass = TF2_GetPlayerClass(client);
  5392.  
  5393. switch (playerclass)
  5394. {
  5395. case TFClass_Scout:
  5396. strcopy(s, PLATFORM_MAX_PATH, HaleKillScout132);
  5397. case TFClass_Pyro:
  5398. strcopy(s, PLATFORM_MAX_PATH, HaleKillPyro132);
  5399. case TFClass_DemoMan:
  5400. strcopy(s, PLATFORM_MAX_PATH, HaleKillDemo132);
  5401. case TFClass_Heavy:
  5402. strcopy(s, PLATFORM_MAX_PATH, HaleKillHeavy132);
  5403. case TFClass_Medic:
  5404. strcopy(s, PLATFORM_MAX_PATH, HaleKillMedic);
  5405. case TFClass_Sniper:
  5406. {
  5407. if (GetRandomInt(0, 1))
  5408. {
  5409. strcopy(s, PLATFORM_MAX_PATH, HaleKillSniper1);
  5410. }
  5411. else
  5412. {
  5413. strcopy(s, PLATFORM_MAX_PATH, HaleKillSniper2);
  5414. }
  5415. }
  5416. case TFClass_Spy:
  5417. {
  5418. new see = GetRandomInt(0, 2);
  5419.  
  5420. if (!see)
  5421. {
  5422. strcopy(s, PLATFORM_MAX_PATH, HaleKillSpy1);
  5423. }
  5424. else if (see == 1)
  5425. {
  5426. strcopy(s, PLATFORM_MAX_PATH, HaleKillSpy2);
  5427. }
  5428. else
  5429. {
  5430. strcopy(s, PLATFORM_MAX_PATH, HaleKillSpy132);
  5431. }
  5432. }
  5433. case TFClass_Engineer:
  5434. {
  5435. new see = GetRandomInt(0, 3);
  5436.  
  5437. if (!see)
  5438. {
  5439. strcopy(s, PLATFORM_MAX_PATH, HaleKillEngie1);
  5440. }
  5441. else if (see == 1)
  5442. {
  5443. strcopy(s, PLATFORM_MAX_PATH, HaleKillEngie2);
  5444. }
  5445. else
  5446. {
  5447. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKillEngie132, GetRandomInt(1, 2));
  5448. }
  5449. }
  5450. }
  5451. if (!StrEqual(s, ""))
  5452. {
  5453. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5454. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5455. }
  5456. }
  5457. }
  5458. case VSHSpecial_Vagineer:
  5459. {
  5460. strcopy(s, PLATFORM_MAX_PATH, VagineerHit);
  5461. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5462. EmitSoundToAll(s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5463. // CreateTimer(0.1, Timer_DissolveRagdoll, any:GetEventInt(event, "userid"));
  5464. }
  5465. case VSHSpecial_HHH:
  5466. {
  5467. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HHHAttack, GetRandomInt(1, 4));
  5468. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5469. EmitSoundToAll(s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5470. }
  5471. case VSHSpecial_Bunny:
  5472. {
  5473. strcopy(s, PLATFORM_MAX_PATH, BunnyKill[GetRandomInt(0, sizeof(BunnyKill)-1)]);
  5474. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5475. EmitSoundToAll(s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5476. }
  5477. case VSHSpecial_CBS:
  5478. {
  5479. if (!GetRandomInt(0, 3) && RedAlivePlayers != 1)
  5480. {
  5481. new TFClassType:playerclass = TF2_GetPlayerClass(client);
  5482.  
  5483. switch (playerclass)
  5484. {
  5485. case TFClass_Spy:
  5486. {
  5487. strcopy(s, PLATFORM_MAX_PATH, "vo/sniper_dominationspy04.wav");
  5488. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5489. EmitSoundToAll(s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, attacker, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5490. }
  5491. }
  5492. }
  5493.  
  5494. new weapon = GetEntPropEnt(Hale, Prop_Send, "m_hActiveWeapon");
  5495.  
  5496. if (weapon == GetPlayerWeaponSlot(Hale, TFWeaponSlot_Melee))
  5497. {
  5498. TF2_RemoveWeaponSlot(Hale, TFWeaponSlot_Melee);
  5499.  
  5500. new clubindex, wepswitch = GetRandomInt(0, 3);
  5501.  
  5502. switch (wepswitch)
  5503. {
  5504. case 0:
  5505. clubindex = 171;
  5506. case 1:
  5507. clubindex = 3;
  5508. case 2:
  5509. clubindex = 232;
  5510. case 3:
  5511. clubindex = 401;
  5512. }
  5513.  
  5514. weapon = SpawnWeapon(Hale, "tf_weapon_club", clubindex, 100, 5, "68 ; 2.0 ; 2 ; 3.1 ; 259 ; 1.0");
  5515. SetEntPropEnt(Hale, Prop_Send, "m_hActiveWeapon", weapon);
  5516. SetEntProp(weapon, Prop_Send, "m_nModelIndexOverrides", GetEntProp(weapon, Prop_Send, "m_iWorldModelIndex"), _, 0);
  5517. }
  5518. }
  5519. }
  5520.  
  5521. if (GetGameTime() <= KSpreeTimer)
  5522. {
  5523. KSpreeCount++;
  5524. }
  5525. else
  5526. {
  5527. KSpreeCount = 1;
  5528. }
  5529.  
  5530. if (KSpreeCount == 3 && RedAlivePlayers != 1)
  5531. {
  5532. switch (Special)
  5533. {
  5534. case VSHSpecial_Hale:
  5535. {
  5536. new see = GetRandomInt(0, 7);
  5537.  
  5538. if (!see || see == 1)
  5539. {
  5540. strcopy(s, PLATFORM_MAX_PATH, HaleKSpree);
  5541. }
  5542. else if (see < 5)
  5543. {
  5544. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKSpreeNew, GetRandomInt(1, 5));
  5545. }
  5546. else
  5547. {
  5548. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleKillKSpree132, GetRandomInt(1, 2));
  5549. }
  5550. }
  5551. case VSHSpecial_Vagineer:
  5552. {
  5553. if (GetRandomInt(0, 4) == 1)
  5554. {
  5555. strcopy(s, PLATFORM_MAX_PATH, VagineerKSpree);
  5556. }
  5557. else if (GetRandomInt(0, 3) == 1)
  5558. {
  5559. strcopy(s, PLATFORM_MAX_PATH, VagineerKSpree2);
  5560. }
  5561. else
  5562. {
  5563. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", VagineerKSpreeNew, GetRandomInt(1, 5));
  5564. }
  5565. }
  5566. case VSHSpecial_HHH:
  5567. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HHHLaught, GetRandomInt(1, 4));
  5568. case VSHSpecial_CBS:
  5569. {
  5570. if (!GetRandomInt(0, 3))
  5571. {
  5572. Format(s, PLATFORM_MAX_PATH, CBS0);
  5573. }
  5574. else if (!GetRandomInt(0, 3))
  5575. {
  5576. Format(s, PLATFORM_MAX_PATH, CBS1);
  5577. }
  5578. else
  5579. {
  5580. Format(s, PLATFORM_MAX_PATH, "%s%02i.wav", CBS2, GetRandomInt(1, 9));
  5581. }
  5582.  
  5583. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5584. }
  5585. case VSHSpecial_Bunny:
  5586. {
  5587. strcopy(s, PLATFORM_MAX_PATH, BunnySpree[GetRandomInt(0, sizeof(BunnySpree)-1)]);
  5588. }
  5589. }
  5590.  
  5591. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5592. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  5593. KSpreeCount = 0;
  5594. }
  5595. else
  5596. {
  5597. KSpreeTimer = GetGameTime() + 5.0;
  5598. }
  5599. }
  5600.  
  5601. if ((TF2_GetPlayerClass(client) == TFClass_Engineer) && !(deathflags & TF_DEATHFLAG_DEADRINGER))
  5602. {
  5603. for (new ent = MaxClients + 1; ent < ME; ent++)
  5604. {
  5605. if (IsValidEdict(ent))
  5606. {
  5607. if (GetEdictClassname(ent, s, sizeof(s)) && !strcmp(s, "obj_sentrygun", false) && GetEntPropEnt(ent, Prop_Send, "m_hBuilder") == client)
  5608. {
  5609. // SDKHooks_TakeDamage(ent, Hale, Hale, Float:(GetEntProp(ent, Prop_Send, "m_iMaxHealth")+8), DMG_CLUB);
  5610. SetVariantInt(GetEntProp(ent, Prop_Send, "m_iMaxHealth") + 8);
  5611. AcceptEntityInput(ent, "RemoveHealth");
  5612. }
  5613. }
  5614. }
  5615. }
  5616.  
  5617. return Plugin_Continue;
  5618. }
  5619.  
  5620. stock SpawnManyAmmoPacks(client, String:model[], skin = 0, num = 14, Float:offsz = 30.0)
  5621. {
  5622. if (hSetAmmoVelocity == INVALID_HANDLE)
  5623. {
  5624. return;
  5625. }
  5626.  
  5627. decl Float:pos[3], Float:vel[3], Float:ang[3];
  5628.  
  5629. ang[0] = 90.0;
  5630. ang[1] = 0.0;
  5631. ang[2] = 0.0;
  5632.  
  5633. GetClientAbsOrigin(client, pos);
  5634.  
  5635. pos[2] += offsz;
  5636.  
  5637. for (new i = 0; i < num; i++)
  5638. {
  5639. vel[0] = GetRandomFloat(-400.0, 400.0);
  5640. vel[1] = GetRandomFloat(-400.0, 400.0);
  5641. vel[2] = GetRandomFloat(300.0, 500.0);
  5642.  
  5643. pos[0] += GetRandomFloat(-5.0, 5.0);
  5644. pos[1] += GetRandomFloat(-5.0, 5.0);
  5645.  
  5646. new ent = CreateEntityByName("tf_ammo_pack");
  5647.  
  5648. if (!IsValidEntity(ent))
  5649. {
  5650. continue;
  5651. }
  5652.  
  5653. SetEntityModel(ent, model);
  5654. DispatchKeyValue(ent, "OnPlayerTouch", "!self,Kill,,0,-1"); //for safety, but it shouldn't act like a normal ammopack
  5655. SetEntProp(ent, Prop_Send, "m_nSkin", skin);
  5656. SetEntProp(ent, Prop_Send, "m_nSolidType", 6);
  5657.  
  5658. // SetEntityMoveType(ent, MOVETYPE_FLYGRAVITY);
  5659. // SetEntProp(ent, Prop_Send, "movetype", 5);
  5660. // SetEntProp(ent, Prop_Send, "movecollide", 0);
  5661.  
  5662. SetEntProp(ent, Prop_Send, "m_usSolidFlags", 152);
  5663. SetEntProp(ent, Prop_Send, "m_triggerBloat", 24);
  5664. SetEntProp(ent, Prop_Send, "m_CollisionGroup", 1);
  5665. SetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity", client);
  5666. SetEntProp(ent, Prop_Send, "m_iTeamNum", 2);
  5667.  
  5668. TeleportEntity(ent, pos, ang, vel);
  5669. DispatchSpawn(ent);
  5670. TeleportEntity(ent, pos, ang, vel);
  5671.  
  5672. SDKCall(hSetAmmoVelocity, ent, vel);
  5673.  
  5674. SetEntProp(ent, Prop_Data, "m_iHealth", 900);
  5675.  
  5676. new offs = GetEntSendPropOffs(ent, "m_vecInitialVelocity", true);
  5677.  
  5678. SetEntData(ent, offs - 4, 1, _, true);
  5679. /* SetEntData(ent, offs-13, 0, 1, true);
  5680. SetEntData(ent, offs-11, 1, 1, true);
  5681. SetEntData(ent, offs-15, 1, 1, true);
  5682. SetEntityMoveType(ent, MOVETYPE_FLYGRAVITY);
  5683. SetEntProp(ent, Prop_Data, "m_nNextThinkTick", GetEntProp(client, Prop_Send, "m_nTickBase") + 3);
  5684. SetEntPropVector(ent, Prop_Data, "m_vecAbsVelocity", vel);
  5685. SetEntPropVector(ent, Prop_Data, "m_vecVelocity", vel);
  5686. SetEntPropVector(ent, Prop_Send, "m_vecInitialVelocity", vel);
  5687. SetEntProp(ent, Prop_Send, "m_bClientSideAnimation", 1);
  5688. PrintToChatAll("aeiou %d %d %d %d %d", GetEntData(ent, offs-16, 1), GetEntData(ent, offs-15, 1), GetEntData(ent, offs-14, 1), GetEntData(ent, offs-13, 1), GetEntData(ent, offs-12, 1));
  5689. */
  5690. }
  5691. }
  5692.  
  5693. public Action:Timer_Damage(Handle:hTimer, any:id)
  5694. {
  5695. new client = GetClientOfUserId(id);
  5696.  
  5697. if (IsValidClient(client, false))
  5698. {
  5699. CPrintToChat(client, "{olive}[VSH] %t. %t %i{default}", "vsh_damage", Damage[client], "vsh_scores", RoundFloat(Damage[client] / 600.0));
  5700. }
  5701.  
  5702. return Plugin_Continue;
  5703. }
  5704.  
  5705. /*public Action:Timer_DissolveRagdoll(Handle:timer, any:userid)
  5706. {
  5707. new victim = GetClientOfUserId(userid);
  5708. new ragdoll = (IsValidClient(victim) ? GetEntPropEnt(victim, Prop_Send, "m_hRagdoll"):-1);
  5709. if (IsValidEntity(ragdoll))
  5710. {
  5711. DissolveRagdoll(ragdoll);
  5712. }
  5713. }
  5714. DissolveRagdoll(ragdoll)
  5715. {
  5716. new dissolver = CreateEntityByName("env_entity_dissolver");
  5717.  
  5718. if (!IsValidEntity(dissolver))
  5719. {
  5720. return;
  5721. }
  5722. DispatchKeyValue(dissolver, "dissolvetype", "0");
  5723. DispatchKeyValue(dissolver, "magnitude", "200");
  5724. DispatchKeyValue(dissolver, "target", "!activator");
  5725. AcceptEntityInput(dissolver, "Dissolve", ragdoll);
  5726. AcceptEntityInput(dissolver, "Kill");
  5727. return;
  5728. }*/
  5729. /*public Action:Timer_ChangeRagdoll(Handle:timer, any:userid)
  5730. {
  5731. new victim = GetClientOfUserId(userid);
  5732. new ragdoll;
  5733. if (IsValidClient(victim)) ragdoll = GetEntPropEnt(victim, Prop_Send, "m_hRagdoll");
  5734. else ragdoll = -1;
  5735. if (IsValidEntity(ragdoll))
  5736. {
  5737. switch (Special)
  5738. {
  5739. case VSHSpecial_Hale: SetEntityModel(ragdoll, HaleModel);
  5740. case VSHSpecial_Vagineer: SetEntityModel(ragdoll, VagineerModel);
  5741. case VSHSpecial_HHH: SetEntityModel(ragdoll, HHHModel);
  5742. case VSHSpecial_CBS: SetEntityModel(ragdoll, CBSModel);
  5743. case VSHSpecial_Bunny: SetEntityModel(ragdoll, BunnyModel);
  5744. }
  5745. }
  5746. }*/
  5747.  
  5748. public Action:event_deflect(Handle:event, const String:name[], bool:dontBroadcast)
  5749. {
  5750. if (!Enabled)
  5751. {
  5752. return Plugin_Continue;
  5753. }
  5754.  
  5755. new deflector = GetClientOfUserId(GetEventInt(event, "userid"));
  5756. new owner = GetClientOfUserId(GetEventInt(event, "ownerid"));
  5757. new weaponid = GetEventInt(event, "weaponid");
  5758.  
  5759. if (owner != Hale)
  5760. {
  5761. return Plugin_Continue;
  5762. }
  5763.  
  5764. if (weaponid != 0)
  5765. {
  5766. return Plugin_Continue;
  5767. }
  5768.  
  5769. new Float:rage = 0.04*RageDMG;
  5770. HaleRage += RoundToCeil(rage);
  5771.  
  5772. if (HaleRage > RageDMG)
  5773. {
  5774. HaleRage = RageDMG;
  5775. }
  5776.  
  5777. if (Special != VSHSpecial_Vagineer)
  5778. {
  5779. return Plugin_Continue;
  5780. }
  5781.  
  5782. if (!TF2_IsPlayerInCondition(owner, TFCond_Ubercharged))
  5783. {
  5784. return Plugin_Continue;
  5785. }
  5786.  
  5787. if (UberRageCount > 11)
  5788. {
  5789. UberRageCount -= 10;
  5790. }
  5791.  
  5792. new newammo = GetAmmo(deflector, 0) - 5;
  5793.  
  5794. SetAmmo(deflector, 0, newammo <= 0 ? 0:newammo);
  5795.  
  5796. return Plugin_Continue;
  5797. }
  5798.  
  5799. public Action:event_jarate(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
  5800. {
  5801. new client = BfReadByte(bf);
  5802. new victim = BfReadByte(bf);
  5803.  
  5804. if (victim != Hale)
  5805. {
  5806. return Plugin_Continue;
  5807. }
  5808.  
  5809. new jar = GetPlayerWeaponSlot(client, 1);
  5810.  
  5811. if (jar != -1 && GetEntProp(jar, Prop_Send, "m_iItemDefinitionIndex") == 58 && GetEntProp(jar, Prop_Send, "m_iEntityLevel") != -122) //-122 is the Jar of Ants and should not be used in this
  5812. {
  5813. new Float:rage = 0.08*RageDMG;
  5814.  
  5815. HaleRage -= RoundToFloor(rage);
  5816.  
  5817. if (HaleRage < 0)
  5818. {
  5819. HaleRage = 0;
  5820. }
  5821.  
  5822. if (Special == VSHSpecial_Vagineer && TF2_IsPlayerInCondition(victim, TFCond_Ubercharged) && UberRageCount < 99)
  5823. {
  5824. UberRageCount += 7.0;
  5825.  
  5826. if (UberRageCount > 99)
  5827. {
  5828. UberRageCount = 99.0;
  5829. }
  5830. }
  5831.  
  5832. new ammo = GetAmmo(Hale, 0);
  5833.  
  5834. if (Special == VSHSpecial_CBS && ammo > 0)
  5835. {
  5836. SetAmmo(Hale, 0, ammo - 1);
  5837. }
  5838. }
  5839.  
  5840. return Plugin_Continue;
  5841. }
  5842.  
  5843. public Action:CheckAlivePlayers(Handle:hTimer)
  5844. {
  5845. if (VSHRoundState == 2 || VSHRoundState == -1)
  5846. {
  5847. return Plugin_Continue;
  5848. }
  5849.  
  5850. RedAlivePlayers = 0;
  5851.  
  5852. for (new i = 1; i <= MaxClients; i++)
  5853. {
  5854. if (IsValidClient(i) && IsPlayerAlive(i) && (GetClientTeam(i) == OtherTeam))
  5855. {
  5856. RedAlivePlayers++;
  5857. }
  5858. }
  5859.  
  5860. if (Special == VSHSpecial_CBS && GetAmmo(Hale, 0) > RedAlivePlayers && RedAlivePlayers != 0)
  5861. {
  5862. SetAmmo(Hale, 0, RedAlivePlayers);
  5863. }
  5864.  
  5865. if (RedAlivePlayers == 0)
  5866. {
  5867. ForceTeamWin(HaleTeam);
  5868. }
  5869. else if (RedAlivePlayers == 1 && IsValidClient(Hale) && VSHRoundState == 1)
  5870. {
  5871. decl Float:pos[3];
  5872. decl String:s[PLATFORM_MAX_PATH];
  5873.  
  5874. GetEntPropVector(Hale, Prop_Send, "m_vecOrigin", pos);
  5875.  
  5876. if (Special != VSHSpecial_HHH)
  5877. {
  5878. if (Special == VSHSpecial_CBS)
  5879. {
  5880. if (!GetRandomInt(0, 2))
  5881. {
  5882. Format(s, PLATFORM_MAX_PATH, "%s", CBS0);
  5883. }
  5884. else
  5885. {
  5886. Format(s, PLATFORM_MAX_PATH, "%s%02i.wav", CBS4, GetRandomInt(1, 25));
  5887. }
  5888.  
  5889. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, _, pos, NULL_VECTOR, false, 0.0);
  5890. }
  5891. else if (Special == VSHSpecial_Bunny)
  5892. {
  5893. strcopy(s, PLATFORM_MAX_PATH, BunnyLast[GetRandomInt(0, sizeof(BunnyLast)-1)]);
  5894. }
  5895. else if (Special == VSHSpecial_Vagineer)
  5896. {
  5897. strcopy(s, PLATFORM_MAX_PATH, VagineerLastA);
  5898. }
  5899. else
  5900. {
  5901. new see = GetRandomInt(0, 5);
  5902.  
  5903. switch (see)
  5904. {
  5905. case 0:
  5906. strcopy(s, PLATFORM_MAX_PATH, HaleComicArmsFallSound);
  5907. case 1:
  5908. Format(s, PLATFORM_MAX_PATH, "%s0%i.wav", HaleLastB, GetRandomInt(1, 4));
  5909. case 2:
  5910. strcopy(s, PLATFORM_MAX_PATH, HaleKillLast132);
  5911. default:
  5912. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleLastMan, GetRandomInt(1, 5));
  5913. }
  5914. }
  5915.  
  5916. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, false, 0.0);
  5917. EmitSoundToAll(s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, pos, NULL_VECTOR, false, 0.0);
  5918. }
  5919. }
  5920. else if (!PointType && (RedAlivePlayers <= (AliveToEnable = GetConVarInt(cvarAliveToEnable))))
  5921. {
  5922. PrintHintTextToAll("%t", "vsh_point_enable", AliveToEnable);
  5923.  
  5924. if (RedAlivePlayers == AliveToEnable)
  5925. {
  5926. EmitSoundToAll("vo/announcer_am_capenabled02.wav");
  5927. }
  5928. else if (RedAlivePlayers < AliveToEnable)
  5929. {
  5930. decl String:s[PLATFORM_MAX_PATH];
  5931.  
  5932. Format(s, PLATFORM_MAX_PATH, "vo/announcer_am_capincite0%i.wav", GetRandomInt(0, 1) ? 1:3);
  5933. EmitSoundToAll(s);
  5934. }
  5935.  
  5936. SetControlPoint(true);
  5937. }
  5938.  
  5939. return Plugin_Continue;
  5940. }
  5941.  
  5942. public Action:event_hurt(Handle:event, const String:name[], bool:dontBroadcast)
  5943. {
  5944. if (!Enabled)
  5945. {
  5946. return Plugin_Continue;
  5947. }
  5948.  
  5949. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  5950. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  5951. new damage = GetEventInt(event, "damageamount");
  5952. new custom = GetEventInt(event, "custom");
  5953.  
  5954. if (client != Hale)
  5955. { // || !IsValidEdict(client) || !IsValidEdict(attacker) || (client <= 0) || (attacker <= 0) || (attacker > MaxClients))
  5956. return Plugin_Continue;
  5957. }
  5958.  
  5959. if (!IsValidClient(attacker) || !IsValidClient(client) || client == attacker)
  5960. {
  5961. return Plugin_Continue;
  5962. }
  5963.  
  5964. if (custom == TF_CUSTOM_BACKSTAB)
  5965. {
  5966. return Plugin_Continue;
  5967. }
  5968.  
  5969. if (custom == TF_CUSTOM_TELEFRAG)
  5970. {
  5971. damage = (IsPlayerAlive(attacker) ? 9001:1);
  5972. }
  5973.  
  5974. if (custom == TF_CUSTOM_BOOTS_STOMP)
  5975. {
  5976. damage = 1024;
  5977. }
  5978.  
  5979. //if (GetEntityFlags(attacker) & !(FL_INWATER | FL_ONGROUND))
  5980. //if (weapon == TF_WEAPON_SHOVEL) damage = 1024;
  5981.  
  5982. if (GetEventBool(event, "minicrit") && GetEventBool(event, "allseecrit"))
  5983. {
  5984. SetEventBool(event, "allseecrit", false);
  5985. }
  5986.  
  5987. HaleHealth -= damage;
  5988. HaleRage += damage;
  5989.  
  5990. if (custom == TF_CUSTOM_TELEFRAG || custom == TF_CUSTOM_BOOTS_STOMP)
  5991. {
  5992. SetEventInt(event, "damageamount", damage);
  5993. }
  5994.  
  5995. Damage[attacker] += damage;
  5996.  
  5997. new healers[MAXPLAYERS];
  5998. new healercount = 0;
  5999.  
  6000. for (new i = 1; i <= MaxClients; i++)
  6001. {
  6002. if (IsValidClient(i) && IsPlayerAlive(i) && (GetHealingTarget(i) == attacker))
  6003. {
  6004. healers[healercount] = i;
  6005. healercount++;
  6006. }
  6007. }
  6008.  
  6009. for (new i = 0; i < healercount; i++)
  6010. {
  6011. if (IsValidClient(healers[i]) && IsPlayerAlive(healers[i]))
  6012. {
  6013. if (damage < 10 || uberTarget[healers[i]] == attacker)
  6014. {
  6015. Damage[healers[i]] += damage;
  6016. }
  6017. else
  6018. {
  6019. Damage[healers[i]] += damage / (healercount + 1);
  6020. }
  6021. }
  6022. }
  6023.  
  6024. if (HaleRage > RageDMG)
  6025. {
  6026. HaleRage = RageDMG;
  6027. }
  6028.  
  6029. return Plugin_Continue;
  6030. }
  6031.  
  6032. public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], damagecustom)
  6033. {
  6034. if (!Enabled || !IsValidEdict(attacker) || ((attacker <= 0) && (client == Hale)) || TF2_IsPlayerInCondition(client, TFCond_Ubercharged))
  6035. {
  6036. return Plugin_Continue;
  6037. }
  6038.  
  6039. if (VSHRoundState == 0 && (client == Hale || (client != attacker && attacker != Hale)))
  6040. {
  6041. damage *= 0.0;
  6042.  
  6043. return Plugin_Changed;
  6044. }
  6045.  
  6046. decl Float:Pos[3];
  6047.  
  6048. GetEntPropVector(attacker, Prop_Send, "m_vecOrigin", Pos);
  6049.  
  6050. if ((attacker == Hale) && IsValidClient(client) && (client != Hale) && !TF2_IsPlayerInCondition(client, TFCond_Bonked) && !TF2_IsPlayerInCondition(client, TFCond_Ubercharged))
  6051. {
  6052. if (TF2_IsPlayerInCondition(client, TFCond_DefenseBuffed))
  6053. {
  6054. ScaleVector(damageForce, 9.0);
  6055. damage *= 0.3;
  6056.  
  6057. return Plugin_Changed;
  6058. }
  6059.  
  6060. if (TF2_IsPlayerInCondition(client, TFCond_DefenseBuffMmmph))
  6061. {
  6062. damage *= 9;
  6063. TF2_AddCondition(client, TFCond_Bonked, 0.1);
  6064.  
  6065. return Plugin_Changed;
  6066. }
  6067.  
  6068. new ent = -1;
  6069.  
  6070. while ((ent = FindEntityByClassname2(ent, "tf_wearable_demoshield")) != -1)
  6071. {
  6072. if (GetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity") == client && !GetEntProp(ent, Prop_Send, "m_bDisguiseWearable"))
  6073. {
  6074. AcceptEntityInput(ent, "Kill");
  6075.  
  6076. EmitSoundToClient(client, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6077. EmitSoundToClient(client, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6078. EmitSoundToClient(attacker, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6079. EmitSoundToClient(attacker, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6080.  
  6081. TF2_AddCondition(client, TFCond_Bonked, 0.1);
  6082.  
  6083. return Plugin_Continue;
  6084. }
  6085. }
  6086.  
  6087. if (TF2_GetPlayerClass(client) == TFClass_Spy)
  6088. {
  6089. if (GetEntProp(client, Prop_Send, "m_bFeignDeathReady") && !TF2_IsPlayerInCondition(client, TFCond_Cloaked))
  6090. {
  6091. if (damagetype & DMG_CRIT)
  6092. {
  6093. damagetype &= ~DMG_CRIT;
  6094. }
  6095.  
  6096. damage = 620.0;
  6097.  
  6098. return Plugin_Changed;
  6099. }
  6100.  
  6101. if (TF2_IsPlayerInCondition(client, TFCond_Cloaked) && TF2_IsPlayerInCondition(client, TFCond_DeadRingered))
  6102. {
  6103. if (damagetype & DMG_CRIT)
  6104. {
  6105. damagetype &= ~DMG_CRIT;
  6106. }
  6107.  
  6108. damage = 850.0;
  6109.  
  6110. return Plugin_Changed;
  6111. }
  6112. // return Plugin_Changed;
  6113. }
  6114.  
  6115. if (TF2_GetPlayerClass(client) == TFClass_Spy && (GetEntProp(client, Prop_Send, "m_bFeignDeathReady") || TF2_IsPlayerInCondition(client, TFCond_DeadRingered)))
  6116. {
  6117. if (damagetype & DMG_CRIT)
  6118. {
  6119. damagetype &= ~DMG_CRIT;
  6120. }
  6121.  
  6122. damage = 620.0;
  6123.  
  6124. return Plugin_Changed;
  6125. }
  6126.  
  6127. new buffweapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  6128. new buffindex = (IsValidEntity(buffweapon) && buffweapon > MaxClients ? GetEntProp(buffweapon, Prop_Send, "m_iItemDefinitionIndex"):-1);
  6129.  
  6130. if (buffindex == 226)
  6131. {
  6132. CreateTimer(0.25, Timer_CheckBuffRage, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
  6133. }
  6134.  
  6135. if (damage <= 160.0 && !(Special == VSHSpecial_CBS && inflictor != attacker) && (Special != VSHSpecial_Bunny || weapon == -1 || weapon == GetPlayerWeaponSlot(Hale, TFWeaponSlot_Melee)))
  6136. {
  6137. damage *= 3;
  6138.  
  6139. return Plugin_Changed;
  6140. }
  6141. }
  6142. else if (attacker != Hale && client == Hale)
  6143. {
  6144. if (attacker <= MaxClients)
  6145. {
  6146. new wepindex = (IsValidEntity(weapon) && weapon > MaxClients ? GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"):-1);
  6147.  
  6148. if (inflictor == attacker || inflictor == weapon)
  6149. {
  6150. if (!IsValidEntity(weapon) && (damagetype & DMG_CRUSH) == DMG_CRUSH && damage == 1000.0) //THIS IS A TELEFRAG
  6151. {
  6152. if (!IsPlayerAlive(attacker))
  6153. {
  6154. damage = 1.0;
  6155.  
  6156. return Plugin_Changed;
  6157. }
  6158.  
  6159. damage = (HaleHealth > 9001 ? 15.0:float(GetEntProp(Hale, Prop_Send, "m_iHealth")) + 90.0);
  6160.  
  6161. new teleowner = FindTeleOwner(attacker);
  6162.  
  6163. if (IsValidClient(teleowner) && teleowner != attacker)
  6164. {
  6165. Damage[teleowner] += RoundFloat(9001.0 * 3 / 5);
  6166. PrintCenterText(teleowner, "TELEFRAG ASSIST! Nice job setting up!");
  6167. }
  6168.  
  6169. PrintCenterText(attacker, "TELEFRAG! You are a pro.");
  6170. PrintCenterText(client, "TELEFRAG! Be careful around quantum tunneling devices!");
  6171.  
  6172. return Plugin_Changed;
  6173. }
  6174.  
  6175. switch (wepindex)
  6176. {
  6177. case 593: //Third Degree
  6178. {
  6179. new healers[MAXPLAYERS];
  6180. new healercount = 0;
  6181.  
  6182. for (new i = 1; i <= MaxClients; i++)
  6183. {
  6184. if (IsValidClient(i) && IsPlayerAlive(i) && (GetHealingTarget(i) == attacker))
  6185. {
  6186. healers[healercount] = i;
  6187. healercount++;
  6188. }
  6189. }
  6190.  
  6191. for (new i = 0; i < healercount; i++)
  6192. {
  6193. if (IsValidClient(healers[i]) && IsPlayerAlive(healers[i]))
  6194. {
  6195. new medigun = GetPlayerWeaponSlot(healers[i], TFWeaponSlot_Secondary);
  6196.  
  6197. if (IsValidEntity(medigun))
  6198. {
  6199. new String:s[64];
  6200.  
  6201. GetEdictClassname(medigun, s, sizeof(s));
  6202.  
  6203. if (strcmp(s, "tf_weapon_medigun", false) == 0)
  6204. {
  6205. new Float:uber = GetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel") + (0.1 / healercount);
  6206. new Float:max = 1.0;
  6207.  
  6208. if (GetEntProp(medigun, Prop_Send, "m_bChargeRelease"))
  6209. {
  6210. max = 1.5;
  6211. }
  6212.  
  6213. if (uber > max)
  6214. {
  6215. uber = max;
  6216. }
  6217.  
  6218. SetEntPropFloat(medigun, Prop_Send, "m_flChargeLevel", uber);
  6219. }
  6220. }
  6221. }
  6222. }
  6223. }
  6224. case 14, 201, 230, 402, 526, 664, 752, 792, 801, 851, 881, 890, 899, 908, 957, 966:
  6225. {
  6226. switch (wepindex) //cleaner to read than if wepindex == || wepindex == || etc
  6227. {
  6228. case 14, 201, 664, 792, 801, 851, 881, 890, 899, 908, 957, 966:
  6229. {
  6230. if (VSHRoundState != 2)
  6231. {
  6232. new Float:chargelevel = (IsValidEntity(weapon) && weapon > MaxClients ? GetEntPropFloat(weapon, Prop_Send, "m_flChargedDamage"):0.0);
  6233. new Float:time = (GlowTimer > 10 ? 1.0:2.0);
  6234.  
  6235. time += (GlowTimer > 10 ? (GlowTimer > 20 ? 1:2):4)*(chargelevel / 100);
  6236. SetEntProp(client, Prop_Send, "m_bGlowEnabled", 1);
  6237. GlowTimer += RoundToCeil(time);
  6238.  
  6239. if (GlowTimer > 30.0)
  6240. {
  6241. GlowTimer = 30.0;
  6242. }
  6243. }
  6244. }
  6245. }
  6246.  
  6247. if (wepindex == 752 && VSHRoundState != 2)
  6248. {
  6249. new Float:chargelevel = (IsValidEntity(weapon) && weapon > MaxClients ? GetEntPropFloat(weapon, Prop_Send, "m_flChargedDamage"):0.0);
  6250. new Float:add = 10 + (chargelevel / 10);
  6251.  
  6252. if (TF2_IsPlayerInCondition(attacker, TFCond:46))
  6253. {
  6254. add /= 3;
  6255. }
  6256.  
  6257. new Float:rage = GetEntPropFloat(attacker, Prop_Send, "m_flRageMeter");
  6258. SetEntPropFloat(attacker, Prop_Send, "m_flRageMeter", (rage + add > 100) ? 100.0:rage + add);
  6259. }
  6260. if (!(damagetype & DMG_CRIT))
  6261. {
  6262. new meleeindex = -1;
  6263.  
  6264. if (Special != VSHSpecial_HHH)
  6265. {
  6266. decl String:wepclassname[64];
  6267. new melee = GetPlayerWeaponSlot(attacker, TFWeaponSlot_Melee);
  6268.  
  6269. if (melee <= MaxClients || !IsValidEntity(melee) || !GetEdictClassname(melee, wepclassname, sizeof(wepclassname)))
  6270. {
  6271. strcopy(wepclassname, sizeof(wepclassname), "");
  6272. }
  6273.  
  6274. meleeindex = ((strncmp(wepclassname, "tf_wea", 6, false) == 0) ? GetEntProp(melee, Prop_Send, "m_iItemDefinitionIndex"):-1);
  6275. }
  6276.  
  6277. if (Special == VSHSpecial_HHH || meleeindex != 232)
  6278. {
  6279. if (TF2_IsPlayerInCondition(attacker, TFCond_CritCola) || TF2_IsPlayerInCondition(attacker, TFCond_Buffed) || TF2_IsPlayerInCondition(attacker, TFCond_CritHype))
  6280. {
  6281. damage *= 1.7;
  6282. }
  6283. else
  6284. {
  6285. if (wepindex != 230 || HaleRage > 0.9*RageDMG)
  6286. {
  6287. damage *= 2.9;
  6288. }
  6289. else
  6290. {
  6291. damage *= 2.4;
  6292. }
  6293. }
  6294.  
  6295. return Plugin_Changed;
  6296. }
  6297. }
  6298. }
  6299. case 355:
  6300. {
  6301. new Float:rage = 0.05*RageDMG;
  6302. HaleRage -= RoundToFloor(rage);
  6303. if (HaleRage < 0)
  6304. {
  6305. HaleRage = 0;
  6306. }
  6307. }
  6308. case 132, 266, 482:
  6309. IncrementHeadCount(attacker);
  6310. case 317:
  6311. SpawnSmallHealthPackAt(client, GetClientTeam(attacker));
  6312. case 214:
  6313. {
  6314. new health = GetClientHealth(attacker);
  6315. new max = GetEntProp(attacker, Prop_Data, "m_iMaxHealth");
  6316. new newhealth = health + 25;
  6317. if (health < max + 50)
  6318. {
  6319. if (newhealth > max + 50)
  6320. {
  6321. newhealth = max + 50;
  6322. }
  6323.  
  6324. SetEntProp(attacker, Prop_Data, "m_iHealth", newhealth);
  6325. SetEntProp(attacker, Prop_Send, "m_iHealth", newhealth);
  6326. }
  6327. if (TF2_IsPlayerInCondition(attacker, TFCond_OnFire))
  6328. {
  6329. TF2_RemoveCondition(attacker, TFCond_OnFire);
  6330. }
  6331. }
  6332. case 357:
  6333. {
  6334. SetEntProp(weapon, Prop_Send, "m_bIsBloody", 1);
  6335.  
  6336. if (GetEntProp(attacker, Prop_Send, "m_iKillCountSinceLastDeploy") < 1)
  6337. {
  6338. SetEntProp(attacker, Prop_Send, "m_iKillCountSinceLastDeploy", 1);
  6339. }
  6340.  
  6341. new health = GetClientHealth(attacker);
  6342. new max = GetEntProp(attacker, Prop_Data, "m_iMaxHealth");
  6343. new newhealth = health + 35;
  6344.  
  6345. if (health < max + 25)
  6346. {
  6347. if (newhealth > max + 25)
  6348. {
  6349. newhealth = max + 25;
  6350. }
  6351.  
  6352. SetEntProp(attacker, Prop_Data, "m_iHealth", newhealth);
  6353. SetEntProp(attacker, Prop_Send, "m_iHealth", newhealth);
  6354. }
  6355.  
  6356. if (TF2_IsPlayerInCondition(attacker, TFCond_OnFire))
  6357. {
  6358. TF2_RemoveCondition(attacker, TFCond_OnFire);
  6359. }
  6360. }
  6361. case 528:
  6362. {
  6363. if (circuitStun > 0.0)
  6364. {
  6365. TF2_StunPlayer(client, circuitStun, 0.0, TF_STUNFLAGS_SMALLBONK | TF_STUNFLAG_NOSOUNDOREFFECT, attacker);
  6366. EmitSoundToAll("weapons/barret_arm_zap.wav", client);
  6367. EmitSoundToClient(client, "weapons/barret_arm_zap.wav");
  6368. }
  6369. }
  6370. case 656:
  6371. {
  6372. CreateTimer(0.1, Timer_StopTickle, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
  6373.  
  6374. if (TF2_IsPlayerInCondition(attacker, TFCond_Dazed))
  6375. {
  6376. TF2_RemoveCondition(attacker, TFCond_Dazed);
  6377. }
  6378. }
  6379. }
  6380. //VoiDeD's Caber-backstab code. To be added with a few special modifications in 1.40+
  6381. /* if ( IsValidEdict( weapon ) && GetEdictClassname( weapon, wepclassname, sizeof( wepclassname ) ) && strcmp( wepclassname, "tf_weapon_stickbomb", false ) == 0 )
  6382. {
  6383. // make caber do backstab damage on explosion
  6384.  
  6385. new bool:isDetonated = GetEntProp( weapon, Prop_Send, "m_iDetonated" ) == 1;
  6386.  
  6387. if ( !isDetonated )
  6388. {
  6389. new Float:changedamage = HaleHealthMax * 0.07;
  6390.  
  6391. Damage[attacker] += RoundFloat(changedamage);
  6392.  
  6393. damage = changedamage;
  6394.  
  6395. HaleHealth -= RoundFloat(changedamage);
  6396. HaleRage += RoundFloat(changedamage);
  6397.  
  6398. if (HaleRage > RageDMG)
  6399. HaleRage = RageDMG;
  6400. }
  6401. }*/
  6402.  
  6403. static bool:foundDmgCustom = false;
  6404. static bool:dmgCustomInOTD = false;
  6405.  
  6406. if (!foundDmgCustom)
  6407. {
  6408. dmgCustomInOTD = (GetFeatureStatus(FeatureType_Capability, "SDKHook_DmgCustomInOTD") == FeatureStatus_Available);
  6409. foundDmgCustom = true;
  6410. }
  6411.  
  6412. new bool:bIsBackstab = false;
  6413.  
  6414. if (dmgCustomInOTD) // new way to check backstabs
  6415. {
  6416. if (damagecustom == TF_CUSTOM_BACKSTAB)
  6417. {
  6418. bIsBackstab = true;
  6419. }
  6420. }
  6421. else if (weapon != 4095 && IsValidEdict(weapon) && weapon == GetPlayerWeaponSlot(attacker, TFWeaponSlot_Melee) && damage > 1000.0) //lousy way of checking backstabs
  6422. {
  6423. decl String:wepclassname[32];
  6424.  
  6425. if (GetEdictClassname(weapon, wepclassname, sizeof(wepclassname)) && strcmp(wepclassname, "tf_weapon_knife", false) == 0) //more robust knife check
  6426. {
  6427. bIsBackstab = true;
  6428. }
  6429. }
  6430.  
  6431. if (bIsBackstab)
  6432. {
  6433. new Float:changedamage = HaleHealthMax*(0.12 - Stabbed / 90);
  6434. new iChangeDamage = RoundFloat(changedamage);
  6435.  
  6436. Damage[attacker] += iChangeDamage;
  6437.  
  6438. if (HaleHealth > iChangeDamage)
  6439. {
  6440. damage = 0.0;
  6441. }
  6442. else
  6443. {
  6444. damage = changedamage;
  6445. }
  6446.  
  6447. HaleHealth -= iChangeDamage;
  6448. HaleRage += iChangeDamage;
  6449.  
  6450. if (HaleRage > RageDMG)
  6451. {
  6452. HaleRage = RageDMG;
  6453. }
  6454.  
  6455. EmitSoundToClient(client, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6456. EmitSoundToClient(attacker, "player/spy_shield_break.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, Pos, NULL_VECTOR, false, 0.0);
  6457. EmitSoundToClient(client, "player/crit_received3.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, _, NULL_VECTOR, false, 0.0);
  6458. EmitSoundToClient(attacker, "player/crit_received3.wav", _, _, SNDLEVEL_TRAFFIC, SND_NOFLAGS, 0.7, 100, _, _, NULL_VECTOR, false, 0.0);
  6459.  
  6460. SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", GetGameTime() + 2.0);
  6461. SetEntPropFloat(attacker, Prop_Send, "m_flNextAttack", GetGameTime() + 2.0);
  6462. SetEntPropFloat(attacker, Prop_Send, "m_flStealthNextChangeTime", GetGameTime() + 2.0);
  6463.  
  6464. new vm = GetEntPropEnt(attacker, Prop_Send, "m_hViewModel");
  6465.  
  6466. if (vm > MaxClients && IsValidEntity(vm) && TF2_GetPlayerClass(attacker) == TFClass_Spy)
  6467. {
  6468. new melee = GetIndexOfWeaponSlot(attacker, TFWeaponSlot_Melee);
  6469. new anim = 15;
  6470.  
  6471. switch (melee)
  6472. {
  6473. case 727:
  6474. anim = 41;
  6475. case 4, 194, 665, 794, 803, 883, 892, 901, 910:
  6476. anim = 10;
  6477. case 638:
  6478. anim = 31;
  6479. }
  6480.  
  6481. SetEntProp(vm, Prop_Send, "m_nSequence", anim);
  6482. }
  6483.  
  6484. PrintCenterText(attacker, "You backstabbed him!");
  6485. PrintCenterText(client, "You were just backstabbed!");
  6486.  
  6487. new Handle:stabevent = CreateEvent("player_hurt", true);
  6488.  
  6489. SetEventInt(stabevent, "userid", GetClientUserId(client));
  6490. SetEventInt(stabevent, "health", HaleHealth);
  6491. SetEventInt(stabevent, "attacker", GetClientUserId(attacker));
  6492. SetEventInt(stabevent, "damageamount", iChangeDamage);
  6493. SetEventInt(stabevent, "custom", TF_CUSTOM_BACKSTAB);
  6494.  
  6495. SetEventBool(stabevent, "crit", true);
  6496. SetEventBool(stabevent, "minicrit", false);
  6497. SetEventBool(stabevent, "allseecrit", true);
  6498.  
  6499. SetEventInt(stabevent, "weaponid", TF_WEAPON_KNIFE);
  6500.  
  6501. FireEvent(stabevent);
  6502.  
  6503. if (wepindex == 225 || wepindex == 574)
  6504. {
  6505. CreateTimer(0.3, Timer_DisguiseBackstab, GetClientUserId(attacker));
  6506. }
  6507.  
  6508. if (wepindex == 356)
  6509. {
  6510. new health = GetClientHealth(attacker) + 100;
  6511.  
  6512. if (health > 270)
  6513. {
  6514. health = 270;
  6515. }
  6516.  
  6517. SetEntProp(attacker, Prop_Data, "m_iHealth", health);
  6518. SetEntProp(attacker, Prop_Send, "m_iHealth", health);
  6519. }
  6520.  
  6521. decl String:s[PLATFORM_MAX_PATH];
  6522.  
  6523. switch (Special)
  6524. {
  6525. case VSHSpecial_Hale:
  6526. {
  6527. Format(s, PLATFORM_MAX_PATH, "%s%i.wav", HaleStubbed132, GetRandomInt(1, 4));
  6528. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6529. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6530. }
  6531. case VSHSpecial_Vagineer:
  6532. {
  6533. EmitSoundToAll("vo/engineer_positivevocalization01.wav", _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6534. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, "vo/engineer_positivevocalization01.wav", _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6535. }
  6536. case VSHSpecial_HHH:
  6537. {
  6538. Format(s, PLATFORM_MAX_PATH, "vo/halloween_boss/knight_pain0%d.wav", GetRandomInt(1, 3));
  6539. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6540. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6541. }
  6542. case VSHSpecial_Bunny:
  6543. {
  6544. strcopy(s, PLATFORM_MAX_PATH, BunnyPain[GetRandomInt(0, sizeof(BunnyPain)-1)]);
  6545. EmitSoundToAll(s, _, SNDCHAN_VOICE, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6546. EmitSoundToAllExcept(SOUNDEXCEPT_VOICE, s, _, SNDCHAN_ITEM, SNDLEVEL_TRAFFIC, SND_NOFLAGS, SNDVOL_NORMAL, 100, Hale, NULL_VECTOR, NULL_VECTOR, false, 0.0);
  6547. }
  6548. }
  6549.  
  6550. if (Stabbed < 5)
  6551. {
  6552. Stabbed++;
  6553. }
  6554.  
  6555. new healers[MAXPLAYERS];
  6556. new healercount = 0;
  6557.  
  6558. for (new i = 1; i <= MaxClients; i++)
  6559. {
  6560. if (IsValidClient(i) && IsPlayerAlive(i) && (GetHealingTarget(i) == attacker))
  6561. {
  6562. healers[healercount] = i;
  6563. healercount++;
  6564. }
  6565. }
  6566.  
  6567. for (new i = 0; i < healercount; i++)
  6568. {
  6569. if (IsValidClient(healers[i]) && IsPlayerAlive(healers[i]))
  6570. {
  6571. if (uberTarget[healers[i]] == attacker)
  6572. {
  6573. Damage[healers[i]] += iChangeDamage;
  6574. }
  6575. else
  6576. {
  6577. Damage[healers[i]] += RoundFloat(changedamage / (healercount + 1));
  6578. }
  6579. }
  6580. }
  6581.  
  6582. return Plugin_Changed;
  6583. }
  6584. }
  6585.  
  6586. if (TF2_GetPlayerClass(attacker) == TFClass_Scout)
  6587. {
  6588. if (wepindex == 45 || ((wepindex == 209 || wepindex == 294 || wepindex == 23 || wepindex == 160 || wepindex == 449) && (TF2_IsPlayerCritBuffed(client) || TF2_IsPlayerInCondition(client, TFCond_CritCola) || TF2_IsPlayerInCondition(client, TFCond_Buffed) || TF2_IsPlayerInCondition(client, TFCond_CritHype))))
  6589. {
  6590. ScaleVector(damageForce, 0.38);
  6591.  
  6592. return Plugin_Changed;
  6593. }
  6594. }
  6595. }
  6596. else
  6597. {
  6598. decl String:s[64];
  6599.  
  6600. if (GetEdictClassname(attacker, s, sizeof(s)) && strcmp(s, "trigger_hurt", false) == 0) // && damage >= 250)
  6601. {
  6602. if (strncmp(currentmap, "vsh_oilrig", 10, false) == 0)
  6603. {
  6604. new version = StringToInt(currentmap[12]);
  6605.  
  6606. if ((version >= 14 || version == 0) && damage >= 300.0)
  6607. {
  6608. bEnableSuperDuperJump = true;
  6609. }
  6610. }
  6611. else
  6612. {
  6613. if (damage >= 250.0)
  6614. {
  6615. bEnableSuperDuperJump = true;
  6616. }
  6617. }
  6618.  
  6619. if (damage > 1500.0)
  6620. {
  6621. damage = 1500.0;
  6622. }
  6623.  
  6624. if (strcmp(currentmap, "arena_arakawa_b3", false) == 0 && damage > 1000.0)
  6625. {
  6626. damage = 490.0;
  6627. }
  6628.  
  6629. HaleHealth -= RoundFloat(damage);
  6630. HaleRage += RoundFloat(damage);
  6631.  
  6632. if (HaleHealth <= 0)
  6633. {
  6634. damage *= 5;
  6635. }
  6636.  
  6637. if (HaleRage > RageDMG)
  6638. {
  6639. HaleRage = RageDMG;
  6640. }
  6641.  
  6642. return Plugin_Changed;
  6643. }
  6644. }
  6645. }
  6646. else if (attacker == 0 && client != Hale && IsValidClient(client, false) && (damagetype & DMG_FALL) && (TF2_GetPlayerClass(client) == TFClass_Soldier || TF2_GetPlayerClass(client) == TFClass_DemoMan))
  6647. {
  6648. new item = GetPlayerWeaponSlot(client, (TF2_GetPlayerClass(client) == TFClass_DemoMan ? TFWeaponSlot_Primary:TFWeaponSlot_Secondary));
  6649.  
  6650. if (item <= 0 || !IsValidEntity(item))
  6651. {
  6652. damage /= 10.0;
  6653.  
  6654. return Plugin_Changed;
  6655. }
  6656. }
  6657.  
  6658. return Plugin_Continue;
  6659. }
  6660.  
  6661. stock GetClientCloakIndex(client)
  6662. {
  6663. if (!IsValidClient(client, false))
  6664. {
  6665. return -1;
  6666. }
  6667.  
  6668. new wep = GetPlayerWeaponSlot(client, 4);
  6669.  
  6670. if (!IsValidEntity(wep))
  6671. {
  6672. return -1;
  6673. }
  6674.  
  6675. new String:classname[64];
  6676.  
  6677. GetEntityClassname(wep, classname, sizeof(classname));
  6678.  
  6679. if (strncmp(classname, "tf_wea", 6, false) != 0)
  6680. {
  6681. return -1;
  6682. }
  6683.  
  6684. return GetEntProp(wep, Prop_Send, "m_iItemDefinitionIndex");
  6685. }
  6686.  
  6687. stock SpawnSmallHealthPackAt(client, ownerteam = 0)
  6688. {
  6689. if (!IsValidClient(client, false) || !IsPlayerAlive(client))
  6690. {
  6691. return;
  6692. }
  6693.  
  6694. new healthpack = CreateEntityByName("item_healthkit_small");
  6695.  
  6696. decl Float:pos[3];
  6697. GetClientAbsOrigin(client, pos);
  6698.  
  6699. pos[2] += 20.0;
  6700.  
  6701. if (IsValidEntity(healthpack))
  6702. {
  6703. DispatchKeyValue(healthpack, "OnPlayerTouch", "!self,Kill,,0,-1"); //for safety, though it normally doesn't respawn
  6704. DispatchSpawn(healthpack);
  6705.  
  6706. SetEntProp(healthpack, Prop_Send, "m_iTeamNum", ownerteam, 4);
  6707. SetEntityMoveType(healthpack, MOVETYPE_VPHYSICS);
  6708.  
  6709. new Float:vel[3];
  6710.  
  6711. vel[0] = float(GetRandomInt(-10, 10)), vel[1] = float(GetRandomInt(-10, 10)), vel[2] = 50.0;
  6712.  
  6713. TeleportEntity(healthpack, pos, NULL_VECTOR, vel);
  6714. // CreateTimer(17.0, Timer_RemoveCandycaneHealthPack, EntIndexToEntRef(healthpack), TIMER_FLAG_NO_MAPCHANGE);
  6715. }
  6716. }
  6717.  
  6718. /*public Action:Timer_RemoveCandycaneHealthPack(Handle:timer, any:ref)
  6719. {
  6720. new entity = EntRefToEntIndex(ref);
  6721. if (entity > MaxClients && IsValidEntity(entity))
  6722. {
  6723. AcceptEntityInput(entity, "Kill");
  6724. }
  6725. }*/
  6726.  
  6727. public Action:Timer_StopTickle(Handle:timer, any:userid)
  6728. {
  6729. new client = GetClientOfUserId(userid);
  6730.  
  6731. if (!IsValidClient(client) || !IsPlayerAlive(client))
  6732. {
  6733. return;
  6734. }
  6735.  
  6736. if (!GetEntProp(client, Prop_Send, "m_bIsReadyToHighFive") && !IsValidEntity(GetEntPropEnt(client, Prop_Send, "m_hHighFivePartner")))
  6737. {
  6738. TF2_RemoveCondition(client, TFCond_Taunting);
  6739. }
  6740. }
  6741.  
  6742. public Action:Timer_CheckBuffRage(Handle:timer, any:userid)
  6743. {
  6744. new client = GetClientOfUserId(userid);
  6745.  
  6746. if (IsValidClient(client) && IsPlayerAlive(client))
  6747. {
  6748. SetEntPropFloat(client, Prop_Send, "m_flRageMeter", 100.0);
  6749. }
  6750. }
  6751.  
  6752. stock IncrementHeadCount(client)
  6753. {
  6754. if (!TF2_IsPlayerInCondition(client, TFCond_DemoBuff))
  6755. {
  6756. TF2_AddCondition(client, TFCond_DemoBuff, -1.0);
  6757. }
  6758.  
  6759. new decapitations = GetEntProp(client, Prop_Send, "m_iDecapitations");
  6760.  
  6761. SetEntProp(client, Prop_Send, "m_iDecapitations", decapitations + 1);
  6762.  
  6763. new health = GetClientHealth(client);
  6764.  
  6765. // health += (decapitations >= 4 ? 10:15);
  6766. health += 15;
  6767.  
  6768. SetEntProp(client, Prop_Data, "m_iHealth", health);
  6769. SetEntProp(client, Prop_Send, "m_iHealth", health);
  6770.  
  6771. TF2_AddCondition(client, TFCond_SpeedBuffAlly, 0.01); //recalc their speed
  6772. }
  6773.  
  6774. stock SwitchToOtherWeapon(client)
  6775. {
  6776. new ammo = GetAmmo(client, 0);
  6777. new weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Primary);
  6778. new clip = (IsValidEntity(weapon) ? GetEntProp(weapon, Prop_Send, "m_iClip1"):-1);
  6779.  
  6780. if (!(ammo == 0 && clip <= 0))
  6781. {
  6782. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
  6783. }
  6784. else
  6785. {
  6786. SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary));
  6787. }
  6788. }
  6789.  
  6790. stock FindTeleOwner(client)
  6791. {
  6792. if (!IsValidClient(client) || !IsPlayerAlive(client))
  6793. {
  6794. return -1;
  6795. }
  6796.  
  6797. new tele = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
  6798.  
  6799. decl String:classname[32];
  6800.  
  6801. if (IsValidEntity(tele) && GetEdictClassname(tele, classname, sizeof(classname)) && strcmp(classname, "obj_teleporter", false) == 0)
  6802. {
  6803. new owner = GetEntPropEnt(tele, Prop_Send, "m_hBuilder");
  6804. if (IsValidClient(owner, false))
  6805. {
  6806. return owner;
  6807. }
  6808. }
  6809.  
  6810. return -1;
  6811. }
  6812.  
  6813. stock TF2_IsPlayerCritBuffed(client)
  6814. {
  6815. return (TF2_IsPlayerInCondition(client, TFCond_Kritzkrieged)
  6816. || TF2_IsPlayerInCondition(client, TFCond_HalloweenCritCandy)
  6817. || TF2_IsPlayerInCondition(client, TFCond:34)
  6818. || TF2_IsPlayerInCondition(client, TFCond:35)
  6819. || TF2_IsPlayerInCondition(client, TFCond_CritOnFirstBlood)
  6820. || TF2_IsPlayerInCondition(client, TFCond_CritOnWin)
  6821. || TF2_IsPlayerInCondition(client, TFCond_CritOnFlagCapture)
  6822. || TF2_IsPlayerInCondition(client, TFCond_CritOnKill)
  6823. || TF2_IsPlayerInCondition(client, TFCond_CritMmmph)
  6824. );
  6825. }
  6826.  
  6827. public Action:Timer_DisguiseBackstab(Handle:timer, any:userid)
  6828. {
  6829. new client = GetClientOfUserId(userid);
  6830.  
  6831. if (IsValidClient(client, false))
  6832. {
  6833. RandomlyDisguise(client);
  6834. }
  6835. }
  6836.  
  6837. stock RandomlyDisguise(client) //original code was mecha's, but the original code is broken and this uses a better method now.
  6838. {
  6839. if (IsValidClient(client) && IsPlayerAlive(client))
  6840. {
  6841. // TF2_AddCondition(client, TFCond_Disguised, 99999.0);
  6842. new disguisetarget = -1;
  6843. new team = GetClientTeam(client);
  6844. new Handle:hArray = CreateArray();
  6845.  
  6846. for (new clientcheck = 0; clientcheck <= MaxClients; clientcheck++)
  6847. {
  6848. if (IsValidClient(clientcheck) && GetClientTeam(clientcheck) == team && clientcheck != client)
  6849. {
  6850. // new TFClassType:class = TF2_GetPlayerClass(clientcheck);
  6851. // if (class == TFClass_Scout || class == TFClass_Medic || class == TFClass_Engineer || class == TFClass_Sniper || class == TFClass_Pyro)
  6852. PushArrayCell(hArray, clientcheck);
  6853. }
  6854. }
  6855.  
  6856. if (GetArraySize(hArray) <= 0)
  6857. {
  6858. disguisetarget = client;
  6859. }
  6860. else
  6861. {
  6862. disguisetarget = GetArrayCell(hArray, GetRandomInt(0, GetArraySize(hArray) - 1));
  6863. }
  6864.  
  6865. if (!IsValidClient(disguisetarget))
  6866. {
  6867. disguisetarget = client;
  6868. }
  6869.  
  6870. // new disguisehealth = GetRandomInt(75, 125);
  6871.  
  6872. new class = GetRandomInt(0, 4);
  6873. new TFClassType:classarray[] = { TFClass_Scout, TFClass_Pyro, TFClass_Medic, TFClass_Engineer, TFClass_Sniper };
  6874.  
  6875. // new disguiseclass = classarray[class];
  6876. // new disguiseclass = _:(disguisetarget != client ? (TF2_GetPlayerClass(disguisetarget)):classarray[class]);
  6877. // new weapon = GetEntPropEnt(disguisetarget, Prop_Send, "m_hActiveWeapon");
  6878.  
  6879. CloseHandle(hArray);
  6880. if (TF2_GetPlayerClass(client) == TFClass_Spy)
  6881. {
  6882. TF2_DisguisePlayer(client, TFTeam:team, classarray[class], disguisetarget);
  6883. }
  6884. else
  6885. {
  6886. TF2_AddCondition(client, TFCond_Disguised, -1.0);
  6887.  
  6888. SetEntProp(client, Prop_Send, "m_nDisguiseTeam", team);
  6889. SetEntProp(client, Prop_Send, "m_nDisguiseClass", classarray[class]);
  6890. SetEntProp(client, Prop_Send, "m_iDisguiseTargetIndex", disguisetarget);
  6891. SetEntProp(client, Prop_Send, "m_iDisguiseHealth", 200);
  6892. }
  6893. /* SetEntProp(client, Prop_Send, "m_nDisguiseClass", disguiseclass);
  6894. SetEntProp(client, Prop_Send, "m_nDisguiseTeam", team);
  6895. SetEntProp(client, Prop_Send, "m_iDisguiseTargetIndex", disguisetarget);
  6896. SetEntProp(client, Prop_Send, "m_iDisguiseHealth", disguisehealth);
  6897. TF2_DisguisePlayer(client, TFTeam:team, TFClassType:disguiseclass);
  6898. FakeClientCommandEx(client, "lastdisguise");
  6899. TF2_AddCondition(client, TFCond_Disguised, 99999.0);*/
  6900. }
  6901. }
  6902.  
  6903. public Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result)
  6904. {
  6905. if (IsValidEntity(weapon) && Special == VSHSpecial_HHH && client == Hale)
  6906. {
  6907. new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  6908.  
  6909. if (index == 266 && StrEqual(weaponname, "tf_weapon_sword", false))
  6910. {
  6911. SickleClimbWalls(client, weapon);
  6912. //CreateTimer(0.0, Timer_NoAttacking, EntIndexToEntRef(weapon), TIMER_FLAG_NO_MAPCHANGE);
  6913. }
  6914. }
  6915.  
  6916. if (!Enabled || !IsValidClient(client, false))
  6917. {
  6918. return Plugin_Continue;
  6919. }
  6920.  
  6921. if (client == Hale)
  6922. {
  6923. if (VSHRoundState != 1 || TF2_IsPlayerCritBuffed(client))
  6924. {
  6925. return Plugin_Continue;
  6926. }
  6927.  
  6928. if (!haleCrits)
  6929. {
  6930. result = false;
  6931.  
  6932. return Plugin_Changed;
  6933. }
  6934. }
  6935. else if (IsValidEntity(weapon)) //&& Special != VSHSpecial_HHH) //I suppose this disallowed bushwacka climbing during HHH rounds?
  6936. {
  6937. new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  6938.  
  6939. if (index == 232 && StrEqual(weaponname, "tf_weapon_club", false))
  6940. {
  6941. SickleClimbWalls(client, weapon);
  6942. //CreateTimer(0.0, Timer_NoAttacking, EntIndexToEntRef(weapon), TIMER_FLAG_NO_MAPCHANGE);
  6943. }
  6944. }
  6945.  
  6946. return Plugin_Continue;
  6947. }
  6948.  
  6949. public SickleClimbWalls(client, weapon) //Credit to Mecha the Slag
  6950. {
  6951. if (!IsValidClient(client))
  6952. {
  6953. return;
  6954. }
  6955.  
  6956. decl String:classname[64];
  6957. decl Float:vecClientEyePos[3];
  6958. decl Float:vecClientEyeAng[3];
  6959.  
  6960. GetClientEyePosition(client, vecClientEyePos); // Get the position of the player's eyes
  6961. GetClientEyeAngles(client, vecClientEyeAng); // Get the angle the player is looking
  6962.  
  6963. //Check for colliding entities
  6964. TR_TraceRayFilter(vecClientEyePos, vecClientEyeAng, MASK_PLAYERSOLID, RayType_Infinite, TraceRayDontHitSelf, client);
  6965.  
  6966. if (!TR_DidHit(INVALID_HANDLE))
  6967. {
  6968. return;
  6969. }
  6970.  
  6971. new TRIndex = TR_GetEntityIndex(INVALID_HANDLE);
  6972. GetEdictClassname(TRIndex, classname, sizeof(classname));
  6973.  
  6974. if (!StrEqual(classname, "worldspawn"))
  6975. {
  6976. return;
  6977. }
  6978.  
  6979. decl Float:fNormal[3];
  6980. TR_GetPlaneNormal(INVALID_HANDLE, fNormal);
  6981. GetVectorAngles(fNormal, fNormal);
  6982.  
  6983. if (fNormal[0] >= 30.0 && fNormal[0] <= 330.0 || fNormal[0] <= -30.0)
  6984. {
  6985. return;
  6986. }
  6987.  
  6988. decl Float:pos[3];
  6989. TR_GetEndPosition(pos);
  6990.  
  6991. new Float:distance = GetVectorDistance(vecClientEyePos, pos);
  6992.  
  6993. if (distance >= 100.0)
  6994. {
  6995. return;
  6996. }
  6997.  
  6998. new Float:fVelocity[3];
  6999.  
  7000. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  7001.  
  7002. fVelocity[2] = 600.0;
  7003.  
  7004. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  7005. SDKHooks_TakeDamage(client, client, client, 15.0, DMG_CLUB, GetPlayerWeaponSlot(client, TFWeaponSlot_Melee));
  7006. ClientCommand(client, "playgamesound \"%s\"", "player\\taunt_clip_spin.wav");
  7007.  
  7008. CreateTimer(0.0, Timer_NoAttacking, EntIndexToEntRef(weapon), TIMER_FLAG_NO_MAPCHANGE);
  7009. }
  7010.  
  7011. public Action:Timer_NoAttacking(Handle:timer, any:ref)
  7012. {
  7013. new weapon = EntRefToEntIndex(ref);
  7014.  
  7015. SetNextAttack(weapon, 1.56);
  7016. }
  7017. stock SetNextAttack(weapon, Float:duration = 0.0)
  7018. {
  7019. if (weapon <= MaxClients || !IsValidEntity(weapon))
  7020. {
  7021. return;
  7022. }
  7023.  
  7024. new Float:next = GetGameTime() + duration;
  7025.  
  7026. SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", next);
  7027. SetEntPropFloat(weapon, Prop_Send, "m_flNextSecondaryAttack", next);
  7028. }
  7029.  
  7030. public bool:TraceRayDontHitSelf(entity, mask, any:data)
  7031. {
  7032. return (entity != data);
  7033. }
  7034.  
  7035. stock FindNextHale(bool:array[])
  7036. {
  7037. new tBoss = -1;
  7038. new tBossPoints = -1073741824;
  7039. new bool:spec = GetConVarBool(cvarForceSpecToHale);
  7040.  
  7041. for (new i = 1; i <= MaxClients; i++)
  7042. {
  7043. if (IsValidClient(i) && (GetClientTeam(i) > _:TFTeam_Spectator || (spec && GetClientTeam(i) != _:TFTeam_Unassigned))) // GetClientTeam(i) != _:TFTeam_Unassigned)
  7044. {
  7045. new points = GetClientQueuePoints(i);
  7046.  
  7047. if (points >= tBossPoints && !array[i])
  7048. {
  7049. tBoss = i;
  7050. tBossPoints = points;
  7051. }
  7052. }
  7053. }
  7054.  
  7055. return tBoss;
  7056. }
  7057.  
  7058. stock FindNextHaleEx()
  7059. {
  7060. new bool:added[MAXPLAYERS + 1];
  7061.  
  7062. if (Hale >= 0)
  7063. {
  7064. added[Hale] = true;
  7065. }
  7066.  
  7067. return FindNextHale(added);
  7068. }
  7069.  
  7070. stock ForceTeamWin(team)
  7071. {
  7072. new ent = FindEntityByClassname2(-1, "team_control_point_master");
  7073.  
  7074. if (ent == -1)
  7075. {
  7076. ent = CreateEntityByName("team_control_point_master");
  7077. DispatchSpawn(ent);
  7078. AcceptEntityInput(ent, "Enable");
  7079. }
  7080.  
  7081. SetVariantInt(team);
  7082. AcceptEntityInput(ent, "SetWinner");
  7083. }
  7084.  
  7085. stock AttachParticle(ent, String:particleType[], Float:offset = 0.0, bool:battach = true)
  7086. {
  7087. new particle = CreateEntityByName("info_particle_system");
  7088.  
  7089. decl String:tName[128];
  7090. decl Float:pos[3];
  7091.  
  7092. GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos);
  7093.  
  7094. pos[2] += offset;
  7095.  
  7096. TeleportEntity(particle, pos, NULL_VECTOR, NULL_VECTOR);
  7097.  
  7098. Format(tName, sizeof(tName), "target%i", ent);
  7099.  
  7100. DispatchKeyValue(ent, "targetname", tName);
  7101. DispatchKeyValue(particle, "targetname", "tf2particle");
  7102. DispatchKeyValue(particle, "parentname", tName);
  7103. DispatchKeyValue(particle, "effect_name", particleType);
  7104. DispatchSpawn(particle);
  7105.  
  7106. SetVariantString(tName);
  7107.  
  7108. if (battach)
  7109. {
  7110. AcceptEntityInput(particle, "SetParent", particle, particle, 0);
  7111. SetEntPropEnt(particle, Prop_Send, "m_hOwnerEntity", ent);
  7112. }
  7113.  
  7114. ActivateEntity(particle);
  7115. AcceptEntityInput(particle, "start");
  7116.  
  7117. return particle;
  7118. }
  7119.  
  7120. stock SpawnWeapon(client, String:name[], index, level, qual, String:att[])
  7121. {
  7122. new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_ALL | FORCE_GENERATION);
  7123.  
  7124. if (hWeapon == INVALID_HANDLE)
  7125. {
  7126. return -1;
  7127. }
  7128.  
  7129. TF2Items_SetClassname(hWeapon, name);
  7130. TF2Items_SetItemIndex(hWeapon, index);
  7131. TF2Items_SetLevel(hWeapon, level);
  7132. TF2Items_SetQuality(hWeapon, qual);
  7133.  
  7134. new String:atts[32][32];
  7135. new count = ExplodeString(att, " ; ", atts, 32, 32);
  7136.  
  7137. if (count > 0)
  7138. {
  7139. TF2Items_SetNumAttributes(hWeapon, count / 2);
  7140.  
  7141. new i2 = 0;
  7142.  
  7143. for (new i = 0; i < count; i += 2)
  7144. {
  7145. TF2Items_SetAttribute(hWeapon, i2, StringToInt(atts[i]), StringToFloat(atts[i + 1]));
  7146. i2++;
  7147. }
  7148. }
  7149. else
  7150. {
  7151. TF2Items_SetNumAttributes(hWeapon, 0);
  7152. }
  7153.  
  7154. new entity = TF2Items_GiveNamedItem(client, hWeapon);
  7155.  
  7156. CloseHandle(hWeapon);
  7157. EquipPlayerWeapon(client, entity);
  7158.  
  7159. return entity;
  7160. }
  7161.  
  7162. public HintPanelH(Handle:menu, MenuAction:action, param1, param2)
  7163. {
  7164. if (!IsValidClient(param1))
  7165. {
  7166. return;
  7167. }
  7168.  
  7169. if (action == MenuAction_Select || (action == MenuAction_Cancel && param2 == MenuCancel_Exit))
  7170. {
  7171. VSHFlags[param1] |= VSHFLAG_CLASSHELPED;
  7172. }
  7173.  
  7174. return;
  7175. }
  7176.  
  7177. public Action:HintPanel(client)
  7178. {
  7179. if (IsVoteInProgress())
  7180. {
  7181. return Plugin_Continue;
  7182. }
  7183.  
  7184. new Handle:panel = CreatePanel();
  7185.  
  7186. decl String:s[512];
  7187.  
  7188. SetGlobalTransTarget(client);
  7189.  
  7190. switch (Special)
  7191. {
  7192. case VSHSpecial_Hale:
  7193. Format(s, 512, "%t", "vsh_help_hale");
  7194. case VSHSpecial_Vagineer:
  7195. Format(s, 512, "%t", "vsh_help_vagineer");
  7196. case VSHSpecial_HHH:
  7197. Format(s, 512, "%t", "vsh_help_hhh");
  7198. case VSHSpecial_CBS:
  7199. Format(s, 512, "%t", "vsh_help_cbs");
  7200. case VSHSpecial_Bunny:
  7201. Format(s, 512, "%t", "vsh_help_bunny");
  7202. }
  7203.  
  7204. DrawPanelText(panel, s);
  7205.  
  7206. Format(s, 512, "%t", "vsh_menu_exit");
  7207. DrawPanelItem(panel, s);
  7208. SendPanelToClient(panel, client, HintPanelH, 9001);
  7209. CloseHandle(panel);
  7210.  
  7211. return Plugin_Continue;
  7212. }
  7213.  
  7214. public QueuePanelH(Handle:menu, MenuAction:action, param1, param2)
  7215. {
  7216. if (action == MenuAction_Select && param2 == 10)
  7217. {
  7218. TurnToZeroPanel(param1);
  7219. }
  7220.  
  7221. return false;
  7222. }
  7223.  
  7224. public Action:QueuePanelCmd(client, Args)
  7225. {
  7226. if (!IsValidClient(client))
  7227. {
  7228. return Plugin_Continue;
  7229. }
  7230.  
  7231. QueuePanel(client);
  7232.  
  7233. return Plugin_Handled;
  7234. }
  7235.  
  7236. public Action:QueuePanel(client)
  7237. {
  7238. if (!Enabled2)
  7239. {
  7240. return Plugin_Continue;
  7241. }
  7242.  
  7243. new Handle:panel = CreatePanel();
  7244.  
  7245. decl String:s[512];
  7246.  
  7247. Format(s, 512, "%T", "vsh_thequeue", client);
  7248. SetPanelTitle(panel, s);
  7249.  
  7250. new bool:added[MAXPLAYERS + 1];
  7251. new tHale = Hale;
  7252.  
  7253. if (Hale >= 0)
  7254. {
  7255. added[Hale] = true;
  7256. }
  7257.  
  7258. if (!Enabled)
  7259. {
  7260. DrawPanelItem(panel, "None");
  7261. }
  7262. else if (IsValidClient(tHale))
  7263. {
  7264. Format(s, sizeof(s), "%N - %i", tHale, GetClientQueuePoints(tHale));
  7265. DrawPanelItem(panel, s);
  7266. }
  7267. else
  7268. {
  7269. DrawPanelItem(panel, "None");
  7270. }
  7271.  
  7272. new i, pingas, bool:botadded;
  7273.  
  7274. DrawPanelText(panel, "---");
  7275.  
  7276. do
  7277. {
  7278. tHale = FindNextHale(added);
  7279. if (IsValidClient(tHale))
  7280. {
  7281. if (client == tHale)
  7282. {
  7283. Format(s, 64, "%N - %i", tHale, GetClientQueuePoints(tHale));
  7284. DrawPanelText(panel, s);
  7285. i--;
  7286. }
  7287. else
  7288. {
  7289. if (IsFakeClient(tHale))
  7290. {
  7291. if (botadded)
  7292. {
  7293. added[tHale] = true;
  7294. continue;
  7295. }
  7296.  
  7297. Format(s, 64, "BOT - %i", botqueuepoints);
  7298. botadded = true;
  7299. }
  7300. else
  7301. {
  7302. Format(s, 64, "%N - %i", tHale, GetClientQueuePoints(tHale));
  7303. }
  7304.  
  7305. DrawPanelItem(panel, s);
  7306. }
  7307.  
  7308. added[tHale] = true;
  7309. i++;
  7310. }
  7311.  
  7312. pingas++;
  7313. }
  7314. while (i < 8 && pingas < 100);
  7315.  
  7316. for (; i < 8; i++)
  7317. {
  7318. DrawPanelItem(panel, "");
  7319. }
  7320.  
  7321. Format(s, 64, "%T %i (%T)", "vsh_your_points", client, GetClientQueuePoints(client), "vsh_to0", client);
  7322. DrawPanelItem(panel, s);
  7323. SendPanelToClient(panel, client, QueuePanelH, 9001);
  7324. CloseHandle(panel);
  7325.  
  7326. return Plugin_Continue;
  7327. }
  7328.  
  7329. public TurnToZeroPanelH(Handle:menu, MenuAction:action, param1, param2)
  7330. {
  7331. if (action == MenuAction_Select && param2 == 1)
  7332. {
  7333. SetClientQueuePoints(param1, 0);
  7334. CPrintToChat(param1, "{olive}[VSH]{default} %t", "vsh_to0_done");
  7335.  
  7336. new cl = FindNextHaleEx();
  7337.  
  7338. if (IsValidClient(cl))
  7339. {
  7340. SkipHalePanelNotify(cl);
  7341. }
  7342. }
  7343. }
  7344.  
  7345. public Action:ResetQueuePointsCmd(client, args)
  7346. {
  7347. if (!Enabled2 || !IsValidClient(client))
  7348. {
  7349. return Plugin_Continue;
  7350. }
  7351.  
  7352. if (GetCmdReplySource() == SM_REPLY_TO_CHAT)
  7353. {
  7354. TurnToZeroPanel(client);
  7355. }
  7356. else
  7357. {
  7358. TurnToZeroPanelH(INVALID_HANDLE, MenuAction_Select, client, 1);
  7359. }
  7360.  
  7361. return Plugin_Handled;
  7362. }
  7363.  
  7364. public Action:TurnToZeroPanel(client)
  7365. {
  7366. if (!Enabled2)
  7367. {
  7368. return Plugin_Continue;
  7369. }
  7370.  
  7371. new Handle:panel = CreatePanel();
  7372.  
  7373. decl String:s[512];
  7374.  
  7375. SetGlobalTransTarget(client);
  7376. Format(s, 512, "%t", "vsh_to0_title");
  7377.  
  7378. SetPanelTitle(panel, s);
  7379. Format(s, 512, "%t", "Yes");
  7380.  
  7381. DrawPanelItem(panel, s);
  7382. Format(s, 512, "%t", "No");
  7383.  
  7384. DrawPanelItem(panel, s);
  7385. SendPanelToClient(panel, client, TurnToZeroPanelH, 9001);
  7386.  
  7387. CloseHandle(panel);
  7388. return Plugin_Continue;
  7389. }
  7390.  
  7391. bool:GetClientClasshelpinfoCookie(client)
  7392. {
  7393. if (!IsValidClient(client) || IsFakeClient(client))
  7394. {
  7395. return false;
  7396. }
  7397.  
  7398. if (!AreClientCookiesCached(client))
  7399. {
  7400. return true;
  7401. }
  7402.  
  7403. decl String:strCookie[32];
  7404. GetClientCookie(client, ClasshelpinfoCookie, strCookie, sizeof(strCookie));
  7405.  
  7406. if (strCookie[0] == 0)
  7407. {
  7408. return true;
  7409. }
  7410. else
  7411. {
  7412. return bool:StringToInt(strCookie);
  7413. }
  7414. }
  7415.  
  7416. GetClientQueuePoints(client)
  7417. {
  7418. if (!IsValidClient(client))
  7419. {
  7420. return 0;
  7421. }
  7422.  
  7423. if (IsFakeClient(client))
  7424. {
  7425. return botqueuepoints;
  7426. }
  7427.  
  7428. if (!AreClientCookiesCached(client))
  7429. {
  7430. return 0;
  7431. }
  7432.  
  7433. decl String:strPoints[32];
  7434.  
  7435. GetClientCookie(client, PointCookie, strPoints, sizeof(strPoints));
  7436.  
  7437. return StringToInt(strPoints);
  7438. }
  7439.  
  7440. SetClientQueuePoints(client, points)
  7441. {
  7442. if (!IsValidClient(client) || IsFakeClient(client) || !AreClientCookiesCached(client))
  7443. {
  7444. return;
  7445. }
  7446.  
  7447. decl String:strPoints[32];
  7448.  
  7449. IntToString(points, strPoints, sizeof(strPoints));
  7450. SetClientCookie(client, PointCookie, strPoints);
  7451. }
  7452.  
  7453. SetAuthIdQueuePoints(String:authid[], points)
  7454. {
  7455. decl String:strPoints[32];
  7456. IntToString(points, strPoints, sizeof(strPoints));
  7457. SetAuthIdCookie(authid, PointCookie, strPoints);
  7458. }
  7459.  
  7460. public HalePanelH(Handle:menu, MenuAction:action, param1, param2)
  7461. {
  7462. if (action == MenuAction_Select)
  7463. {
  7464. switch (param2)
  7465. {
  7466. case 1:
  7467. Command_GetHP(param1);
  7468. case 2:
  7469. HelpPanel(param1);
  7470. case 3:
  7471. HelpPanel2(param1);
  7472. case 4:
  7473. NewPanel(param1, maxversion);
  7474. case 5:
  7475. QueuePanel(param1);
  7476. case 6:
  7477. MusicTogglePanel(param1);
  7478. case 7:
  7479. VoiceTogglePanel(param1);
  7480. case 8:
  7481. ClasshelpinfoSetting(param1);
  7482. /* case 9:
  7483. {
  7484. if (ACH_Enabled)
  7485. FakeClientCommandEx(param1, "haleach");
  7486. else
  7487. return;
  7488. }
  7489. case 0:
  7490. {
  7491. if (ACH_Enabled)
  7492. FakeClientCommandEx(param1, "haleach_stats");
  7493. else
  7494. return;
  7495. }*/
  7496. default:
  7497. return;
  7498. }
  7499. }
  7500. }
  7501.  
  7502. public Action:HalePanel(client, args)
  7503. {
  7504. if (!Enabled2 || !IsValidClient(client, false))
  7505. {
  7506. return Plugin_Continue;
  7507. }
  7508.  
  7509. new Handle:panel = CreatePanel();
  7510. new size = 256;
  7511.  
  7512. decl String:s[size];
  7513.  
  7514. SetGlobalTransTarget(client);
  7515.  
  7516. Format(s, size, "%t", "vsh_menu_1");
  7517. SetPanelTitle(panel, s);
  7518.  
  7519. Format(s, size, "%t", "vsh_menu_2");
  7520. DrawPanelItem(panel, s);
  7521.  
  7522. Format(s, size, "%t", "vsh_menu_3");
  7523. DrawPanelItem(panel, s);
  7524.  
  7525. Format(s, size, "%t", "vsh_menu_7");
  7526. DrawPanelItem(panel, s);
  7527.  
  7528. Format(s, size, "%t", "vsh_menu_4");
  7529. DrawPanelItem(panel, s);
  7530.  
  7531. Format(s, size, "%t", "vsh_menu_5");
  7532. DrawPanelItem(panel, s);
  7533.  
  7534. Format(s, size, "%t", "vsh_menu_8");
  7535. DrawPanelItem(panel, s);
  7536.  
  7537. Format(s, size, "%t", "vsh_menu_9");
  7538. DrawPanelItem(panel, s);
  7539.  
  7540. Format(s, size, "%t", "vsh_menu_9a");
  7541. DrawPanelItem(panel, s);
  7542.  
  7543. /* if (ACH_Enabled)
  7544. {
  7545. Format(s, size, "%t", "vsh_menu_10");
  7546. DrawPanelItem(panel, s);
  7547. Format(s, size, "%t", "vsh_menu_11");
  7548. DrawPanelItem(panel, s);
  7549. }*/
  7550. Format(s, size, "%t", "vsh_menu_exit");
  7551. DrawPanelItem(panel, s);
  7552.  
  7553. SendPanelToClient(panel, client, HalePanelH, 9001);
  7554.  
  7555. CloseHandle(panel);
  7556.  
  7557. return Plugin_Handled;
  7558. }
  7559.  
  7560. public NewPanelH(Handle:menu, MenuAction:action, param1, param2)
  7561. {
  7562. if (action == MenuAction_Select)
  7563. {
  7564. switch (param2)
  7565. {
  7566. case 1:
  7567. {
  7568. if (curHelp[param1] <= 0)
  7569. {
  7570. NewPanel(param1, 0);
  7571. }
  7572. else
  7573. {
  7574. NewPanel(param1, --curHelp[param1]);
  7575. }
  7576. }
  7577. case 2:
  7578. {
  7579. if (curHelp[param1] >= maxversion)
  7580. {
  7581. NewPanel(param1, maxversion);
  7582. }
  7583. else
  7584. {
  7585. NewPanel(param1, ++curHelp[param1]);
  7586. }
  7587. }
  7588. default:
  7589. return;
  7590. }
  7591. }
  7592. }
  7593.  
  7594. public Action:NewPanelCmd(client, args)
  7595. {
  7596. if (!IsValidClient(client))
  7597. {
  7598. return Plugin_Continue;
  7599. }
  7600.  
  7601. NewPanel(client, maxversion);
  7602.  
  7603. return Plugin_Handled;
  7604. }
  7605.  
  7606. public Action:NewPanel(client, versionindex)
  7607. {
  7608. if (!Enabled2)
  7609. {
  7610. return Plugin_Continue;
  7611. }
  7612.  
  7613. curHelp[client] = versionindex;
  7614.  
  7615. new Handle:panel = CreatePanel();
  7616.  
  7617. decl String:s[90];
  7618.  
  7619. SetGlobalTransTarget(client);
  7620.  
  7621. Format(s, 90, "=%t%s:=", "vsh_whatsnew", haleversiontitles[versionindex]);
  7622. SetPanelTitle(panel, s);
  7623.  
  7624. FindVersionData(panel, versionindex);
  7625.  
  7626. if (versionindex > 0)
  7627. {
  7628. Format(s, 90, "%t", "vsh_older");
  7629. }
  7630. else
  7631. {
  7632. Format(s, 90, "%t", "vsh_noolder");
  7633. }
  7634.  
  7635. DrawPanelItem(panel, s);
  7636.  
  7637. if (versionindex < maxversion)
  7638. {
  7639. Format(s, 90, "%t", "vsh_newer");
  7640. }
  7641. else
  7642. {
  7643. Format(s, 90, "%t", "vsh_nonewer");
  7644. }
  7645.  
  7646. DrawPanelItem(panel, s);
  7647.  
  7648. Format(s, 512, "%t", "vsh_menu_exit");
  7649. DrawPanelItem(panel, s);
  7650.  
  7651. SendPanelToClient(panel, client, NewPanelH, 9001);
  7652.  
  7653. CloseHandle(panel);
  7654.  
  7655. return Plugin_Continue;
  7656. }
  7657.  
  7658. stock FindVersionData(Handle:panel, versionindex)
  7659. {
  7660. switch (versionindex)
  7661. {
  7662. case 48: //142
  7663. {
  7664. DrawPanelText(panel, "1) Festive fixes");
  7665. DrawPanelText(panel, "2) Hopefully fixed targes disappearing");
  7666. #if defined EASTER_BUNNY_ON
  7667. DrawPanelText(panel, "3) Easter and April Fool's Day so close together... hmmm...");
  7668. #endif
  7669. }
  7670. case 47: //141
  7671. {
  7672. DrawPanelText(panel, "1) Fixed bosses disguising");
  7673. DrawPanelText(panel, "2) Updated action slot whitelist");
  7674. DrawPanelText(panel, "3) Updated sniper rifle list, Fest. Huntsman");
  7675. DrawPanelText(panel, "4) Medigun speed works like Quick-Fix");
  7676. DrawPanelText(panel, "5) Medigun+gunslinger vm fix");
  7677. DrawPanelText(panel, "6) CBS gets Fest. Huntsman");
  7678. DrawPanelText(panel, "7) Spies take more dmg while cloaked (normal watch)");
  7679. DrawPanelText(panel, "8) Experimental backstab block animation");
  7680. }
  7681. case 46: //140
  7682. {
  7683. DrawPanelText(panel, "1) Dead Ringers have no cloak defense buff. Normal cloaks do.");
  7684. DrawPanelText(panel, "2) Fixed Sniper Rifle reskin behavior");
  7685. DrawPanelText(panel, "3) Boss has small amount of stun resistance after rage");
  7686. DrawPanelText(panel, "4) Fixed HHH/CBS models");
  7687. }
  7688. case 45: //139c
  7689. {
  7690. DrawPanelText(panel, "1) Backstab disguising smoother/less obvious");
  7691. DrawPanelText(panel, "2) Rage 'dings' dispenser/tele, to help locate Hale");
  7692. DrawPanelText(panel, "3) Improved skip panel");
  7693. DrawPanelText(panel, "4) Removed crits from sniper rifles, now do 2.9x damage");
  7694. DrawPanelText(panel, "-- Sleeper does 2.4x damage, 2.9x if Hale's rage is >90pct");
  7695. DrawPanelText(panel, "-- Bushwacka nerfs still apply");
  7696. DrawPanelText(panel, "-- Minicrit- less damage, more knockback");
  7697. DrawPanelText(panel, "5) Scaled sniper rifle glow time a bit better");
  7698. DrawPanelText(panel, "6) Fixed Dead Ringer spy death icon");
  7699. }
  7700. case 44: //139c
  7701. {
  7702. DrawPanelText(panel, "7) BabyFaceBlaster will fill boost normally, but will hit 100 and drain+minicrits");
  7703. DrawPanelText(panel, "8) Can't Eureka+destroy dispenser to insta-tele");
  7704. DrawPanelText(panel, "9) Phlogger invuln during the taunt");
  7705. DrawPanelText(panel, "10) Added !hale_resetq");
  7706. DrawPanelText(panel, "11) Heatmaker gains Focus on hit (varies by charge)");
  7707. DrawPanelText(panel, "12) Bosses get short defense buff after rage");
  7708. DrawPanelText(panel, "13) Cozy Camper comes with SMG - 1.5s bleed, no random crit, -15% dmg");
  7709. DrawPanelText(panel, "14) Valve buffed Crossbow. Balancing.");
  7710. DrawPanelText(panel, "15) New cvars-hale_force_team, hale_enable_eureka");
  7711. }
  7712. case 43: //139c
  7713. {
  7714. DrawPanelText(panel, "16) Powerlord's Better Backstab Detection");
  7715. DrawPanelText(panel, "17) Backburner has charged airblast");
  7716. DrawPanelText(panel, "18) Skip Hale notification mixes things up");
  7717. DrawPanelText(panel, "19) Bosses may or may not obey Pyrovision voice rules. Or both.");
  7718. }
  7719. case 42: //139
  7720. {
  7721. DrawPanelText(panel, "1) !hale_resetqueuepoints");
  7722. DrawPanelText(panel, "-- From chat, asks for confirmation");
  7723. DrawPanelText(panel, "-- From console, no confirmation!");
  7724. DrawPanelText(panel, "2) Help panel stops repeatedly popping up");
  7725. DrawPanelText(panel, "3) Medic is credited 100% of damage done during uber");
  7726. DrawPanelText(panel, "4) Bushwacka changes:");
  7727. DrawPanelText(panel, "-- Hit a wall to climb it");
  7728. DrawPanelText(panel, "-- Slower fire rate");
  7729. DrawPanelText(panel, "-- Disables crits on rifles (not Huntsman)");
  7730. DrawPanelText(panel, "-- Effect does not occur during HHH round");
  7731. DrawPanelText(panel, "...contd.");
  7732. }
  7733.  
  7734. case 41: //139
  7735. {
  7736. DrawPanelText(panel, "5) Late December increases chances of CBS appearing");
  7737. DrawPanelText(panel, "6) If map changes mid-round, queue points not lost");
  7738. DrawPanelText(panel, "7) Fixed HHH tele (again).");
  7739. DrawPanelText(panel, "8) HHH tele removes Sniper Rifle glow");
  7740. DrawPanelText(panel, "9) Mantread stomp deals 5x damage to Hale");
  7741. DrawPanelText(panel, "10) Rage stun range- Vagineer increased, CBS decreased");
  7742. DrawPanelText(panel, "11) Balanced CBS arrows");
  7743. DrawPanelText(panel, "12) Minicrits will not play loud sound to all players");
  7744. DrawPanelText(panel, "13) Dead Ringer will not be able to activate for 2s after backstab");
  7745. DrawPanelText(panel, "-- Other spy watches can");
  7746. DrawPanelText(panel, "14) Fixed crit issues");
  7747. DrawPanelText(panel, "15) Hale queue now accepts negative points");
  7748. DrawPanelText(panel, "...contd.");
  7749. }
  7750. case 40: //139
  7751. {
  7752. DrawPanelText(panel, "16) For server owners:");
  7753. DrawPanelText(panel, "-- Translations updated");
  7754. DrawPanelText(panel, "-- Added hale_spec_force_boss cvar");
  7755. DrawPanelText(panel, "-- Now attempts to integrate tf2items config");
  7756. DrawPanelText(panel, "-- With SteamTools, changes game desc");
  7757. DrawPanelText(panel, "-- Plugin may warn if config is outdated");
  7758. DrawPanelText(panel, "-- Jump/tele charge defines at top of code");
  7759. DrawPanelText(panel, "17) For mapmakers:");
  7760. DrawPanelText(panel, "-- Indicate that your map has music:");
  7761. DrawPanelText(panel, "-- Add info_target with name 'hale_no_music'");
  7762. DrawPanelText(panel, "18) Third Degree hit adds uber to healers");
  7763. DrawPanelText(panel, "19) Knockback resistance on Hale/HHH");
  7764. }
  7765. case 39: //138
  7766. {
  7767. DrawPanelText(panel, "1) Bots will use rage.");
  7768. DrawPanelText(panel, "2) Doors only forced open on specified maps");
  7769. DrawPanelText(panel, "3) CBS spawns more during Winter holidays");
  7770. DrawPanelText(panel, "4) Deathspam for teamswitch gone");
  7771. DrawPanelText(panel, "5) More notice for next Hale");
  7772. DrawPanelText(panel, "6) Wrap Assassin has 2 ammo");
  7773. DrawPanelText(panel, "7) Holiday Punch slightly disorients Hale");
  7774. DrawPanelText(panel, "-- If stunned Heavy punches Hale, removes stun");
  7775. DrawPanelText(panel, "8) Mantreads increase rocketjump distance");
  7776. }
  7777. case 38: //138
  7778. {
  7779. DrawPanelText(panel, "9) Fixed CBS Huntsman rate of fire");
  7780. DrawPanelText(panel, "10) Fixed permanent invuln Vagineer glitch");
  7781. DrawPanelText(panel, "11) Jarate removes some Vagineer uber time and 1 CBS arrow");
  7782. DrawPanelText(panel, "12) Low-end Medic assist damage now counted");
  7783. DrawPanelText(panel, "13) Hitting Dead Ringers does more damage (as balancing)");
  7784. DrawPanelText(panel, "14) Eureka Effect temporarily removed)");
  7785. DrawPanelText(panel, "15) HHH won't get stuck in ceilings when teleporting");
  7786. DrawPanelText(panel, "16) Further updates pending");
  7787. }
  7788. case 37: //137
  7789. {
  7790. DrawPanelText(panel, "1) Fixed taunt/rage.");
  7791. DrawPanelText(panel, "2) Fixed rage+high five.");
  7792. DrawPanelText(panel, "3) hale_circuit_stun - Circuit Stun time (0 to disable)");
  7793. DrawPanelText(panel, "4) Fixed coaching bug");
  7794. DrawPanelText(panel, "5) Config file for map doors");
  7795. DrawPanelText(panel, "6) Fixed floor-Hale");
  7796. DrawPanelText(panel, "7) Fixed Circuit stun");
  7797. DrawPanelText(panel, "8) Fixed negative health bug");
  7798. DrawPanelText(panel, "9) hale_enabled isn't a dummy cvar anymore");
  7799. DrawPanelText(panel, "10) hale_special cmd fixes");
  7800. }
  7801. case 36: //137
  7802. {
  7803. DrawPanelText(panel, "11) 1st-round cap enables after 1 min.");
  7804. DrawPanelText(panel, "12) More invalid Hale checks.");
  7805. DrawPanelText(panel, "13) Backstabs act like Razorbackstab (2s)");
  7806. DrawPanelText(panel, "14) Fixed map check error");
  7807. DrawPanelText(panel, "15) Wanga Prick -> Eternal Reward effect");
  7808. DrawPanelText(panel, "16) Jarate removes 8% of Hale's rage meter");
  7809. DrawPanelText(panel, "17) The Fan O' War removes 5% of the rage meter on hit");
  7810. DrawPanelText(panel, "18) Removed Shortstop reload penalty");
  7811. DrawPanelText(panel, "19) VSH_OnMusic forward");
  7812. }
  7813. case 35: //1369
  7814. {
  7815. DrawPanelText(panel, "1) Fixed spawn door blocking.");
  7816. DrawPanelText(panel, "2) Cleaned up HUD text (health, etc).");
  7817. DrawPanelText(panel, "3) VSH_OnDoJump now has a bool for superduper.");
  7818. DrawPanelText(panel, "4) !halenoclass changed to !haleclassinfotoggle.");
  7819. DrawPanelText(panel, "5) Fixed invalid clients becoming Hale");
  7820. DrawPanelText(panel, "6) Removed teamscramble from first round.");
  7821. DrawPanelText(panel, "7) Vagineer noises:");
  7822. DrawPanelText(panel, "-- Nope for no");
  7823. DrawPanelText(panel, "-- Gottam/mottag (same as jump but quieter) for Move Up");
  7824. DrawPanelText(panel, "-- Hurr for everything else");
  7825. }
  7826. case 34: //1369
  7827. {
  7828. DrawPanelText(panel, "8) All map dispensers will be on the non-Hale team (fixes health bug)");
  7829. DrawPanelText(panel, "9) Fixed command flags on overlay command");
  7830. DrawPanelText(panel, "10) Fixed soldier shotgun not dealing midair minicrits.");
  7831. DrawPanelText(panel, "11) Fixed invalid weapons on clients");
  7832. DrawPanelText(panel, "12) Damage indicator (+spec damage indicator)");
  7833. DrawPanelText(panel, "13) Hale speed remains during humiliation time");
  7834. DrawPanelText(panel, "14) SuperDuperTele for HHH stuns for 4s instead of regular 2");
  7835. }
  7836. case 33: //1369
  7837. {
  7838. DrawPanelText(panel, "15) Battalion's Backup adds +10 max hp, but still only overheal to 300");
  7839. DrawPanelText(panel, "-- Full rage meter when hit by Hale. Buff causes drastic defense boost.");
  7840. DrawPanelText(panel, "16) Fixed a telefrag glitch");
  7841. DrawPanelText(panel, "17) Powerjack is now +25hp on hit, heal up to +50 overheal");
  7842. DrawPanelText(panel, "18) Backstab now shows the regular hit indicator (like other weapons do)");
  7843. DrawPanelText(panel, "19) Kunai adds 100hp on backstab, up to 270");
  7844. DrawPanelText(panel, "20) FaN/Scout crit knockback not nerfed to oblivion anymore");
  7845. DrawPanelText(panel, "21) Removed Short Circuit stun (better effect being made)");
  7846. }
  7847. case 32: //1368
  7848. {
  7849. DrawPanelText(panel, "1) Now FaN and Scout crit knockback is REALLY lessened.");
  7850. DrawPanelText(panel, "2) Medic says 'I'm charged' when he gets fully uber-charge with syringegun.");
  7851. DrawPanelText(panel, "3) Team will scramble in 1st round, if 1st round is default arena.");
  7852. DrawPanelText(panel, "4) Now client can disable info about changes of classes, displayed when round started.");
  7853. DrawPanelText(panel, "5) Powerjack adds 50HPs per hit.");
  7854. DrawPanelText(panel, "6) Short Circuit stuns Hale for 2.0 seconds.");
  7855. DrawPanelText(panel, "7) Vagineer says \"hurr\"");
  7856. //DrawPanelText(panel, "8) Added support of VSH achievements.");
  7857. }
  7858. case 31: //1367
  7859. {
  7860. DrawPanelText(panel, "1) Map-specific fixes:");
  7861. DrawPanelText(panel, "-- Oilrig's pit no longer allows HHH to instatele");
  7862. DrawPanelText(panel, "-- Arakawa's pit damage drastically lessened");
  7863. DrawPanelText(panel, "2) General map fixes: disable spawn-blocking walls");
  7864. DrawPanelText(panel, "3) Cap point now properly un/locks instead of fake-unlocking.");
  7865. DrawPanelText(panel, "4) Tried fixing double-music playing.");
  7866. DrawPanelText(panel, "5) Fixed Eternal Reward disguise glitch - edge case.");
  7867. DrawPanelText(panel, "6) Help menus no longer glitch votes.");
  7868. }
  7869. case 30: //1366
  7870. {
  7871. DrawPanelText(panel, "1) Fixed superjump velocity code.");
  7872. DrawPanelText(panel, "2) Fixed replaced Rocket Jumpers not minicritting Hale in midair.");
  7873. }
  7874. case 29: //1365
  7875. {
  7876. DrawPanelText(panel, "1) Half-Zatoichi is now allowed. Heal 35 health on hit, but must hit Hale to remove Honorbound.");
  7877. DrawPanelText(panel, "-- Can add up to 25 overheal");
  7878. DrawPanelText(panel, "-- Starts the round bloodied.");
  7879. DrawPanelText(panel, "2) Fixed Hale not building rage when only Scouts remain.");
  7880. DrawPanelText(panel, "3) Tried fixing Hale disconnect/nextround glitches (including music).");
  7881. DrawPanelText(panel, "4) Candycane spawns healthpack on hit.");
  7882. }
  7883. case 28: //1364
  7884. {
  7885. DrawPanelText(panel, "1) Added convar hale_first_round (default 0). If it's 0, first round will be default arena.");
  7886. DrawPanelText(panel, "2) Added more translations.");
  7887. }
  7888. case 27: //1363
  7889. {
  7890. DrawPanelText(panel, "1) Fixed a queue point exploit (VoiDeD is mean)");
  7891. DrawPanelText(panel, "2) HHH has backstab/death sound now");
  7892. DrawPanelText(panel, "3) First rounds are normal arena");
  7893. DrawPanelText(panel, "-- Some weapon replacements still apply!");
  7894. DrawPanelText(panel, "-- Teambalance is still off, too.");
  7895. DrawPanelText(panel, "4) Fixed arena_ maps not switching teams occasionally");
  7896. DrawPanelText(panel, "-- After 3 rounds with a team, has a chance to switch");
  7897. DrawPanelText(panel, "-- Will add a cvar to keep Hale always blue/force team, soon");
  7898. DrawPanelText(panel, "5) Fixed pit damage");
  7899. }
  7900. case 26: //1361 and 2
  7901. {
  7902. DrawPanelText(panel, "1) CBS music");
  7903. DrawPanelText(panel, "2) Soldiers minicrit Hale while he's in midair.");
  7904. DrawPanelText(panel, "3) Direct Hit crits instead of minicrits");
  7905. DrawPanelText(panel, "4) Reserve Shooter switches faster, +10% dmg");
  7906. DrawPanelText(panel, "5) Added hale_stop_music cmd - admins stop music for all");
  7907. DrawPanelText(panel, "6) FaN and Scout crit knockback is lessened");
  7908. DrawPanelText(panel, "7) Your halemusic/halevoice settings are saved");
  7909. DrawPanelText(panel, "1.362) Sounds aren't stupid .mdl files anymore");
  7910. DrawPanelText(panel, "1.362) Fixed translations");
  7911. }
  7912. case 25: //136
  7913. {
  7914. DrawPanelText(panel, "MEGA UPDATE by FlaminSarge! Check next few pages");
  7915. DrawPanelText(panel, "SUGGEST MANNO-TECH WEAPON CHANGES");
  7916. DrawPanelText(panel, "1) Updated CBS model");
  7917. DrawPanelText(panel, "2) Fixed last man alive sound");
  7918. DrawPanelText(panel, "3) Removed broken hale line, fixed one");
  7919. DrawPanelText(panel, "4) New HHH rage sound");
  7920. DrawPanelText(panel, "5) HHH music (/halemusic)");
  7921. DrawPanelText(panel, "6) CBS jump noise");
  7922. DrawPanelText(panel, "7) /halevoice and /halemusic to turn off voice/music");
  7923. DrawPanelText(panel, "8) Updated natives/forwards (can change rage dist in fwd)");
  7924. }
  7925. case 24: //136
  7926. {
  7927. DrawPanelText(panel, "9) hale_crits cvar to turn off hale random crits");
  7928. DrawPanelText(panel, "10) Fixed sentries not repairing when raged");
  7929. DrawPanelText(panel, "-- Set hale_ragesentrydamagemode 0 to force engineer to pick up sentry to repair");
  7930. DrawPanelText(panel, "11) Now uses sourcemod autoconfig (tf/cfg/sourcemod/)");
  7931. DrawPanelText(panel, "12) No longer requires saxton_hale_points.cfg file");
  7932. DrawPanelText(panel, "-- Now using clientprefs for queue points");
  7933. DrawPanelText(panel, "13) When on non-VSH map, team switch does not occur so often.");
  7934. DrawPanelText(panel, "14) Should have full replay compatibility");
  7935. DrawPanelText(panel, "15) Bots work with queue, are Hale less often");
  7936. }
  7937. case 23: //136
  7938. {
  7939. DrawPanelText(panel, "16) Hale's health increased by 1 (in code)");
  7940. DrawPanelText(panel, "17) Many many many many many fixes");
  7941. DrawPanelText(panel, "18) Crossbow +150% damage +10 uber on hit");
  7942. DrawPanelText(panel, "19) Syringegun has overdose speed boost");
  7943. DrawPanelText(panel, "20) Sniper glow time scales with charge (2 to 8 seconds)");
  7944. DrawPanelText(panel, "21) Eyelander/reskins add heads on hit");
  7945. DrawPanelText(panel, "22) Axetinguisher/reskins use fire axe attributes");
  7946. DrawPanelText(panel, "23) GRU/KGB is +50% speed but -7hp/s");
  7947. DrawPanelText(panel, "24) Airblasting boss adds rage (no airblast reload though)");
  7948. DrawPanelText(panel, "25) Airblasting uber vagineer adds time to uber and takes extra ammo");
  7949. }
  7950. case 22: //136
  7951. {
  7952. DrawPanelText(panel, "26) Frontier Justice allowed, crits only when sentry sees Hale");
  7953. DrawPanelText(panel, "27) Boss weighdown (look down + crouch) after 5 seconds in midair");
  7954. DrawPanelText(panel, "28) FaN is back");
  7955. DrawPanelText(panel, "29) Scout crits/minicrits do less knockback if not melee");
  7956. DrawPanelText(panel, "30) Saxton has his own fists");
  7957. DrawPanelText(panel, "31) Unlimited /halehp but after 3, longer cooldown");
  7958. DrawPanelText(panel, "32) Fist kill icons");
  7959. DrawPanelText(panel, "33) Fixed CBS arrow count (start at 9, but if less than 9 players, uses only that number of players)");
  7960. DrawPanelText(panel, "34) Spy primary minicrits");
  7961. DrawPanelText(panel, "35) Dead ringer fixed");
  7962. }
  7963. case 21: //136
  7964. {
  7965. DrawPanelText(panel, "36) Flare gun replaced with detonator. Has large jump but more self-damage (like old detonator beta)");
  7966. DrawPanelText(panel, "37) Eternal Reward backstab disguises as random faster classes");
  7967. DrawPanelText(panel, "38) Kunai adds 60 health on backstab");
  7968. DrawPanelText(panel, "39) Randomizer compatibility.");
  7969. DrawPanelText(panel, "40) Medic uber works as normal with crits added (multiple targets, etc)");
  7970. DrawPanelText(panel, "41) Crits stay when being healed, but adds minicrits too (for sentry, etc)");
  7971. DrawPanelText(panel, "42) Fixed Sniper back weapon replacement");
  7972. }
  7973. case 20: //136
  7974. {
  7975. DrawPanelText(panel, "43) Vagineer NOPE and Well Don't That Beat All!");
  7976. DrawPanelText(panel, "44) Telefrags do 9001 damage");
  7977. DrawPanelText(panel, "45) Speed boost when healing scouts (like Quick-Fix)");
  7978. DrawPanelText(panel, "46) Rage builds (VERY slowly) if there are only Scouts left");
  7979. DrawPanelText(panel, "47) Healing assist damage split between healers");
  7980. DrawPanelText(panel, "48) Fixed backstab assist damage");
  7981. DrawPanelText(panel, "49) Fixed HHH attacking during tele");
  7982. DrawPanelText(panel, "50) Soldier boots - 1/10th fall damage");
  7983. DrawPanelText(panel, "AND MORE! (I forget all of them)");
  7984. }
  7985. case 19: //135_3
  7986. {
  7987. DrawPanelText(panel, "1)Added point system (/halenext).");
  7988. DrawPanelText(panel, "2)Added [VSH] to VSH messages.");
  7989. DrawPanelText(panel, "3)Removed native VSH_GetSaxtonHaleHealth() added native VSH_GetRoundState().");
  7990. DrawPanelText(panel, "4)There is mini-crits for scout's pistols. Not full crits, like before.");
  7991. DrawPanelText(panel, "5)Fixed issues associated with crits.");
  7992. DrawPanelText(panel, "6)Added FORCE_GENERATION flag to stop errorlogs.");
  7993. DrawPanelText(panel, "135_2 and 135_3)Bugfixes and updated translations.");
  7994. }
  7995. case 18: //135
  7996. {
  7997. DrawPanelText(panel, "1)Special crits will not removed by Medic.");
  7998. DrawPanelText(panel, "2)Sniper's glow is working again.");
  7999. DrawPanelText(panel, "3)Less errors in console.");
  8000. DrawPanelText(panel, "4)Less messages in chat.");
  8001. DrawPanelText(panel, "5)Added more natives.");
  8002. DrawPanelText(panel, "6)\"Over 9000\" sound returns! Thx you, FlaminSarge.");
  8003. DrawPanelText(panel, "7)Hopefully no more errors in logs.");
  8004. }
  8005. case 17: //134
  8006. {
  8007. DrawPanelText(panel, "1)Biohazard skin for CBS");
  8008. DrawPanelText(panel, "2)TF2_IsPlayerInCondition() fixed");
  8009. DrawPanelText(panel, "3)Now sniper rifle must be 100perc.charged to glow Hale.");
  8010. DrawPanelText(panel, "4)Fixed Vagineer's model.");
  8011. DrawPanelText(panel, "5)Added Natives.");
  8012. DrawPanelText(panel, "6)Hunstman deals more damage.");
  8013. DrawPanelText(panel, "7)Added reload time (5sec) for Pyro's airblast. ");
  8014. DrawPanelText(panel, "1.34_1 1)Fixed airblast reload when VSH is disabled.");
  8015. DrawPanelText(panel, "1.34_1 2)Fixed airblast reload after detonator's alt-fire.");
  8016. DrawPanelText(panel, "1.34_1 3)Airblast reload time reduced to 3 seconds.");
  8017. DrawPanelText(panel, "1.34_1 4)hale_special 3 is disabled.");
  8018. }
  8019. case 16: //133
  8020. {
  8021. DrawPanelText(panel, "1)Fixed bugs, associated with Uber-update.");
  8022. DrawPanelText(panel, "2)FaN replaced with Soda Popper.");
  8023. DrawPanelText(panel, "3)Bazaar Bargain replaced with Sniper Rifle.");
  8024. DrawPanelText(panel, "4)Sniper Rifle adding glow to Hale - anyone can see him for 5 seconds.");
  8025. DrawPanelText(panel, "5)Crusader's Crossbow deals more damage.");
  8026. DrawPanelText(panel, "6)Code optimizing.");
  8027. }
  8028. case 15: //132
  8029. {
  8030. DrawPanelText(panel, "1)Added new Saxton's lines on...");
  8031. DrawPanelText(panel, " a)round start");
  8032. DrawPanelText(panel, " b)jump");
  8033. DrawPanelText(panel, " c)backstab");
  8034. DrawPanelText(panel, " d)destroy Sentry");
  8035. DrawPanelText(panel, " e)kill Scout, Pyro, Heavy, Engineer, Spy");
  8036. DrawPanelText(panel, " f)last man standing");
  8037. DrawPanelText(panel, " g)killing spree");
  8038. DrawPanelText(panel, "2)Fixed bugged count of CBS' arrows.");
  8039. DrawPanelText(panel, "3)Reduced Hale's damage versus DR by 20 HPs.");
  8040. DrawPanelText(panel, "4)Now two specials can not be at a stretch.");
  8041. DrawPanelText(panel, "v1.32_1 1)Fixed bug with replay.");
  8042. DrawPanelText(panel, "v1.32_1 2)Fixed bug with help menu.");
  8043. }
  8044. case 14: //131
  8045. DrawPanelText(panel, "1)Now \"replay\" will not change team.");
  8046. case 13: //130
  8047. DrawPanelText(panel, "1)Fixed bugs, associated with crushes, error logs, scores.");
  8048. case 12: //129
  8049. {
  8050. DrawPanelText(panel, "1)Fixed random crushes associated with CBS.");
  8051. DrawPanelText(panel, "2)Now Hale's HP formula is ((760+x-1)*(x-1))^1.04");
  8052. DrawPanelText(panel, "3)Added hale_special0. Use it to change next boss to Hale.");
  8053. DrawPanelText(panel, "4)CBS has 9 arrows for bow-rage. Also he has stun rage, but on little distantion.");
  8054. DrawPanelText(panel, "5)Teammates gets 2 scores per each 600 damage");
  8055. DrawPanelText(panel, "6)Demoman with Targe has crits on his primary weapon.");
  8056. DrawPanelText(panel, "7)Removed support of non-Arena maps, because nobody wasn't use it.");
  8057. DrawPanelText(panel, "8)Pistol/Lugermorph has crits.");
  8058. }
  8059. case 11: //128
  8060. {
  8061. DrawPanelText(panel, "VS Saxton Hale Mode is back!");
  8062. DrawPanelText(panel, "1)Christian Brutal Sniper is a regular character.");
  8063. DrawPanelText(panel, "2)CBS has 3 melee weapons ad bow-rage.");
  8064. DrawPanelText(panel, "3)Added new lines for Vagineer.");
  8065. DrawPanelText(panel, "4)Updated models of Vagineer and HHH jr.");
  8066. }
  8067. case 10: //999
  8068. DrawPanelText(panel, "Attachables are broken. Many \"thx\" to Valve.");
  8069. case 9: //126
  8070. {
  8071. DrawPanelText(panel, "1)Added the second URL for auto-update.");
  8072. DrawPanelText(panel, "2)Fixed problems, when auto-update was corrupt plugin.");
  8073. DrawPanelText(panel, "3)Added a question for the next Hale, if he want to be him. (/haleme)");
  8074. DrawPanelText(panel, "4)Eyelander and Half-Zatoichi was replaced with Claidheamh Mor.");
  8075. DrawPanelText(panel, "5)Fan O'War replaced with Bat.");
  8076. DrawPanelText(panel, "6)Dispenser and TP won't be destoyed after Engineer's death.");
  8077. DrawPanelText(panel, "7)Mode uses the localization file.");
  8078. DrawPanelText(panel, "8)Saxton Hale will be choosed randomly for the first 3 rounds (then by queue).");
  8079. }
  8080. case 8: //125
  8081. {
  8082. DrawPanelText(panel, "1)Fixed silent HHHjr's rage.");
  8083. DrawPanelText(panel, "2)Now bots (sourcetv too) do not will be Hale");
  8084. DrawPanelText(panel, "3)Fixed invalid uber on Vagineer's head.");
  8085. DrawPanelText(panel, "4)Fixed other little bugs.");
  8086. }
  8087. case 7: //124
  8088. {
  8089. DrawPanelText(panel, "1)Fixed destroyed buildables associated with spy's fake death.");
  8090. DrawPanelText(panel, "2)Syringe Gun replaced with Blutsauger.");
  8091. DrawPanelText(panel, "3)Blutsauger, on hit: +5 to uber-charge.");
  8092. DrawPanelText(panel, "4)Removed crits from Blutsauger.");
  8093. DrawPanelText(panel, "5)CnD replaced with Invis Watch.");
  8094. DrawPanelText(panel, "6)Fr.Justice replaced with shotgun");
  8095. DrawPanelText(panel, "7)Fists of steel replaced with fists.");
  8096. DrawPanelText(panel, "8)KGB replaced with GRU.");
  8097. DrawPanelText(panel, "9)Added /haleclass.");
  8098. DrawPanelText(panel, "10)Medic gets assist damage scores (1/2 from healing target's damage scores, 1/1 when uber-charged)");
  8099. }
  8100. case 6: //123
  8101. {
  8102. DrawPanelText(panel, "1)Added Super Duper Jump to rescue Hale from pit");
  8103. DrawPanelText(panel, "2)Removed pyro's ammolimit");
  8104. DrawPanelText(panel, "3)Fixed little bugs.");
  8105. }
  8106. case 5: //122
  8107. {
  8108. DrawPanelText(panel, "1.21)Point will be enabled when X or less players be alive.");
  8109. DrawPanelText(panel, "1.22)Now it's working :) Also little optimize about player count.");
  8110. }
  8111. case 4: //120
  8112. {
  8113. DrawPanelText(panel, "1)Added new Hale's phrases.");
  8114. DrawPanelText(panel, "2)More bugfixes.");
  8115. DrawPanelText(panel, "3)Improved super-jump.");
  8116. }
  8117. case 3: //112
  8118. {
  8119. DrawPanelText(panel, "1)More bugfixes.");
  8120. DrawPanelText(panel, "2)Now \"(Hale)<mapname>\" can be nominated for nextmap.");
  8121. DrawPanelText(panel, "3)Medigun's uber gets uber and crits for Medic and his target.");
  8122. DrawPanelText(panel, "4)Fixed infinite Specials.");
  8123. DrawPanelText(panel, "5)And more bugfixes.");
  8124. }
  8125. case 2: //111
  8126. {
  8127. DrawPanelText(panel, "1)Fixed immortal spy");
  8128. DrawPanelText(panel, "2)Fixed crashes associated with classlimits.");
  8129. }
  8130. case 1: //110
  8131. {
  8132. DrawPanelText(panel, "1)Not important changes on code.");
  8133. DrawPanelText(panel, "2)Added hale_enabled convar.");
  8134. DrawPanelText(panel, "3)Fixed bug, when all hats was removed...why?");
  8135. }
  8136. case 0: //100
  8137. {
  8138. DrawPanelText(panel, "Released!!!");
  8139. DrawPanelText(panel, "On new version you will get info about changes.");
  8140. }
  8141. default:
  8142. {
  8143. DrawPanelText(panel, "-- Somehow you've managed to find a glitched version page!");
  8144. DrawPanelText(panel, "-- Congratulations. Now go fight Hale.");
  8145. }
  8146. }
  8147. }
  8148.  
  8149. public HelpPanelH(Handle:menu, MenuAction:action, param1, param2)
  8150. {
  8151. if (action == MenuAction_Select)
  8152. {
  8153. return;
  8154. }
  8155. }
  8156.  
  8157. public Action:HelpPanelCmd(client, args)
  8158. {
  8159. if (!IsValidClient(client))
  8160. {
  8161. return Plugin_Continue;
  8162. }
  8163.  
  8164. HelpPanel(client);
  8165.  
  8166. return Plugin_Handled;
  8167. }
  8168.  
  8169. public Action:HelpPanel(client)
  8170. {
  8171. if (!Enabled2 || IsVoteInProgress())
  8172. {
  8173. return Plugin_Continue;
  8174. }
  8175.  
  8176. new Handle:panel = CreatePanel();
  8177.  
  8178. decl String:s[512];
  8179.  
  8180. SetGlobalTransTarget(client);
  8181.  
  8182. Format(s, 512, "%t", "vsh_help_mode");
  8183. DrawPanelItem(panel, s);
  8184.  
  8185. Format(s, 512, "%t", "vsh_menu_exit");
  8186. DrawPanelItem(panel, s);
  8187.  
  8188. SendPanelToClient(panel, client, HelpPanelH, 9001);
  8189.  
  8190. CloseHandle(panel);
  8191.  
  8192. return Plugin_Continue;
  8193. }
  8194.  
  8195. public Action:HelpPanel2Cmd(client, args)
  8196. {
  8197. if (!IsValidClient(client))
  8198. {
  8199. return Plugin_Continue;
  8200. }
  8201.  
  8202. HelpPanel2(client);
  8203.  
  8204. return Plugin_Handled;
  8205. }
  8206.  
  8207. public Action:HelpPanel2(client)
  8208. {
  8209. if (!Enabled2 || IsVoteInProgress())
  8210. {
  8211. return Plugin_Continue;
  8212. }
  8213.  
  8214. decl String:s[512];
  8215.  
  8216. new TFClassType:class = TF2_GetPlayerClass(client);
  8217.  
  8218. SetGlobalTransTarget(client);
  8219.  
  8220. switch (class)
  8221. {
  8222. case TFClass_Scout:
  8223. Format(s, 512, "%t", "vsh_help_scout");
  8224. case TFClass_Soldier:
  8225. Format(s, 512, "%t", "vsh_help_soldier");
  8226. case TFClass_Pyro:
  8227. Format(s, 512, "%t", "vsh_help_pyro");
  8228. case TFClass_DemoMan:
  8229. Format(s, 512, "%t", "vsh_help_demo");
  8230. case TFClass_Heavy:
  8231. Format(s, 512, "%t", "vsh_help_heavy");
  8232. case TFClass_Engineer:
  8233. Format(s, 512, "%t", "vsh_help_eggineer");
  8234. case TFClass_Medic:
  8235. Format(s, 512, "%t", "vsh_help_medic");
  8236. case TFClass_Sniper:
  8237. Format(s, 512, "%t", "vsh_help_sniper");
  8238. case TFClass_Spy:
  8239. Format(s, 512, "%t", "vsh_help_spie");
  8240. default:
  8241. Format(s, 512, "");
  8242. }
  8243.  
  8244. new Handle:panel = CreatePanel();
  8245.  
  8246. if (class != TFClass_Sniper)
  8247. {
  8248. Format(s, 512, "%t\n%s", "vsh_help_melee", s);
  8249. }
  8250.  
  8251. SetPanelTitle(panel, s);
  8252. DrawPanelItem(panel, "Exit");
  8253.  
  8254. SendPanelToClient(panel, client, HintPanelH, 12);
  8255.  
  8256. CloseHandle(panel);
  8257.  
  8258. return Plugin_Continue;
  8259. }
  8260.  
  8261. public Action:ClasshelpinfoCmd(client, args)
  8262. {
  8263. if (!IsValidClient(client))
  8264. {
  8265. return Plugin_Continue;
  8266. }
  8267.  
  8268. ClasshelpinfoSetting(client);
  8269.  
  8270. return Plugin_Handled;
  8271. }
  8272.  
  8273. public Action:ClasshelpinfoSetting(client)
  8274. {
  8275. if (!Enabled2)
  8276. {
  8277. return Plugin_Continue;
  8278. }
  8279.  
  8280. new Handle:panel = CreatePanel();
  8281.  
  8282. SetPanelTitle(panel, "Turn the VS Saxton Hale class info...");
  8283.  
  8284. DrawPanelItem(panel, "On");
  8285. DrawPanelItem(panel, "Off");
  8286.  
  8287. SendPanelToClient(panel, client, ClasshelpinfoTogglePanelH, 9001);
  8288.  
  8289. CloseHandle(panel);
  8290.  
  8291. return Plugin_Handled;
  8292. }
  8293.  
  8294. public ClasshelpinfoTogglePanelH(Handle:menu, MenuAction:action, param1, param2)
  8295. {
  8296. if (IsValidClient(param1))
  8297. {
  8298. if (action == MenuAction_Select)
  8299. {
  8300. if (param2 == 2)
  8301. {
  8302. SetClientCookie(param1, ClasshelpinfoCookie, "0");
  8303. }
  8304. else
  8305. {
  8306. SetClientCookie(param1, ClasshelpinfoCookie, "1");
  8307. }
  8308.  
  8309. CPrintToChat(param1, "{olive}[VSH]{default} %t", "vsh_classinfo", param2 == 2 ? "off":"on");
  8310. }
  8311. }
  8312. }
  8313.  
  8314. /*public HelpPanelH1(Handle:menu, MenuAction:action, param1, param2)
  8315. {
  8316. if (action == MenuAction_Select)
  8317. {
  8318. if (param2 == 1)
  8319. HelpPanel(param1);
  8320. else if (param2 == 2)
  8321. return;
  8322. }
  8323. }
  8324. public Action:HelpPanel1(client, Args)
  8325. {
  8326. if (!Enabled2)
  8327. return Plugin_Continue;
  8328. new Handle:panel = CreatePanel();
  8329. SetPanelTitle(panel, "Hale is unusually strong.\nBut he doesn't use weapons, because\nhe believes that problems should be\nsolved with bare hands.");
  8330. DrawPanelItem(panel, "Back");
  8331. DrawPanelItem(panel, "Exit");
  8332. SendPanelToClient(panel, client, HelpPanelH1, 9001);
  8333. CloseHandle(panel);
  8334. return Plugin_Continue;
  8335. }*/
  8336.  
  8337. public Action:MusicTogglePanelCmd(client, args)
  8338. {
  8339. if (!IsValidClient(client))
  8340. {
  8341. return Plugin_Continue;
  8342. }
  8343.  
  8344. MusicTogglePanel(client);
  8345.  
  8346. return Plugin_Handled;
  8347. }
  8348.  
  8349. public Action:MusicTogglePanel(client)
  8350. {
  8351. if (!Enabled2 || !IsValidClient(client))
  8352. {
  8353. return Plugin_Continue;
  8354. }
  8355.  
  8356. new Handle:panel = CreatePanel();
  8357.  
  8358. SetPanelTitle(panel, "Turn the VS Saxton Hale music...");
  8359.  
  8360. DrawPanelItem(panel, "On");
  8361. DrawPanelItem(panel, "Off");
  8362.  
  8363. SendPanelToClient(panel, client, MusicTogglePanelH, 9001);
  8364.  
  8365. CloseHandle(panel);
  8366.  
  8367. return Plugin_Continue;
  8368. }
  8369.  
  8370. public MusicTogglePanelH(Handle:menu, MenuAction:action, param1, param2)
  8371. {
  8372. if (IsValidClient(param1))
  8373. {
  8374. if (action == MenuAction_Select)
  8375. {
  8376. if (param2 == 2)
  8377. {
  8378. SetClientSoundOptions(param1, SOUNDEXCEPT_MUSIC, false);
  8379. StopHaleMusic(param1);
  8380. }
  8381. else
  8382. {
  8383. SetClientSoundOptions(param1, SOUNDEXCEPT_MUSIC, true);
  8384. }
  8385.  
  8386. CPrintToChat(param1, "{olive}[VSH]{default} %t", "vsh_music", param2 == 2 ? "off":"on");
  8387. }
  8388. }
  8389. }
  8390. public Action:VoiceTogglePanelCmd(client, args)
  8391. {
  8392. if (!IsValidClient(client))
  8393. {
  8394. return Plugin_Continue;
  8395. }
  8396.  
  8397. VoiceTogglePanel(client);
  8398.  
  8399. return Plugin_Handled;
  8400. }
  8401.  
  8402. public Action:VoiceTogglePanel(client)
  8403. {
  8404. if (!Enabled2 || !IsValidClient(client))
  8405. {
  8406. return Plugin_Continue;
  8407. }
  8408.  
  8409. new Handle:panel = CreatePanel();
  8410.  
  8411. SetPanelTitle(panel, "Turn the VS Saxton Hale voices...");
  8412.  
  8413. DrawPanelItem(panel, "On");
  8414. DrawPanelItem(panel, "Off");
  8415.  
  8416. SendPanelToClient(panel, client, VoiceTogglePanelH, 9001);
  8417.  
  8418. CloseHandle(panel);
  8419.  
  8420. return Plugin_Continue;
  8421. }
  8422.  
  8423. public VoiceTogglePanelH(Handle:menu, MenuAction:action, param1, param2)
  8424. {
  8425. if (IsValidClient(param1))
  8426. {
  8427. if (action == MenuAction_Select)
  8428. {
  8429. if (param2 == 2)
  8430. {
  8431. SetClientSoundOptions(param1, SOUNDEXCEPT_VOICE, false);
  8432. }
  8433. else
  8434. {
  8435. SetClientSoundOptions(param1, SOUNDEXCEPT_VOICE, true);
  8436. }
  8437.  
  8438. CPrintToChat(param1, "{olive}[VSH]{default} %t", "vsh_voice", param2 == 2 ? "off":"on");
  8439.  
  8440. if (param2 == 2)
  8441. {
  8442. CPrintToChat(param1, "%t", "vsh_voice2");
  8443. }
  8444. }
  8445. }
  8446. }
  8447.  
  8448. public Action:HookSound(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
  8449. {
  8450. if (!Enabled || ((entity != Hale) && ((entity <= 0) || !IsValidClient(Hale) || (entity != GetPlayerWeaponSlot(Hale, 0)))))
  8451. {
  8452. return Plugin_Continue;
  8453. }
  8454.  
  8455. if (StrContains(sample, "saxton_hale", false) != -1)
  8456. {
  8457. return Plugin_Continue;
  8458. }
  8459.  
  8460. if (strcmp(sample, "vo/engineer_LaughLong01.wav", false) == 0)
  8461. {
  8462. strcopy(sample, PLATFORM_MAX_PATH, VagineerKSpree);
  8463.  
  8464. return Plugin_Changed;
  8465. }
  8466.  
  8467. if (entity == Hale && Special == VSHSpecial_HHH && strncmp(sample, "vo", 2, false) == 0 && StrContains(sample, "halloween_boss") == -1)
  8468. {
  8469. if (GetRandomInt(0, 100) <= 10)
  8470. {
  8471. Format(sample, PLATFORM_MAX_PATH, "%s0%i.wav", HHHLaught, GetRandomInt(1, 4));
  8472.  
  8473. return Plugin_Changed;
  8474. }
  8475. }
  8476.  
  8477. if (Special != VSHSpecial_CBS && !strncmp(sample, "vo", 2, false) && StrContains(sample, "halloween_boss") == -1)
  8478. {
  8479. if (Special == VSHSpecial_Vagineer)
  8480. {
  8481. if (StrContains(sample, "engineer_moveup", false) != -1)
  8482. {
  8483. Format(sample, PLATFORM_MAX_PATH, "%s%i.wav", VagineerJump, GetRandomInt(1, 2));
  8484. }
  8485. else if (StrContains(sample, "engineer_no", false) != -1 || GetRandomInt(0, 9) > 6)
  8486. {
  8487. strcopy(sample, PLATFORM_MAX_PATH, "vo/engineer_no01.wav");
  8488. }
  8489. else
  8490. {
  8491. strcopy(sample, PLATFORM_MAX_PATH, "vo/engineer_jeers02.wav");
  8492. }
  8493.  
  8494. return Plugin_Changed;
  8495. }
  8496.  
  8497. if (Special == VSHSpecial_Bunny)
  8498. {
  8499. if (StrContains(sample, "gibberish", false) == -1 && StrContains(sample, "burp", false) == -1 && !GetRandomInt(0, 2))
  8500. {
  8501. //Do sound things
  8502. strcopy(sample, PLATFORM_MAX_PATH, BunnyRandomVoice[GetRandomInt(0, sizeof(BunnyRandomVoice)-1)]);
  8503.  
  8504. return Plugin_Changed;
  8505. }
  8506.  
  8507. return Plugin_Continue;
  8508. }
  8509.  
  8510. return Plugin_Handled;
  8511. }
  8512.  
  8513. return Plugin_Continue;
  8514. }
  8515.  
  8516. stock SetAmmo(client, slot, ammo)
  8517. {
  8518. new weapon = GetPlayerWeaponSlot(client, slot);
  8519.  
  8520. if (IsValidEntity(weapon))
  8521. {
  8522. new iOffset = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType", 1) * 4;
  8523. new iAmmoTable = FindSendPropInfo("CTFPlayer", "m_iAmmo");
  8524.  
  8525. SetEntData(client, iAmmoTable + iOffset, ammo, 4, true);
  8526. }
  8527. }
  8528.  
  8529. stock GetAmmo(client, slot)
  8530. {
  8531. if (!IsValidClient(client))
  8532. {
  8533. return 0;
  8534. }
  8535.  
  8536. new weapon = GetPlayerWeaponSlot(client, slot);
  8537.  
  8538. if (IsValidEntity(weapon))
  8539. {
  8540. new iOffset = GetEntProp(weapon, Prop_Send, "m_iPrimaryAmmoType", 1) * 4;
  8541. new iAmmoTable = FindSendPropInfo("CTFPlayer", "m_iAmmo");
  8542.  
  8543. return GetEntData(client, iAmmoTable + iOffset);
  8544. }
  8545.  
  8546. return 0;
  8547. }
  8548.  
  8549. stock GetHealingTarget(client)
  8550. {
  8551. new String:s[64];
  8552. new medigun = GetPlayerWeaponSlot(client, TFWeaponSlot_Secondary);
  8553.  
  8554. if (medigun <= MaxClients || !IsValidEdict(medigun))
  8555. {
  8556. return -1;
  8557. }
  8558.  
  8559. GetEdictClassname(medigun, s, sizeof(s));
  8560.  
  8561. if (strcmp(s, "tf_weapon_medigun", false) == 0)
  8562. {
  8563. if (GetEntProp(medigun, Prop_Send, "m_bHealing"))
  8564. {
  8565. return GetEntPropEnt(medigun, Prop_Send, "m_hHealingTarget");
  8566. }
  8567. }
  8568.  
  8569. return -1;
  8570. }
  8571.  
  8572. stock bool:IsValidClient(client, bool:replaycheck = true)
  8573. {
  8574. if (client <= 0 || client > MaxClients || !IsClientInGame(client) || GetEntProp(client, Prop_Send, "m_bIsCoaching") || (replaycheck && (IsClientSourceTV(client) || IsClientReplay(client))))
  8575. {
  8576. return false;
  8577. }
  8578.  
  8579. return true;
  8580. }
  8581.  
  8582. public OnEntityCreated(entity, const String:classname[])
  8583. {
  8584. if (Enabled && VSHRoundState == 1 && strcmp(classname, "tf_projectile_pipe", false) == 0)
  8585. {
  8586. SDKHook(entity, SDKHook_SpawnPost, OnEggBombSpawned);
  8587. }
  8588. }
  8589.  
  8590. public OnEggBombSpawned(entity)
  8591. {
  8592. new owner = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
  8593.  
  8594. if (IsValidClient(owner) && owner == Hale && Special == VSHSpecial_Bunny)
  8595. {
  8596. CreateTimer(0.0, Timer_SetEggBomb, EntIndexToEntRef(entity), TIMER_FLAG_NO_MAPCHANGE);
  8597. }
  8598. }
  8599.  
  8600. public Action:Timer_SetEggBomb(Handle:timer, any:ref)
  8601. {
  8602. new entity = EntRefToEntIndex(ref);
  8603.  
  8604. if (FileExists(EggModel) && IsModelPrecached(EggModel) && IsValidEntity(entity))
  8605. {
  8606. new att = AttachProjectileModel(entity, EggModel);
  8607.  
  8608. SetEntProp(att, Prop_Send, "m_nSkin", 0);
  8609. SetEntityRenderMode(entity, RENDER_TRANSCOLOR);
  8610. SetEntityRenderColor(entity, 255, 255, 255, 0);
  8611. }
  8612. }
  8613.  
  8614. stock CreateVM(client, String:model[])
  8615. {
  8616. new ent = CreateEntityByName("tf_wearable_vm");
  8617.  
  8618. if (!IsValidEntity(ent))
  8619. {
  8620. return -1;
  8621. }
  8622.  
  8623. SetEntProp(ent, Prop_Send, "m_nModelIndex", PrecacheModel(model));
  8624. SetEntProp(ent, Prop_Send, "m_fEffects", EF_BONEMERGE | EF_BONEMERGE_FASTCULL);
  8625. SetEntProp(ent, Prop_Send, "m_iTeamNum", GetClientTeam(client));
  8626. SetEntProp(ent, Prop_Send, "m_usSolidFlags", 4);
  8627. SetEntProp(ent, Prop_Send, "m_CollisionGroup", 11);
  8628.  
  8629. DispatchSpawn(ent);
  8630.  
  8631. SetVariantString("!activator");
  8632. ActivateEntity(ent);
  8633.  
  8634. TF2_EquipWearable(client, ent);
  8635.  
  8636. return ent;
  8637. }
  8638.  
  8639. stock TF2_EquipWearable(client, entity)
  8640. {
  8641. SDKCall(hEquipWearable, client, entity);
  8642. }
  8643.  
  8644. stock AttachProjectileModel(entity, String:strModel[], String:strAnim[] = "")
  8645. {
  8646. if (!IsValidEntity(entity))
  8647. {
  8648. return -1;
  8649. }
  8650.  
  8651. new model = CreateEntityByName("prop_dynamic");
  8652.  
  8653. if (IsValidEdict(model))
  8654. {
  8655. decl Float:pos[3];
  8656. decl Float:ang[3];
  8657.  
  8658. GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
  8659. GetEntPropVector(entity, Prop_Send, "m_angRotation", ang);
  8660.  
  8661. TeleportEntity(model, pos, ang, NULL_VECTOR);
  8662. DispatchKeyValue(model, "model", strModel);
  8663. DispatchSpawn(model);
  8664. SetVariantString("!activator");
  8665. AcceptEntityInput(model, "SetParent", entity, model, 0);
  8666.  
  8667. if (strAnim[0] != '\0')
  8668. {
  8669. SetVariantString(strAnim);
  8670. AcceptEntityInput(model, "SetDefaultAnimation");
  8671. SetVariantString(strAnim);
  8672. AcceptEntityInput(model, "SetAnimation");
  8673. }
  8674.  
  8675. SetEntPropEnt(model, Prop_Send, "m_hOwnerEntity", entity);
  8676.  
  8677. return model;
  8678. }
  8679. else
  8680. {
  8681. LogError("(AttachProjectileModel): Could not create prop_dynamic");
  8682. }
  8683.  
  8684. return -1;
  8685. }
  8686.  
  8687. stock FindEntityByClassname2(startEnt, const String:classname[])
  8688. {
  8689. /* If startEnt isn't valid shifting it back to the nearest valid one */
  8690. while (startEnt > -1 && !IsValidEntity(startEnt))
  8691. {
  8692. startEnt--;
  8693. }
  8694.  
  8695. return FindEntityByClassname(startEnt, classname);
  8696. }
  8697.  
  8698. stock SetHaleHealthFix(client, oldhealth)
  8699. {
  8700. new originalhealth = oldhealth;
  8701. // if (originalhealth < 4096)
  8702. // {
  8703. // SetEntProp(client, Prop_Send, "m_iHealth", originalhealth);
  8704. // return;
  8705. // }
  8706. // oldhealth = oldhealth % 4096;
  8707. // if (oldhealth < 5) originalhealth += 10;
  8708.  
  8709. // SetEntProp(Hale, Prop_Data, "m_iHealth", HaleHealth);
  8710. SetEntProp(client, Prop_Send, "m_iHealth", originalhealth);
  8711. }
  8712.  
  8713. public Native_IsVSHMap(Handle:plugin, numParams)
  8714. {
  8715. return IsSaxtonHaleMap();
  8716. /* new result = IsSaxtonHaleMap();
  8717. new result2 = result;
  8718.  
  8719. new Action:act = Plugin_Continue;
  8720. Call_StartForward(OnIsVSHMap);
  8721. Call_PushCellRef(result2);
  8722. Call_Finish(act);
  8723. if (act == Plugin_Changed)
  8724. result = result2;
  8725. return result;*/
  8726. }
  8727. /*
  8728. public Native_IsEnabled(Handle:plugin, numParams)
  8729. {
  8730. new result = Enabled;
  8731. new result2 = result;
  8732.  
  8733. new Action:act = Plugin_Continue;
  8734. Call_StartForward(OnIsEnabled);
  8735. Call_PushCellRef(result2);
  8736. Call_Finish(act);
  8737. if (act == Plugin_Changed)
  8738. result = result2;
  8739. return result;
  8740. }
  8741.  
  8742.  
  8743.  
  8744. public Native_GetHale(Handle:plugin, numParams)
  8745. {
  8746. new result = -1;
  8747. if (IsValidClient(Hale))
  8748. result = GetClientUserId(Hale);
  8749. new result2 = result;
  8750.  
  8751. new Action:act = Plugin_Continue;
  8752. Call_StartForward(OnGetHale);
  8753. Call_PushCellRef(result2);
  8754. Call_Finish(act);
  8755. if (act == Plugin_Changed)
  8756. result = result2;
  8757. return result;
  8758.  
  8759. }
  8760.  
  8761. public Native_GetTeam(Handle:plugin, numParams)
  8762. {
  8763. new result = HaleTeam;
  8764. new result2 = result;
  8765.  
  8766. new Action:act = Plugin_Continue;
  8767. Call_StartForward(OnGetTeam);
  8768. Call_PushCellRef(result2);
  8769. Call_Finish(act);
  8770. if (act == Plugin_Changed)
  8771. result = result2;
  8772. return result;
  8773. }
  8774.  
  8775. public Native_GetSpecial(Handle:plugin, numParams)
  8776. {
  8777. new result = Special;
  8778. new result2 = result;
  8779.  
  8780. new Action:act = Plugin_Continue;
  8781. Call_StartForward(OnGetSpecial);
  8782. Call_PushCellRef(result2);
  8783. Call_Finish(act);
  8784. if (act == Plugin_Changed)
  8785. result = result2;
  8786. return result;
  8787. }
  8788.  
  8789. public Native_GetHealth(Handle:plugin, numParams)
  8790. {
  8791. new result = HaleHealth;
  8792. new result2 = result;
  8793.  
  8794. new Action:act = Plugin_Continue;
  8795. Call_StartForward(OnGetHealth);
  8796. Call_PushCellRef(result2);
  8797. Call_Finish(act);
  8798. if (act == Plugin_Changed)
  8799. result = result2;
  8800.  
  8801. return result;
  8802. }
  8803.  
  8804. public Native_GetHealthMax(Handle:plugin, numParams)
  8805. {
  8806. new result = HaleHealthMax;
  8807. new result2 = result;
  8808.  
  8809. new Action:act = Plugin_Continue;
  8810. Call_StartForward(OnGetHealthMax);
  8811. Call_PushCellRef(result2);
  8812. Call_Finish(act);
  8813. if (act == Plugin_Changed)
  8814. result = result2;
  8815. return result;
  8816. }
  8817.  
  8818. public Native_GetRoundState(Handle:plugin, numParams)
  8819. {
  8820. new result = VSHRoundState;
  8821. new result2 = result;
  8822.  
  8823. new Action:act = Plugin_Continue;
  8824. Call_StartForward(OnGetRoundState);
  8825. Call_PushCellRef(result2);
  8826. Call_Finish(act);
  8827. if (act == Plugin_Changed)
  8828. result = result2;
  8829. return result;
  8830. }
  8831. public Native_GetDamage(Handle:plugin, numParams)
  8832. {
  8833. new client = GetNativeCell(1);
  8834. new result = 0;
  8835. if (IsValidClient(client))
  8836. result = Damage[client];
  8837. new result2 = result;
  8838.  
  8839. new Action:act = Plugin_Continue;
  8840. Call_StartForward(OnGetDamage);
  8841. Call_PushCell(client);
  8842. Call_PushCellRef(result2);
  8843. Call_Finish(act);
  8844. if (act == Plugin_Changed)
  8845. result = result2;
  8846. return result;
  8847. }*/
  8848.  
  8849. public Native_IsEnabled(Handle:plugin, numParams)
  8850. {
  8851. return Enabled;
  8852. }
  8853.  
  8854. public Native_GetHale(Handle:plugin, numParams)
  8855. {
  8856. if (IsValidClient(Hale))
  8857. {
  8858. return GetClientUserId(Hale);
  8859. }
  8860.  
  8861. return -1;
  8862. }
  8863.  
  8864. public Native_GetTeam(Handle:plugin, numParams)
  8865. {
  8866. return HaleTeam;
  8867. }
  8868.  
  8869. public Native_GetSpecial(Handle:plugin, numParams)
  8870. {
  8871. return Special;
  8872. }
  8873.  
  8874. public Native_GetHealth(Handle:plugin, numParams)
  8875. {
  8876. return HaleHealth;
  8877. }
  8878.  
  8879. public Native_GetHealthMax(Handle:plugin, numParams)
  8880. {
  8881. return HaleHealthMax;
  8882. }
  8883.  
  8884. public Native_GetRoundState(Handle:plugin, numParams)
  8885. {
  8886. return VSHRoundState;
  8887. }
  8888.  
  8889. public Native_GetDamage(Handle:plugin, numParams)
  8890. {
  8891. new client = GetNativeCell(1);
  8892.  
  8893. if (!IsValidClient(client))
  8894. {
  8895. return 0;
  8896. }
  8897. return Damage[client];
  8898. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement