AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [ReQ-EDIT] Boss Plugin Edit (https://forums.alliedmods.net/showthread.php?t=178450)

wTf. 02-16-2012 06:55

[ReQ-EDIT] Boss Plugin Edit
 
This pluin edit?

PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define DIONE_CLASSNAME "dione"

new dione_model_id
new const dione_model[] = "models/dione/dione.mdl"
new const skill_posion[2][] = {
    
"models/dione/ef_poison01.mdl"// Start
    
"models/dione/ef_poison02.mdl" // End
}
new const 
skill_swing[] = "models/dione/ef_swing.mdl"
new const skill_tentacle[][] = {
    
"models/dione/ef_tentacle_sign.mdl",
    
"models/dione/tentacle.mdl",
    
"models/dione/ef_tentacle.mdl"
}

new const 
skill_bite_sound[] = "dione/zbs_attack_bite.wav"
new const skill_posion_sound[] = "dione/zbs_attack_poison1.wav"
new const skill_swing_sound[] = "dione/boss_swing.wav"
new const skill_rolling_sound[] = "dione/zbs_rolling2.wav"
new const escape_sound[] = "dione/exit1.wav"

new Float:g_origin[3], ent_idFloat:g_angles[3], Float:g_v_angles[3]
new 
Float:g_poison_touch[33], g_rollingg_can_do_skillg_doing_skill
new g_regm_iBlood[2], g_can_bite

public plugin_init()
{
    
register_plugin("[Dias's NPC] Dione""1.0""Dias")
    
    
register_touch("poison""*""fw_poison_touch")
    
register_touch("poison2""*""fw_poison2_touch")
    
register_touch("tentacle2""*""fw_tentacle_touch")
    
    
register_touch(DIONE_CLASSNAME"*""fw_dione_touch")
    
register_think(DIONE_CLASSNAME"fw_dione_think")
    
    
register_clcmd("say /get_origin""get_origin_first")
    
register_clcmd("say /make""dione_appear")
    
    
register_clcmd("say /skill_swing""dione_do_skill")
    
register_clcmd("say /skill_poison""dione_do_skill2")
    
register_clcmd("say /skill_rolling""dione_do_skill3")
    
register_clcmd("say /skill_bite""dione_do_skill4")
    
register_clcmd("say /skill_tentacle""dione_do_skill5")
}

public 
plugin_precache()
{
    
dione_model_id engfunc(EngFunc_PrecacheModeldione_model)
    
engfunc(EngFunc_PrecacheModelskill_swing)
    
    for(new 
0sizeof(skill_posion); i++)
    {
        
engfunc(EngFunc_PrecacheModelskill_posion[i])
    }
    for(new 
0sizeof(skill_tentacle); i++)
    {
        
engfunc(EngFunc_PrecacheModelskill_tentacle[i])
    }    
    
    
engfunc(EngFunc_PrecacheSoundskill_bite_sound)
    
engfunc(EngFunc_PrecacheSoundskill_posion_sound)
    
engfunc(EngFunc_PrecacheSoundskill_swing_sound)
    
engfunc(EngFunc_PrecacheSoundskill_rolling_sound)
    
engfunc(EngFunc_PrecacheSoundescape_sound)
    
    
m_iBlood[0] = precache_model("sprites/blood.spr")
    
m_iBlood[1] = precache_model("sprites/bloodspray.spr")    
}

public 
get_origin_first(id)
{
    
pev(idpev_origing_origin)
    
pev(idpev_anglesg_angles)
    
pev(idpev_v_angleg_v_angles)
}

public 
dione_appear(id)
{
    new 
ent create_entity("info_target")
    
ent_id ent
    
    entity_set_origin
(entg_origin)
    
entity_set_vector(entEV_VEC_anglesg_angles)
    
entity_set_vector(entEV_VEC_v_angleg_v_angles)
    
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_health500.0)
    
    
entity_set_string(ent,EV_SZ_classnameDIONE_CLASSNAME)
    
entity_set_model(entdione_model)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_STEP)
    
    new 
Float:maxs[3] = {50.0,50.050.0}
    new 
