Oberon Boss
- #include <amxmodx>
- #include <engine>
- #include <fakemeta>
- #include <hamsandwich>
- #include <xs>
- #define OBERON_CLASSNAME "oberon"
- #define OBERON_HEALTH 40000.0
- #define TASK_SKILL 123123123
- #define TASK_HOOKINGUP 123312312
- #define TASK_HOOKINGDOWN 123312313
- new const oberon_model[] = "models/boss/zbs_bossl_big02.mdl"
- new const oberon_knife_effect[] = "models/boss/ef_knife.mdl"
- new const oberon_hole_effect[] = "models/boss/ef_hole.mdl"
- new const oberon_bomb_model[] = "models/boss/zbs_bossl_big02_bomb.mdl"
- new const oberon_appear_sound[] = "misc/boss/appear.wav"
- new const oberon_death_sound[] = "misc/boss/death.wav"
- new const oberon_evolution_sound[] = "misc/boss/knife.wav"
- new const oberon_attack_sound[8][] =
- {
- "misc/boss/attack1.wav",
- "misc/boss/attack2.wav",
- "misc/boss/attack3_jump.wav",
- "misc/boss/attack3.wav",
- "misc/boss/knife_attack1.wav",
- "misc/boss/knife_attack2.wav",
- "misc/boss/knife_attack3_jump.wav",
- "misc/boss/knife_attack3.wav"
- }
- new const oberon_hole_sound[] = "oberon/hole.wav"
- new const oberon_bomb_sound[] = "oberon/attack_bomb.wav"
- new oberon_model_id, g_reg, m_iBlood[2], exp_spr_id
- new Float:g_cur_origin[3], Float:g_cur_angles[3], Float:g_cur_v_angle[3]
- new g_evolution, g_evoluting, g_doing_other, g_attacking3, Float:g_attacking3_origin[3]
- public plugin_init()
- {
- register_plugin("Oberon Boss", "1.0", "Dias & ModsCs")
- register_event("HLTV", "event_newround", "a", "1=0", "2=0")
- register_touch(OBERON_CLASSNAME, "*", "fw_touch")
- register_clcmd("say /zapiszmiejsce", "get_origin", ADMIN_LEVEL_H)
- register_clcmd("say /stworzbossa", "create_oberon", ADMIN_LEVEL_H)
- }
- public plugin_precache()
- {
- oberon_model_id = precache_model(oberon_model)
- precache_model(oberon_knife_effect)
- precache_model(oberon_hole_effect)
- precache_model(oberon_bomb_model)
- precache_sound(oberon_appear_sound)
- precache_sound(oberon_death_sound)
- precache_sound(oberon_evolution_sound)
- for(new i = 0; i < sizeof(oberon_attack_sound); i++)
- {
- precache_sound(oberon_attack_sound[i])
- }
- precache_sound(oberon_hole_sound)
- precache_sound(oberon_bomb_sound)
- m_iBlood[0] = precache_model("sprites/blood.spr")
- m_iBlood[1] = precache_model("sprites/bloodspray.spr")
- exp_spr_id = precache_model("sprites/zerogxplode.spr")
- }
- public event_newround()
- {
- static ent
- ent = find_ent_by_class(-1, OBERON_CLASSNAME)
- if(task_exists(ent+TASK_SKILL)) remove_task(ent+TASK_SKILL)
- }
- public get_origin(id)
- {
- pev(id, pev_origin, g_cur_origin)
- pev(id, pev_angles, g_cur_angles)
- pev(id, pev_v_angle, g_cur_v_angle)
- client_print(id, print_chat, "[Oberon Boss] Zapisano miejsce stworzenia")
- }
- public create_oberon(id)
- {
- new ent = create_entity("info_target")
- entity_set_origin(ent, g_cur_origin)
- entity_set_vector(ent, EV_VEC_angles, g_cur_angles)
- //entity_set_vector(ent, EV_VEC_v_angle, g_cur_v_angle)
- entity_set_float(ent, EV_FL_takedamage, 1.0)
- entity_set_float(ent, EV_FL_health, OBERON_HEALTH + 1000.0)
- entity_set_string(ent,EV_SZ_classname, OBERON_CLASSNAME)
- entity_set_model(ent, oberon_model)
- entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_STEP)
- new Float:maxs[3] = {100.0, 100.0, 100.0}
- new Float:mins[3] = {-100.0, -100.0, -30.0}
- entity_set_size(ent, mins, maxs)
- entity_set_int(ent, EV_INT_modelindex, oberon_model_id)
- set_entity_anim(ent, 1)
- set_pev(ent, pev_iuser4, 0)
- entity_set_float(ent, EV_FL_nextthink, halflife_time() + 6.0)
- set_task(5.0, "start_oberon", ent)
- set_task(15.0, "do_random_skill", ent, _, _, "b")
- if(!g_reg)
- {
- RegisterHamFromEntity(Ham_TakeDamage, ent, "fw_takedmg", 1)
- RegisterHamFromEntity(Ham_Think, ent, "fw_think")
- g_reg = 1
- }
- g_evolution = 0
- g_evoluting = 0
- g_doing_other = 0
- drop_to_floor(ent)
- emit_sound(ent, CHAN_BODY, oberon_appear_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public start_oberon(ent)
- {
- set_entity_anim(ent, 2)
- }
- public fw_think(ent)
- {
- if(!is_valid_ent(ent))
- return HAM_IGNORED
- if(pev(ent, pev_iuser4) == 1) // Oberon nie zyje
- return HAM_IGNORED
- if(g_evoluting || g_doing_other)
- return HAM_IGNORED
- if(pev(ent, pev_health) - 1000.0 <= 0.0)
- {
- set_pev(ent, pev_iuser4, 1)
- set_entity_anim(ent, 20)
- set_task(15.0, "move_entity", ent)
- entity_set_int(ent, EV_INT_solid, SOLID_NOT)
- entity_set_float(ent, EV_FL_takedamage, 0.0)
- emit_sound(ent, CHAN_BODY, oberon_death_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
- return HAM_IGNORED
- }
- if((pev(ent, pev_health) - 1000.0 <= OBERON_HEALTH / 2.0) && !g_evolution)
- {
- g_evoluting = 1
- set_entity_anim(ent, 11)
- emit_sound(ent, CHAN_BODY, oberon_evolution_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(8.0, "set_new_idle", ent)
- return HAM_IGNORED
- }
- static victim
- static Float:Origin[3], Float:VicOrigin[3], Float:distance
- victim = FindClosesEnemy(ent)
- pev(ent, pev_origin, Origin)
- pev(victim, pev_origin, VicOrigin)
- distance = get_distance_f(Origin, VicOrigin)
- if(is_user_alive(victim))
- {
- if(distance <= 250.0)
- {
- if(!is_valid_ent(ent))
- return FMRES_IGNORED
- new Float:Ent_Origin[3], Float:Vic_Origin[3]
- pev(ent, pev_origin, Ent_Origin)
- pev(victim, pev_origin, Vic_Origin)
- npc_turntotarget(ent, Ent_Origin, victim, Vic_Origin)
- static Attack_Type, attack_anim, attack_sound
- Attack_Type = random_num(1, 2)
- if(Attack_Type == 1)
- {
- if(g_evolution)
- {
- attack_anim = 14
- attack_sound = 4
- } else {
- attack_anim = 6
- attack_sound = 0
- }
- set_entity_anim(ent, attack_anim)
- emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(1.0, "do_takedmg", ent)
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 3.0)
- } else {
- if(g_evolution)
- {
- attack_anim = 15
- attack_sound = 5
- } else {
- attack_anim = 7
- attack_sound = 1
- }
- set_entity_anim(ent, attack_anim)
- emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(0.5, "do_takedmg", ent)
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 3.0)
- }
- }
- else
- {
- static moving_anim
- if(g_evolution)
- moving_anim = 13
- else
- moving_anim = 3
- if(pev(ent, pev_sequence) != moving_anim)
- {
- entity_set_float(ent, EV_FL_animtime, get_gametime())
- entity_set_float(ent, EV_FL_framerate, 1.0)
- entity_set_int(ent, EV_INT_sequence, moving_anim)
- }
- new Float:Ent_Origin[3], Float:Vic_Origin[3]
- pev(ent, pev_origin, Ent_Origin)
- pev(victim, pev_origin, Vic_Origin)
- npc_turntotarget(ent, Ent_Origin, victim, Vic_Origin)
- hook_ent(ent, victim, 100.0)
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
- }
- }
- else
- {
- static idle_anim
- if(g_evolution)
- idle_anim = 12
- else
- idle_anim = 2
- if(pev(ent, pev_sequence) != idle_anim)
- {
- set_entity_anim(ent, idle_anim)
- }
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0)
- }
- return HAM_HANDLED
- }
- public do_random_skill(ent)
- {
- if(!pev_valid(ent))
- return PLUGIN_HANDLED
- if(g_evoluting)
- return PLUGIN_HANDLED
- if(pev(ent, pev_health) - 1000.0 <= 0.0)
- return PLUGIN_HANDLED
- static random_skill
- random_skill = random_num(0, 100)
- g_doing_other = 1
- switch(random_skill)
- {
- case 0..37:
- {
- do_attack3(ent)
- }
- case 38..72:
- {
- do_hole(ent)
- }
- case 73..100:
- {
- do_bomb(ent)
- }
- }
- return PLUGIN_CONTINUE
- }
- public do_bomb(oberon)
- {
- g_doing_other = 1
- static bomb_anim
- if(g_evolution)
- bomb_anim = 18
- else
- bomb_anim = 9
- set_entity_anim(oberon, bomb_anim)
- set_task(3.0, "do_skill_bomb", oberon+2015, _, _, "b")
- set_task(10.0, "stop_skill_bomb", oberon)
- }
- public stop_skill_bomb(oberon)
- {
- remove_task(oberon+2015)
- static idle_anim
- if(g_evolution)
- idle_anim = 12
- else
- idle_anim = 2
- set_entity_anim(oberon, idle_anim)
- set_task(2.0, "reset_think", oberon)
- }
- public do_skill_bomb(oberon)
- {
- oberon -= 2015
- static Float:StartOrigin[3], Float:TempOrigin[6][3], Float:VicOrigin[6][3], Float:Random1
- pev(oberon, pev_origin, StartOrigin)
- emit_sound(oberon, CHAN_BODY, oberon_bomb_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
- // Pierwsza Bomba
- Random1 = random_float(100.0, 500.0)
- VicOrigin[0][0] = StartOrigin[0] + Random1
- VicOrigin[0][1] = StartOrigin[1]
- VicOrigin[0][2] = StartOrigin[2]
- TempOrigin[0][0] = VicOrigin[0][0] - (Random1 / 2.0)
- TempOrigin[0][1] = VicOrigin[0][1]
- TempOrigin[0][2] = VicOrigin[0][2] + 500.0
- // Druga Bomba
- Random1 = random_float(100.0, 500.0)
- VicOrigin[1][0] = StartOrigin[0]
- VicOrigin[1][1] = StartOrigin[1] + Random1
- VicOrigin[1][2] = StartOrigin[2]
- TempOrigin[1][0] = VicOrigin[1][0]
- TempOrigin[1][1] = VicOrigin[1][1] - (Random1 / 2.0)
- TempOrigin[1][2] = VicOrigin[1][2] + 500.0
- // Trzecia Bomba
- Random1 = random_float(100.0, 500.0)
- VicOrigin[2][0] = StartOrigin[0] - Random1
- VicOrigin[2][1] = StartOrigin[1]
- VicOrigin[2][2] = StartOrigin[2]
- TempOrigin[2][0] = VicOrigin[2][0] - (Random1 / 2.0)
- TempOrigin[2][1] = VicOrigin[2][1]
- TempOrigin[2][2] = VicOrigin[2][2] + 500.0
- // Czwarta Bomba
- VicOrigin[3][0] = StartOrigin[0]
- VicOrigin[3][1] = StartOrigin[1] - Random1
- VicOrigin[3][2] = StartOrigin[2]
- TempOrigin[3][0] = VicOrigin[3][0]
- TempOrigin[3][1] = VicOrigin[3][1] - (Random1 / 2.0)
- TempOrigin[3][2] = VicOrigin[3][2] + 500.0
- // Piata Bomba
- VicOrigin[4][0] = StartOrigin[0] + Random1
- VicOrigin[4][1] = StartOrigin[1] + Random1
- VicOrigin[4][2] = StartOrigin[2]
- TempOrigin[4][0] = VicOrigin[4][0] - (Random1 / 2.0)
- TempOrigin[4][1] = VicOrigin[4][1] - (Random1 / 2.0)
- TempOrigin[4][2] = VicOrigin[4][2] + 500.0
- // Szusta Bomba
- VicOrigin[5][0] = StartOrigin[0] + Random1
- VicOrigin[5][1] = StartOrigin[1] - Random1
- VicOrigin[5][2] = StartOrigin[2]
- TempOrigin[5][0] = VicOrigin[5][0] + (Random1 / 2.0)
- TempOrigin[5][1] = VicOrigin[5][1] - (Random1 / 2.0)
- TempOrigin[5][2] = VicOrigin[5][2] + 500.0
- for(new i = 0; i < 6; i++)
- {
- make_bomb(StartOrigin, TempOrigin[i], VicOrigin[i])
- }
- }
- public make_bomb(Float:StartOrigin[3], Float:TempOrigin[3], Float:VicOrigin[3])
- {
- new ent = create_entity("info_target")
- StartOrigin[2] += 20.0
- entity_set_origin(ent, StartOrigin)
- entity_set_string(ent,EV_SZ_classname, "oberon_bomb")
- entity_set_model(ent, oberon_bomb_model)
- entity_set_int(ent, EV_INT_solid, SOLID_NOT)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_BOUNCE)
- new Float:maxs[3] = {10.0,10.0,10.0}
- new Float:mins[3] = {-10.0,-10.0,-5.0}
- entity_set_size(ent, mins, maxs)
- entity_set_float(ent, EV_FL_animtime, get_gametime())
- entity_set_float(ent, EV_FL_framerate, 1.0)
- entity_set_int(ent, EV_INT_sequence, 0)
- static arg[4], arg2[4]
- arg[0] = ent
- arg[1] = floatround(TempOrigin[0])
- arg[2] = floatround(TempOrigin[1])
- arg[3] = floatround(TempOrigin[2])
- arg2[0] = ent
- arg2[1] = floatround(VicOrigin[0])
- arg2[2] = floatround(VicOrigin[1])
- arg2[3] = floatround(VicOrigin[2])
- set_task(0.01, "do_hook_bomb_up", TASK_HOOKINGUP, arg, sizeof(arg), "b")
- set_task(1.0, "do_hook_bomb_down", _, arg2, sizeof(arg2))
- set_task(2.0, "bomb_explode", ent)
- }
- public bomb_explode(ent)
- {
- remove_task(TASK_HOOKINGUP)
- remove_task(TASK_HOOKINGDOWN)
- static Float:Origin[3]
- pev(ent, pev_origin, Origin)
- message_begin(MSG_BROADCAST ,SVC_TEMPENTITY)
- write_byte(TE_EXPLOSION)
- engfunc(EngFunc_WriteCoord, Origin[0])
- engfunc(EngFunc_WriteCoord, Origin[1])
- engfunc(EngFunc_WriteCoord, Origin[2])
- write_short(exp_spr_id) // sprite index
- write_byte(20) // scale in 0.1's
- write_byte(30) // framerate
- write_byte(0) // flags
- message_end()
- for(new i = 1; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(i, ent) <= 300.0)
- {
- static Float:Damage
- Damage = random_float(10.0, 30.0)
- if(g_evolution)
- Damage *= 2.0
- ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
- hit_screen(i)
- }
- }
- remove_entity(ent)
- }
- public do_hook_bomb_down(arg[4])
- {
- remove_task(TASK_HOOKINGUP)
- set_task(0.01, "do_hook_bomb_down2", TASK_HOOKINGDOWN, arg, sizeof(arg), "b")
- }
- public do_hook_bomb_down2(arg[4])
- {
- static ent, Float:VicOrigin[3]
- ent = arg[0]
- VicOrigin[0] = float(arg[1])
- VicOrigin[1] = float(arg[2])
- VicOrigin[2] = float(arg[3])
- hook_ent2(ent, VicOrigin, 500.0)
- }
- public do_hook_bomb_up(arg[4])
- {
- static ent, Float:TempOrigin[3]
- ent = arg[0]
- TempOrigin[0] = float(arg[1])
- TempOrigin[1] = float(arg[2])
- TempOrigin[2] = float(arg[3])
- hook_ent2(ent, TempOrigin, 500.0)
- }
- public do_hole(oberon)
- {
- static hole_anim
- if(g_evolution)
- hole_anim = 19
- else
- hole_anim = 10
- set_entity_anim(oberon, hole_anim)
- emit_sound(oberon, CHAN_BODY, oberon_hole_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
- new ent = create_entity("info_target")
- static Float:Origin[3]
- pev(oberon, pev_origin, Origin)
- Origin[2] -= 10.0
- entity_set_origin(ent, Origin)
- entity_set_string(ent,EV_SZ_classname, "hole_hook")
- entity_set_model(ent, oberon_hole_effect)
- entity_set_int(ent, EV_INT_solid, SOLID_NOT)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
- new Float:maxs[3] = {1.0,1.0,1.0}
- new Float:mins[3] = {-1.0,-1.0,-1.0}
- entity_set_size(ent, mins, maxs)
- entity_set_float(ent, EV_FL_animtime, get_gametime())
- entity_set_float(ent, EV_FL_framerate, 1.0)
- entity_set_int(ent, EV_INT_sequence, 0)
- set_pev(ent, pev_rendermode, kRenderTransAdd)
- set_pev(ent, pev_renderamt, 255.0)
- drop_to_floor(ent)
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(oberon, i) <= 1000.0)
- {
- static arg[2]
- arg[0] = oberon
- arg[1] = i
- set_task(0.01, "do_hook_player", 512512, arg, sizeof(arg), "b")
- }
- }
- set_task(5.0, "stop_hook", oberon+2012)
- }
- public do_hook_player(arg[2])
- {
- static Float:Origin[3], Float:Speed
- pev(arg[0], pev_origin, Origin)
- Speed = (1000.0 / entity_range(arg[0], arg[1])) * 75.0
- hook_ent2(arg[1], Origin, Speed)
- }
- public stop_hook(oberon)
- {
- oberon -= 2012
- static ent
- ent = find_ent_by_class(-1, "hole_hook")
- remove_entity(ent)
- remove_task(512512)
- do_takedmg(oberon)
- set_task(1.0, "reset_think", oberon)
- }
- public do_attack3(ent)
- {
- static attack3_anim, attack3_sound
- if(g_evolution)
- {
- attack3_anim = 16
- attack3_sound = 6
- } else {
- attack3_anim = 8
- attack3_sound = 2
- }
- g_attacking3 = 1
- set_entity_anim(ent, attack3_anim)
- emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack3_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(0.1, "attack3_jump", ent)
- }
- public attack3_jump(ent)
- {
- set_task(0.01, "hookingup", ent+TASK_HOOKINGUP, _, _, "b")
- set_task(1.0, "hookingdown", ent+TASK_HOOKINGDOWN)
- static Enemy
- Enemy = FindClosesEnemy(ent)
- pev(Enemy, pev_origin, g_attacking3_origin)
- }
- public hookingup(ent)
- {
- ent -= TASK_HOOKINGUP
- static Float:Origin[3]
- pev(ent, pev_origin, Origin)
- Origin[2] += 1000.0
- hook_ent2(ent, Origin, 1000.0)
- static Enemy
- Enemy = FindClosesEnemy(ent)
- new Float:Ent_Origin[3], Float:Vic_Origin[3]
- pev(ent, pev_origin, Ent_Origin)
- pev(Enemy, pev_origin, Vic_Origin)
- npc_turntotarget(ent, Ent_Origin, Enemy, Vic_Origin)
- }
- public hookingdown(ent)
- {
- ent -= TASK_HOOKINGDOWN
- remove_task(ent+TASK_HOOKINGUP)
- set_task(0.5, "set_func1", ent)
- set_task(0.01, "hookingdown2", ent+TASK_HOOKINGDOWN, _, _, "b")
- }
- public set_func1(ent)
- {
- set_pev(ent, pev_iuser3, 1)
- }
- public hookingdown2(ent)
- {
- ent -= TASK_HOOKINGDOWN
- static Enemy
- Enemy = FindClosesEnemy(ent)
- hook_ent2(ent, g_attacking3_origin, 1000.0)
- new Float:Ent_Origin[3], Float:Vic_Origin[3]
- pev(ent, pev_origin, Ent_Origin)
- pev(Enemy, pev_origin, Vic_Origin)
- npc_turntotarget(ent, Ent_Origin, Enemy, Vic_Origin)
- }
- public fw_touch(ent, touch)
- {
- if(!pev_valid(ent))
- return FMRES_IGNORED
- if(g_attacking3 && pev(ent, pev_iuser3) == 1)
- {
- remove_task(ent+TASK_HOOKINGDOWN)
- if(is_user_alive(touch))
- user_kill(touch)
- g_attacking3 = 0
- set_pev(ent, pev_iuser3, 0)
- set_task(0.75, "reset_think", ent)
- for(new i = 1; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 300.0)
- {
- hit_screen(i)
- static Float:Damage
- Damage = random_float(10.0, 25.0)
- if(g_evolution)
- Damage *= 1.5
- ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
- }
- }
- static attack3_sound
- if(g_evolution)
- attack3_sound = 7
- else
- attack3_sound = 3
- emit_sound(ent, CHAN_BODY, oberon_attack_sound[attack3_sound], 1.0, ATTN_NORM, 0, PITCH_NORM)
- drop_to_floor(ent)
- }
- return FMRES_HANDLED
- }
- public do_takedmg(ent2)
- {
- if(g_evolution)
- {
- new ent = create_entity("info_target")
- static Float:Origin[3], Float:Angles[3]
- pev(ent2, pev_origin, Origin)
- pev(ent2, pev_angles, Angles)
- entity_set_origin(ent, Origin)
- entity_set_vector(ent, EV_VEC_angles, Angles)
- entity_set_string(ent,EV_SZ_classname, "knife_effect")
- entity_set_model(ent, oberon_knife_effect)
- entity_set_int(ent, EV_INT_solid, SOLID_NOT)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
- new Float:maxs[3] = {40.0, 40.0, 1.0}
- new Float:mins[3] = {-40.0, -40.0, -1.0}
- entity_set_size(ent, mins, maxs)
- drop_to_floor(ent)
- set_task(1.0, "remove_knife_effect", ent)
- }
- for(new i = 1; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent2, i) <= 300.0)
- {
- hit_screen(i)
- static Float:Damage
- Damage = random_float(7.5, 15.0)
- if(g_evolution)
- Damage *= 2.0
- ExecuteHam(Ham_TakeDamage, i, 0, i, Damage, DMG_BLAST)
- }
- }
- }
- public remove_knife_effect(ent)
- {
- remove_entity(ent)
- }
- public set_new_idle(ent)
- {
- g_evoluting = 0
- g_evolution = 1
- set_entity_anim(ent, 12)
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
- }
- public move_entity(ent)
- {
- static Float:Origin[3]
- Origin[0] = 4290.0
- Origin[1] = 4290.0
- Origin[2] = 4290.0
- set_pev(ent, pev_origin, Origin)
- entity_set_float(ent, EV_FL_nextthink, halflife_time() + 99999999.0)
- }
- public fw_takedmg(victim, inflictor, attacker, Float:damage, damagebits)
- {
- static Float:Origin[3]
- fm_get_aimorigin(attacker, Origin)
- client_print(attacker, print_center, "Zycie Oberona: %i", floatround(pev(victim, pev_health) - 1000.0))
- create_blood(Origin)
- }
- stock set_entity_anim(ent, anim)
- {
- entity_set_float(ent, EV_FL_animtime, get_gametime())
- entity_set_float(ent, EV_FL_framerate, 1.0)
- entity_set_int(ent, EV_INT_sequence, anim)
- }
- stock create_blood(const Float:origin[3])
- {
- // Show some blood :)
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BLOODSPRITE)
- engfunc(EngFunc_WriteCoord, origin[0])
- engfunc(EngFunc_WriteCoord, origin[1])
- engfunc(EngFunc_WriteCoord, origin[2])
- write_short(m_iBlood[1])
- write_short(m_iBlood[0])
- write_byte(75)
- write_byte(5)
- message_end()
- }
- stock fm_get_aimorigin(index, Float:origin[3])
- {
- new Float:start[3], Float:view_ofs[3];
- pev(index, pev_origin, start);
- pev(index, pev_view_ofs, view_ofs);
- xs_vec_add(start, view_ofs, start);
- new Float:dest[3];
- pev(index, pev_v_angle, dest);
- engfunc(EngFunc_MakeVectors, dest);
- global_get(glb_v_forward, dest);
- xs_vec_mul_scalar(dest, 9999.0, dest);
- xs_vec_add(start, dest, dest);
- engfunc(EngFunc_TraceLine, start, dest, 0, index, 0);
- get_tr2(0, TR_vecEndPos, origin);
- return 1;
- }
- public FindClosesEnemy(entid)
- {
- new Float:Dist
- new Float:maxdistance=4000.0
- new indexid=0
- for(new i=1;i<=get_maxplayers();i++){
- if(is_user_alive(i) && is_valid_ent(i) && can_see_fm(entid, i))
- {
- Dist = entity_range(entid, i)
- if(Dist <= maxdistance)
- {
- maxdistance=Dist
- indexid=i
- return indexid
- }
- }
- }
- return 0
- }
- public npc_turntotarget(ent, Float:Ent_Origin[3], target, Float:Vic_Origin[3])
- {
- if(target)
- {
- new Float:newAngle[3]
- entity_get_vector(ent, EV_VEC_angles, newAngle)
- new Float:x = Vic_Origin[0] - Ent_Origin[0]
- new Float:z = Vic_Origin[1] - Ent_Origin[1]
- new Float:radians = floatatan(z/x, radian)
- newAngle[1] = radians * (180 / 3.14)
- if (Vic_Origin[0] < Ent_Origin[0])
- newAngle[1] -= 180.0
- entity_set_vector(ent, EV_VEC_angles, newAngle)
- }
- }
- public bool:can_see_fm(entindex1, entindex2)
- {
- if (!entindex1 || !entindex2)
- return false
- if (pev_valid(entindex1) && pev_valid(entindex1))
- {
- new flags = pev(entindex1, pev_flags)
- if (flags & EF_NODRAW || flags & FL_NOTARGET)
- {
- return false
- }
- new Float:lookerOrig[3]
- new Float:targetBaseOrig[3]
- new Float:targetOrig[3]
- new Float:temp[3]
- pev(entindex1, pev_origin, lookerOrig)
- pev(entindex1, pev_view_ofs, temp)
- lookerOrig[0] += temp[0]
- lookerOrig[1] += temp[1]
- lookerOrig[2] += temp[2]
- pev(entindex2, pev_origin, targetBaseOrig)
- pev(entindex2, pev_view_ofs, temp)
- targetOrig[0] = targetBaseOrig [0] + temp[0]
- targetOrig[1] = targetBaseOrig [1] + temp[1]
- targetOrig[2] = targetBaseOrig [2] + temp[2]
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the had of seen player
- if (get_tr2(0, TraceResult:TR_InOpen) && get_tr2(0, TraceResult:TR_InWater))
- {
- return false
- }
- else
- {
- new Float:flFraction
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- else
- {
- targetOrig[0] = targetBaseOrig [0]
- targetOrig[1] = targetBaseOrig [1]
- targetOrig[2] = targetBaseOrig [2]
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the body of seen player
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- else
- {
- targetOrig[0] = targetBaseOrig [0]
- targetOrig[1] = targetBaseOrig [1]
- targetOrig[2] = targetBaseOrig [2] - 17.0
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the legs of seen player
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- }
- }
- }
- }
- return false
- }
- public hook_ent(ent, victim, Float:speed)
- {
- static Float:fl_Velocity[3]
- static Float:VicOrigin[3], Float:EntOrigin[3]
- pev(ent, pev_origin, EntOrigin)
- pev(victim, pev_origin, VicOrigin)
- static Float:distance_f
- distance_f = get_distance_f(EntOrigin, VicOrigin)
- if (distance_f > 60.0)
- {
- new Float:fl_Time = distance_f / speed
- fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
- fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
- fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
- } else
- {
- fl_Velocity[0] = 0.0
- fl_Velocity[1] = 0.0
- fl_Velocity[2] = 0.0
- }
- entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
- }
- public hook_ent2(ent, Float:VicOrigin[3], Float:speed)
- {
- static Float:fl_Velocity[3]
- static Float:EntOrigin[3]
- pev(ent, pev_origin, EntOrigin)
- static Float:distance_f
- distance_f = get_distance_f(EntOrigin, VicOrigin)
- if (distance_f > 60.0)
- {
- new Float:fl_Time = distance_f / speed
- fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
- fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
- fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
- } else
- {
- fl_Velocity[0] = 0.0
- fl_Velocity[1] = 0.0
- fl_Velocity[2] = 0.0
- }
- entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
- }
- public hit_screen(id)
- {
- message_begin(MSG_ONE, get_user_msgid("ScreenShake"),{0,0,0}, id)
- write_short(1<<14)
- write_short(1<<13)
- write_short(1<<13)
- message_end()
- }
- public reset_think(ent)
- {
- g_doing_other = 0
- entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.1)
- }
Teddy Boss
- /* Boss CSO By Itachi Uchiha-
- My Canal Youtube https://www.youtube.com/channel/UCar-rq1Dvuvha9Id2ypP7tg
- My Facebook Contact https://www.facebook.com/ItachiUchihapro
- My Pag Facebook https://www.facebook.com/TutorialesItachi/
- Wep Forro http://itachiuchiha-mods.esy.es/
- Boss All https://daniel3536.jimdo.com/news-boss-for-cs-1-6-2017/
- */
- #include <amxmodx>
- #include <engine>
- #include <fakemeta_+>
- #include <hamsandwich>
- #define PLUGIN "CSO Boss Teddy Bear Final"
- #define VERSION "4.0"
- #define AUTHOR "Itachi Uchiha- Mods Scripter"
- //Configs Boss
- #define CLASS_NAME_BOSS "Boss_Teddy_CSO"
- #define HEALTH_BOSS 500.0
- #define SPEED_TEDDY 150.0
- //Damage Attack
- #define DAMAGE_ATTACK 50.0
- #define DAMAGE_TENTACLE 100.0
- #define DAMAGE_TENTACLE_TOUCH 20.0
- #define DAMAGE_HOLE1 1000.0
- #define DAMAGE_HALLOWEEN 50.0
- #define DAMAGE_FINAL 1000.0 //Touch Boss
- //Remove Task Anti Bug
- #define HP_SPRITE 1
- #define ATTACK_TASK 2
- #define CORRER_TEDDY 3
- #define TENTACLE_TEDDY 4
- #define HOLE_TEDDY 5
- #define HOLE1_TEDDY 6
- #define METEOR_TEDDY 7
- //Resources..
- #define ice_model "models/Teddy_CSO/dd_iceblock.mdl"
- #define frozer "Teddy_CSO/congelacion.wav"//"Teddy_CSO/impalehit.wav"
- enum
- {
- ANIM_DUMMY = 0,
- SCENE_APPEAR,
- ZBS_IDLE1,
- ZBS_WALK,
- ZBS_RUN,
- ZBS_ATTACK1,
- ZBS_ATTACK2,
- ZBS_ATTACK_SLIDING,
- ZBS_ATTACK_CANDY,
- ZBS_ATTACK_HOLE,
- ZBS_ATTACK_HOLE2,
- ZBS_ATTACK_METEOR,
- SCENE_CHANGE,
- TEDDY_DEATH
- }
- new const news[][] =
- {
- "sprites/Teddy_CSO/shockwave.spr"
- }
- static g_news[sizeof news]
- enum {
- shockwave
- }
- new const Boss_Model_CSO[] = "models/Teddy_CSO/Teddy_CSO.mdl"
- new const Boss_Tentacle_CSO[] = "models/Teddy_CSO/Dulce.mdl"
- new const Boss_Hole_Effect[] = "models/Teddy_CSO/ef_hole.mdl"
- new const Boss_Halloween[] = "models/Teddy_CSO/halloween.mdl"
- new const Boss_Halloween2[] = "sprites/Teddy_CSO/blue.spr"
- new const Hp_Sprite_Boss[] = "sprites/Teddy_CSO/hp.spr"
- new const Sound_Boss_CSO[20][] =
- {
- "Teddy_CSO/zbs_attack2.wav",
- "Teddy_CSO/death.wav",
- "Teddy_CSO/footstep1.wav",
- "Teddy_CSO/footstep2.wav",
- "Teddy_CSO/zbs_fail.wav",
- "Teddy_CSO/zbs_clear.wav",
- "Teddy_CSO/candy_attack.wav",
- "Teddy_CSO/scene_appear1.wav",
- "Teddy_CSO/zbs_attack1.wav",
- "Teddy_CSO/zbs_attack_sliding.wav",
- "Teddy_CSO/zbs_attack_hole.wav",
- "Teddy_CSO/zbs_attack_candy.wav",
- "Teddy_CSO/scene_change.wav",
- "Teddy_CSO/zbs_attack_hole2_1.wav",
- "Teddy_CSO/zbs_attack_meteor.wav",
- "Teddy_CSO/zbs_attack_meteor_exp.wav",
- "Teddy_CSO/zbs_attack_hole2_2.wav",
- "Teddy_CSO/footstep3.wav",
- "Teddy_CSO/gift_explode.wav",
- "Teddy_CSO/footstep4.wav"
- }
- new Boss_Model_Linux, Damage_Off, Start_Boss_CSO, Damage_Touch, y_hpbar, y_think, y_bleeding[2], bool:g_bCongelado[33],
- iceent[33], g_msgScreenFade, g_exploSpr, g_explosfr, frostgib, y_npc_hp
- new Float:VAngles[3], Float:Origin[3], Float:Attack_Time
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("HLTV", "event_newround", "a", "1=0", "2=0")
- register_think(CLASS_NAME_BOSS, "cso_boss_think")
- register_touch(CLASS_NAME_BOSS, "*", "cso_boss_touch")
- register_forward(FM_PlayerPreThink, "fw_Player_Frozer")
- RegisterHam(Ham_Spawn, "player", "Bug_Frozer", 1)
- register_think("Halloween_Meteos", "fire_helloween_think")
- register_touch("Halloween_Meteos", "*", "npc_ball_touch")
- register_touch("Damage_Tentacle_Teddy", "*", "Tentacle_Touch")
- g_msgScreenFade = get_user_msgid("ScreenFade")
- register_clcmd("say /teddy", "npc_position")
- register_clcmd("say /teddy2", "create_cso_boss")
- }
- public plugin_cfg() // Cvar's goes here
- {
- server_cmd("mp_freezetime 0.0")
- }
- public plugin_precache()
- {
- Boss_Model_Linux = precache_model(Boss_Model_CSO)
- precache_model(Boss_Tentacle_CSO)
- precache_model(Boss_Hole_Effect)
- precache_sound(frozer)
- precache_model(ice_model)
- precache_model(Hp_Sprite_Boss)
- precache_model(Boss_Halloween)
- precache_model(Boss_Halloween2)
- frostgib = precache_model("sprites/Teddy_CSO/frostgib.spr")
- g_exploSpr = engfunc(EngFunc_PrecacheModel, "sprites/Teddy_CSo/shockwave.spr")
- g_explosfr = precache_model("sprites/Teddy_CSo/frost_exp.spr")
- y_npc_hp = precache_model("sprites/Teddy_CSO/zerogxplode.spr")
- y_bleeding[0] = precache_model("sprites/Teddy_CSO/blood.spr")
- y_bleeding[1] = precache_model("sprites/Teddy_CSO/bloodspray.spr")
- for(new i = 0; i < sizeof(Sound_Boss_CSO); i++)
- precache_sound(Sound_Boss_CSO[i])
- for(new i; i <= charsmax(news); i++)
- g_news[i] = precache_model(news[i])
- }
- public event_newround()
- {
- if(pev_valid(y_think))
- {
- remove_task(y_think+HP_SPRITE)
- remove_task(y_think+ATTACK_TASK)
- remove_task(y_think+CORRER_TEDDY)
- remove_task(y_think+TENTACLE_TEDDY)
- remove_task(y_think+HOLE_TEDDY)
- remove_task(y_think+HOLE1_TEDDY)
- remove_task(y_think+METEOR_TEDDY)
- remove_entity_name(CLASS_NAME_BOSS)
- remove_entity_name("teddy_final")
- remove_entity_name("DareDevil")
- remove_entity_name("Halloween_Meteos")
- remove_entity_name("Damage_Tentacle_Teddy")
- }
- if(pev_valid(y_hpbar)) remove_entity(y_hpbar)
- }
- public npc_position(id)
- {
- pev(id, pev_angles, VAngles)
- pev(id, pev_origin, Origin)
- client_print(id, print_console, "Origin %f %f %f", Origin[0], Origin[1], Origin[2])
- client_print(id, print_console, "Angles %f %f %f", VAngles[0], VAngles[1], VAngles[2])
- }
- public Bug_Frozer(id)
- {
- if(is_user_connected(id))
- {
- g_bCongelado[id] = false
- }
- }
- public create_cso_boss()
- {
- event_newround()
- new ent = create_entity("info_target")
- y_think = ent
- Damage_Touch = 0
- Start_Boss_CSO = 0
- set_pev(ent, pev_origin, Origin)
- //set_pev(ent, pev_angles, VAngles)
- set_pev(ent, pev_gamestate, 1)
- set_pev(ent, pev_takedamage, 1.0)
- set_pev(ent, pev_health, HEALTH_BOSS + 1000.0)
- set_pev(ent, pev_classname, CLASS_NAME_BOSS)
- engfunc(EngFunc_SetModel, ent, Boss_Model_CSO)
- set_pev(ent, pev_solid, SOLID_BBOX)
- set_pev(ent, pev_movetype, MOVETYPE_PUSHSTEP)
- anim(ent, SCENE_APPEAR)
- new Float:maxs[3] = {35.0, 55.0, 200.0}
- new Float:mins[3] = {-35.0, -55.0, -35.0}
- engfunc(EngFunc_SetSize, ent, mins, maxs)
- set_pev(ent, pev_modelindex, Boss_Model_Linux)
- set_pev(ent, pev_nextthink, get_gametime() + 5.0)
- if(!Damage_Off)
- {
- Damage_Off = 1
- RegisterHamFromEntity(Ham_TakeDamage, ent, "cso_boss_take_damage", 1)
- }
- y_hpbar = create_entity("env_sprite")
- set_pev(y_hpbar, pev_scale, 0.4)
- set_pev(y_hpbar, pev_owner, ent)
- engfunc(EngFunc_SetModel, y_hpbar, Hp_Sprite_Boss)
- set_task(0.1, "cso_boss_ready", ent+HP_SPRITE, _, _, "b")
- }
- public cso_boss_ready(ent)
- {
- ent -= HP_SPRITE
- if(!pev_valid(ent))
- {
- remove_task(ent+HP_SPRITE)
- return
- }
- static Float:Origin[3], Float:cso_boss_health
- pev(ent, pev_origin, Origin)
- Origin[2] += 265.0
- engfunc(EngFunc_SetOrigin, y_hpbar, Origin)
- pev(ent, pev_health, cso_boss_health)
- if(HEALTH_BOSS < (cso_boss_health - 1000.0))
- {
- set_pev(y_hpbar, pev_frame, 100.0)
- } else {
- set_pev(y_hpbar, pev_frame, 0.0 + ((((cso_boss_health - 1000.0) - 1 ) * 100) / HEALTH_BOSS))
- }
- }
- //----------------------------Attacks Teddy----------------------------
- public Teddy_Attack(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- anim(ent, ZBS_ATTACK1)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- new randomx = random_num(0,1)
- switch(randomx) {
- case 0:
- {
- anim(ent, ZBS_ATTACK1)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[8], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(0.3, "Damage_Teddy", ent+ATTACK_TASK)
- set_task(1.0, "simple_attack_reload", ent+ATTACK_TASK)
- }
- case 1:
- {
- anim(ent, ZBS_ATTACK2)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[0], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(0.7, "Damage_Teddy2", ent+ATTACK_TASK)
- set_task(1.3, "simple_attack_reload", ent+ATTACK_TASK)
- }
- }
- }
- public Damage_Teddy(ent)
- {
- ent -= ATTACK_TASK
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 500.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 400.0, {144, 238, 144})
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 250.0)
- {
- shake_screen(i)
- ScreenFade(i, 2, {79, 79, 79}, 120)
- ExecuteHam(Ham_TakeDamage, i, 0, i, DAMAGE_ATTACK, DMG_SLASH)
- }
- }
- }
- public Damage_Teddy2(ent)
- {
- ent -= ATTACK_TASK
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 500.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 400.0, {144, 238, 144})
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 250.0)
- {
- shake_screen(i)
- ScreenFade(i, 2, {79, 79, 79}, 120)
- ExecuteHam(Ham_TakeDamage, i, 0, i, DAMAGE_ATTACK, DMG_SLASH)
- static Float:Jugador[3]
- Jugador[2] = 400.0
- Jugador[0] = 400.0
- set_pev(i, pev_velocity, Jugador)
- }
- }
- }
- public simple_attack_reload(ent)
- {
- ent -= ATTACK_TASK
- Start_Boss_CSO = 0
- }
- //----------------------------Correr Teddy----------------------------
- public Correr_Teddy(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- Damage_Touch = 1
- anim(ent, ZBS_ATTACK_SLIDING)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[9], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(0.7, "CorrerTeddy", ent+CORRER_TEDDY)
- set_task(2.5, "Correr_Teddy3", ent+CORRER_TEDDY)
- }
- public CorrerTeddy(ent)
- {
- ent -= CORRER_TEDDY
- set_task(0.2, "Correr_Teddy2", ent+CORRER_TEDDY, _, _, "b")
- }
- public Correr_Teddy2(ent)
- {
- ent -= CORRER_TEDDY
- if(!pev_valid(ent))
- return
- set_pev(ent, pev_movetype, MOVETYPE_PUSHSTEP)
- static Float:Origin[3]
- get_position(ent, 4000.0, 0.0, 0.0, Origin)
- control_ai2(ent, Origin, 1000.0)
- }
- public Correr_Teddy3(ent)
- {
- ent -= CORRER_TEDDY
- if(!pev_valid(ent))
- return
- Damage_Touch = 0
- remove_task(ent+CORRER_TEDDY)
- set_task(2.0, "reload_run", ent+CORRER_TEDDY)
- }
- public reload_run(ent)
- {
- ent -= CORRER_TEDDY
- remove_task(ent+CORRER_TEDDY)
- Start_Boss_CSO = 0
- anim(ent, ZBS_IDLE1)
- }
- //----------------------------Candy Teddy----------------------------
- public Tentacle_Hammer(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- anim(ent, ZBS_ATTACK_CANDY)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- set_task(10.0, "reload_run2", ent+TENTACLE_TEDDY)
- set_task(0.9, "Start_Tentacle", ent+TENTACLE_TEDDY)
- set_task(4.7, "Start_Tentacle", ent+TENTACLE_TEDDY)
- set_task(7.5, "Start_Tentacle", ent+TENTACLE_TEDDY)
- set_task(0.9, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(3.0, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(4.7, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(6.4, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(7.5, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(7.0, "Damage_Teddy3", ent+TENTACLE_TEDDY)
- set_task(8.5, "Sound_Tentacle_Hammer", ent+TENTACLE_TEDDY)
- }
- public Sound_Tentacle_Hammer(ent)
- {
- ent -= TENTACLE_TEDDY
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[11], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public Damage_Teddy3(ent)
- {
- ent -= TENTACLE_TEDDY
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 550.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 450.0, {144, 238, 144})
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[8], 1.0, ATTN_NORM, 0, PITCH_NORM)
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 300.0)
- {
- shake_screen(i)
- ScreenFade(i, 2, {79, 79, 79}, 120)
- ExecuteHam(Ham_TakeDamage, i, 0, i, DAMAGE_TENTACLE, DMG_SLASH)
- }
- }
- }
- public reload_run2(ent)
- {
- ent -= TENTACLE_TEDDY
- remove_task(ent+CORRER_TEDDY)
- Start_Boss_CSO = 0
- anim(ent, ZBS_IDLE1)
- }
- public Start_Tentacle(ent)
- {
- ent -= TENTACLE_TEDDY
- if(!pev_valid(ent))
- return
- static Float:beam_origin[25][3]
- get_position(ent, 200.0, 00.0, 50.0, beam_origin[0])
- get_position(ent, 300.0, 00.0, 50.0, beam_origin[1])
- get_position(ent, 400.0, 00.0, 50.0, beam_origin[2])
- get_position(ent, 500.0, 00.0, 50.0, beam_origin[3])
- get_position(ent, 600.0, 00.0, 50.0, beam_origin[4])
- get_position(ent, 200.0, 150.0, 50.0, beam_origin[5])
- get_position(ent, 300.0, 150.0, 50.0, beam_origin[6])
- get_position(ent, 400.0, 150.0, 50.0, beam_origin[7])
- get_position(ent, 500.0, 150.0, 50.0, beam_origin[8])
- get_position(ent, 600.0, 150.0, 50.0, beam_origin[9])
- get_position(ent, 200.0, 250.0, 50.0, beam_origin[10])
- get_position(ent, 300.0, 250.0, 50.0, beam_origin[11])
- get_position(ent, 400.0, 250.0, 50.0, beam_origin[12])
- get_position(ent, 500.0, 250.0, 50.0, beam_origin[13])
- get_position(ent, 600.0, 250.0, 50.0, beam_origin[14])
- get_position(ent, 200.0, -150.0, 50.0, beam_origin[15])
- get_position(ent, 300.0, -150.0, 50.0, beam_origin[16])
- get_position(ent, 400.0, -150.0, 50.0, beam_origin[17])
- get_position(ent, 500.0, -150.0, 50.0, beam_origin[18])
- get_position(ent, 600.0, -150.0, 50.0, beam_origin[19])
- get_position(ent, 200.0, -250.0, 50.0, beam_origin[20])
- get_position(ent, 300.0, -250.0, 50.0, beam_origin[21])
- get_position(ent, 400.0, -250.0, 50.0, beam_origin[22])
- get_position(ent, 500.0, -250.0, 50.0, beam_origin[23])
- get_position(ent, 600.0, -250.0, 50.0, beam_origin[24])
- for(new i = 0; i < 25; i++)
- Create_Tentacle1(beam_origin[i])
- }
- public Create_Tentacle1(Float:StartOrigin[3])
- {
- static Ent; Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
- if(!pev_valid(Ent)) return
- set_pev(Ent, pev_movetype, MOVETYPE_NONE)
- set_pev(Ent, pev_solid, SOLID_BBOX)
- set_pev(Ent, pev_classname, "Damage_Tentacle_Teddy")
- engfunc(EngFunc_SetModel, Ent, Boss_Tentacle_CSO)
- set_pev(Ent, pev_origin, StartOrigin)
- anim(Ent, 0)
- new Float:maxs[3] = {5.0, 5.0, 30.0}
- new Float:mins[3] = {-5.0, -5.0, -30.0}
- entity_set_size(Ent, mins, maxs)
- set_task(1.0, "Remover_Tentacle", Ent+TENTACLE_TEDDY)
- }
- public Remover_Tentacle(Ent)
- {
- Ent -= TENTACLE_TEDDY
- if(!pev_valid(Ent)) return
- engfunc(EngFunc_RemoveEntity, Ent)
- }
- public Tentacle_Touch(Ent, id)
- {
- if(!pev_valid(Ent))
- return
- new Classname[32]
- if(pev_valid(id)) pev(id, pev_classname, Classname, sizeof(Classname))
- if(equal(Classname, "Damage_Tentacle_Teddy"))
- return
- if(is_user_alive(id))
- {
- ScreenFade(id, 2, {79, 79, 79}, 120)
- ExecuteHam(Ham_TakeDamage, id, 0, id, DAMAGE_TENTACLE_TOUCH, DMG_SLASH)
- }
- }
- //----------------------------Hole1 Teddy----------------------------
- public Teddy_Hole1(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- anim(ent, ZBS_ATTACK_HOLE)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[10], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(8.0, "reload_run3", ent+HOLE_TEDDY)
- set_task(5.0, "Damage_Teddy4", ent+HOLE_TEDDY)
- set_task(0.2, "attack_hole", ent+HOLE_TEDDY)
- }
- public Damage_Teddy4(ent)
- {
- ent -= HOLE_TEDDY
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 550.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 450.0, {144, 238, 144})
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 300.0)
- {
- shake_screen(i)
- ScreenFade(i, 2, {79, 79, 79}, 120)
- ExecuteHam(Ham_TakeDamage, i, 0, i, DAMAGE_HOLE1, DMG_SLASH)
- //user_kill(i)
- }
- }
- }
- public attack_hole(Teddy)
- {
- Teddy -= HOLE_TEDDY
- new ent = create_entity("info_target")
- static Float:Origin[3]
- pev(Teddy, pev_origin, Origin)
- Origin[2] -= 10.0
- set_pev(ent, pev_origin, Origin)
- set_pev(ent, pev_classname, "teddy_final")
- engfunc(EngFunc_SetModel, ent, Boss_Hole_Effect)
- set_pev(ent, pev_solid, SOLID_NOT)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- new Float:maxs[3] = {1.0,1.0,1.0}
- new Float:mins[3] = {-1.0,-1.0,-1.0}
- engfunc(EngFunc_SetSize, ent, mins, maxs)
- set_pev(ent, pev_animtime, get_gametime())
- anim(ent, 0)
- set_pev(ent, pev_rendermode, kRenderTransAdd)
- set_pev(ent, pev_renderamt, 255.0)
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(Teddy, i) <= 1000.0)
- {
- static arg[2]
- arg[0] = Teddy
- arg[1] = i
- set_task(0.01, "Jalar_Humanos", HOLE1_TEDDY, arg, sizeof(arg), "b")
- }
- }
- set_task(5.8, "stop_jalamiento", Teddy+2012)
- }
- public Jalar_Humanos(arg[2])
- {
- static Float:Origin[3], Float:Speed
- pev(arg[0], pev_origin, Origin)
- Speed = (1000.0 / entity_range(arg[0], arg[1])) * 75.0
- control_ai2(arg[1], Origin, Speed)
- }
- public stop_jalamiento(Teddy)
- {
- Teddy -= 2012
- static ent
- ent = find_ent_by_class(-1, "teddy_final")
- remove_entity(ent)
- remove_task(HOLE1_TEDDY)
- }
- public reload_run3(ent)
- {
- ent -= HOLE_TEDDY
- Start_Boss_CSO = 0
- anim(ent, ZBS_IDLE1)
- }
- //----------------------------Hole2 Teddy----------------------------
- public Teddy_Hole2(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- anim(ent, ZBS_ATTACK_HOLE2)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[13], 1.0, ATTN_NORM, 0, PITCH_NORM)
- set_task(8.0, "reload_run3", ent+HOLE_TEDDY)
- set_task(5.0, "Damage_Teddy5", ent+HOLE_TEDDY)
- set_task(0.1, "attack_hole", ent+HOLE_TEDDY)
- set_task(5.0, "Hole_Teddy_Sound", ent+HOLE_TEDDY)
- }
- public Hole_Teddy_Sound(ent)
- {
- ent -= HOLE_TEDDY
- emit_sound(ent, CHAN_BODY, Sound_Boss_CSO[16], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public Damage_Teddy5(ent)
- {
- ent -= HOLE_TEDDY
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 750.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 650.0, {144, 238, 144})
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 450.0)
- {
- shake_screen(i)
- Congelar(i)
- }
- }
- }
- public Congelar(id)
- {
- if (!is_user_alive(id))
- return;
- ice_entity(id, 1)
- frost_explode(id)
- if (pev(id, pev_flags) & FL_ONGROUND)
- set_pev(id, pev_gravity, 999999.9)
- else
- set_pev(id, pev_gravity, 0.000001)
- g_bCongelado[id] = true
- set_task(7.0, "Descongelar", id)
- }
- public Descongelar(id)
- {
- //if (!is_user_alive(id))
- //return;
- ice_entity(id, 0)
- remove_frost(id)
- g_bCongelado[id] = false
- set_pev(id, pev_gravity, 1.0)
- set_pev(id, pev_maxspeed, 250.0)
- }
- //----------------------------Meteor Teddy----------------------------
- public Attack_Meteor_Halloween(ent)
- {
- if(!pev_valid(ent) || Start_Boss_CSO)
- return
- Start_Boss_CSO = 1
- anim(ent, 11)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[14], 1.0, ATTN_NORM, 0, PITCH_NORM)
- //set_task(8.0, "reload_run4", ent+METEOR_TEDDY)
- set_task(6.0, "Damage_Teddy6", ent+METEOR_TEDDY)
- set_task(6.0, "Meteor_Sound", ent+METEOR_TEDDY)
- set_task(3.9, "Regalitos_Halloweeen", ent+METEOR_TEDDY)
- }
- public Meteor_Sound(ent)
- {
- emit_sound(ent, CHAN_AUTO, Sound_Boss_CSO[15], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public Damage_Teddy6(ent)
- {
- ent -= METEOR_TEDDY
- if(!pev_valid(ent))
- return
- static Float:Orig[3]
- pev(ent, pev_origin, Orig)
- ShockWave(Orig, 5, 70, 550.0, {255, 0, 0})
- ShockWave(Orig, 5, 70, 450.0, {144, 238, 144})
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 300.0)
- {
- shake_screen(i)
- ScreenFade(i, 2, {79, 79, 79}, 120)
- user_kill(i)
- }
- }
- }
- public reload_run4(ent)
- {
- ent -= METEOR_TEDDY
- Start_Boss_CSO = 0
- anim(ent, ZBS_IDLE1)
- }
- //Code Sacado De Dias.... Solo Esto..
- public Regalitos_Halloweeen(ent)
- {
- ent -= METEOR_TEDDY
- if(!pev_valid(ent))
- return
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- static Float:Origin[3]
- get_position(ent, 150.0, 0.0, 50.0, Origin)
- //emit_sound(ent, CHAN_BODY, npc_sound[3], 1.0, ATTN_NORM, 0, PITCH_NORM)
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 4000)
- {
- shake_screen(i)
- ScreenFade(i, 10, {255, 0, 0}, 120)
- }
- }
- set_task(0.1, "fire_attack_teddy", ent+METEOR_TEDDY)
- set_task(3.8, "remove_attack_teddy", ent+METEOR_TEDDY)
- }
- public remove_attack_teddy(ent)
- {
- ent -= METEOR_TEDDY
- if(!pev_valid(ent))
- return
- remove_task(ent+METEOR_TEDDY)
- set_task(2.1, "reload_run4", ent+METEOR_TEDDY)
- }
- public npc_ball_touch(ent, id)
- {
- if(!pev_valid(ent))
- return
- static Float:Origin[3]
- pev(ent, pev_origin, Origin)
- message_begin(MSG_BROADCAST ,SVC_TEMPENTITY)
- write_byte(TE_EXPLOSION)
- engfunc(EngFunc_WriteCoord, Origin[0])
- engfunc(EngFunc_WriteCoord, Origin[1])
- engfunc(EngFunc_WriteCoord, Origin[2])
- write_short(y_npc_hp)
- write_byte(10)
- write_byte(30)
- write_byte(4)
- message_end()
- emit_sound(ent, CHAN_BODY, Sound_Boss_CSO[18], 1.0, ATTN_NORM, 0, PITCH_NORM)
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 250)
- {
- shake_screen(i)
- ExecuteHam(Ham_TakeDamage, i, 0, i, DAMAGE_HALLOWEEN, DMG_SLASH)
- ScreenFade(i, 3, {255, 0, 0}, 120)
- }
- }
- remove_entity(ent)
- }
- public fire_attack_teddy(ent)
- {
- ent -= METEOR_TEDDY
- if(!pev_valid(ent))
- return
- static Float:explosion[24][3], Float:ball_place[24][3]
- explosion[0][0] = 200.0
- explosion[0][1] = 0.0
- explosion[0][2] = 500.0
- explosion[1][0] = 400.0
- explosion[1][1] = 0.0
- explosion[1][2] = 500.0
- explosion[2][0] = -200.0
- explosion[2][1] = 0.0
- explosion[2][2] = 500.0
- explosion[3][0] = -400.0
- explosion[3][1] = 0.0
- explosion[3][2] = 500.0
- explosion[4][0] = 0.0
- explosion[4][1] = 200.0
- explosion[4][2] = 500.0
- explosion[5][0] = 0.0
- explosion[5][1] = 400.0
- explosion[5][2] = 500.0
- explosion[6][0] = 0.0
- explosion[6][1] = -200.0
- explosion[6][2] = 500.0
- explosion[7][0] = 0.0
- explosion[7][1] = -400.0
- explosion[7][2] = 500.0
- explosion[8][0] = 200.0
- explosion[8][1] = 200.0
- explosion[8][2] = 500.0
- explosion[9][0] = 400.0
- explosion[9][1] = 400.0
- explosion[9][2] = 500.0
- explosion[10][0] = 200.0
- explosion[10][1] = 400.0
- explosion[10][2] = 500.0
- explosion[11][0] = 400.0
- explosion[11][1] = 200.0
- explosion[11][2] = 500.0
- explosion[12][0] = -200.0
- explosion[12][1] = 200.0
- explosion[12][2] = 500.0
- explosion[13][0] = -400.0
- explosion[13][1] = 400.0
- explosion[13][2] = 500.0
- explosion[14][0] = -200.0
- explosion[14][1] = 400.0
- explosion[14][2] = 500.0
- explosion[15][0] = -400.0
- explosion[15][1] = 200.0
- explosion[15][2] = 500.0
- explosion[16][0] = -200.0
- explosion[16][1] = -200.0
- explosion[17][2] = 500.0
- explosion[17][0] = -200.0
- explosion[17][1] = -200.0
- explosion[17][2] = 500.0
- explosion[18][0] = -200.0
- explosion[18][1] = -400.0
- explosion[18][2] = 500.0
- explosion[19][0] = -400.0
- explosion[19][1] = -200.0
- explosion[19][2] = 500.0
- explosion[20][0] = 200.0
- explosion[20][1] = -200.0
- explosion[20][2] = 500.0
- explosion[21][0] = 400.0
- explosion[21][1] = -400.0
- explosion[21][2] = 500.0
- explosion[22][0] = 200.0
- explosion[22][1] = -400.0
- explosion[22][2] = 500.0
- explosion[23][0] = 400.0
- explosion[23][1] = -200.0
- explosion[23][2] = 500.0
- for(new i = 0; i < sizeof(explosion); i++)
- {
- get_position(ent, explosion[i][0], explosion[i][1], explosion[i][2], ball_place[i])
- npc_fireball_big(ent, ball_place[i])
- }
- set_task(1.0, "fire_attack_teddy", ent+METEOR_TEDDY)
- }
- public npc_fireball_big(fireboss, Float:Origin[3])
- {
- new ent = create_entity("info_target")
- static Float:Angles[3]
- pev(fireboss, pev_angles, Angles)
- entity_set_origin(ent, Origin)
- Angles[0] = -100.0
- entity_set_vector(ent, EV_VEC_angles, Angles)
- Angles[0] = 100.0
- entity_set_vector(ent, EV_VEC_v_angle, Angles)
- entity_set_string(ent, EV_SZ_classname, "Halloween_Meteos")
- entity_set_model(ent, Boss_Halloween)
- entity_set_int(ent, EV_INT_solid, 2)
- entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY)
- new Float:maxs[3] = {15.0, 15.0, 15.0}
- new Float:mins[3] = {-15.0, -15.0, -15.0}
- entity_set_size(ent, mins, maxs)
- set_pev(ent, pev_owner, fireboss)
- static Float:Velocity[3]
- VelocityByAim(ent, random_num(250, 1000), Velocity)
- set_pev(ent, pev_light_level, 180)
- set_pev(ent, pev_rendermode, kRenderTransAdd)
- set_pev(ent, pev_renderamt, 255.0)
- entity_set_vector(ent, EV_VEC_velocity, Velocity)
- burning(ent, 0.5)
- }
- public burning(ball, Float:size)
- {
- static ent
- ent = create_entity("env_sprite")
- set_pev(ent, pev_takedamage, 0.0)
- set_pev(ent, pev_solid, SOLID_NOT)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- set_pev(ent, pev_classname, "Halloween_Meteos")
- engfunc(EngFunc_SetModel, ent, Boss_Halloween2)
- set_pev(ent, pev_rendermode, kRenderTransAdd)
- set_pev(ent, pev_renderamt, 255.0)
- set_pev(ent, pev_light_level, 180)
- set_pev(ent, pev_scale, size)
- set_pev(ent, pev_owner, ball)
- set_pev(ent, pev_animtime, get_gametime())
- set_pev(ent, pev_framerate, 8.0)
- set_pev(ent, pev_frame, 0.1)
- set_pev(ent, pev_spawnflags, SF_SPRITE_STARTON)
- dllfunc(DLLFunc_Spawn, ent)
- fire_helloween_think(ent)
- set_pev(ent, pev_nextthink, get_gametime() + 0.01)
- return ent
- }
- public fire_helloween_think(ent)
- {
- if(!pev_valid(ent))
- return
- if(!pev_valid(pev(ent, pev_owner)))
- {
- remove_entity(ent)
- return
- }
- static owner
- owner = pev(ent, pev_owner)
- static Float:Origin[3]
- pev(owner, pev_origin, Origin)
- Origin[2] += 25.0
- entity_set_origin(ent, Origin)
- set_pev(ent, pev_nextthink, get_gametime() + 0.01)
- }
- //----------------------------Skills Full Final----------------------------
- public fw_Player_Frozer(id)
- {
- if (!is_user_alive(id))
- return;
- if (g_bCongelado[id])
- {
- set_pev(id, pev_velocity, Float:{0.0,0.0,0.0})
- set_pev(id, pev_maxspeed, 1.0)
- }
- }
- public cso_boss_touch(ent, id)
- {
- if(!pev_valid(id))
- return
- if(is_user_alive(id) && Damage_Touch)
- {
- ExecuteHam(Ham_TakeDamage, id, 0, id, DAMAGE_FINAL, DMG_SLASH)
- shake_screen(id)
- ScreenFade(id, 10, {255, 0, 0}, 120)
- }
- }
- public cso_boss_think(ent)
- {
- if(!pev_valid(ent))
- return
- if(pev(ent, pev_iuser3))
- return
- if(pev(ent, pev_health) - 1000.0 < 0.0)
- {
- cso_boss_death(ent)
- set_pev(ent, pev_iuser3, 1)
- return
- }
- if(!Start_Boss_CSO)
- {
- static victim
- static Float:Origin[3], Float:ent_place[3], Float:player_place[3], Float:EnemyOrigin[3]
- victim = enemy_distance(ent)
- pev(victim, pev_origin, EnemyOrigin)
- pev(ent, pev_origin, Origin)
- if(is_user_alive(victim))
- {
- if(entity_range(victim, ent) <= 170)
- {
- Anim_Victim(ent, Origin, victim, EnemyOrigin)
- Teddy_Attack(ent)
- set_pev(ent, pev_nextthink, get_gametime() + 0.1)
- } else {
- if(pev(ent, pev_sequence) != ZBS_WALK)
- anim(ent, ZBS_WALK)
- set_pev(ent, pev_movetype, MOVETYPE_PUSHSTEP)
- if(get_gametime() - 10.0 > Attack_Time)
- {
- new Random_Skill_Teddy = random_num(0,4)
- switch(Random_Skill_Teddy) {
- case 0: Correr_Teddy(ent)
- case 1: Tentacle_Hammer(ent)
- case 2: Teddy_Hole1(ent)
- case 3: Teddy_Hole2(ent)
- case 4: Attack_Meteor_Halloween(ent)
- }
- Attack_Time = get_gametime()
- }
- for(new i = 0; i < get_maxplayers(); i++)
- {
- if(is_user_alive(i) && entity_range(ent, i) <= 600)
- {
- shake_screen(i)
- }
- }
- emit_sound(ent, CHAN_STREAM, Sound_Boss_CSO[19], 1.0, ATTN_NORM, 0, PITCH_NORM)
- pev(ent, pev_origin, ent_place)
- pev(victim, pev_origin, player_place)
- Anim_Victim(ent, ent_place, victim, player_place)
- control_ai(ent, victim, SPEED_TEDDY)
- if(pev(ent, pev_iuser4) != victim)
- set_pev(ent, pev_iuser4, victim)
- set_pev(ent, pev_nextthink, get_gametime() + 0.0)
- }
- } else {
- if(pev(ent, pev_sequence) != ZBS_IDLE1)
- anim(ent, ZBS_IDLE1)
- set_pev(ent, pev_nextthink, get_gametime() + 0.0)
- }
- } else {
- set_pev(ent, pev_nextthink, get_gametime() + 0.0)
- }
- return
- }
- public cso_boss_death(ent)
- {
- emit_sound(ent, CHAN_BODY, Sound_Boss_CSO[1], 1.0, ATTN_NORM, 0, PITCH_NORM)
- anim(ent, TEDDY_DEATH)
- set_pev(ent, pev_movetype, MOVETYPE_NONE)
- set_pev(ent, pev_solid, SOLID_NOT)
- set_pev(ent, pev_velocity, {0.0, 0.0, 0.0})
- set_pev(ent, pev_deadflag, DEAD_DYING)
- remove_task(ent+HP_SPRITE)
- remove_task(ent+ATTACK_TASK)
- remove_task(ent+CORRER_TEDDY)
- remove_task(ent+TENTACLE_TEDDY)
- remove_task(ent+HOLE_TEDDY)
- remove_task(ent+HOLE1_TEDDY)
- remove_task(ent+METEOR_TEDDY)
- remove_entity_name("teddy_final")
- remove_entity_name("DareDevil")
- remove_entity_name("Halloween_Meteos")
- remove_entity_name("Damage_Tentacle_Teddy")
- set_task(7.0, "delete_cso_boss", ent)
- return HAM_SUPERCEDE
- }
- public delete_cso_boss(ent)
- {
- remove_entity(ent)
- remove_entity(y_hpbar)
- }
- public cso_boss_take_damage(victim, inflictor, attacker, Float:damage, damagebits)
- {
- static Float:Origin[3]
- fm_get_aim_origin(attacker, Origin)
- create_blood(Origin)
- emit_sound(victim, CHAN_BODY, Sound_Boss_CSO[7], 1.0, ATTN_NORM, 0, PITCH_NORM)
- }
- public enemy_distance(entid)
- {
- new Float:range2
- new Float:maxrange=2000.0
- new indexid=0
- for(new i=1;i<=get_maxplayers();i++)
- {
- if(is_user_alive(i) && is_valid_ent(i) && attacking1(entid, i))
- {
- range2 = entity_range(entid, i)
- if(range2 <= maxrange)
- {
- maxrange=range2
- indexid=i
- }
- }
- }
- return (indexid) ? indexid : 0
- }
- public Anim_Victim(ent, Float:ent_place[3], target, Float:player_place[3])
- {
- if(target)
- {
- new Float:newAngle[3]
- entity_get_vector(ent, EV_VEC_angles, newAngle)
- new Float:x = player_place[0] - ent_place[0]
- new Float:z = player_place[1] - ent_place[1]
- new Float:radians = floatatan(z/x, radian)
- newAngle[1] = radians * (180 / 3.14)
- if (player_place[0] < ent_place[0])
- newAngle[1] -= 180.0
- entity_set_vector(ent, EV_VEC_v_angle, newAngle)
- entity_set_vector(ent, EV_VEC_angles, newAngle)
- }
- }
- public bool:attacking1(entindex1, entindex2)
- {
- if (!entindex1 || !entindex2)
- return false
- if (pev_valid(entindex1) && pev_valid(entindex1))
- {
- new flags = pev(entindex1, pev_flags)
- if (flags & EF_NODRAW || flags & FL_NOTARGET)
- {
- return false
- }
- new Float:lookerOrig[3]
- new Float:targetBaseOrig[3]
- new Float:targetOrig[3]
- new Float:temp[3]
- pev(entindex1, pev_origin, lookerOrig)
- pev(entindex1, pev_view_ofs, temp)
- lookerOrig[0] += temp[0]
- lookerOrig[1] += temp[1]
- lookerOrig[2] += temp[2]
- pev(entindex2, pev_origin, targetBaseOrig)
- pev(entindex2, pev_view_ofs, temp)
- targetOrig[0] = targetBaseOrig [0] + temp[0]
- targetOrig[1] = targetBaseOrig [1] + temp[1]
- targetOrig[2] = targetBaseOrig [2] + temp[2]
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0)
- if (get_tr2(0, TraceResult:TR_InOpen) && get_tr2(0, TraceResult:TR_InWater))
- {
- return false
- }
- else
- {
- new Float:flFraction
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- else
- {
- targetOrig[0] = targetBaseOrig [0]
- targetOrig[1] = targetBaseOrig [1]
- targetOrig[2] = targetBaseOrig [2]
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0)
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- else
- {
- targetOrig[0] = targetBaseOrig [0]
- targetOrig[1] = targetBaseOrig [1]
- targetOrig[2] = targetBaseOrig [2] - 17.0
- engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0)
- get_tr2(0, TraceResult:TR_flFraction, flFraction)
- if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
- {
- return true
- }
- }
- }
- }
- }
- return false
- }
- public control_ai(ent, victim, Float:speed)
- {
- static Float:fl_Velocity[3]
- static Float:VicOrigin[3], Float:EntOrigin[3]
- pev(ent, pev_origin, EntOrigin)
- pev(victim, pev_origin, VicOrigin)
- static Float:distance_f
- distance_f = get_distance_f(EntOrigin, VicOrigin)
- if (distance_f > 60.0)
- {
- new Float:fl_Time = distance_f / speed
- fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
- fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
- fl_Velocity[2] = 0.0
- } else
- {
- fl_Velocity[0] = 0.0
- fl_Velocity[1] = 0.0
- fl_Velocity[2] = 0.0
- }
- entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
- }
- stock control_ai2(ent, Float:VicOrigin[3], Float:speed)
- {
- static Float:fl_Velocity[3]
- static Float:EntOrigin[3]
- pev(ent, pev_origin, EntOrigin)
- static Float:distance_f
- distance_f = get_distance_f(EntOrigin, VicOrigin)
- if (distance_f > 60.0)
- {
- new Float:fl_Time = distance_f / speed
- fl_Velocity[0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
- fl_Velocity[1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
- fl_Velocity[2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
- } else {
- fl_Velocity[0] = 0.0
- fl_Velocity[1] = 0.0
- fl_Velocity[2] = 0.0
- }
- entity_set_vector(ent, EV_VEC_velocity, fl_Velocity)
- }
- stock ScreenFade(id, Timer, Colors[3], Alpha) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id);
- write_short((1<<12) * Timer)
- write_short(1<<12)
- write_short(0)
- write_byte(Colors[0])
- write_byte(Colors[1])
- write_byte(Colors[2])
- write_byte(Alpha)
- message_end()
- }
- stock shake_screen(id)
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"),{0,0,0}, id)
- write_short(1<<14)
- write_short(1<<13)
- write_short(1<<13)
- message_end()
- }
- stock anim(ent, sequence) {
- set_pev(ent, pev_sequence, sequence)
- set_pev(ent, pev_animtime, halflife_time())
- set_pev(ent, pev_framerate, 1.0)
- }
- stock get_position(ent, Float:forw, Float:right, Float:up, Float:vStart[])
- {
- new Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
- pev(ent, pev_origin, vOrigin)
- pev(ent, pev_view_ofs,vUp)
- xs_vec_add(vOrigin,vUp,vOrigin)
- pev(ent, pev_v_angle, vAngle)
- vAngle[0] = 0.0
- angle_vector(vAngle,ANGLEVECTOR_FORWARD,vForward)
- angle_vector(vAngle,ANGLEVECTOR_RIGHT,vRight)
- angle_vector(vAngle,ANGLEVECTOR_UP,vUp)
- vStart[0] = vOrigin[0] + vForward[0] * forw + vRight[0] * right + vUp[0] * up
- vStart[1] = vOrigin[1] + vForward[1] * forw + vRight[1] * right + vUp[1] * up
- vStart[2] = vOrigin[2] + vForward[2] * forw + vRight[2] * right + vUp[2] * up
- }
- stock create_blood(const Float:origin[3])
- {
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(TE_BLOODSPRITE)
- engfunc(EngFunc_WriteCoord, origin[0])
- engfunc(EngFunc_WriteCoord, origin[1])
- engfunc(EngFunc_WriteCoord, origin[2])
- write_short(y_bleeding[1])
- write_short(y_bleeding[0])
- write_byte(218)
- write_byte(7)
- message_end()
- }
- stock ShockWave(Float:Orig[3], Life, Width, Float:Radius, Color[3])
- {
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Orig, 0)
- write_byte(TE_BEAMCYLINDER)
- engfunc(EngFunc_WriteCoord, Orig[0])
- engfunc(EngFunc_WriteCoord, Orig[1])
- engfunc(EngFunc_WriteCoord, Orig[2]-40.0)
- engfunc(EngFunc_WriteCoord, Orig[0])
- engfunc(EngFunc_WriteCoord, Orig[1])
- engfunc(EngFunc_WriteCoord, Orig[2]+Radius)
- write_short(g_news[0])
- write_byte(0)
- write_byte(0)
- write_byte(Life)
- write_byte(Width)
- write_byte(0)
- write_byte(Color[0])
- write_byte(Color[1])
- write_byte(Color[2])
- write_byte(255)
- write_byte(0)
- message_end()
- }
- stock ice_entity( id, status )
- {
- if(status)
- {
- static ent, Float:o[3]
- if(!is_user_alive(id))
- {
- ice_entity( id, 0 )
- return
- }
- if( is_valid_ent(iceent[id]) )
- {
- if( pev( iceent[id], pev_iuser3 ) != id )
- {
- if( pev(iceent[id], pev_team) == 6969 ) remove_entity(iceent[id])
- }
- else
- {
- pev( id, pev_origin, o )
- if( pev( id, pev_flags ) & FL_DUCKING ) o[2] -= 15.0
- else o[2] -= 35.0
- entity_set_origin(iceent[id], o)
- return
- }
- }
- pev( id, pev_origin, o )
- if( pev( id, pev_flags ) & FL_DUCKING ) o[2] -= 15.0
- else o[2] -= 35.0
- ent = create_entity("info_target")
- set_pev( ent, pev_classname, "DareDevil" )
- entity_set_model(ent, ice_model)
- dllfunc(DLLFunc_Spawn, ent)
- set_pev(ent, pev_solid, SOLID_BBOX)
- set_pev(ent, pev_movetype, MOVETYPE_FLY)
- entity_set_origin(ent, o)
- entity_set_size(ent, Float:{ -3.0, -3.0, -3.0 }, Float:{ 3.0, 3.0, 3.0 } )
- set_pev( ent, pev_iuser3, id )
- set_pev( ent, pev_team, 6969 )
- set_rendering(ent, kRenderFxNone, 255, 255, 255, kRenderTransAdd, 255)
- iceent[id] = ent
- }
- else
- {
- if( is_valid_ent(iceent[id]) )
- {
- if( pev(iceent[id], pev_team) == 6969 ) remove_entity(iceent[id])
- iceent[id] = -1
- }
- }
- }
- frost_explode(ent)
- {
- // Get origin
- static Float:originF[3]
- pev(ent, pev_origin, originF)
- // Make the explosion
- create_blast(originF)
- emit_sound(ent, CHAN_AUTO, frozer, 1.0, ATTN_NORM, 0, PITCH_NORM)
- message_begin(MSG_ONE, g_msgScreenFade, _, ent)
- write_short(0) // duration
- write_short(0) // hold time
- write_short(0x0004) // fade type
- write_byte(0) // red
- write_byte(50) // green
- write_byte(200) // blue
- write_byte(100) // alpha
- message_end()
- }
- public remove_frost(id)
- {
- // Gradually remove screen's blue tint
- message_begin(MSG_ONE, g_msgScreenFade, _, id)
- write_short((1<<12)) // duration
- write_short(0) // hold time
- write_short(0x0000) // fade type
- write_byte(0) // red
- write_byte(50) // green
- write_byte(200) // blue
- write_byte(100) // alpha
- message_end()
- }
- create_blast(const Float:originF[3])
- {
- // Medium ring
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
- write_byte(TE_BEAMCYLINDER) // TE id
- engfunc(EngFunc_WriteCoord, originF[0]) // x
- engfunc(EngFunc_WriteCoord, originF[1]) // y
- engfunc(EngFunc_WriteCoord, originF[2]) // z
- engfunc(EngFunc_WriteCoord, originF[0]) // x axis
- engfunc(EngFunc_WriteCoord, originF[1]) // y axis
- engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
- write_short(g_exploSpr) // sprite
- write_byte(0) // startframe
- write_byte(0) // framerate
- write_byte(4) // life
- write_byte(60) // width
- write_byte(0) // noise
- write_byte(0) // red
- write_byte(191) // green
- write_byte(255) // blue
- write_byte(200) // brightness
- write_byte(0) // speed
- message_end()
- // Largest ring
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
- write_byte(TE_BEAMCYLINDER) // TE id
- engfunc(EngFunc_WriteCoord, originF[0]) // x
- engfunc(EngFunc_WriteCoord, originF[1]) // y
- engfunc(EngFunc_WriteCoord, originF[2]) // z
- engfunc(EngFunc_WriteCoord, originF[0]) // x axis
- engfunc(EngFunc_WriteCoord, originF[1]) // y axis
- engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
- write_short(g_exploSpr) // sprite
- write_byte(0) // startframe
- write_byte(0) // framerate
- write_byte(4) // life
- write_byte(60) // width
- write_byte(0) // noise
- write_byte(0) // red
- write_byte(191) // green
- write_byte(255) // blue
- write_byte(200) // brightness
- write_byte(0) // speed
- message_end()
- // Luz Dinamica
- engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
- write_byte(TE_DLIGHT) // TE id
- engfunc(EngFunc_WriteCoord, originF[0]) // x
- engfunc(EngFunc_WriteCoord, originF[1]) // y
- engfunc(EngFunc_WriteCoord, originF[2]) // z
- write_byte(50) // radio
- write_byte(0) // red
- write_byte(191) // green
- write_byte(255) // blue
- write_byte(30) // vida en 0.1, 30 = 3 segundos
- write_byte(30) // velocidad de decaimiento
- message_end()
- engfunc(EngFunc_MessageBegin, MSG_BROADCAST,SVC_TEMPENTITY, originF, 0)
- write_byte(TE_EXPLOSION)
- engfunc(EngFunc_WriteCoord, originF[0]) // x axis
- engfunc(EngFunc_WriteCoord, originF[1]) // y axis
- engfunc(EngFunc_WriteCoord, originF[2]+10) // z axis
- write_short(g_explosfr)
- write_byte(17)
- write_byte(15)
- write_byte(TE_EXPLFLAG_NOSOUND)
- message_end();
- engfunc(EngFunc_MessageBegin, MSG_BROADCAST,SVC_TEMPENTITY, originF, 0)
- write_byte(TE_SPRITETRAIL) // TE ID
- engfunc(EngFunc_WriteCoord, originF[0]) // x axis
- engfunc(EngFunc_WriteCoord, originF[1]) // y axis
- engfunc(EngFunc_WriteCoord, originF[2] + 40) // z axis
- engfunc(EngFunc_WriteCoord, originF[0]) // x axis
- engfunc(EngFunc_WriteCoord, originF[1]) // y axis
- engfunc(EngFunc_WriteCoord, originF[2]) // z axis
- write_short(frostgib) // Sprite Index
- write_byte(30) // Count
- write_byte(10) // Life
- write_byte(4) // Scale
- write_byte(50) // Velocity Along Vector
- write_byte(10) // Rendomness of Velocity
- message_end();
- }