Can I get some help with my script. I wanted it to be that players will get some 'special item' at all maps listed in my array. Problem is, it only reads the first list in array which is 'moc_pryd06'
Here is my *noob* script:
- script #mvp_kill -1,{
OnNPCKillEvent:
setarray .@t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","lhz_dun03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02";
if ( getmonsterinfo( killedrid, MOB_MVPEXP )) {
if ( strcharinfo(3) == .@t_maps$[.@a] && rand(100) < 90 ) {
if ( getcharid(1) ) {
getpartymember getcharid(1), 1;
getpartymember getcharid(1), 2;
for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
.@partymemberaid[.@c] = $@partymemberaid[.@i];
.@c++;
}
}
getitem 30017, 1, .@partymemberaid[ rand( .@c ) ];
announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and got reward at "+ strcharinfo(3), bc_all;
}
else {
getitem 30017, 1;
announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and got an MVP Badge at "+ strcharinfo(3), bc_all;
}
}
else {
if ( strcharinfo(3) == instance_mapname("06guild_01") ) end;
if ( getcharid(1) ) {
announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all;
} else {
announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all;
}
}
}
end;
}
Question
pajodex
Hi,
Can I get some help with my script. I wanted it to be that players will get some 'special item' at all maps listed in my array. Problem is, it only reads the first list in array which is 'moc_pryd06'
Here is my *noob* script:
- script #mvp_kill -1,{ OnNPCKillEvent: setarray .@t_maps$[0],"moc_pryd06","lhz_dun03","gld2_prt","abbey02","ayo_dun02","lhz_dun04","ra_fild02","xmas_fild01","dic_dun02","beach_dun","iz_dun05","tur_dun04","lhz_dun02","jupe_core","moc_fild22","anthell02","odin_tem03","lhz_dun03","gon_dun03","gef_fild02","thana_boss","gef_fild10","ein_dun02","gef_fild14","moc_pryd04","dew_dun01","in_sphinx5","niflheim","moc_fild17","xmas_dun02","ice_dun03","kh_dun02","treasure02","moc_prydn2","pay_dun04","ra_san05","mosk_dun03","ama_dun03","thor_v03","gef_dun01","mjolnir_04","abyss_03","dic_dun03","prt_sewb4","pay_fild11","gef_dun02","gl_chyard","ra_fild03","ra_fild04","ve_fild01","ve_fild02","lou_dun03","prt_maze03","bra_dun02"; if ( getmonsterinfo( killedrid, MOB_MVPEXP )) { if ( strcharinfo(3) == .@t_maps$[.@a] && rand(100) < 90 ) { if ( getcharid(1) ) { getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { .@partymemberaid[.@c] = $@partymemberaid[.@i]; .@c++; } } getitem 30017, 1, .@partymemberaid[ rand( .@c ) ]; announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and got reward at "+ strcharinfo(3), bc_all; } else { getitem 30017, 1; announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" and got an MVP Badge at "+ strcharinfo(3), bc_all; } } else { if ( strcharinfo(3) == instance_mapname("06guild_01") ) end; if ( getcharid(1) ) { announce "[ System ] : Player ["+ strcharinfo(0) +"] of party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), bc_all; } else { announce "[ System ] : Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" alone at "+ strcharinfo(3), bc_all; } } } end; }
Link to comment
Share on other sites
8 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.