为了更令人误会……我把标题改得更糟糕了
在玩某伺服器时……会出现这个事件……
喔喔、复仇者出现了
要记着……这个是很普通的传染模式……
话说很久很久以前……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
感谢收看
附上懒人包(真的很懒……繁化都没有……)