Float:mins[3] = {-50.0, -50.0,-30.0}
    
entity_set_size(entminsmaxs)
    
entity_set_int(entEV_INT_modelindexdione_model_id)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence4)
    
    
entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.01)

    if(!
g_reg)
    {
        
RegisterHamFromEntity(Ham_TakeDamageent"fw_takedmg")
        
RegisterHamFromEntity(Ham_Killedent"fw_killed")
        
g_reg 1
    
}    
    
    
g_can_bite 0
    g_rolling 
0
    g_can_do_skill 
1
    
    drop_to_floor
(ent)
}

public 
dione_do_skill()
{
    
g_doing_skill 1
    dione_swing
()
}

public 
dione_do_skill2()
{
    
g_doing_skill 1
    dione_poison
()
}

public 
dione_do_skill3()
{
    
g_doing_skill 1
    dione_rolling
()
}

public 
dione_do_skill4()
{
    
g_can_bite 1
}

public 
dione_do_skill5()
{
    
g_doing_skill 1
    dione_tentacle
()
}

public 
fw_dione_think(ent)
{
    if(!
is_valid_ent(ent))
        return 
FMRES_IGNORED
        
    
if(!g_doing_skill && g_can_bite)
    {
        static 
victim
        
static Float:Origin[3], Float:VicOrigin[3], Float:distance
        
        victim 
FindClosesEnemy(ent)
        
pev(entpev_originOrigin)
        
pev(victimpev_originVicOrigin)
        
        
distance get_distance_f(OriginVicOrigin)
        
        if(
is_user_alive(victim))
        {
            if(
distance <= 300.0)
            {
                if(!
is_valid_ent(ent))
                    return 
FMRES_IGNORED    
            
                
new Float:Ent_Origin[3], Float:Vic_Origin[3]
                
                
pev(entpev_originEnt_Origin)
                
pev(victimpev_originVic_Origin)            
            
                
npc_turntotarget(entEnt_OriginvictimVic_Origin)
                
                
entity_set_float(entEV_FL_animtimeget_gametime())
                
entity_set_float(entEV_FL_framerate1.0)
                
entity_set_int(entEV_INT_sequence8)        
                
                
emit_sound(victimCHAN_BODYskill_bite_sound1.0ATTN_NORM0PITCH_NORM)
                
                static 
arg[2]
                
arg[0] = ent
                arg
[1] = victim
                
                set_task
(0.5"dione_attack"_argsizeof(arg))
                
set_task(1.0"dione_attack2"victim)
                
entity_set_float(entEV_FL_nextthinkget_gametime() + 3.0)
            } else {
                
                if(
pev(entpev_sequence) != 5)
                {
                    
entity_set_float(entEV_FL_animtimeget_gametime())
                    
entity_set_float(entEV_FL_framerate1.0)
                    
entity_set_int(entEV_INT_sequence5)
                }
                    
                new 
Float:Ent_Origin[3], Float:Vic_Origin[3]
                
                
pev(entpev_originEnt_Origin)
                
pev(victimpev_originVic_Origin)
                
                
npc_turntotarget(entEnt_OriginvictimVic_Origin)
                
hook_ent(entvictim)
                
                
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.5)
            }
        } else {
            if(
pev(entpev_sequence) != 4)
            {
                
entity_set_float(entEV_FL_animtimeget_gametime())
                
entity_set_float(entEV_FL_framerate1.0)
                
entity_set_int(entEV_INT_sequence4)
            }
                
            
entity_set_float(entEV_FL_nextthinkget_gametime() + 1.0)
        }        
    } else {
        
entity_set_float(entEV_FL_nextthinkget_gametime() + 2.0)
    }
    
    return 
FMRES_HANDLED
}

