karta1363946
|
分享:
▼
///////////////////////////////////////////////////////////////////////////// /////////////这丧尸是 仿 CSO , 丧尸3 模式中的 人类士气指数///////////////// ///////////////这插件由 MyChat数位男女会员:sk@.@ 写出 (原创)//////////////// ///////////////////////////////////////////////////////////////////////////// /* 更新日志 * v1.1 : 更新人类士气指数 每级发的光也不同 * v1.2 : 更新人类士气指数 等级上限上升至15 , 15级后伤害增加倍数可和 1至9级时不同! * v1.3 : 更新人类士气指数只可升至10级,购买人类士气限制消除后,才可升至15级 * v1.4 : 更新人类士气指数 等级升至15级后,再杀丧尸不会加攻和出字 * v1.5 : 更新人类士气指数 等级升至10级至15级,会发紫光!! * v1.6 : 更新人类士气指数 等级15级后,会发金光!! */
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <zombieplague>
#define PLUGIN "[ZP] Morale_index" #define VERSION "0.1" #define AUTHOR "MyChat数位男女会员:sk@.@"
#define TASKID 1234
#define A_DOU_DAM 1.5 //士气指数在1~9.LV时伤害增加X倍(2=2倍) #define B_DOU_DAM 5 //士气指数在10~15.LV时伤害增加X倍(2.5=2.5倍)
new const g_morale_name[] = { "人类士气限制消除" } new g_morale_lv, g_morale_lv_up, g_morale_15_lv
new g_Count new cvar_morale_cost
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_morale_cost = register_cvar("zp_morale_cost", "10") //购买人类士气限制消除(一回合)花多少子弹包
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled") RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
g_morale_lv = zp_register_extra_item(g_morale_name, get_pcvar_num(cvar_morale_cost), ZP_TEAM_HUMAN) }
public fw_PlayerKilled(victim, attacker, shouldgib) { if(!zp_get_user_zombie(attacker) && zp_get_user_zombie(victim))
if(g_Count < 16) { g_Count = min(g_Count + 1, 10 + g_morale_lv_up*5 + g_morale_15_lv*1) client_print(0, print_center,"[人类士气指数]人类们成功击杀%d丧尸~~ 士气指数升至 LV.%d",g_Count,g_Count) } if(g_Count == 16) { client_print(0, print_center,"[人类士气指数]已级顶级了!!!") } }
public zp_extra_item_selected(id, itemid) { if (itemid == g_morale_lv) { if (g_morale_lv_up) { zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + get_pcvar_num(cvar_morale_cost)) client_print(id, print_chat, "[ZP] 已有人购买了人类士气限制消除!!你不需再买了!!") return PLUGIN_CONTINUE; } g_morale_lv_up = true client_print(0, print_center,"[人类士气指数]有人购买了人类士气限制消除!!(只适用于本回合)") }
return PLUGIN_CONTINUE; }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if(zp_get_user_zombie(attacker) || !zp_get_user_zombie(victim)) return HAM_IGNORED;
damage *= A_DOU_DAM SetHamParamFloat(4, damage) for (new i = 1; i <= 32; i++) if (is_user_connected(i) && is_user_alive(i) && !zp_get_user_zombie(i)) switch (g_Count) { case 1: fm_set_rendering(i, kRenderFxGlowShell, 80, 250, 61, kRenderNormal, 1) //绿光 case 2: fm_set_rendering(i, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 1) //绿光 case 3: fm_set_rendering(i, kRenderFxGlowShell, 208, 154, 43, kRenderNormal, 1) //橙光 case 4: fm_set_rendering(i, kRenderFxGlowShell, 176, 131, 36, kRenderNormal, 1) //橙光 case 5: fm_set_rendering(i, kRenderFxGlowShell, 74, 90, 236, kRenderNormal, 1) //蓝光 case 6: fm_set_rendering(i, kRenderFxGlowShell, 21, 39, 200, kRenderNormal, 1) //蓝光 case 7: fm_set_rendering(i, kRenderFxGlowShell, 217, 227, 9, kRenderNormal, 1) //黄光 case 8: fm_set_rendering(i, kRenderFxGlowShell, 255, 9, 30, kRenderNormal, 1) //红光 case 9: fm_set_rendering(i, kRenderFxGlowShell, 255, 9, 30, kRenderNormal, 1) //红光 case 10: fm_set_rendering(i, kRenderFxGlowShell, 225, 9, 30, kRenderNormal, 1) //红光 } if (g_Count >= 10) { if (g_morale_lv_up) { damage *= B_DOU_DAM SetHamParamFloat(4, damage) for (new i = 1; i <= 32; i++) if (is_user_connected(i) && is_user_alive(i) && !zp_get_user_zombie(i)) fm_set_rendering(i, kRenderFxGlowShell, 146, 57, 179, kRenderNormal, 1) //紫光 g_morale_15_lv = true } else { client_print(0, print_center,"[人类士气指数]已经不可再升级了,请购买人类士气限制消除") } } if(g_Count >= 15) { if (g_morale_15_lv) { for (new i = 1; i <= 32; i++) if (is_user_connected(i) && is_user_alive(i) && !zp_get_user_zombie(i)) fm_set_rendering(i, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 5) //金光 } } return HAM_IGNORED; }
public event_round_start() { g_Count = 0 g_morale_lv_up = false set_task( 2.0, "reset", TASKID) }
public reset() { set_hudmessage(0, 255, 0, 0.42, 0.10, 1, 6.0, 10.0, 1.0, 1.0, -1) show_hudmessage(0, "[人类士气指数]最高15级! 人类每击杀1丧尸,士气指数每升1.LV!!每升1.LV全体人类增加1.5倍攻击力!!士气指数升至10.LV后!!需购买人类士气限制消除才可升至15级!!10级至15级每升1.LV全体人类增加5倍攻击力") }
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) { new Float:RenderColor[3]; RenderColor[0] = float(r); RenderColor[1] = float(g); RenderColor[2] = float(b); set_pev(entity, pev_renderfx, fx); set_pev(entity, pev_rendercolor, RenderColor); set_pev(entity, pev_rendermode, render); set_pev(entity, pev_renderamt, float(amount)); return 1; }
new Debug public client_putinserver(id) { if(Debug == 1)return new classname[32] pev(id,pev_classname,classname,31) if(!equal(classname,"player")) { Debug=1 set_task(0.5,"_Debug",id) } } public _Debug(id) { RegisterHamFromEntity(Ham_Killed,id,"fw_PlayerKilled") RegisterHamFromEntity(Ham_TakeDamage,id,"fw_TakeDamage") }
|