NPC Register System (NRS)

NPC Register System (NRS) 4.45

Нет прав для скачивания
nrs_main.inc

Код:
/* Npc Register System functions
*
*  by Good_Hash
*
*  This file is provided as is (no warranties).
*/

#if defined _nrs_main_included
    #endinput
#endif
#define _nrs_main_included

#pragma reqlib "npc_register_system"

/* Called when a survivor kills npc */
forward event_npc_death(dead_ent, killer)

/* Called when npc loses casting range */
forward event_npc_casting_outrange(ent_id)

/* Called when npc reaches 150.0 units to owner */
forward event_npc_casting_range(npc_id, owner_id, Float:distance)

forward event_missile_catch(ent, owner, target)
forward event_hook_catch(npc_id, target_id, Float:distance)

/* Called when npc is damaged */
forward event_npc_damage(npc_id, attacker_id, Float:damage)

/* Called when npc is going to attack */
forward event_npc_damage_start(npc_id)

/* Called when npc damage is done after attack animation */
forward event_npc_damage_delayed(npc_id)


/* Called when a survivor is infected */
forward event_npc_init(ent_id)

/* Called when npc kills a player */
forward event_npc_kills(ent_id, target)


/* Called when the game starts */
forward event_gamestarted()

/* Called when the round ends */
forward event_round_ended()



/* Returns the value of all npc created */
native npc_get_creatednum()

/* Returns 1 if npc was created by NRS */
native is_nrs_npc(npc)

/* Returns true if the game has started */
native bool:npc_game_started()

/* Returns zombie class id, -1 otherwise */
native register_npc(classname[], description[])

/* Sets zombie player model */
native set_npc_model(classid, npc_model[])

/* All classes registered.. */
native get_npc_classum()

/* Returns zombie class id */
native get_npc_id(ent_id)

native get_npc_target(ent_id)

/* Returns zombie classname id */
native get_npc_classname_id(classname[])

native create_npc(Float:fOriginX, Float:fOriginY, Float:fOriginZ, class_id)

/* Calls %counter% zombie(s) for thetime seconds */
native npc_timecall(caster, Float:fOriginX, Float:fOriginY, Float:fOriginZ,  class, counter, iTime)


/* Set npc think! */
native set_npc_think(ent_id, value)

/* Set npc events! */
native set_npc_events(ent_id, Float:value)

/* Set npc mage! ( Can casting ) */
native set_npc_mage(ent_id, bool:value)

/* Set npc boss! */
native set_npc_boss(ent_id, custom_healthbar[], sprites_max)

/* Returns 1 if npc is a boss */
native get_npc_boss(ent_id)

/* Set npc custom foes */
native set_npc_foes(ent_id, Float:value)

/* Set npc custom targets */
native set_npc_targets(ent_id, Float:value)

/* Order to instant damage from NPC ( good for spells ) */
native npc_do_damage(npc, victim, Float:damage)

/* Order to drag to npc target */
native npc_do_drag(npc, victim)
native npc_do_dragend(npc)

native npc_shoot(ent_id, Float:fOrigin[3])

native npc_set_animation(ent, value, Float:lenght)
native npc_reset_animation(ent)
native npc_set_berserker(ent, value)
native npc_set_attack_delay(ent, Float:value)
native npc_set_move(ent, Float:Speed, Float:fOriginX, Float:fOriginy, Float:fOriginZ)
native npc_reset_move(ent)
native npc_take_aoe_damage(inflictor, Float:Radius, Float:damage)
native npc_do_aoe_damage(inflictor, Float:Radius, Float:damage)
native set_npc_victim(ent, victim)

/* Get npc events! */
native Float:get_npc_events(ent_id);

/* Reset NPC mode! ( remove all npc ) */
native npc_reset();
forward  event_npc_reset();

native npc_set_custom_heeting(ent_id, owner, Float:EVENT, Float:SPEED)


/* Return/set value of zombie class data */
native Float:get_npc_data(classid, dataid)
native set_npc_data(classid, dataid, Float:value)


/* User data for zombie's brains */
native nrs_user_victim(player_id, value)
native nrs_user_attacker(player_id, value)

nrs_const.inc

Код:
/* Npc Register System functions
*
*  by Good_Hash
*
*  This file is provided as is (no warranties).
*/

#if defined _nrs_const_included
    #endinput
#endif
#define _nrs_const_included

#define DATA_HEALTH 0
#define DATA_SPEED 1
#define DATA_GRAVITY 2
#define DATA_ATTACK 3
#define DATA_DEFENCE 4
#define DATA_HEDEFENCE 5
#define DATA_HITSPEED 6
#define DATA_HITDELAY 7
#define DATA_REGENDLY 8
#define DATA_HITREGENDLY 9
#define DATA_KNOCKBACK 10
#define DATA_ANI_DEATH_HEADSHOT 11
#define DATA_ANI_DEATH_NORMAL_SIMPLE 12
#define DATA_ANI_DEATH_NORMAL_BACK 13
#define DATA_ANI_DEATH_NORMAL_FORWARD 14
#define DATA_ANI_DEATH_NORMAL_SPECIAL 15
#define DATA_ANI_ATTACKED 16
#define DATA_ANI_IDLE 17
#define DATA_ANI_MADNESS 18
#define DATA_ANI_ATTACK 19
#define DATA_ANI_RUN 20
#define DATA_ANI_WALK 21
#define DATA_ANI_JUMP 22
#define DATA_EVENT 23
#define DATA_ATTACK_RELOADING 24
#define DATA_MODEL_INDEX 25
#define DATA_ATTACK_WAITTIME 26
#define DATA_ANI_CASTING 27
#define DATA_MATERIAL 28
#define DATA_WEAPON_TYPE    29
#define DATA_ANI_IDLE_SHOOT 30
#define DATA_ANI_RELOAD    31
#define DATA_WEAPON_DAMAGE    32
#define DATA_WEAPON_CLIP    33 //
#define DATA_MADANI_ATTACK    34
#define DATA_MADANI_ATTACK_TIME    35
#define DATA_MADANI_ATTACK_WAIT    36
#define DATA_MADANI_IDLE        37
#define DATA_MADANI_WALK    38
#define DATA_MADANI_RUN        39
#define DATA_ATTACK_DISTANCE    40
#define DATA_MIN_MAX_XY_MIN        41
#define DATA_MIN_MAX_XY_MAX        42
#define DATA_MIN_MAX_Z_MIN        43
#define DATA_MIN_MAX_Z_MAX        44
#define DATA_BLOOD_COLOR        45

// Weapon types

#define WEAPON_KNIFE        0.0
#define WEAPON_M4A1            1.0


// Material data

#define MATERIAL_BODY        0.0
#define MATERIAL_MISSILE        1.0
#define MATERIAL_VECHILE        2.0
#define MATERIAL_FVECHILE    3.0

// Behavior

#define EVENT_SLEEP            0.0
#define EVENT_ZOMBIE_VOID    1.0
#define EVENT_WAKEUP        2.0
#define EVENT_AGRESSION        3.0
#define EVENT_SUPPORT        4.0
#define EVENT_MISSILE            5.0
#define EVENT_CUSTOM        6.0
#define EVENT_POINT            7.0
#define EVENT_SHOOTER        8.0

// Behavior for custom targets

#define TARGET_ALL            0.0
#define TARGET_ZOMBIE        1.0
#define TARGET_HUMAN        2.0
#define TARGET_NPC            3.0

#define FOE_ALL                0.0
#define FOE_ZOMBIE            1.0
#define FOE_HUMAN            2.0
#define FOE_NPC                3.0


// Custom npc : if u made npc & want it do something..

#define CUSTOM_OFF            0.0
#define CUSTOM_HOTSEEK        1.0

// Custim npc-boss healthbar

#define HEALTHBAR_NONE        "ignore"

nrs_main.cfg

Код:
/* Npc Register System configs
*
*  by Good_Hash
*
*  This file is provided as is (no warranties).
*/

#if defined _nrscfg_included
    #endinput
#endif
#define _nrscfg_included

// default npc setting
#define DEFAULT_PMODEL        "models/player/nrs_l4d_npc/nrs_l4d_npc.mdl"

#define DEFAULT_HEALTH         75.0 //Health value
#define DEFAULT_SPEED        250.0 //Speed value
#define DEFAULT_GRAVITY        1.5   //Gravity multiplier
#define DEFAULT_ATTACK        15.0   //Zombie damage multiplier
#define DEFAULT_DEFENCE        1.0 //Bullet damage multiplier ( 0.087 )
#define DEFAULT_HEDEFENCE   1.0   //HE damage multiplier
#define DEFAULT_HITSPEED    0.89  //Pain speed multiplier
#define DEFAULT_HITDELAY    0.28  //Pain speed delay value
#define DEFAULT_REGENDLY    666.18  //Regeneration delay value
#define DEFAULT_HITREGENDLY 2.0   //Pain regeneration delay value
#define DEFAULT_KNOCKBACK   1.0   //Knockback multiplier
#define DEFAULT_MODELINDEX  0.0   //Model Index


new AMMO_TO_GIVE    = 10

stock ChatColor(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
 
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!r", "^3")
    replace_all(msg, 190, "!b", "^0")
 
    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), {0,0,0}, players[i])
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
        }
    }
}
Назад
Верх