public 
dione_attack(arg[])
{
    static 
entvictim
    ent 
arg[0]
    
victim arg[1]
    
    
ExecuteHam(Ham_TakeDamagevictim0victimrandom_float(15.030.0), DMG_BLAST
    
    
set_task(1.5"stop_attack"ent)
}

public 
dione_attack2(victim)
{
    
ExecuteHam(Ham_TakeDamagevictim0victimrandom_float(15.030.0), DMG_BLAST
}

public 
stop_attack(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence4)    
}

public 
fw_takedmg(victiminflictorattackerFloat:damagedamagebits)
{
    static 
Float:Origin[3]
    
pev(victimpev_originOrigin)
    
    
create_blood(Origin)    
}

public 
fw_killed(ent2attacker)
{
    static 
ent
    ent 
create_entity("info_target")
    static 
Float:Origin[3], Float:Angles[3]
    
    
pev(ent2pev_originOrigin)
    
pev(ent2pev_anglesAngles)
    
    
entity_set_origin(entOrigin)
    
entity_set_vector(entEV_VEC_anglesAngles)
    
    
entity_set_string(entEV_SZ_classname"temp_zb")
    
entity_set_model(entdione_model)
    
    new 
Float:maxs[3] = {50.0,50.050.0}
    new 
Float:mins[3] = {-50.0, -50.0,-30.0}
    
entity_set_size(entminsmaxs)    
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence16)        
    
    
set_task(5.0"set_dione_run"ent)
    
set_task(10.0"remove_temp_zb"ent)
    
    
emit_sound(entCHAN_BODYescape_sound1.0ATTN_NORM0PITCH_NORM)
    
    
drop_to_floor(ent)
}

public 
set_dione_run(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence17)
}

public 
remove_temp_zb(ent)
{
    
remove_entity(ent)
}

// ====================== TENTACLE SKILL ==============================
public dione_tentacle()
{
    if(!
g_can_do_skill)
        return 
PLUGIN_HANDLED
    
    
static ent
    ent 
ent_id
    
    g_doing_skill 
1
    
    entity_set_float
(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence9)    
    
    
set_task(2.5"make_hole_tentacle"ent)
    
    return 
PLUGIN_CONTINUE
}

