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") }
|