K i n G Posted August 29, 2023 Posted August 29, 2023 Looking for MVP Script. If the MVP is alive PVP is on. If the MVP is die it will announce the killer of the Boss. Plus PVP is disabled. Also, may I request an MVP Board? Thanks a lot! Quote
0 Winterfox Posted August 29, 2023 Posted August 29, 2023 (edited) This script will enable pvp when there is atleast one living mvp on a map. If the last mvp gets killed, it will announce the kill and end pvp until a mvp is spawned again. Optionally, you can disable the dynamic mobs option in monster.conf. This will result in pvp already being enabled on a living mvps map, when a player loads it. Otherwise, it might take a second to refresh, since the script has to check the newly loaded mobs first. The downside is of course that disabling dynamic mobs will take more ram. - script MVP_PVP_MODE FAKE_NPC,{ function mapHasAliveMVP; function mobHasMvpMode; OnInit: setarray(.mvp_maps$, "moc_pryd06","ra_fild03","ra_fild04","ve_fild01","ve_fild02", "lou_dun03","prt_maze03","abbey03", "gl_chyard","abyss_03","gef_dun02","gef_dun01","treasure02", "pay_fild10","gon_dun03","abbey02","xmas_fild01","ra_san05", "prt_sewb4","mosk_dun03","thor_v03","ama_dun03", "kh_dun02","ayo_dun02","niflheim","anthell02", "mjolnir_04","pay_dun04","gef_fild03","gef_fild10", "moc_pryd04","in_sphinx5","moc_fild17","ein_dun02","xmas_dun02", "beach_dun","thana_boss","tur_dun04","odin_tem03", "jupe_core","lhz_dun02"); freeloop(1); while(true) { for(.@i = 0; .@i < getarraysize(.mvp_maps$); .@i++) if(mapHasAliveMVP(.mvp_maps$[.@i])) pvpon(.mvp_maps$[.@i]); sleep(1000); } freeloop(0); end; OnNPCKillEvent: getunitdata(killedgid, .@data); .@map$ = mapid2name(.@data[UMOB_MAPID]); if(!mobHasMvpMode(.@data[UMOB_MODE]) || mapHasAliveMVP(.@map$)) end; announce(strcharinfo(0) + " killed " + strmobinfo(1, killedrid) + "!", bc_all); pvpoff(.@map$); end; function mapHasAliveMVP { .@map$ = getarg(0); getmapunits(BL_MOB, .@map$, .@mobs); for(.@i = 0; .@i < getarraysize(.@mobs); .@i++) { getunitdata(.@mobs[.@i], .@data); if(.@data[UMOB_HP] == 0 || !mobHasMvpMode(.@data[UMOB_MODE])) continue; return 1; } return 0; } function mobHasMvpMode { return getarg(0) & MD_MVP; } } Edited August 29, 2023 by Winterfox Quote
0 Gidz Cross Posted August 30, 2023 Posted August 30, 2023 16 hours ago, K i n G said: Looking for MVP Script. If the MVP is alive PVP is on. If the MVP is die it will announce the killer of the Boss. Plus PVP is disabled. Also, may I request an MVP Board? Thanks a lot! I use this mod when mvp is alive Quote
0 K i n G Posted August 31, 2023 Author Posted August 31, 2023 On 8/30/2023 at 4:45 AM, Winterfox said: This script will enable pvp when there is atleast one living mvp on a map. If the last mvp gets killed, it will announce the kill and end pvp until a mvp is spawned again. Optionally, you can disable the dynamic mobs option in monster.conf. This will result in pvp already being enabled on a living mvps map, when a player loads it. Otherwise, it might take a second to refresh, since the script has to check the newly loaded mobs first. The downside is of course that disabling dynamic mobs will take more ram. - script MVP_PVP_MODE FAKE_NPC,{ function mapHasAliveMVP; function mobHasMvpMode; OnInit: setarray(.mvp_maps$, "moc_pryd06","ra_fild03","ra_fild04","ve_fild01","ve_fild02", "lou_dun03","prt_maze03","abbey03", "gl_chyard","abyss_03","gef_dun02","gef_dun01","treasure02", "pay_fild10","gon_dun03","abbey02","xmas_fild01","ra_san05", "prt_sewb4","mosk_dun03","thor_v03","ama_dun03", "kh_dun02","ayo_dun02","niflheim","anthell02", "mjolnir_04","pay_dun04","gef_fild03","gef_fild10", "moc_pryd04","in_sphinx5","moc_fild17","ein_dun02","xmas_dun02", "beach_dun","thana_boss","tur_dun04","odin_tem03", "jupe_core","lhz_dun02"); freeloop(1); while(true) { for(.@i = 0; .@i < getarraysize(.mvp_maps$); .@i++) if(mapHasAliveMVP(.mvp_maps$[.@i])) pvpon(.mvp_maps$[.@i]); sleep(1000); } freeloop(0); end; OnNPCKillEvent: getunitdata(killedgid, .@data); .@map$ = mapid2name(.@data[UMOB_MAPID]); if(!mobHasMvpMode(.@data[UMOB_MODE]) || mapHasAliveMVP(.@map$)) end; announce(strcharinfo(0) + " killed " + strmobinfo(1, killedrid) + "!", bc_all); pvpoff(.@map$); end; function mapHasAliveMVP { .@map$ = getarg(0); getmapunits(BL_MOB, .@map$, .@mobs); for(.@i = 0; .@i < getarraysize(.@mobs); .@i++) { getunitdata(.@mobs[.@i], .@data); if(.@data[UMOB_HP] == 0 || !mobHasMvpMode(.@data[UMOB_MODE])) continue; return 1; } return 0; } function mobHasMvpMode { return getarg(0) & MD_MVP; } } Thank you! I will try this one. Quote
0 K i n G Posted August 31, 2023 Author Posted August 31, 2023 On 8/30/2023 at 4:45 AM, Winterfox said: This script will enable pvp when there is atleast one living mvp on a map. If the last mvp gets killed, it will announce the kill and end pvp until a mvp is spawned again. Optionally, you can disable the dynamic mobs option in monster.conf. This will result in pvp already being enabled on a living mvps map, when a player loads it. Otherwise, it might take a second to refresh, since the script has to check the newly loaded mobs first. The downside is of course that disabling dynamic mobs will take more ram. - script MVP_PVP_MODE FAKE_NPC,{ function mapHasAliveMVP; function mobHasMvpMode; OnInit: setarray(.mvp_maps$, "moc_pryd06","ra_fild03","ra_fild04","ve_fild01","ve_fild02", "lou_dun03","prt_maze03","abbey03", "gl_chyard","abyss_03","gef_dun02","gef_dun01","treasure02", "pay_fild10","gon_dun03","abbey02","xmas_fild01","ra_san05", "prt_sewb4","mosk_dun03","thor_v03","ama_dun03", "kh_dun02","ayo_dun02","niflheim","anthell02", "mjolnir_04","pay_dun04","gef_fild03","gef_fild10", "moc_pryd04","in_sphinx5","moc_fild17","ein_dun02","xmas_dun02", "beach_dun","thana_boss","tur_dun04","odin_tem03", "jupe_core","lhz_dun02"); freeloop(1); while(true) { for(.@i = 0; .@i < getarraysize(.mvp_maps$); .@i++) if(mapHasAliveMVP(.mvp_maps$[.@i])) pvpon(.mvp_maps$[.@i]); sleep(1000); } freeloop(0); end; OnNPCKillEvent: getunitdata(killedgid, .@data); .@map$ = mapid2name(.@data[UMOB_MAPID]); if(!mobHasMvpMode(.@data[UMOB_MODE]) || mapHasAliveMVP(.@map$)) end; announce(strcharinfo(0) + " killed " + strmobinfo(1, killedrid) + "!", bc_all); pvpoff(.@map$); end; function mapHasAliveMVP { .@map$ = getarg(0); getmapunits(BL_MOB, .@map$, .@mobs); for(.@i = 0; .@i < getarraysize(.@mobs); .@i++) { getunitdata(.@mobs[.@i], .@data); if(.@data[UMOB_HP] == 0 || !mobHasMvpMode(.@data[UMOB_MODE])) continue; return 1; } return 0; } function mobHasMvpMode { return getarg(0) & MD_MVP; } } The tomb and announcement are working. But when the MVP is up the PVP is off. Quote
Question
K i n G
Looking for MVP Script.
If the MVP is alive PVP is on.
If the MVP is die it will announce the killer of the Boss. Plus PVP is disabled.
Also, may I request an MVP Board?
Thanks a lot!
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.