public 
make_hole_tentacle(ent)
{
    static 
Float:Origin[3], Float:beam_origin[30][3], Float:Angles[3]
    
    
entity_get_vector(entEV_VEC_originOrigin)
    
entity_get_vector(entEV_VEC_v_angleAngles)

    
// 1st
    
beam_origin[0][0] = Origin[0]
    
beam_origin[0][1] = Origin[1] + 100.0
    beam_origin
[0][2] = Origin[2]
    
    
// 2nd
    
beam_origin[1][0] = Origin[0]
    
beam_origin[1][1] = Origin[1] + 200.0
    beam_origin
[1][2] = Origin[2]

    
// 3rd 
    
beam_origin[2][0] = Origin[0]
    
beam_origin[2][1] = Origin[1] + 300.0
    beam_origin
[2][2] = Origin[2]

    
// 4th 
    
beam_origin[3][0] = Origin[0]
    
beam_origin[3][1] = Origin[1] + 400.0
    beam_origin
[3][2] = Origin[2]

    
// 5th 
    
beam_origin[4][0] = Origin[0]
    
beam_origin[4][1] = Origin[1] + 500.0
    beam_origin
[4][2] = Origin[2]

    
// 6th 
    
beam_origin[5][0] = Origin[0] + 100.0
    beam_origin
[5][1] = Origin[1] + 100.0
    beam_origin
[5][2] = Origin[2]

    
// 7th 
    
beam_origin[6][0] = Origin[0] + 200.0
    beam_origin
[6][1] = Origin[1] + 200.0
    beam_origin
[6][2] = Origin[2]

    
// 8th 
    
beam_origin[7][0] = Origin[0] + 300.0
    beam_origin
[7][1] = Origin[1] + 300.0
    beam_origin
[7][2] = Origin[2]
    
    
// 9th 
    
beam_origin[8][0] = Origin[0] + 400.0
    beam_origin
[8][1] = Origin[1] + 400.0
    beam_origin
[8][2] = Origin[2]
    
    
// 10th 
    
beam_origin[9][0] = Origin[0] + 500.0
    beam_origin
[9][1] = Origin[1] + 500.0
    beam_origin
[9][2] = Origin[2]
    
    
// 11th 
    
beam_origin[10][0] = Origin[0] - 100.0
    beam_origin
[10][1] = Origin[1] + 100.0
    beam_origin
[10][2] = Origin[2]

    
// 12th 
    
beam_origin[11][0] = Origin[0] - 200.0
    beam_origin
[11][1] = Origin[1] + 200.0
    beam_origin
[11][2] = Origin[2]

    
// 13th 
    
beam_origin[12][0] = Origin[0] - 300.0
    beam_origin
[12][1] = Origin[1] + 300.0
    beam_origin
[12][2] = Origin[2]

    
// 14th 
    
beam_origin[13][0] = Origin[0] - 400.0
    beam_origin
[13][1] = Origin[1] + 400.0
    beam_origin
[13][2] = Origin[2]
    
    
// 15th 
    
beam_origin[14][0] = Origin[0] - 500.0
    beam_origin
[14][1] = Origin[1] + 500.0
    beam_origin
[14][2] = Origin[2]
    
    
// II
    
    // 1st
    
beam_origin[15][0] = Origin[0]
    
beam_origin[15][1] = Origin[1] - 100.0
    beam_origin
[15][2] = Origin[2]
    
    
// 2nd
    
beam_origin[16][0] = Origin[0]
    
beam_origin[16][1] = Origin[1] - 200.0
    beam_origin
[16][2] = Origin[2]

    
// 3rd 
    
beam_origin[17][0] = Origin[0]
    
beam_origin[17][1] = Origin[1] - 300.0
    beam_origin
[17][2] = Origin[2]

    
// 4th 
    
beam_origin[18][0] = Origin[0]
    
beam_origin[18][1] = Origin[1] - 400.0
    beam_origin
[18][2] = Origin[2]

    
// 5th 
    
beam_origin[19][0] = Origin[0]
    
beam_origin[19][1] = Origin[1] - 500.0
    beam_origin
[19][2] = Origin[2]

    
// 6th 
    
beam_origin[20][0] = Origin[0] - 100.0
    beam_origin
[20][1] = Origin[1] - 100.0
    beam_origin
[20][2] = Origin[2]

    
// 7th 
    
beam_origin[21][0] = Origin[0] - 200.0
    beam_origin
[21][1] = Origin[1] - 200.0
    beam_origin
[21][2] = Origin[2]

    
// 8th 
    
beam_origin[22][0] = Origin[0] - 300.0
    beam_origin
[22][1] = Origin[1] - 300.0
    beam_origin
[22][2] = Origin[2]
    
    
// 9th 
    
beam_origin[23][0] = Origin[0] - 400.0
    beam_origin
[23][1] = Origin[1] - 400.0
    beam_origin
[23][2] = Origin[2]
    
    
// 10th 
    
beam_origin[24][0] = Origin[0] - 500.0
    beam_origin
[24][1] = Origin[1] - 500.0
    beam_origin
[24][2] = Origin[2]
    
    
// 11th 
    
beam_origin[25][0] = Origin[0] + 100.0
    beam_origin
[25][1] = Origin[1] - 100.0
    beam_origin
[25][2] = Origin[2]

    
// 12th 
    
beam_origin[26][0] = Origin[0] + 200.0
    beam_origin
[26][1] = Origin[1] - 200.0
    beam_origin
[26][2] = Origin[2]

    
// 13th 
    
beam_origin[27][0] = Origin[0] + 300.0
    beam_origin
[27][1] = Origin[1] - 300.0
    beam_origin
[27][2] = Origin[2]

    
// 14th 
    
beam_origin[28][0] = Origin[0] + 400.0
    beam_origin
[28][1] = Origin[1] - 400.0
    beam_origin
[28][2] = Origin[2]
    
    
// 15th 
    
beam_origin[29][0] = Origin[0] + 500.0
    beam_origin
[29][1] = Origin[1] - 500.0
    beam_origin
[29][2] = Origin[2]
    
    for(new 
i30i++) 
    {
        
make_tentacle(beam_origin[i], Angles)
    }        
    
    
set_task(8.0"set_default_anim"ent)
}

