HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4.  
  5. #define m_flWait 44
  6.  
  7. public plugin_init( ) {
  8. register_plugin( "Deathrun Maps Fixer", "1.7", "xPaw" );
  9.  
  10. register_cvar( "deathrun_mapsfixer", "1.7", FCVAR_SERVER | FCVAR_SPONLY );
  11.  
  12. new szMapname[ 32 ];
  13. get_mapname( szMapname, charsmax( szMapname ) );
  14.  
  15. if( equali( szMapname, "deathrun_nightmare_beta2" ) )
  16. remove_entity( find_ent_by_model( -1, "func_wall", "*95" ) );
  17. else if( equali( szMapname, "deathrun_impossible_last" ) )
  18. remove_entity( find_ent_by_model( -1, "func_wall", "*112" ) );
  19. else if( equali( szMapname, "deathrun_impossible" ) )
  20. remove_entity( find_ent_by_model( -1, "func_wall", "*119" ) );
  21. else if( equali( szMapname, "deathrun_insane" ) )
  22. FixMap_Insane( );
  23. else if( equali( szMapname, "deathrun_caves" ) )
  24. CreateTriggerHurt( Float:{ 1420.0, 629.0, 279.0 }, Float:{ 1555.0, 1101.0, 309.0 } );
  25. else if( equali( szMapname, "deathrun_bkm" ) )
  26. FixMap_Bkm( );
  27. else if( equali( szMapname, "deathrun_piirates" ) )
  28. FixMap_Piirates( );
  29. else if( equali( szMapname, "deathrun_fatality_beta5" ) )
  30. FixMap_Fatality( 0 );
  31. else if( equali( szMapname, "deathrun_fatality_beta6" ) )
  32. FixMap_Fatality( 1 );
  33. else if( equali( szMapname, "deathrun_meadsy_final" ) )
  34. FixMap_Meadsy( );
  35. else if( equali( szMapname, "deathrun_aztecrun" ) )
  36. FixMap_AztecRun( );
  37. else if( equali( szMapname, "deathrun_pyramid" ) )
  38. FixMap_Pyramid( );
  39. else if( equali( szMapname, "deathrun_cxx-inc" ) )
  40. FixMap_CxxInc( );
  41. else if( equali( szMapname, "deathrun_mordownia" ) )
  42. FixMap_Mordownia( );
  43. else if( equali( szMapname, "deathrun_W0RMS" ) )
  44. FixMap_Worms( );
  45. else if( equali( szMapname, "deathrun_hotel_b6" ) )
  46. FixMap_Hotel( );
  47. }
  48.  
  49. FixMap_Insane( ) {
  50. remove_entity( find_ent_by_model( -1, "func_wall", "*144" ) );
  51.  
  52. // Anti stuck bug in trap
  53. DispatchKeyValue( find_ent_by_model( -1, "func_door_rotating", "*71" ), "dmg", "1000" );
  54. DispatchKeyValue( find_ent_by_model( -1, "func_door_rotating", "*72" ), "dmg", "1000" );
  55.  
  56. // Hurt higher damage
  57. DispatchKeyValue( find_ent_by_model( -1, "trigger_hurt", "*135" ), "dmg", "300" );
  58.  
  59. // Push replace to hurt
  60. new Float:vMins[ 3 ], Float:vMaxs[ 3 ];
  61. new iEntity = find_ent_by_model( -1, "trigger_push", "*140" );
  62. entity_get_vector( iEntity, EV_VEC_mins, vMins );
  63. entity_get_vector( iEntity, EV_VEC_maxs, vMaxs );
  64. remove_entity( iEntity );
  65. CreateTriggerHurt( vMins, vMaxs );
  66.  
  67. // Button replace to door
  68. new Float:vOrigin[ 3 ];
  69. iEntity = find_ent_by_model( -1, "func_button", "*4" );
  70. entity_get_vector( iEntity, EV_VEC_origin, vOrigin );
  71. remove_entity( iEntity );
  72.  
  73. iEntity = create_entity( "func_door" );
  74.  
  75. if( is_valid_ent( iEntity ) ) {
  76. entity_set_vector( iEntity, EV_VEC_origin, vOrigin );
  77. entity_set_float( iEntity, EV_FL_speed, 700.0 );
  78. entity_set_string( iEntity, EV_SZ_targetname, "startpush" );
  79. entity_set_string( iEntity, EV_SZ_model, "*4" );
  80.  
  81. DispatchKeyValue( iEntity, "angles", "0 270 0" );
  82. DispatchSpawn( iEntity );
  83.  
  84. set_pdata_float( iEntity, m_flWait, 4.0, 4 );
  85. }
  86. }
  87.  
  88. FixMap_Piirates( ) {
  89. new const Traps[ ][ ] = {
  90. "*19",
  91. "*44",
  92. "*49",
  93. "*82",
  94. "*95",
  95. "*117"
  96. };
  97.  
  98. new const Angles[ ][ ] = { // <3 master4life
  99. "0 270 0",
  100. "-90 0 0",
  101. "0 180 0",
  102. "0 0 0",
  103. "0 90 0",
  104. "90 0 0"
  105. };
  106.  
  107. new iEntity, Float:vOrigin[ 3 ], Float:flWait, Float:flDmg, Float:flSpeed, szTargetName[ 10 ];
  108. for( new i = 0; i < sizeof Traps; i++ ) {
  109. iEntity = find_ent_by_model( -1, "func_button", Traps[ i ] );
  110.  
  111. if( iEntity > 0 ) {
  112. flWait = get_pdata_float( iEntity, m_flWait, 4 );
  113. flDmg = entity_get_float( iEntity, EV_FL_dmg );
  114. flSpeed = entity_get_float( iEntity, EV_FL_speed );
  115. entity_get_vector( iEntity, EV_VEC_origin, vOrigin );
  116. entity_get_string( iEntity, EV_SZ_targetname, szTargetName, charsmax( szTargetName ) );
  117.  
  118. remove_entity( iEntity );
  119.  
  120. iEntity = create_entity( "func_door" );
  121. if( is_valid_ent( iEntity ) ) {
  122. entity_set_vector( iEntity, EV_VEC_origin, vOrigin );
  123. entity_set_float( iEntity, EV_FL_dmg, flDmg );
  124. entity_set_float( iEntity, EV_FL_speed, flSpeed );
  125. entity_set_string( iEntity, EV_SZ_targetname, szTargetName );
  126. entity_set_string( iEntity, EV_SZ_model, Traps[ i ] );
  127.  
  128. DispatchKeyValue( iEntity, "angles", Angles[ i ] );
  129. DispatchSpawn( iEntity );
  130.  
  131. set_pdata_float( iEntity, m_flWait, flWait, 4 );
  132. }
  133. }
  134. }
  135. }
  136.  
  137. FixMap_Hotel( ) {
  138. // Make those doors to be silent, because it makes too much noise
  139. new iEntity;
  140. while( ( iEntity = find_ent_by_tname( iEntity, "z52" ) ) > 0 )
  141. entity_set_string( iEntity, EV_SZ_noise1, "common/null.wav" );
  142. }
  143.  
  144. FixMap_Worms( ) {
  145. new const Breaks[ ][ ] = {
  146. "*1",
  147. "*2",
  148. "*5",
  149. "*15",
  150. "*16",
  151. "*17",
  152. "*18",
  153. "*19",
  154. "*20",
  155. "*33",
  156. "*34",
  157. "*35",
  158. "*36",
  159. "*153",
  160. "*156",
  161. "*158",
  162. "*159"
  163. };
  164.  
  165. // Trigger only flag on breakables
  166. new iEntity;
  167. for( new i = 0; i < sizeof Breaks; i++ ) {
  168. iEntity = find_ent_by_model( -1, "func_breakable", Breaks[ i ] );
  169.  
  170. entity_set_int( iEntity, EV_INT_spawnflags, SF_BREAK_TRIGGER_ONLY );
  171. }
  172. }
  173.  
  174. FixMap_Mordownia( ) {
  175. new const Pushes[ ][ ] = {
  176. "*52",
  177. "*58"
  178. };
  179.  
  180. new const Breaks[ ][ ] = {
  181. "*1",
  182. "*11",
  183. "*26",
  184. "*70"
  185. };
  186.  
  187. // Replace pushes to hurt
  188. new iEntity, Float:flMins[ 3 ], Float:flMaxs[ 3 ];
  189. for( new i = 0; i < sizeof Pushes; i++ ) {
  190. iEntity = find_ent_by_model( -1, "trigger_push", Pushes[ i ] );
  191.  
  192. entity_get_vector( iEntity, EV_VEC_mins, flMins );
  193. entity_get_vector( iEntity, EV_VEC_maxs, flMaxs );
  194. remove_entity( iEntity );
  195.  
  196. CreateTriggerHurt( flMins, flMaxs );
  197. }
  198.  
  199. // Trigger only flag on breakables
  200. for( new i = 0; i < sizeof Breaks; i++ ) {
  201. iEntity = find_ent_by_model( -1, "func_breakable", Breaks[ i ] );
  202.  
  203. entity_set_int( iEntity, EV_INT_spawnflags, SF_BREAK_TRIGGER_ONLY );
  204. }
  205. }
  206.  
  207. FixMap_Bkm( ) {
  208. new iEntity = find_ent_by_model( -1, "func_door_rotating", "*7" );
  209. remove_entity( iEntity );
  210.  
  211. iEntity = find_ent_by_model( -1, "func_breakable", "*44" );
  212.  
  213. // Trigger only flag on breakable
  214. entity_set_int( iEntity, EV_INT_spawnflags, SF_BREAK_TRIGGER_ONLY );
  215. entity_set_string( iEntity, EV_SZ_target, "" ); // clear it, bugfix
  216.  
  217. iEntity = find_ent_by_model( -1, "func_breakable", "*43" );
  218.  
  219. // Trigger only flag on breakable
  220. entity_set_int( iEntity, EV_INT_spawnflags, SF_BREAK_TRIGGER_ONLY );
  221. entity_set_string( iEntity, EV_SZ_target, "" ); // clear it, bugfix
  222.  
  223. // Create trigger_hurt, mapper forget 1 xD
  224. CreateTriggerHurt( Float:{ -608.0, -480.0, -608.0 }, Float:{ 1152.0, 1376.0, -588.0 } );
  225. }
  226.  
  227. FixMap_Fatality( IsBeta6 ) {
  228. new Fatality_Glass[ 7 ][ 4 ], iGlassNum;
  229.  
  230. if( !IsBeta6 ) {
  231. new const Beta6[ ][ ] = {
  232. "*40",
  233. "*91",
  234. "*92",
  235. "*54",
  236. "*75",
  237. "*52"
  238. };
  239.  
  240. for( iGlassNum = 0; iGlassNum < sizeof Beta6; iGlassNum++ )
  241. copy( Fatality_Glass[ iGlassNum ], 3, Beta6[ iGlassNum ] );
  242. } else {
  243. new const Beta5[ ][ ] = {
  244. "*39",
  245. "*52",
  246. "*87",
  247. "*88"
  248. };
  249.  
  250. for( iGlassNum = 0; iGlassNum < sizeof Beta5; iGlassNum++ )
  251. copy( Fatality_Glass[ iGlassNum ], 3, Beta5[ iGlassNum ] );
  252. }
  253.  
  254. // Replaces breakables to walls (glass)
  255. new iEntity, Float:vOrigin[ 3 ];
  256. for( new i = 0; i < iGlassNum; i++ ) {
  257. iEntity = find_ent_by_model( -1, "func_breakable", Fatality_Glass[ i ] );
  258.  
  259. if( iEntity > 0 ) {
  260. entity_get_vector( iEntity, EV_VEC_origin, vOrigin );
  261. remove_entity( iEntity );
  262.  
  263. iEntity = create_entity( "func_wall" );
  264. entity_set_vector( iEntity, EV_VEC_origin, vOrigin );
  265. entity_set_string( iEntity, EV_SZ_model, Fatality_Glass[ i ] );
  266. DispatchSpawn( iEntity );
  267.  
  268. entity_set_int( iEntity, EV_INT_rendermode, kRenderTransTexture );
  269. entity_set_vector( iEntity, EV_VEC_rendercolor, Float:{ 0.0, 0.0, 0.0 } );
  270. entity_set_float( iEntity, EV_FL_renderamt, 100.0 );
  271. }
  272. }
  273.  
  274. // Remove hurt in fire
  275. if( IsBeta6 )
  276. iEntity = find_ent_by_model( -1, "trigger_hurt", "*96" );
  277. else
  278. iEntity = find_ent_by_model( -1, "trigger_hurt", "*100" );
  279.  
  280. remove_entity( iEntity );
  281. }
  282.  
  283. FixMap_Meadsy( ) {
  284. new const Meadsy_Doors[ ][ ] = {
  285. "*2",
  286. "*3",
  287. "*4",
  288. "*70",
  289. "*78",
  290. "*79",
  291. "*87",
  292. "*88",
  293. "*89",
  294. "*90",
  295. "*91",
  296. "*92",
  297. "*32",
  298. "*33",
  299. "*34",
  300. "*37",
  301. "*38",
  302. "*39",
  303. "*109",
  304. "*110",
  305. "*111",
  306. "*112"
  307. };
  308.  
  309. new const Meadsy_DoorsRot[ ][ ] = {
  310. "*35",
  311. "*36",
  312. "*73",
  313. "*99",
  314. "*101"
  315. };
  316.  
  317. new iEntity = find_ent_by_model( -1, "func_door", "*106" );
  318. remove_entity( iEntity );
  319.  
  320. iEntity = find_ent_by_model( -1, "func_button", "*104" );
  321. remove_entity( iEntity );
  322.  
  323. new i;
  324. for( i = 0; i < sizeof Meadsy_Doors; i++ ) {
  325. iEntity = find_ent_by_model( -1, "func_door", Meadsy_Doors[ i ] );
  326.  
  327. if( iEntity > 0 )
  328. entity_set_int( iEntity, EV_INT_spawnflags, 0 );
  329. }
  330.  
  331. for( i = 0; i < sizeof Meadsy_DoorsRot; i++ ) {
  332. iEntity = find_ent_by_model( -1, "func_door_rotating", Meadsy_DoorsRot[ i ] );
  333.  
  334. if( iEntity > 0 )
  335. entity_set_int( iEntity, EV_INT_spawnflags, 0 );
  336. }
  337.  
  338. CreateTriggerHurt( Float:{ -824.0, 989.0, 164.0 }, Float:{ -674.0, 1348.0, 252.0 } );
  339. }
  340.  
  341. FixMap_AztecRun( ) {
  342. new const AztecRun_Doors[ ][ ] = {
  343. "*11",
  344. "*14",
  345. "*15",
  346. "*23",
  347. "*78",
  348. "*79",
  349. "*80",
  350. "*81",
  351. "*82",
  352. "*83"
  353. };
  354.  
  355. // Remove flags on doors (anti +use bug)
  356. new iEntity;
  357. for( new i = 0; i < sizeof AztecRun_Doors; i++ ) {
  358. iEntity = find_ent_by_model( -1, "func_door", AztecRun_Doors[ i ] );
  359.  
  360. if( iEntity > 0 )
  361. entity_set_int( iEntity, EV_INT_spawnflags, 0 );
  362. }
  363.  
  364. // Remove not working shit
  365. remove_entity( find_ent_by_model( -1, "func_button", "*67" ) );
  366. remove_entity( find_ent_by_model( -1, "button_target", "*68" ) );
  367. }
  368.  
  369. FixMap_Pyramid( ) {
  370. new const Pyramid_Doors[ ][ ] = {
  371. "*12",
  372. "*13",
  373. "*14",
  374. "*15"
  375. };
  376.  
  377. // Remove flags on doors (anti +use bug)
  378. new iEntity;
  379. for( new i = 0; i < sizeof Pyramid_Doors; i++ ) {
  380. iEntity = find_ent_by_model( -1, "func_door", Pyramid_Doors[ i ] );
  381.  
  382. if( iEntity > 0 )
  383. entity_set_int( iEntity, EV_INT_spawnflags, 0 );
  384. }
  385.  
  386. // Remove not working shit
  387. remove_entity( find_ent_by_model( -1, "func_button", "*36" ) );
  388. remove_entity( find_ent_by_model( -1, "func_button", "*37" ) );
  389. }
  390.  
  391. FixMap_CxxInc( ) {
  392. new const CxxInc_Breakables[ ][ ] = {
  393. "*149",
  394. "*150",
  395. "*151",
  396. "*152",
  397. "*153",
  398. "*154",
  399. "*155",
  400. "*156",
  401. "*157",
  402. "*158",
  403. "*159",
  404. "*160",
  405. "*161",
  406. "*162",
  407. "*163",
  408. "*164",
  409. "*165",
  410. "*166"
  411. };
  412.  
  413. // Remove breakables
  414. new iEntity;
  415. for( new i = 0; i < sizeof CxxInc_Breakables; i++ ) {
  416. iEntity = find_ent_by_model( -1, "func_breakable", CxxInc_Breakables[ i ] );
  417.  
  418. remove_entity( iEntity );
  419. }
  420.  
  421. // Create trigger hurt in black room (anti stuck + semiclip bugg)
  422. CreateTriggerHurt( Float:{ -1200.0, -168.0, -1436.0 }, Float:{ 1220.0, 176.0, -1127.0 } );
  423. }
  424.  
  425. CreateTriggerHurt( const Float:flMins[ 3 ], const Float:flMaxs[ 3 ] ) {
  426. new iEntity = create_entity( "trigger_hurt" );
  427.  
  428. if( !is_valid_ent( iEntity ) )
  429. return 0;
  430.  
  431. DispatchKeyValue( iEntity, "classname", "trigger_hurt" );
  432. DispatchKeyValue( iEntity, "damagetype", "1024" );
  433. DispatchKeyValue( iEntity, "dmg", "1000" );
  434. DispatchKeyValue( iEntity, "origin", "0 0 0" );
  435.  
  436. DispatchSpawn( iEntity );
  437.  
  438. entity_set_size( iEntity, flMins, flMaxs );
  439. entity_set_int( iEntity, EV_INT_solid, SOLID_TRIGGER );
  440.  
  441. return iEntity;
  442. }