Jump to content
  • 0

MvP invasion


Question

Posted

Hello, i just want to make this script summon all mvps instead of 1, i tought it was going to summon all mvps but actually it only summons 1 random mvp of the current IDs D:!

 

here is the code

-	script	mvpinis	-1,{
OnInit:
setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia";
setarray .MVP[0],1511,1785,1630,2320,1039,1272,1719,1389,1115,1418,1252,1086,1885,1492,1734,1251,1688,2156,1373,1147,1087,1190,1038,1157,1159,1623,1583,1312,1685,1658;
end;

OnMinute00:
.event_timer++;
if( .event_timer % 8 == 0 ) end;
killmonster .Map$[ .RandMap ],"All";
set .RandMap,rand( getarraysize( .Map$ ) );
set .RandMVP,rand( getarraysize( .MVP ) );
monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .RandMVP ],1,strnpcinfo(0)+"::OnKilled";
announce "Invasion MvP : "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" han invadido "+.Map$[ .RandMap ]+" .",0;
end;

OnKilled:
announce "Evento MvP : Todos los MvP han sido cazados",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;
}

im not sure about it, for now i can not test it, but to change the numers of mvps that will spawn on invasion i have to change this number/line?

 

monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .RandMVP ],1,strnpcinfo(0)+"::OnKilled";

 

the problem is, that if i manage to make the scripot to summon all the mvps, it may summon repeated mvps D:! and no my players and i would love to summon 1 mvp of each ID on the script ):

 

help please D:

 

thanks in advicie

6 answers to this question

Recommended Posts

Posted

for(set .@i,0; .@i<getarraysize(.MVP) set .@i,.@i+1){
monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .@i ],1,strnpcinfo(0)+"::OnKilled"; }

It will summon all MVP in array.

Actually i havent test it yet, but i think it would work, tell me if not.

Posted

it will end like this?

 

-	script	mvpinis	-1,{
OnInit:
setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia";
setarray .MVP[0],1511,1785,1630,2320,1039,1272,1719,1389,1115,1418,1252,1086,1885,1492,1734,1251,1688,2156,1373,1147,1087,1190,1038,1157,1159,1623,1583,1312,1685,1658;
end;

OnMinute00:
.event_timer++;
if( .event_timer % 8 == 0 ) end;
killmonster .Map$[ .RandMap ],"All";
for(set .@i,0; .@i<getarraysize(.MVP) set .@i,.@i+1){
monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .@i ],1,strnpcinfo(0)+"::OnKilled"; }
announce "Invasion MvP : "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" han invadido "+.Map$[ .RandMap ]+" .",0;
end;

OnKilled:
announce "Evento MvP : Todos los MvP han sido cazados",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;
}
Posted


- script mvpinis -1,{

OnInit:

setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia";

setarray .MVP[0],1511,1785,1630,2320,1039,1272,1719,1389,1115,1418,1252,1086,1885,1492,1734,1251,1688,2156,1373,1147,1087,1190,1038,1157,1159,1623,1583,1312,1685,1658;

end;

OnMinute00:

.event_timer++;

if( .event_timer % 8 == 0 ) end;

killmonster .Map$[ .RandMap ],"All";

set .RandMap,rand( getarraysize( .Map$ ) );

for(set .@i,0; .@i<getarraysize(.MVP) set .@i,.@i+1){

monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .@i ],1,strnpcinfo(0)+"::OnKilled"; }

announce "Invasion MvP : "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" han invadido "+.Map$[ .RandMap ]+" .",0;

end;

OnKilled:

announce "Evento MvP : Todos los MvP han sido cazados",0;

set mvp_point, mvp_point + 1;// +1 mvp point

end;

}

Posted (edited)

thanks sir, i can not test it right now but i will and if i find any error i will tell you, thanks again o:!

 

ow sorry for answering until now

i got error sir ):

qcun.png

code

-	script	mvpinis	-1,{
OnInit:
setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia";
setarray .MVP[0],1511,1785,1630,2320,1039,1272,1719,1389,1115,1418,1252,1086,1885,1492,1734,1251,1688,2156,1373,1147,1087,1190,1038,1157,1159,1623,1583,1312,1685,1658;
end;

OnMinute00:
.event_timer++;
if( .event_timer % 8 == 0 ) end;
killmonster .Map$[ .RandMap ],"All";
set .RandMap,rand( getarraysize( .Map$ ) );
for(set .@i,0; .@i<getarraysize(.MVP) set .@i,.@i+1){
monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .@i ],1,strnpcinfo(0)+"::OnKilled"; }
announce "Invasion MvP : "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" han invadido "+.Map$[ .RandMap ]+" .",0;
end;

OnKilled:
announce "Evento MvP : Todos los MvP han sido cazados",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;
}

): thanks for reading me,i hope this will give enought information

Edited by Kido
Posted

You're missing a semicolon in the loop header (line 12).

 

Change

for(set .@i,0; .@i<getarraysize(.MVP) set .@i,.@i+1){

to

for(set .@i,0; .@i<getarraysize(.MVP); set .@i,.@i+1){

 

thank you, sorry for late answer, i can not test this right now but if error occur i will edit this, thanks again i hope y will work!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...