public 
make_tentacle(Float:Origin[3], Float:Angles[3])
{
    new 
ent create_entity("info_target")

    
Origin[2] += 5.0
    
    entity_set_origin
(entOrigin)
    
entity_set_vector(entEV_VEC_v_angleAngles)
    
    
entity_set_string(ent,EV_SZ_classname"tentacle")
    
entity_set_model(entskill_tentacle[0])
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    
    new 
Float:maxs[3] = {1.0,1.0,1.0}
    new 
Float:mins[3] = {-1.0,-1.0,-1.0}
    
entity_set_size(entminsmaxs)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)    
    
    
set_pev(entpev_rendermodekRenderTransAdd)
    
set_pev(entpev_renderamt255.0)        
    
    
set_task(4.0"tentacle_change"ent)
    
    
//drop_to_floor(ent)
}

public 
tentacle_change(ent)
{
    
entity_set_model(entskill_tentacle[1])
    
    
entity_set_string(ent,EV_SZ_classname"tentacle2")
    
    new 
Float:maxs[3] = {26.0,26.0,36.0}
    new 
Float:mins[3] = {-26.0,-26.0,-36.0}
    
entity_set_size(entminsmaxs)    
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)    
    
    
set_pev(entpev_rendermodekRenderNormal)
    
set_pev(entpev_renderamt255.0)        
    
    
set_task(1.0"tentacle_change2"ent)
}

public 
tentacle_change2(ent)
{
    
entity_set_model(entskill_tentacle[2])
    
entity_set_string(ent,EV_SZ_classname"tentacle")
    
    new 
Float:maxs[3] = {1.0,1.0,1.0}
    new 
Float:mins[3] = {-1.0,-1.0,-1.0}
    
entity_set_size(entminsmaxs)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)    
    
    
set_pev(entpev_rendermodekRenderTransAdd)
    
set_pev(entpev_renderamt255.0)        
    
    
set_task(3.0"remove_tentacle"ent)
}

public 
remove_tentacle(ent)
{
    
remove_entity(ent)
    
    
g_doing_skill 0
}

public 
set_default_anim(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence4)        
}

public 
fw_tentacle_touch(tentacletouch)
{
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()
        
        if(
CurTime 0.1 g_poison_touch[touch])
        {
            static 
ent
            ent 
find_ent_by_owner(-1"weapon_knife"touch)
            
ExecuteHamB(Ham_TakeDamagetouchenttouch5.0DMG_BLAST)    
            
            
g_poison_touch[touch] = CurTime
        
}
    }    
}

// ====================== ROLLING SKILL ==============================
public dione_rolling()
{
    if(!
g_can_do_skill)
        return 
PLUGIN_HANDLED
    
    
static ent
    ent 
ent_id
    
    g_doing_skill 
1
    
    entity_set_float
(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence13)
    
    
set_task(0.75"do_rolling"ent)
    
set_task(2.0"stop_rolling"ent)
    
    return 
PLUGIN_CONTINUE
}

public 
do_rolling(ent)
{
    
g_rolling 1
    
    entity_set_float
(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence14)
    
    
emit_sound(entCHAN_BODYskill_rolling_sound1.0ATTN_NORM0PITCH_NORM)
    
    static 
Float:Velocity[3]
    
velocity_by_aim(ent1250Velocity)
    
    
entity_set_vector(entEV_VEC_velocityVelocity)
    
    for(new 
1get_maxplayers(); i++)
    {
        if(
is_user_alive(i) && entity_range(ient) <= 500.0)
        {
            
message_begin(MSG_ONEget_user_msgid("ScreenShake"),{0,0,0}, i)
            
write_short(1<<14)
            
write_short(1<<13)
            
write_short(1<<13)
            
message_end()
        }
    }
    
    
drop_to_floor(ent)
}

public 
stop_rolling(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence15)
    
    static 
Float:Velocity[3]
    
velocity_by_aim(ent0Velocity)
    
    
entity_set_vector(entEV_VEC_velocityVelocity)    
    
