hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.03. 18:46



Jelenlévő felhasználók

Jelenleg 539 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 539 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Boss
HozzászólásElküldve: 2014.11.30. 17:04 
Offline
Senior Tag

Csatlakozott: 2014.04.26. 23:27
Hozzászólások: 201
Megköszönt másnak: 19 alkalommal
Megköszönték neki: 1 alkalommal
Sziasztok.Bele-e lehetne írni ,hogy aki megölte ki írja a nevét így gondoltam!
[Oberon] Pisti Megölte az oberont ezért V.I.P-ra számíthat!

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4. #include <hamsandwich>
  5. #include <xs>
  6.  
  7. #define OBERON_CLASSNAME "oberon"
  8. #define OBERON_HEALTH 500.0
  9.  
  10. #define TASK_SKILL 123123123
  11. #define TASK_HOOKINGUP 123312312
  12. #define TASK_HOOKINGDOWN 123312313
  13.  
  14. new const oberon_model[] = "models/oberon/zbs_bossl_big02.mdl"
  15. new const oberon_knife_effect[] = "models/oberon/ef_knife.mdl"
  16. new const oberon_hole_effect[] = "models/oberon/ef_hole.mdl"
  17. new const oberon_bomb_model[] = "models/oberon/zbs_bossl_big02_bomb.mdl"
  18.  
  19. new const oberon_appear_sound[] = "oberon/appear.wav"
  20. new const oberon_death_sound[] = "oberon/death.wav"
  21. new const oberon_evolution_sound[] = "oberon/knife.wav"
  22. new const oberon_attack_sound[8][] =
  23. {
  24. "oberon/attack1.wav",
  25. "oberon/attack2.wav",
  26. "oberon/attack3_jump.wav",
  27. "oberon/attack3.wav",
  28. "oberon/knife_attack1.wav",
  29. "oberon/knife_attack2.wav",
  30. "oberon/knife_attack3_jump.wav",
  31. "oberon/knife_attack3.wav"
  32. }
  33. new const oberon_hole_sound[] = "oberon/hole.wav"
  34. new const oberon_bomb_sound[] = "oberon/attack_bomb.wav"
  35.  
  36. new oberon_model_id, g_reg, m_iBlood[2], exp_spr_id
  37. new Float:g_cur_origin[3], Float:g_cur_angles[3], Float:g_cur_v_angle[3]
  38. new g_evolution, g_evoluting, g_doing_other, g_attacking3, Float:g_attacking3_origin[3]
  39.  
  40. public plugin_init()
  41. {
  42. register_plugin("[Dias's NPC] Oberon", "1.0", "Dias")
  43.  
  44. register_event("HLTV", "event_newround", "a", "1=0", "2=0")
  45. register_touch(OBERON_CLASSNAME, "*", "fw_touch")
  46.  
  47. register_clcmd("say /get_origin", "get_origin")
  48. register_clcmd("say /make", "create_oberon")
  49. }
  50.  
  51. public plugin_precache()
  52. {
  53. oberon_model_id = precache_model(oberon_model)
  54. precache_model(oberon_knife_effect)
  55. precache_model(oberon_hole_effect)
  56. precache_model(oberon_bomb_model)
  57.  
  58. precache_sound(oberon_appear_sound)
  59. precache_sound(oberon_death_sound)
  60. precache_sound(oberon_evolution_sound)
  61. for(new i = 0; i < sizeof(oberon_attack_sound); i++)
  62. {
  63. precache_sound(oberon_attack_sound[i])
  64. }
  65. precache_sound(oberon_hole_sound)
  66. precache_sound(oberon_bomb_sound)
  67.  
  68. m_iBlood[0] = precache_model("sprites/blood.spr")
  69. m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  70. exp_spr_id = precache_model("sprites/zerogxplode.spr")
  71. }
  72.  
  73. public event_newround()
  74. {
  75. static ent
  76. ent = find_ent_by_class(-1, OBERON_CLASSNAME)
  77.  
  78. if(task_exists(ent+TASK_SKILL)) remove_task(ent+TASK_SKILL)
  79. }
  80.  
  81. public get_origin(id)
  82. {
  83. pev(id, pev_origin, g_cur_origin)
  84. pev(id, pev_angles, g_cur_angles)
  85. pev(id, pev_v_angle, g_cur_v_angle)
  86.  
  87. client_print(id, print_chat, "[Dias's NPC] Saved Origin")
  88. }
  89.  
  90. public create_oberon(id)
  91. {
  92. new ent = create_entity("info_target")
  93.  
  94. entity_set_origin(ent, g_cur_origin)
  95. entity_set_vector(ent, EV_VEC_angles, g_cur_angles)
  96. //entity_set_vector(ent, EV_VEC_v_angle, g_cur_v_angle)
  97.  
  98. entity_set_float(ent, EV_FL_takedamage, 1.0)
  99. entity_set_float(ent, EV_FL_health, OBERON_HEALTH + 1000.0)
  100.  
  101. entity_set_string(ent,EV_SZ_classname, OBERON_CLASSNAME)
  102. entity_set_model(ent, oberon_model)
  103. entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX)
  104. entity_set_int(ent, EV_INT_movetype, MOVETYPE_STEP)
  105.  
  106. new Float:maxs[3] = {100.0, 100.0, 100.0}
  107. new Float:mins[3] = {-100.0, -100.0, -30.0}
  108. entity_set_size(ent, mins, maxs)
  109. entity_set_int(ent, EV_INT_modelindex, oberon_model_id)
  110.  
  111. set_entity_anim(ent, 1)
  112.  
  113. set_pev(ent, pev_iuser4, 0)
  114.  
  115. entity_set_float(ent, EV_FL_nextthink, halflife_time() + 6.0)
  116. set_task(5.0, "start_oberon", ent)
  117.  
  118. set_task(15.0, "do_random_skill", ent, _, _, "b")
  119.  
  120. if(!g_reg)
  121. {
  122. RegisterHamFromEntity(Ham_TakeDamage, ent, "fw_takedmg", 1)
  123. RegisterHamFromEntity(Ham_Think, ent, "fw_think")
  124. g_reg = 1
  125. }
  126.  
  127. g_evolution = 0
  128. g_evoluting = 0
  129. g_doing_other = 0
  130.  
  131. drop_to_floor(ent)
  132. emit_sound(ent, CHAN_BODY, oberon_appear_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  133. }
  134.  
  135. public start_oberon(ent)
  136. {
  137. set_entity_anim(ent, 2)
  138. }
  139.  
  140. public fw_think(ent)
  141. {
  142. if(!is_valid_ent(ent))
  143. return HAM_IGNORED
  144.  
  145. if(pev(ent, pev_iuser4) == 1) // Oberon is dead
  146. return HAM_IGNORED
  147.  
  148. if(g_evoluting || g_doing_other)
  149. return HAM_IGNORED
  150.  
  151. if(pev(ent, pev_health) - 1000.0 <= 0.0)
  152. {
  153. set_pev(ent, pev_iuser4, 1)
  154. set_entity_anim(ent, 20)
  155. set_task(15.0, "move_entity", ent)
  156. entity_set_int(ent, EV_INT_solid, SOLID_NOT)
  157. entity_set_float(ent, EV_FL_takedamage, 0.0)
  158.  
  159. emit_sound(ent, CHAN_BODY, oberon_death_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  160.  
  161. return HAM_IGNORED
  162. }
  163. if((pev(ent, pev_health) - 1000.0 <= OBERON_HEALTH / 2.0) && !g_evolution)
  164. {
  165. g_evoluting = 1
  166. set_entity_anim(ent, 11)
  167.  
  168. emit_sound(ent, CHAN_BODY, oberon_evolution_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  169. set_task(8.0, "set_new_idle", ent)
  170.  
  171. return HAM_IGNORED
  172. }
  173.  
  174. static victim
  175. static Float:Origin[3], Float:VicOrigin[3], Float:distance
  176.  
  177. victim = FindClosesEnemy(ent)
  178. pev(ent, pev_origin, Origin)
  179. pev(victim, pev_origin, VicOrigin)
  180.  
  181. distance = get_distance_f(Origin, VicOrigin)
  182.  
  183. if(is_user_alive(victim))
  184. {
  185. if(distance <= 250.0)
  186. {
  187. if(!is_valid_ent(ent))
  188. return FMRES_IGNORED
  189.  
  190. new Float:Ent_Origin[3], Float:Vic_Origin[3]
  191.  
  192. pev(ent, pev_origin, Ent_Origin)
  193. pev(victim, pev_origin, Vic_Origin)
  194.  
  195. npc_turntotarget(ent, Ent_Origin, victim, Vic_Origin)
  196.  
  197. static Attack_Type, attack_anim, attack_sound
  198. Attack_Type = random_num(1, 2)
  199.  
  200. if(Attack_Type == 1)
  201. {
  202. if(g_evolution)
  203. {
  204. attack_anim = 14
  205. attack_sound = 4
  206. } else {
  207. attack_anim = 6
  208. attack_sound = 0
  209. }
  210.  
  211. set_entity_anim(ent, attack_anim)
  212. emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
  213.  
  214. set_task(1.0, "do_takedmg", ent)
  215.  
  216. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 3.0)
  217. } else {
  218. if(g_evolution)
  219. {
  220. attack_anim = 15
  221. attack_sound = 5
  222. } else {
  223. attack_anim = 7
  224. attack_sound = 1
  225. }
  226.  
  227. set_entity_anim(ent, attack_anim)
  228. emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
  229.  
  230. set_task(0.5, "do_takedmg", ent)
  231.  
  232. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 3.0)
  233. }
  234.  
  235. } else {
  236. static moving_anim
  237.  
  238. if(g_evolution)
  239. moving_anim = 13
  240. else
  241. moving_anim = 3
  242.  
  243. if(pev(ent, pev_sequence) != moving_anim)
  244. {
  245. entity_set_float(ent, EV_FL_animtime, get_gametime())
  246. entity_set_float(ent, EV_FL_framerate, 1.0)
  247. entity_set_int(ent, EV_INT_sequence, moving_anim)
  248. }
  249.  
  250. new Float:Ent_Origin[3], Float:Vic_Origin[3]
  251.  
  252. pev(ent, pev_origin, Ent_Origin)
  253. pev(victim, pev_origin, Vic_Origin)
  254.  
  255. npc_turntotarget(ent, Ent_Origin, victim, Vic_Origin)
  256. hook_ent(ent, victim, 100.0)
  257.  
  258. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
  259. }
  260. } else {
  261. static idle_anim
  262.  
  263. if(g_evolution)
  264. idle_anim = 12
  265. else
  266. idle_anim = 2
  267.  
  268. if(pev(ent, pev_sequence) != idle_anim)
  269. {
  270. set_entity_anim(ent, idle_anim)
  271. }
  272.  
  273. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0)
  274. }
  275.  
  276. return HAM_HANDLED
  277. }
  278.  
  279. public do_random_skill(ent)
  280. {
  281. if(!pev_valid(ent))
  282. return PLUGIN_HANDLED
  283.  
  284. if(g_evoluting)
  285. return PLUGIN_HANDLED
  286.  
  287. if(pev(ent, pev_health) - 1000.0 <= 0.0)
  288. return PLUGIN_HANDLED
  289.  
  290. static random_skill
  291. random_skill = random_num(0, 100)
  292.  
  293. g_doing_other = 1
  294.  
  295. switch(random_skill)
  296. {
  297. case 0..37: {
  298. do_attack3(ent)
  299.  
  300. }
  301. case 38..72: {
  302. do_hole(ent)
  303. }
  304. case 73..100: {
  305. do_bomb(ent)
  306. }
  307. }
  308.  
  309. return PLUGIN_CONTINUE
  310. }
  311.  
  312. public do_bomb(oberon)
  313. {
  314. g_doing_other = 1
  315.  
  316. static bomb_anim
  317. if(g_evolution)
  318. bomb_anim = 18
  319. else
  320. bomb_anim = 9
  321.  
  322. set_entity_anim(oberon, bomb_anim)
  323.  
  324. set_task(3.0, "do_skill_bomb", oberon+2015, _, _, "b")
  325. set_task(10.0, "stop_skill_bomb", oberon)
  326. }
  327.  
  328. public stop_skill_bomb(oberon)
  329. {
  330. remove_task(oberon+2015)
  331.  
  332. static idle_anim
  333.  
  334. if(g_evolution)
  335. idle_anim = 12
  336. else
  337. idle_anim = 2
  338.  
  339. set_entity_anim(oberon, idle_anim)
  340. set_task(2.0, "reset_think", oberon)
  341. }
  342.  
  343. public do_skill_bomb(oberon)
  344. {
  345. oberon -= 2015
  346. static Float:StartOrigin[3], Float:TempOrigin[6][3], Float:VicOrigin[6][3], Float:Random1
  347.  
  348. pev(oberon, pev_origin, StartOrigin)
  349. emit_sound(oberon, CHAN_BODY, oberon_bomb_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  350.  
  351. // 1st Bomb
  352. Random1 = random_float(100.0, 500.0)
  353. VicOrigin[0][0] = StartOrigin[0] + Random1
  354. VicOrigin[0][1] = StartOrigin[1]
  355. VicOrigin[0][2] = StartOrigin[2]
  356.  
  357. TempOrigin[0][0] = VicOrigin[0][0] - (Random1 / 2.0)
  358. TempOrigin[0][1] = VicOrigin[0][1]
  359. TempOrigin[0][2] = VicOrigin[0][2] + 500.0
  360.  
  361. // 2nd Bomb
  362. Random1 = random_float(100.0, 500.0)
  363. VicOrigin[1][0] = StartOrigin[0]
  364. VicOrigin[1][1] = StartOrigin[1] + Random1
  365. VicOrigin[1][2] = StartOrigin[2]
  366.  
  367. TempOrigin[1][0] = VicOrigin[1][0]
  368. TempOrigin[1][1] = VicOrigin[1][1] - (Random1 / 2.0)
  369. TempOrigin[1][2] = VicOrigin[1][2] + 500.0
  370.  
  371. // 3rd Bomb
  372. Random1 = random_float(100.0, 500.0)
  373. VicOrigin[2][0] = StartOrigin[0] - Random1
  374. VicOrigin[2][1] = StartOrigin[1]
  375. VicOrigin[2][2] = StartOrigin[2]
  376.  
  377. TempOrigin[2][0] = VicOrigin[2][0] - (Random1 / 2.0)
  378. TempOrigin[2][1] = VicOrigin[2][1]
  379. TempOrigin[2][2] = VicOrigin[2][2] + 500.0
  380.  
  381. // 4th Bomb
  382. VicOrigin[3][0] = StartOrigin[0]
  383. VicOrigin[3][1] = StartOrigin[1] - Random1
  384. VicOrigin[3][2] = StartOrigin[2]
  385.  
  386. TempOrigin[3][0] = VicOrigin[3][0]
  387. TempOrigin[3][1] = VicOrigin[3][1] - (Random1 / 2.0)
  388. TempOrigin[3][2] = VicOrigin[3][2] + 500.0
  389.  
  390. // 5th Bomb
  391. VicOrigin[4][0] = StartOrigin[0] + Random1
  392. VicOrigin[4][1] = StartOrigin[1] + Random1
  393. VicOrigin[4][2] = StartOrigin[2]
  394.  
  395. TempOrigin[4][0] = VicOrigin[4][0] - (Random1 / 2.0)
  396. TempOrigin[4][1] = VicOrigin[4][1] - (Random1 / 2.0)
  397. TempOrigin[4][2] = VicOrigin[4][2] + 500.0
  398.  
  399. // 6th Bomb
  400. VicOrigin[5][0] = StartOrigin[0] + Random1
  401. VicOrigin[5][1] = StartOrigin[1] - Random1
  402. VicOrigin[5][2] = StartOrigin[2]
  403.  
  404. TempOrigin[5][0] = VicOrigin[5][0] + (Random1 / 2.0)
  405. TempOrigin[5][1] = VicOrigin[5][1] - (Random1 / 2.0)
  406. TempOrigin[5][2] = VicOrigin[5][2] + 500.0
  407.  
  408. for(new i = 0; i < 6; i++)
  409. {
  410. make_bomb(StartOrigin, TempOrigin[i], VicOrigin[i])
  411. }
  412. }
  413.  
  414. public make_bomb(Float:StartOrigin[3], Float:TempOrigin[3], Float:VicOrigin[3])
  415. {
  416. new ent = create_entity("info_target")
  417.  
  418. StartOrigin[2] += 20.0
  419.  
  420. entity_set_origin(ent, StartOrigin)
  421.  
  422. entity_set_string(ent,EV_SZ_classname, "oberon_bomb")
  423. entity_set_model(ent, oberon_bomb_model)
  424. entity_set_int(ent, EV_INT_solid, SOLID_NOT)
  425. entity_set_int(ent, EV_INT_movetype, MOVETYPE_BOUNCE)
  426.  
  427. new Float:maxs[3] = {10.0,10.0,10.0}
  428. new Float:mins[3] = {-10.0,-10.0,-5.0}
  429. entity_set_size(ent, mins, maxs)
  430.  
  431. entity_set_float(ent, EV_FL_animtime, get_gametime())
  432. entity_set_float(ent, EV_FL_framerate, 1.0)
  433. entity_set_int(ent, EV_INT_sequence, 0)
  434.  
  435. static arg[4], arg2[4]
  436.  
  437. arg[0] = ent
  438. arg[1] = floatround(TempOrigin[0])
  439. arg[2] = floatround(TempOrigin[1])
  440. arg[3] = floatround(TempOrigin[2])
  441.  
  442. arg2[0] = ent
  443. arg2[1] = floatround(VicOrigin[0])
  444. arg2[2] = floatround(VicOrigin[1])
  445. arg2[3] = floatround(VicOrigin[2])
  446.  
  447. set_task(0.01, "do_hook_bomb_up", TASK_HOOKINGUP, arg, sizeof(arg), "b")
  448. set_task(1.0, "do_hook_bomb_down", _, arg2, sizeof(arg2))
  449. set_task(2.0, "bomb_explode", ent)
  450. }
  451.  
  452. public bomb_explode(ent)
  453. {
  454. remove_task(TASK_HOOKINGUP)
  455. remove_task(TASK_HOOKINGDOWN)
  456.  
  457. static Float:Origin[3]
  458. pev(ent, pev_origin, Origin)
  459.  
  460. message_begin(MSG_BROADCAST ,SVC_TEMPENTITY)
  461. write_byte(TE_EXPLOSION)
  462. engfunc(EngFunc_WriteCoord, Origin[0])
  463. engfunc(EngFunc_WriteCoord, Origin[1])
  464. engfunc(EngFunc_WriteCoord, Origin[2])
  465. write_short(exp_spr_id) // sprite index
  466. write_byte(20) // scale in 0.1's
  467. write_byte(30) // framerate
  468. write_byte(0) // flags
  469. message_end()
  470.  
  471. for(new i = 1; i < get_maxplayers(); i++)
  472. {
  473. if(is_user_alive(i) && entity_range(i, ent) <= 300.0)
  474. {
  475. static Float:Damage
  476. Damage = random_float(10.0, 30.0)
  477.  
  478. if(g_evolution)
  479. Damage *= 2.0
  480.  
  481. ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
  482. hit_screen(i)
  483. }
  484. }
  485.  
  486. remove_entity(ent)
  487. }
  488.  
  489. public do_hook_bomb_down(arg[4])
  490. {
  491. remove_task(TASK_HOOKINGUP)
  492. set_task(0.01, "do_hook_bomb_down2", TASK_HOOKINGDOWN, arg, sizeof(arg), "b")
  493. }
  494.  
  495. public do_hook_bomb_down2(arg[4])
  496. {
  497. static ent, Float:VicOrigin[3]
  498.  
  499. ent = arg[0]
  500. VicOrigin[0] = float(arg[1])
  501. VicOrigin[1] = float(arg[2])
  502. VicOrigin[2] = float(arg[3])
  503.  
  504. hook_ent2(ent, VicOrigin, 500.0)
  505. }
  506.  
  507. public do_hook_bomb_up(arg[4])
  508. {
  509. static ent, Float:TempOrigin[3]
  510.  
  511. ent = arg[0]
  512. TempOrigin[0] = float(arg[1])
  513. TempOrigin[1] = float(arg[2])
  514. TempOrigin[2] = float(arg[3])
  515.  
  516. hook_ent2(ent, TempOrigin, 500.0)
  517. }
  518.  
  519. public do_hole(oberon)
  520. {
  521. static hole_anim
  522.  
  523. if(g_evolution)
  524. hole_anim = 19
  525. else
  526. hole_anim = 10
  527.  
  528. set_entity_anim(oberon, hole_anim)
  529. emit_sound(oberon, CHAN_BODY, oberon_hole_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  530.  
  531. new ent = create_entity("info_target")
  532.  
  533. static Float:Origin[3]
  534. pev(oberon, pev_origin, Origin)
  535.  
  536. Origin[2] -= 10.0
  537.  
  538. entity_set_origin(ent, Origin)
  539.  
  540. entity_set_string(ent,EV_SZ_classname, "hole_hook")
  541. entity_set_model(ent, oberon_hole_effect)
  542. entity_set_int(ent, EV_INT_solid, SOLID_NOT)
  543. entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
  544.  
  545. new Float:maxs[3] = {1.0,1.0,1.0}
  546. new Float:mins[3] = {-1.0,-1.0,-1.0}
  547. entity_set_size(ent, mins, maxs)
  548.  
  549. entity_set_float(ent, EV_FL_animtime, get_gametime())
  550. entity_set_float(ent, EV_FL_framerate, 1.0)
  551. entity_set_int(ent, EV_INT_sequence, 0)
  552.  
  553. set_pev(ent, pev_rendermode, kRenderTransAdd)
  554. set_pev(ent, pev_renderamt, 255.0)
  555.  
  556. drop_to_floor(ent)
  557.  
  558. for(new i = 0; i < get_maxplayers(); i++)
  559. {
  560. if(is_user_alive(i) && entity_range(oberon, i) <= 1000.0)
  561. {
  562. static arg[2]
  563. arg[0] = oberon
  564. arg[1] = i
  565.  
  566. set_task(0.01, "do_hook_player", 512512, arg, sizeof(arg), "b")
  567. }
  568. }
  569.  
  570. set_task(5.0, "stop_hook", oberon+2012)
  571. }
  572.  
  573. public do_hook_player(arg[2])
  574. {
  575. static Float:Origin[3], Float:Speed
  576. pev(arg[0], pev_origin, Origin)
  577.  
  578. Speed = (1000.0 / entity_range(arg[0], arg[1])) * 75.0
  579.  
  580. hook_ent2(arg[1], Origin, Speed)
  581. }
  582.  
  583. public stop_hook(oberon)
  584. {
  585. oberon -= 2012
  586.  
  587. static ent
  588. ent = find_ent_by_class(-1, "hole_hook")
  589.  
  590. remove_entity(ent)
  591. remove_task(512512)
  592.  
  593. do_takedmg(oberon)
  594. set_task(1.0, "reset_think", oberon)
  595. }
  596.  
  597. public do_attack3(ent)
  598. {
  599. static attack3_anim, attack3_sound
  600.  
  601. if(g_evolution)
  602. {
  603. attack3_anim = 16
  604. attack3_sound = 6
  605. } else {
  606. attack3_anim = 8
  607. attack3_sound = 2
  608. }
  609.  
  610. g_attacking3 = 1
  611.  
  612. set_entity_anim(ent, attack3_anim)
  613.  
  614. emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack3_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
  615. set_task(0.1, "attack3_jump", ent)
  616. }
  617.  
  618. public attack3_jump(ent)
  619. {
  620. set_task(0.01, "hookingup", ent+TASK_HOOKINGUP, _, _, "b")
  621. set_task(1.0, "hookingdown", ent+TASK_HOOKINGDOWN)
  622.  
  623. static Enemy
  624. Enemy = FindClosesEnemy(ent)
  625.  
  626. pev(Enemy, pev_origin, g_attacking3_origin)
  627. }
  628.  
  629. public hookingup(ent)
  630. {
  631. ent -= TASK_HOOKINGUP
  632.  
  633. static Float:Origin[3]
  634. pev(ent, pev_origin, Origin)
  635.  
  636. Origin[2] += 1000.0
  637.  
  638. hook_ent2(ent, Origin, 1000.0)
  639.  
  640. static Enemy
  641. Enemy = FindClosesEnemy(ent)
  642.  
  643. new Float:Ent_Origin[3], Float:Vic_Origin[3]
  644.  
  645. pev(ent, pev_origin, Ent_Origin)
  646. pev(Enemy, pev_origin, Vic_Origin)
  647.  
  648. npc_turntotarget(ent, Ent_Origin, Enemy, Vic_Origin)
  649. }
  650.  
  651. public hookingdown(ent)
  652. {
  653. ent -= TASK_HOOKINGDOWN
  654.  
  655. remove_task(ent+TASK_HOOKINGUP)
  656. set_task(0.5, "set_func1", ent)
  657.  
  658. set_task(0.01, "hookingdown2", ent+TASK_HOOKINGDOWN, _, _, "b")
  659. }
  660.  
  661. public set_func1(ent)
  662. {
  663. set_pev(ent, pev_iuser3, 1)
  664. }
  665.  
  666. public hookingdown2(ent)
  667. {
  668. ent -= TASK_HOOKINGDOWN
  669.  
  670. static Enemy
  671. Enemy = FindClosesEnemy(ent)
  672.  
  673. hook_ent2(ent, g_attacking3_origin, 1000.0)
  674.  
  675. new Float:Ent_Origin[3], Float:Vic_Origin[3]
  676.  
  677. pev(ent, pev_origin, Ent_Origin)
  678. pev(Enemy, pev_origin, Vic_Origin)
  679.  
  680. npc_turntotarget(ent, Ent_Origin, Enemy, Vic_Origin)
  681. }
  682.  
  683. public fw_touch(ent, touch)
  684. {
  685. if(!pev_valid(ent))
  686. return FMRES_IGNORED
  687.  
  688. if(g_attacking3 && pev(ent, pev_iuser3) == 1)
  689. {
  690. remove_task(ent+TASK_HOOKINGDOWN)
  691.  
  692. if(is_user_alive(touch))
  693. user_kill(touch)
  694.  
  695. g_attacking3 = 0
  696. set_pev(ent, pev_iuser3, 0)
  697.  
  698. set_task(0.75, "reset_think", ent)
  699.  
  700. for(new i = 1; i < get_maxplayers(); i++)
  701. {
  702. if(is_user_alive(i) && entity_range(ent, i) <= 300.0)
  703. {
  704. hit_screen(i)
  705.  
  706. static Float:Damage
  707. Damage = random_float(10.0, 25.0)
  708.  
  709. if(g_evolution)
  710. Damage *= 1.5
  711.  
  712. ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
  713. }
  714. }
  715.  
  716. static attack3_sound
  717. if(g_evolution)
  718. attack3_sound = 7
  719. else
  720. attack3_sound = 3
  721.  
  722. emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack3_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
  723.  
  724. drop_to_floor(ent)
  725. }
  726.  
  727. return FMRES_HANDLED
  728. }
  729.  
  730. public do_takedmg(ent2)
  731. {
  732. if(g_evolution)
  733. {
  734. new ent = create_entity("info_target")
  735.  
  736. static Float:Origin[3], Float:Angles[3]
  737. pev(ent2, pev_origin, Origin)
  738. pev(ent2, pev_angles, Angles)
  739.  
  740. entity_set_origin(ent, Origin)
  741. entity_set_vector(ent, EV_VEC_angles, Angles)
  742.  
  743. entity_set_string(ent,EV_SZ_classname, "knife_effect")
  744. entity_set_model(ent, oberon_knife_effect)
  745. entity_set_int(ent, EV_INT_solid, SOLID_NOT)
  746. entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
  747.  
  748. new Float:maxs[3] = {40.0, 40.0, 1.0}
  749. new Float:mins[3] = {-40.0, -40.0, -1.0}
  750. entity_set_size(ent, mins, maxs)
  751.  
  752. drop_to_floor(ent)
  753.  
  754. set_task(1.0, "remove_knife_effect", ent)
  755. }
  756.  
  757. for(new i = 1; i < get_maxplayers(); i++)
  758. {
  759. if(is_user_alive(i) && entity_range(ent2, i) <= 300.0)
  760. {
  761. hit_screen(i)
  762.  
  763. static Float:Damage
  764. Damage = random_float(7.5, 15.0)
  765.  
  766. if(g_evolution)
  767. Damage *= 2.0
  768.  
  769. ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
  770. }
  771. }
  772. }
  773.  
  774. public remove_knife_effect(ent)
  775. {
  776. remove_entity(ent)
  777. }
  778.  
  779. public set_new_idle(ent)
  780. {
  781. g_evoluting = 0
  782. g_evolution = 1
  783. set_entity_anim(ent, 12)
  784.  
  785. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
  786. }
  787.  
  788. public move_entity(ent)
  789. {
  790. static Float:Origin[3]
  791.  
  792. Origin[0] = 4290.0
  793. Origin[1] = 4290.0
  794. Origin[2] = 4290.0
  795.  
  796. set_pev(ent, pev_origin, Origin)
  797. entity_set_float(ent, EV_FL_nextthink, halflife_time() + 99999999.0)
  798. }
  799.  
  800. public fw_takedmg(victim, inflictor, attacker, Float:damage, damagebits)
  801. {
  802. static Float:Origin[3]
  803. fm_get_aimorigin(attacker, Origin)
  804.  
  805. client_print(attacker, print_center, "A Boss Élete: %i", floatround(pev(victim, pev_health) - 1000.0))
  806.  
  807. create_blood(Origin)
  808. }
  809.  
  810. stock set_entity_anim(ent, anim)
  811. {
  812. entity_set_float(ent, EV_FL_animtime, get_gametime())
  813. entity_set_float(ent, EV_FL_framerate, 1.0)
  814. entity_set_int(ent, EV_INT_sequence, anim)
  815. }
  816.  
  817. stock create_blood(const Float:origin[3])
  818. {
  819. // Show some blood <!-- s:) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":)\" title=\"mosoly\" /><!-- s:) -->
  820. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  821. write_byte(TE_BLOODSPRITE)
  822. engfunc(EngFunc_WriteCoord, origin[0])
  823. engfunc(EngFunc_WriteCoord, origin[1])
  824. engfunc(EngFunc_WriteCoord, origin[2])
  825. write_short(m_iBlood[1])
  826. write_short(m_iBlood[0])
  827. write_byte(75)
  828. write_byte(5)
  829. message_end()
  830. }
  831.  
  832. stock fm_get_aimorigin(index, Float:origin[3])
  833. {
  834. new Float:start[3], Float:view_ofs[3];
  835. pev(index, pev_origin, start);
  836. pev(index, pev_view_ofs, view_ofs);
  837. xs_vec_add(start, view_ofs, start);
  838.  
  839. new Float:dest[3];
  840. pev(index, pev_v_angle, dest);
  841. engfunc(EngFunc_MakeVectors, dest);
  842. global_get(glb_v_forward, dest);
  843. xs_vec_mul_scalar(dest, 9999.0, dest);
  844. xs_vec_add(start, dest, dest);
  845.  
  846. engfunc(EngFunc_TraceLine, start, dest, 0, index, 0);
  847. get_tr2(0, TR_vecEndPos, origin);
  848.  
  849. return 1;
  850. }
  851.  
  852. public FindClosesEnemy(entid)
  853. {
  854. new Float:Dist
  855. new Float:maxdistance=4000.0
  856. new indexid=0
  857. for(new i=1;i<=get_maxplayers();i++){
  858. if(is_user_alive(i) && is_valid_ent(i) && can_see_fm(entid, i))
  859. {
  860. Dist = entity_range(entid, i)
  861. if(Dist <= maxdistance)
  862. {
  863. maxdistance=Dist
  864. indexid=i
  865.  
  866. return indexid
  867. }
  868. }
  869. }
  870. return 0
  871. }
  872.  
  873. public npc_turntotarget(ent, Float:Ent_Origin[3], target, Float:Vic_Origin[3])
  874. {
  875. if(target)
  876. {
  877. new Float:newAngle[3]
  878. entity_get_vector(ent, EV_VEC_angles, newAngle)
  879. new Float:x = Vic_Origin[0] - Ent_Origin[0]
  880. new Float:z = Vic_Origin[1] - Ent_Origin[1]
  881.  
  882. new Float:radians = floatatan(z/x, radian)
  883. newAngle[1] = radians * (180 / 3.14)
  884. if (Vic_Origin[0] < Ent_Origin[0])
  885. newAngle[1] -= 180.0
  886.  
  887. entity_set_vector(ent, EV_VEC_angles, newAngle)
  888. }
  889. }
  890.  
  891. public bool:can_see_fm(entindex1, entindex2)
  892. {
  893. if (!entindex1 || !entindex2)
  894. return false
  895.  
  896. if (pev_valid(entindex1) && pev_valid(entindex1))
  897. {
  898. new flags = pev(entindex1, pev_flags)
  899. if (flags & EF_NODRAW || flags & FL_NOTARGET)
  900. {
  901. return false
  902. }
  903.  
  904. new Float:lookerOrig[3]
  905. new Float:targetBaseOrig[3]
  906. new Float:targetOrig[3]
  907. new Float:temp[3]
  908.  
  909. pev(entindex1, pev_origin, lookerOrig)
  910. pev(entindex1, pev_view_ofs, temp)
  911. lookerOrig[0] += temp[0]
  912. lookerOrig[1] += temp[1]
  913. lookerOrig[2] += temp[2]
  914.  
  915. pev(entindex2, pev_origin, targetBaseOrig)
  916. pev(entindex2, pev_view_ofs, temp)
  917. targetOrig[0] = targetBaseOrig [0] + temp[0]
  918. targetOrig[1] = targetBaseOrig [1] + temp[1]
  919. targetOrig[2] = targetBaseOrig [2] + temp[2]
  920.  
  921. engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the had of seen player
  922. if (get_tr2(0, TraceResult:TR_InOpen) && get_tr2(0, TraceResult:TR_InWater))
  923. {
  924. return false
  925. }
  926. else
  927. {
  928. new Float:flFraction
  929. get_tr2(0, TraceResult:TR_flFraction, flFraction)
  930. if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
  931. {
  932. return true
  933. }
  934. else
  935. {
  936. targetOrig[0] = targetBaseOrig [0]
  937. targetOrig[1] = targetBaseOrig [1]
  938. targetOrig[2] = targetBaseOrig [2]
  939. engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the body of seen player
  940. get_tr2(0, TraceResult:TR_flFraction, flFraction)
  941. if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
  942. {
  943. return true
  944. }
  945. else
  946. {
  947. targetOrig[0] = targetBaseOrig [0]
  948. targetOrig[1] = targetBaseOrig [1]
  949. targetOrig[2] = targetBaseOrig [2] - 17.0
  950. engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the legs of seen player
  951. get_tr2(0, TraceResult:TR_flFraction, flFraction)
  952. if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
  953. {
  954. return true
  955. }
  956. }
  957. }
  958. }
  959. }
  960. return false
  961. }
  962.  
  963. public hook_ent(ent, victim, Float:speed)
  964. {
  965. static Float:fl_Velocity[3]
  966. static Float:VicOrigin[3], Float:EntOrigin[3]
  967.  
  968. pev(ent, pev_origin, EntOrigin)
  969. pev(victim, pev_origin, VicOrigin)
  970.  
  971. static Float:distance_f
  972. distance_f = get_distance_f(EntOrigin, VicOrigin)
  973.  
  974. if (distance_f > 60.0)
  975. {
  976. new Float:fl_Time = distance_f / speed
  977.  
  978. fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
  979. fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
  980. fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
  981. } else
  982. {
  983. fl_Velocity[0] = 0.0
  984. fl_Velocity[1] = 0.0
  985. fl_Velocity[2] = 0.0
  986. }
  987.  
  988. entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
  989. }
  990.  
  991. public hook_ent2(ent, Float:VicOrigin[3], Float:speed)
  992. {
  993. static Float:fl_Velocity[3]
  994. static Float:EntOrigin[3]
  995.  
  996. pev(ent, pev_origin, EntOrigin)
  997.  
  998. static Float:distance_f
  999. distance_f = get_distance_f(EntOrigin, VicOrigin)
  1000.  
  1001. if (distance_f > 60.0)
  1002. {
  1003. new Float:fl_Time = distance_f / speed
  1004.  
  1005. fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
  1006. fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
  1007. fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
  1008. } else
  1009. {
  1010. fl_Velocity[0] = 0.0
  1011. fl_Velocity[1] = 0.0
  1012. fl_Velocity[2] = 0.0
  1013. }
  1014.  
  1015. entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
  1016. }
  1017.  
  1018. public hit_screen(id)
  1019. {
  1020. message_begin(MSG_ONE, get_user_msgid("ScreenShake"),{0,0,0}, id)
  1021. write_short(1<<14)
  1022. write_short(1<<13)
  1023. write_short(1<<13)
  1024. message_end()
  1025. }
  1026.  
  1027. public reset_think(ent)
  1028. {
  1029. g_doing_other = 0
  1030. entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
  1031. }
  1032. stock print_color(const id, const input[], any:...)
  1033. {
  1034. new count = 1, players[32]
  1035. static msg[191]
  1036. vformat(msg, 190, input, 3)
  1037.  
  1038. replace_all(msg, 190, "!g", "^4")
  1039. replace_all(msg, 190, "!y", "^1")
  1040. replace_all(msg, 190, "!t", "^3")
  1041. replace_all(msg, 190, "á", "á")
  1042. replace_all(msg, 190, "é", "Ă©")
  1043. replace_all(msg, 190, "í", "Ă­")
  1044. replace_all(msg, 190, "ó", "Ăł")
  1045. replace_all(msg, 190, "ö", "ö")
  1046. replace_all(msg, 190, "ő", "Ĺ‘")
  1047. replace_all(msg, 190, "ú", "Ăş")
  1048. replace_all(msg, 190, "ü", "ĂĽ")
  1049. replace_all(msg, 190, "ű", "ű")
  1050. replace_all(msg, 190, "Á", "Á")
  1051. replace_all(msg, 190, "É", "É")
  1052. replace_all(msg, 190, "Í", "ĂŤ")
  1053. replace_all(msg, 190, "Ó", "Ă“")
  1054. replace_all(msg, 190, "Ö", "Ă–")
  1055. replace_all(msg, 190, "Ő", "Ő")
  1056. replace_all(msg, 190, "Ú", "Ăš")
  1057. replace_all(msg, 190, "Ü", "Ăś")
  1058. replace_all(msg, 190, "Ű", "Ĺ°")
  1059.  
  1060. if (id) players[0] = id; else get_players(players, count, "ch")
  1061. {
  1062. for (new i = 0; i < count; i++)
  1063. {
  1064. if (is_user_connected(players[i]))
  1065. {
  1066. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  1067. write_byte(players[i])
  1068. write_string(msg)
  1069. message_end()
  1070. }
  1071. }
  1072. }
  1073. return PLUGIN_HANDLED
  1074. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 1 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 18 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole