#include #include #include #include #include #define ZOMBIE_NAME "Boomer" #define ZOMBIE_INFO "Strong Zombie" #define ZOMBIE_MODEL "boomer_zombi_origin" #define ZOMBIE_CLAW "v_knife_boomer_zombi.mdl" #define ZOMBIE_GRENADE "models/batcon/grenade/v_zombibomb_boomer_zombi.mdl" #define ZOMBIE_HEALTH 2000 #define ZOMBIE_SPEED 220 #define ZOMBIE_GRAVITY 0.88 #define ZOMBIE_KNOCBACK 0.43 #define ZOMBIE_DAMAGE 4.0 #define TIME_RELOAD 15.0 #define TIME_ABILITY 1.0 #define SOUND_SKILL "batcon/big_new/boomer_skill.wav" #define SOUND_EVOLUTION "batcon/zombi_evolution.wav" #define EVOLUTION_HEALTH_1 4000 #define EVOLUTION_SPEED_1 300 #define EVOLUTION_GRAVITY_1 0.70 #define EVOLUTION_HEALTH_2 6000 #define EVOLUTION_SPEED_2 350 #define EVOLUTION_GRAVITY_2 0.30 #define RELOAD_ABILITY_EVOLUTION 5.0 #define INFECT_PLAYER_1 5 #define INFECT_PLAYER_2 10 const m_pPlayer = 41 const m_flNextPrimaryAttack = 46 const m_flNextSecondaryAttack = 47 const m_flTimeWeaponIdle = 48 const OFFSET_PAINSHOCK = 108 new class_boomer new g_ability[33], g_evolution[33], stadia_1[33], stadia_2[33] public plugin_init() { register_plugin("[Z] Class: Strong Zombie","1.0","batcon") register_clcmd("drop","ability_start") RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade", "Ham_Item_Deploy_Post", 1) RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fw_Knife_SecondaryAttack_Post", 1) register_clcmd("say level", "chat") } public plugin_precache() { class_boomer = zp_register_zombie_class(ZOMBIE_NAME, ZOMBIE_INFO, ZOMBIE_MODEL, ZOMBIE_CLAW, ZOMBIE_HEALTH, ZOMBIE_SPEED, Float:ZOMBIE_GRAVITY, Float:ZOMBIE_KNOCBACK) engfunc(EngFunc_PrecacheModel, ZOMBIE_GRENADE) engfunc(EngFunc_PrecacheSound, SOUND_SKILL) engfunc(EngFunc_PrecacheSound, SOUND_EVOLUTION) } public Ham_Item_Deploy_Post(weapon_ent) { new id = get_pdata_cbase(weapon_ent, m_pPlayer) if((zp_get_user_zombie_class(id) == class_boomer) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id)) { set_pev(id, pev_viewmodel2, ZOMBIE_GRENADE) } } public fw_TakeDamage(victim, inflictor, attacker, Float:damage) { if (victim != attacker && is_user_connected(attacker)) { if((get_user_weapon(attacker) == CSW_KNIFE) && (zp_get_user_zombie_class(attacker) == class_boomer) && zp_get_user_zombie(attacker) && !zp_get_user_nemesis(attacker)) { SetHamParamFloat(4, damage * ZOMBIE_DAMAGE) } } } public fw_Knife_SecondaryAttack_Post(weapon_ent) { new id = get_pdata_cbase(weapon_ent, m_pPlayer, 4) if(is_user_connected(id) && (zp_get_user_zombie_class(id) == class_boomer) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id)) { set_pdata_float(weapon_ent, m_flNextPrimaryAttack, 2.0, 4) set_pdata_float(weapon_ent, m_flNextSecondaryAttack, 2.0, 4) set_pdata_float(weapon_ent, m_flTimeWeaponIdle, 2.0, 4) } return HAM_IGNORED } public ability_start(id) { if(is_user_alive(id) && (zp_get_user_zombie_class(id) == class_boomer) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id)) { if(g_ability[id]) { fm_set_rendering(id, kRenderFxGlowShell, 0, 170, 0, kRenderNormal, 0) g_ability[id] = false set_pev(id, pev_health, stadia_1[id] ? float(EVOLUTION_HEALTH_1) : stadia_2[id] ? float(EVOLUTION_HEALTH_2) : float(ZOMBIE_HEALTH)) emit_sound(id, CHAN_STREAM, SOUND_SKILL, 1.0, ATTN_NORM, 0, PITCH_NORM) UTIL_PlayWeaponAnimation(id, 2) message_begin(MSG_ONE,get_user_msgid("ScreenFade"),_,id) write_short(8192) write_short(8192) write_short(0x0000) write_byte(0) write_byte(170) write_byte(0) write_byte(70) message_end() set_task(TIME_ABILITY, "ability_end", id) } } } public ability_end(id) { if ((zp_get_user_zombie_class(id) == class_boomer) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) { fm_set_user_rendering(id) set_task(stadia_2[id] ? RELOAD_ABILITY_EVOLUTION : TIME_RELOAD ,"ability",id) } } public ability(id) { if ((zp_get_user_zombie_class(id) == class_boomer) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) { g_ability[id] = true } } public zp_user_infected_post(id, infector) { if ((zp_get_user_zombie_class(id) == class_boomer) && !zp_get_user_nemesis(id)) { if(zp_get_user_first_zombie(id)) { g_evolution[id] = INFECT_PLAYER_1 evolution(id, 0) } else { g_evolution[id] = 0 stadia_1[id] = false stadia_2[id] = false } g_ability[id] = true } if(is_user_connected(infector) && zp_get_user_zombie_class(infector) == class_boomer) { g_evolution[infector]++ if(g_evolution[infector] == INFECT_PLAYER_1) { evolution(infector, 0) } else if(g_evolution[infector] == INFECT_PLAYER_2) { evolution(infector, 1) } } } public zp_user_humanized_post(id) { remove_task(id) g_evolution[id] = 0 stadia_1[id] = false stadia_2[id] = false } public evolution(index, level) { switch(level) { case 0: { set_pev(index, pev_health, float(EVOLUTION_HEALTH_1)) set_pev(index, pev_maxspeed, float(EVOLUTION_SPEED_1)) set_pev(index, pev_gravity, EVOLUTION_GRAVITY_1) stadia_1[index] = true stadia_2[index] = false } case 1: { set_pev(index, pev_health, float(EVOLUTION_HEALTH_2)) set_pev(index, pev_maxspeed, float(EVOLUTION_SPEED_2)) set_pev(index, pev_gravity, EVOLUTION_GRAVITY_2) stadia_1[index] = false stadia_2[index] = true } } emit_sound(index, CHAN_STREAM, SOUND_EVOLUTION, 1.0, ATTN_NORM, 0, PITCH_NORM) } public chat(id) { if(stadia_1[id]) { client_print(id,print_chat,"[Z] Evolution : 1") } else if(stadia_2[id]) { client_print(id,print_chat,"[Z] Evolution : Max") } else { client_print(id,print_chat,"[Z] Evolution : 0") } } stock UTIL_PlayWeaponAnimation(const Player, const Sequence) { set_pev(Player, pev_weaponanim, Sequence) message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player) write_byte(Sequence) write_byte(pev(Player, pev_body)) message_end() }