drop_to_floor(ent)
    
    
g_rolling 0
    
    set_task
(1.0"restart_rolling"ent)
}

public 
restart_rolling(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence4)    

    
g_doing_skill 0
    
    drop_to_floor
(ent)
}

public 
fw_dione_touch(dionetouch)
{
    if(!
g_rolling)
        return 
FMRES_IGNORED
        
    
if(is_user_alive(touch))
    {
        
user_kill(touch)
    }
    
    return 
FMRES_HANDLED
}

// ====================== SWING SKILL ==============================
public dione_swing()
{
    if(!
g_can_do_skill)
        return 
PLUGIN_HANDLED    
    
    
static ent
    ent 
ent_id
    
    g_doing_skill 
1
    
    entity_set_float
(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)
    
entity_set_int(entEV_INT_sequence7)
    
    
emit_sound(entCHAN_BODYskill_swing_sound1.0ATTN_NORM0PITCH_NORM)
    
    
set_task(1.0"attack_swing"ent)
    
set_task(1.5"remove_swing_model"ent)
    
set_task(2.0"stop_swing"ent)

    return 
PLUGIN_CONTINUE
}

public 
attack_swing(dione)
{
    new 
ent create_entity("info_target")

    static 
Float:Origin[3]
    
entity_get_vector(dioneEV_VEC_originOrigin)
    
    
Origin[2] -= 30.0
    entity_set_origin
(entOrigin)
    
    
entity_set_string(ent,EV_SZ_classname"swing")
    
entity_set_model(entskill_swing)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(entminsmaxs)
    
    
set_pev(entpev_rendermodekRenderTransAdd)
    
set_pev(entpev_renderamt255.0)    
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)    
    
    for(new 
1get_maxplayers(); i++)
    {
        if(
is_user_alive(i) && entity_range(idione) <= 300.0)
        {
            
message_begin(MSG_ONEget_user_msgid("ScreenShake"),{0,0,0}, i)
            
write_short(1<<14)
            
write_short(1<<13)
            
write_short(1<<13)
            
message_end()
            
            
ExecuteHamB(Ham_TakeDamagei0i15.0DMG_BLAST)    
        
            new 
wpnwpnname[32]
            
wpn get_user_weapon(i)
            if(
get_weaponname(wpnwpnnamecharsmax(wpnname)))
            {
                
engclient_cmd(i"drop"wpnname)
            }
        }
    }
    
    
drop_to_floor(ent)
}

public 
remove_swing_model(ent)
{
    static 
ent2
    ent2 
find_ent_by_class(-1"swing")
    
    
remove_entity(ent2)    
}

public 
stop_swing(ent)
{
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence4)    
    
    
g_doing_skill 0
}

// ====================== POISON SKILL ==============================
public dione_poison()
{
    if(!
g_can_do_skill)
        return 
PLUGIN_HANDLED    
    
    
static ent
    ent 
ent_id
    
    g_doing_skill 
1
    
    emit_sound
(entCHAN_BODYskill_posion_sound1.0ATTN_NORM0PITCH_NORM)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequencerandom_num(1112))
    
    
set_task(3.5"attack_poison"ent)
    
    return 
PLUGIN_CONTINUE
}

public 
attack_poison(dione)
{
    static 
Float:Velocity[3], Float:Origin[3], Float:Angles[3], Float:V_Angles[3]

    
engfunc(EngFunc_GetAttachmentdione0OriginAngles)
    
    
//entity_get_vector(dione, EV_VEC_origin, Origin)
    
entity_get_vector(dioneEV_VEC_anglesAngles)
    
entity_get_vector(dioneEV_VEC_v_angleV_Angles)
    
    new 
ent create_entity("info_target")

    
entity_set_origin(entOrigin)
    
    
entity_set_vector(entEV_VEC_anglesAngles)
    
entity_set_vector(entEV_VEC_v_angleV_Angles)
    
    
entity_set_string(ent,EV_SZ_classname"poison")
    
entity_set_model(entskill_posion[0])
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)
    
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(entminsmaxs)
    
    
velocity_by_aim(dione1500Velocity)
    
