為了更令人誤會……我把標題改得更糟糕了
在玩某伺服器時……會出現這個事件……
喔喔、復仇者出現了
要記著……這個是很普通的傳染模式……
話說很久很久以前……YKH大在Ailledmodders問過一下
他提到有
機率性的存在……嘿嘿嘿
首先,我的是
ZP4.3,別的我不敢保證
1.
備份!!弄不回來我可幫不了你阿!!
2.開啟zombie_plague40.sma
3.找尋『new g_burning_duration[33] // burning task duration』
4.在下面開新行加入:
複製程式
// For Nemesis
new g_nemesis_in_game[33] // 選定不幸的彊屍
new bool:g_nemesis_appear
new bool:g_nemesis_die
new bool:OK_to_make
5.找尋『public event_round_start()』
6.在裡加入
複製程式
// Nemesis Something
g_nemesis_appear = false
g_nemesis_die = false
OK_to_make = false
set_task(random_float(30.0,125.0), "make_rubbish_nemesis")
7.加入新行 --
注意不是在『public event_round_start()』內複製程式
public make_rubbish_nemesis()
{
OK_to_make = true
}
8.再找尋『respawn_player_manually(id)』
9.把整個『respawn_player_manually(id)』換成我這個:
複製程式
respawn_player_manually(id)
{
// Set proper team before respawning, so that the TeamInfo message that's sent doesn't confuse PODBots
if (g_respawn_as_zombie[id])
{
fm_cs_set_user_team(id, FM_CS_TEAM_T)
if(g_nemround && fnGetNemesis() == 0)
return;
if (g_plagueround && fnGetNemesis() == 0)
return;
if (g_nemesis_die)
return;
new g_hahachance = random_num(1,10)
if(g_hahachance == 1 && fnGetNemesis() == 0)
{
if(!g_nemesis_appear && OK_to_make && g_modestarted)
{
g_nemesis_in_game[id] = true
g_nemesis_appear = true
}
}
}
else
fm_cs_set_user_team(id, FM_CS_TEAM_CT)
// Respawning a player has never been so easy
ExecuteHamB(Ham_CS_RoundRespawn, id) // 這指令是重生……能活動、能咬人的那種
if(g_nemesis_in_game[id]) // 能活動就了召喚復仇者吧,嘿嘿嘿
{
zombieme(id, 0, 1, 0, 0)
set_hudmessage(200, 0, 0, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "NEMESIS 出現……", LANG_PLAYER)
g_nemesis_in_game[id] = false
g_nemesis_appear = true
}
}
10.修改參數
複製程式
set_task(random_float(30.0,125.0), "make_rubbish_nemesis") // 新遊戲後隨後30-125秒內會出現復仇者
new g_hahachance = random_num(1,10) // 1/10的機會
背景音樂:
11.找尋『public fw_PlayerKilled(victim, attacker, shouldgib)』
12.找尋裡面的『if (g_nemesis[victim])』
13.把整個『if (g_nemesis[victim])』換成我這個
複製程式
// Nemesis explodes!
if (g_nemesis[victim])
{
SetHamParamInteger(3, 2)
set_hudmessage(200, 0, 0, HUD_EVENT_X, HUD_EVENT_Y, 0, 0.0, 3.0, 2.0, 1.0, -1)
ShowSyncHudMsg(0, g_MsgSync, "NEMESIS 已被殺死,喪屍將不可再重生。", LANG_PLAYER)
g_nemesis_die = true
remove_task(TASK_AMBIENCESOUNDS)
set_task(0.0, "ambience_sound_effects", TASK_AMBIENCESOUNDS)
}
14.回到『respawn_player_manually(id)』
15.找尋『g_nemesis_appear = true』
16.在下面加入
複製程式
remove_task(TASK_AMBIENCESOUNDS)
set_task(0.0, "ambience_sound_effects", TASK_AMBIENCESOUNDS)
17.飛走
18.飛到『public ambience_sound_effects(taskid)』
19.把整個『public ambience_sound_effects(taskid)』換成我的
複製程式
// Ambience Sound Effects Task
public ambience_sound_effects(taskid)
{
// Play a random sound depending on the round
static sound[64], iRand, duration, ismp3
if(g_nemesis_die)
{
iRand = random_num(0, ArraySize(sound_ambience1) - 1)
ArrayGetString(sound_ambience1, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience1_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience1_ismp3, iRand)
}
else if (g_nemround) // Nemesis Mode
{
iRand = random_num(0, ArraySize(sound_ambience2) - 1)
ArrayGetString(sound_ambience2, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience2_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience2_ismp3, iRand)
}
else if (g_survround) // Survivor Mode
{
iRand = random_num(0, ArraySize(sound_ambience3) - 1)
ArrayGetString(sound_ambience3, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience3_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience3_ismp3, iRand)
}
else if (g_swarmround) // Swarm Mode
{
iRand = random_num(0, ArraySize(sound_ambience4) - 1)
ArrayGetString(sound_ambience4, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience4_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience4_ismp3, iRand)
}
else if (g_plagueround) // Plague Mode
{
iRand = random_num(0, ArraySize(sound_ambience5) - 1)
ArrayGetString(sound_ambience5, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience5_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience5_ismp3, iRand)
}
else if(g_nemesis_appear)
{
iRand = random_num(0, ArraySize(sound_ambience2) - 1)
ArrayGetString(sound_ambience2, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience2_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience2_ismp3, iRand)
}
else // Infection Mode
{
iRand = random_num(0, ArraySize(sound_ambience1) - 1)
ArrayGetString(sound_ambience1, iRand, sound, charsmax(sound))
duration = ArrayGetCell(sound_ambience1_duration, iRand)
ismp3 = ArrayGetCell(sound_ambience1_ismp3, iRand)
}
// Play it on clients
if (ismp3)
client_cmd(0, "mp3 play ^"sound/%s^"", sound)
else
PlaySound(sound)
// Set the task for when the sound is done playing
set_task(float(duration), "ambience_sound_effects", TASK_AMBIENCESOUNDS)
}
完成後效果如此:
於多人感染、普通感染等等沒有復仇者出現的模式中,在30-125秒內隨機找一個要復活的彊屍當復仇者(並使用復仇者模式音樂)
若復仇者掛掉,彊屍就不能再重生,而且回到普通感染模式的音樂
Q&A
一、為什麼沒背景音樂?
答:因為你沒在『cstrike/addons/amxmodx/configs/zombie_plague.ini』內加入聲音
例:
複製程式
[Ambience Sounds] (randomly chosen if more than one) (only .wav and .mp3 formats supported) (duration is in seconds)
INFECTION ENABLE = 1
INFECTION SOUNDS = zombie_plague/gamestartup1.mp3
INFECTION DURATIONS = 268
NEMESIS ENABLE = 1
NEMESIS SOUNDS = zombie_plague/nemesis_detected.mp3
NEMESIS DURATIONS = 63
感謝收看
附上懶人包(真的很懶……繁化都沒有……)