/* * ------------------------------------- * -----[ZP] Heavy Tank Zombie Class---- * ------------------------------------- * --------Author: 4eRT (aka pff)------- * ------------------------------------- * About: * Made at dimon4g's idea and request. * ------------------------------------- * Credits: * - dimon4g - for idea. * ------------------------------------- * Cvars: * zp_heavy_tank_give_ap 1 //how many ammo packs will be given? def=1 * zp_heavy_tank_give_ap_freq 15 //how often ammo packs will be given(sec)? def=15.0 * zp_heavy_tank_give_hp 5 //how many health will be given? def=5 * zp_heavy_tank_give_hp_freq 7 //how often hp will be given(sec)? def=7.0 * zp_heavy_tank_aura_radius 15.0 //radius of aura. def=15 * zp_heavy_tank_aura_red 215 // amount of red color(0-255). def=215 * zp_heavy_tank_aura_green 255 // amount of green color(0-255). def=255 * zp_heavy_tank_aura_blue 0 // amount of blue color(0-255). def=0 * ------------------------------------- * History: * 0.1 (27.03.09) * First release. Adds 1(cvar) AP every 15(cvar) sec. * 0.2 (27.03.09) * Restore 5(cvar) HP every 7(cvar) sec if health < maximum HP. Fun module required. * 0.3 (27.03.09) * Added customizable aura. * 0.4 (03.04.09) * Fixed bug (after humanizing or choosing another class Heavy Tank powers remains) */ #include #include #include #include new g_heavy_tank // Heavy Tank Zombie Attributes new const zclass_name[] = { "Heavy Tank Zombie" } new const zclass_info[] = { "HP+++ Knockback-- Speed-" } new const zclass_model[] = { "zombie_strong" } new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } const zclass_health = 5000 const zclass_speed = 150 const Float:zclass_gravity = 1.0 const Float:zclass_knockback = 0.4 public plugin_precache() { register_plugin("[ZP] Heavy Tank Zombie", "0.4", "4eRT") register_cvar("zp_heavy_tank_give_ap", "1") register_cvar("zp_heavy_tank_give_ap_freq", "15.0") register_cvar("zp_heavy_tank_give_hp", "5") register_cvar("zp_heavy_tank_give_hp_freq", "7.0") register_cvar("zp_heavy_tank_aura_radius", "15.0") register_cvar("zp_heavy_tank_aura_red", "215") register_cvar("zp_heavy_tank_aura_green", "255") register_cvar("zp_heavy_tank_aura_blue", "0") g_heavy_tank = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) } public zp_user_infected_post(id, infector) { if (zp_get_user_zombie_class(id) == g_heavy_tank) { set_task(get_cvar_float("zp_heavy_tank_give_ap_freq"), "AddAP", id, _, _, "b") set_task(get_cvar_float("zp_heavy_tank_give_hp_freq"), "AddHP", id, _, _, "b") set_task(0.1, "Aura", id, _, _, "b") } } public AddAP(id) { if (zp_get_user_zombie(id)) { if (zp_get_user_zombie_class(id) == g_heavy_tank) { if (!is_user_alive(id)) return PLUGIN_HANDLED new user_ap = zp_get_user_ammo_packs(id) new give_ap = get_cvar_num("zp_heavy_tank_give_ap") zp_set_user_ammo_packs(id, user_ap + give_ap) } else { remove_task(id) } } else { remove_task(id) } return PLUGIN_CONTINUE } public AddHP(id) { if (zp_get_user_zombie(id)) { if (zp_get_user_zombie_class(id) == g_heavy_tank) { new cur_hp = get_user_health(id) new am_hp = get_cvar_num("zp_heavy_tank_give_hp") new max_hp = zp_get_zombie_maxhealth(id) if (cur_hp < max_hp) { set_user_health(id, cur_hp + am_hp) } else { return PLUGIN_HANDLED } } else { remove_task(id) } } else { remove_task(id) } return PLUGIN_CONTINUE } public Aura(id) { if (zp_get_user_zombie(id)) { if (zp_get_user_zombie_class(id) == g_heavy_tank) { if (!is_user_alive(id)) return PLUGIN_HANDLED static Float:originF[3] pev(id, pev_origin, originF) engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0) write_byte(TE_DLIGHT) engfunc(EngFunc_WriteCoord, originF[0]) engfunc(EngFunc_WriteCoord, originF[1]) engfunc(EngFunc_WriteCoord, originF[2]) write_byte(get_cvar_num("zp_heavy_tank_aura_radius")) write_byte(get_cvar_num("zp_heavy_tank_aura_red")) write_byte(get_cvar_num("zp_heavy_tank_aura_green")) write_byte(get_cvar_num("zp_heavy_tank_aura_blue")) write_byte(2) write_byte(0) message_end() } else { remove_task(id) } } else { remove_task(id) } return PLUGIN_CONTINUE }