entity_set_vector(entEV_VEC_velocityVelocity)
    
    
entity_set_float(dioneEV_FL_animtimeget_gametime())
    
entity_set_float(dioneEV_FL_framerate1.0)    
    
entity_set_int(dioneEV_INT_sequence4)    
}

public 
fw_poison_touch(poisontouch)
{
    
entity_set_int(poisonEV_INT_movetypeMOVETYPE_NONE)
    
    static 
Float:Origin[3], Float:beam_origin[8][3]
    
entity_get_vector(poisonEV_VEC_originOrigin)

    
// 1st
    
beam_origin[0][0] = Origin[0] + 100.0
    beam_origin
[0][1] = Origin[1] + 50.0
    beam_origin
[0][2] = Origin[2]
    
    
// 2nd
    
beam_origin[1][0] = Origin[0] + 100.0
    beam_origin
[1][1] = Origin[1] - 50.0
    beam_origin
[1][2] = Origin[2]

    
// 3rd 
    
beam_origin[2][0] = Origin[0] - 100.0
    beam_origin
[2][1] = Origin[1] - 50.0
    beam_origin
[2][2] = Origin[2]

    
// 4th 
    
beam_origin[3][0] = Origin[0] - 100.0
    beam_origin
[3][1] = Origin[1] + 50.0
    beam_origin
[3][2] = Origin[2]

    
// 5th 
    
beam_origin[4][0] = Origin[0] + 50.0
    beam_origin
[4][1] = Origin[1] + 100.0
    beam_origin
[4][2] = Origin[2]

    
// 6th 
    
beam_origin[5][0] = Origin[0] + 50.0
    beam_origin
[5][1] = Origin[1] - 100.0
    beam_origin
[5][2] = Origin[2]

    
// 7th 
    
beam_origin[6][0] = Origin[0] - 50.0
    beam_origin
[6][1] = Origin[1] - 100.0
    beam_origin
[6][2] = Origin[2]

    
// 8th 
    
beam_origin[7][0] = Origin[0] - 50.0
    beam_origin
[7][1] = Origin[1] + 100.0
    beam_origin
[7][2] = Origin[2]
    
    
Origin[2] -= 35.0
    make_acid
(Origin)
    
    for(new 
i8i++) 
    {
        
make_acid(beam_origin[i])
    }    
    
    new 
Float:remove_origin[3] = {999999.9,999999.9,999999.0}    
    
entity_set_origin(poisonremove_origin)    
}

public 
fw_poison2_touch(poisontouch)
{
    if(
is_user_alive(touch))
    {
        static 
Float:CurTime
        CurTime 
get_gametime()
        
        if(
CurTime 1.0 g_poison_touch[touch])
        {
            static 
ent
            ent 
find_ent_by_owner(-1"weapon_knife"touch)
            
ExecuteHamB(Ham_TakeDamagetouchenttouch10.0DMG_BLAST)    
            
            
g_poison_touch[touch] = CurTime
        
}
    }
}

public 
remove_poison(ent)
{
    
remove_entity(ent)
    
    
g_doing_skill 0
}

public 
make_acid(Float:Origin[3])
{
    new 
ent create_entity("info_target")
    
    
entity_set_origin(entOrigin)

    
set_pev(entpev_rendermodekRenderTransAdd)
    
set_pev(entpev_renderamt150.0)
    
    
entity_set_string(ent,EV_SZ_classname"poison2")
    
entity_set_model(entskill_posion[1])
    
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    
    new 
Float:maxs[3] = {40.040.01.0}
    new 
Float:mins[3] = {-40.0, -40.0, -1.0}
    
entity_set_size(entminsmaxs)
        
    
drop_to_floor(ent)
    
    
set_task(5.0"remove_poison"ent)
}

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(entidi))
        {
            
Dist entity_range(entidi)
            if(
Dist <= maxdistance)
            {
                
maxdistance=Dist
                indexid
=i
                
                
return indexid
            
}
        }    
    }    
    return 
0
}

public 
npc_turntotarget(entFloat:Ent_Origin[3], targetFloat:Vic_Origin[3]) 
{
    if(
target
    {
        new 
Float:newAngle[3]
        
entity_get_vector(entEV_VEC_anglesnewAngle)
        new 
Float:Vic_Origin[0] - Ent_Origin[0]
        new 
Float:Vic_Origin[1] - Ent_Origin[1]

        new 
Float:radians floatatan(z/xradian)
        
newAngle[1] = radians * (180 3.14)
        if (
Vic_Origin[0] < Ent_Origin[0])
            
newAngle[1] -= 180.0
        
        entity_set_vector
(entEV_VEC_anglesnewAngle)
    }
}

public 
bool:can_see_fm(entindex1entindex2)
{
    if (!
entindex1 || !entindex2)
        return 
false

    
if (pev_valid(entindex1) && pev_valid(entindex1))
    {
        new 
flags pev(entindex1pev_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(entindex1pev_originlookerOrig)
        
pev(entindex1pev_view_ofstemp)
        
lookerOrig[0] += temp[0]
        
lookerOrig[1] += temp[1]
        
lookerOrig[2] += temp[2]

        
pev(entindex2pev_origintargetBaseOrig)
        
pev(entindex2pev_view_ofstemp)
        
targetOrig[0] = targetBaseOrig [0] + temp[0]
        
targetOrig[1] = targetBaseOrig [1] + temp[1]
        
targetOrig[2] = targetBaseOrig [2] + temp[2]

        
engfunc(EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the had of seen player
        
if (get_tr2(0TraceResult:TR_InOpen) && get_tr2(0TraceResult:TR_InWater))
        {
            return 
false
        

        else 
        {
            new 
Float:flFraction
            get_tr2
(0TraceResult:TR_flFractionflFraction)
            if (
flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
            {
                return 
true
            
}
            else
            {
                
targetOrig[0] = targetBaseOrig [0]
                
targetOrig[1] = targetBaseOrig [1]
                
targetOrig[2] = targetBaseOrig [2]
                
engfunc(EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the body of seen player
                
get_tr2(0TraceResult:TR_flFractionflFraction)
                if (
flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
                {
                    return 
true
                
}
                else
                {
                    
targetOrig[0] = targetBaseOrig [0]
                    
targetOrig[1] = targetBaseOrig [1]
                    
targetOrig[2] = targetBaseOrig [2] - 17.0
                    engfunc
(EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the legs of seen player
                    
get_tr2(0TraceResult:TR_flFractionflFraction)
                    if (
flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
                    {
                        return 
true
                    
}
                }
            }
        }
    }
    return 
false
}

public 
hook_ent(entvictim)
{
    static 
Float:fl_Velocity[3]
    static 
Float:VicOrigin[3], Float:EntOrigin[3]

    
pev(entpev_originEntOrigin)
    
pev(victimpev_originVicOrigin)
    
    static 
Float:distance_f
    distance_f 
get_distance_f(EntOriginVicOrigin)

    if (
distance_f 60.0)
    {
        new 
Float:fl_Time distance_f 250.0

        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(entEV_VEC_velocityfl_Velocity)
}

public 
create_blood(const Float:origin[3])
{
    
// Show some blood :)
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY
    
write_byte(TE_BLOODSPRITE)
    
engfunc(EngFunc_WriteCoordorigin[0])
    
engfunc(EngFunc_WriteCoordorigin[1])
    
engfunc(EngFunc_WriteCoordorigin[2])
    
write_short(m_iBlood[1])
    
write_short(m_iBlood[0])
    
write_byte(75)
    
write_byte(5)
    
message_end()




1- When kill boss come to exp.
2- Adjustable boss health(cvar) -> Sample: "amx_boss_health <9999999>"
3- Born within the period determined in any part of the map boss(cvar) -> Sample: "amx_boss_time <30.0>"
4- Utilize the boss skill.


Thnx in advance.

wTf. 04-08-2012 12:49

Re: [ReQ-EDIT] Boss Plugin Edit
 
Uppp


All times are GMT -4. The time now is 10:02.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.