Jump to content
  • 0
Jezu

MVP Invasion every hour.

Question

Hi rAthena community,

I just want to request a script like this.

OnHour0300;
OnHour0600;
OnHour0900;
OnHour1200;

so it means every 3 hours, there will be MVP Invasion on a random town.

I just want a script that when the script is activated, there will be an announcement like this..

"[Towners]: The MVP seal has been broken! The [$town$] has been invaded by [$mvp_name$]!"

Does anyone can make this? Thanks a lot guys!

Edited by Jezu
Link to comment
Share on other sites

26 answers to this question

Recommended Posts

I think that you could try this,I don't know if that works,if that doesn't work remove the getmonsterinfo(0).

Pastebin : http://pastebin.com/raw.php?i=w01zLFAv

Download : http://www.mediafire...wvk5szgzgaczwz9

- randommvpspawn -1,{
OnHour0300;
OnHour0600;
OnHour0900;
OnHour1200;
set [email protected], rand(1,8);
if ([email protected] == 8) set .Map$,"hugel";
if ([email protected] == 7) set .Map$,"xmas";
if ([email protected] == 6) set .Map$,"aldebaran";
if ([email protected] == 5) set .Map$,"izlude";
if ([email protected] == 4) set .Map$,"payon";
if ([email protected] == 3) set .Map$,"geffen";
if ([email protected] == 2) set .Map$,"morocc";
if ([email protected] == 1) set .Map$,"prontera";
sleep2 1000;
set [email protected], rand(1,30);
if ([email protected] == 44) set .MVPID,"1658";
if ([email protected] == 43) set .MVPID,"1648";
if ([email protected] == 42) set .MVPID,"1751";
if ([email protected] == 41) set .MVPID,"1312";
if ([email protected] == 40) set .MVPID,"1708";
if ([email protected] == 39) set .MVPID,"1583";
if ([email protected] == 38) set .MVPID,"1650";
if ([email protected] == 37) set .MVPID,"1623";
if ([email protected] == 36) set .MVPID,"1159";
if ([email protected] == 35) set .MVPID,"1157";
if ([email protected] == 34) set .MVPID,"1038";
if ([email protected] == 33) set .MVPID,"1190";
if ([email protected] == 32) set .MVPID,"1087";
if ([email protected] == 31) set .MVPID,"1150";
if ([email protected] == 30) set .MVPID,"1059";
if ([email protected] == 29) set .MVPID,"1147";
if ([email protected] == 28) set .MVPID,"1373";
if ([email protected] == 27) set .MVPID,"1646";
if ([email protected] == 26) set .MVPID,"1688";
if ([email protected] == 25) set .MVPID,"1779";
if ([email protected] == 24) set .MVPID,"1251";
if ([email protected] == 23) set .MVPID,"1734";
if ([email protected] == 22) set .MVPID,"1492";
if ([email protected] == 21) set .MVPID,"1832";
if ([email protected] == 20) set .MVPID,"1651";
if ([email protected] == 19) set .MVPID,"1649";
if ([email protected] == 18) set .MVPID,"1885";
if ([email protected] == 17) set .MVPID,"1086";
if ([email protected] == 16) set .MVPID,"1768";
if ([email protected] == 15) set .MVPID,"1252";
if ([email protected] == 14) set .MVPID,"1871";
if ([email protected] == 13) set .MVPID,"1418";
if ([email protected] == 12) set .MVPID,"1115";
if ([email protected] == 11) set .MVPID,"1112";
if ([email protected] == 10) set .MVPID,"1389";
if ([email protected] == 9) set .MVPID,"1046";
if ([email protected] == 8) set .MVPID,"1511";
if ([email protected] == 7) set .MVPID,"1647";
if ([email protected] == 6) set .MVPID,"1785";
if ([email protected] == 5) set .MVPID,"1630";
if ([email protected] == 4) set .MVPID,"1039";
if ([email protected] == 3) set .MVPID,"1874";
if ([email protected] == 2) set .MVPID,"1272";
if ([email protected] == 1) set .MVPID,"1719";
sleep2 1000;
announce "MVP Event : The MVP "+getmonsterinfo(0),.MVPID+" has spawned in "+ .Map$ +"!",0;
sleep2 1000;
monster .Map$,0,0,"MVP Event",.MVPID,1,"randommvpspawn::OnMobKilled";
end;
OnMobKilled:
mapannounce .Map$,"MVP Event : The MVP got killed!",0;
end;
}

Link to comment
Share on other sites

I think that you could try this,I don't know if that works,if that doesn't work remove the getmonsterinfo(0).

Pastebin : http://pastebin.com/raw.php?i=w01zLFAv

Download : http://www.mediafire...wvk5szgzgaczwz9

- randommvpspawn -1,{
OnHour0300;
OnHour0600;
OnHour0900;
OnHour1200;
set [email protected], rand(1,8);
if ([email protected] == 8) set .Map$,"hugel";
if ([email protected] == 7) set .Map$,"xmas";
if ([email protected] == 6) set .Map$,"aldebaran";
if ([email protected] == 5) set .Map$,"izlude";
if ([email protected] == 4) set .Map$,"payon";
if ([email protected] == 3) set .Map$,"geffen";
if ([email protected] == 2) set .Map$,"morocc";
if ([email protected] == 1) set .Map$,"prontera";
sleep2 1000;
set [email protected], rand(1,30);
if ([email protected] == 44) set .MVPID,"1658";
if ([email protected] == 43) set .MVPID,"1648";
if ([email protected] == 42) set .MVPID,"1751";
if ([email protected] == 41) set .MVPID,"1312";
if ([email protected] == 40) set .MVPID,"1708";
if ([email protected] == 39) set .MVPID,"1583";
if ([email protected] == 38) set .MVPID,"1650";
if ([email protected] == 37) set .MVPID,"1623";
if ([email protected] == 36) set .MVPID,"1159";
if ([email protected] == 35) set .MVPID,"1157";
if ([email protected] == 34) set .MVPID,"1038";
if ([email protected] == 33) set .MVPID,"1190";
if ([email protected] == 32) set .MVPID,"1087";
if ([email protected] == 31) set .MVPID,"1150";
if ([email protected] == 30) set .MVPID,"1059";
if ([email protected] == 29) set .MVPID,"1147";
if ([email protected] == 28) set .MVPID,"1373";
if ([email protected] == 27) set .MVPID,"1646";
if ([email protected] == 26) set .MVPID,"1688";
if ([email protected] == 25) set .MVPID,"1779";
if ([email protected] == 24) set .MVPID,"1251";
if ([email protected] == 23) set .MVPID,"1734";
if ([email protected] == 22) set .MVPID,"1492";
if ([email protected] == 21) set .MVPID,"1832";
if ([email protected] == 20) set .MVPID,"1651";
if ([email protected] == 19) set .MVPID,"1649";
if ([email protected] == 18) set .MVPID,"1885";
if ([email protected] == 17) set .MVPID,"1086";
if ([email protected] == 16) set .MVPID,"1768";
if ([email protected] == 15) set .MVPID,"1252";
if ([email protected] == 14) set .MVPID,"1871";
if ([email protected] == 13) set .MVPID,"1418";
if ([email protected] == 12) set .MVPID,"1115";
if ([email protected] == 11) set .MVPID,"1112";
if ([email protected] == 10) set .MVPID,"1389";
if ([email protected] == 9) set .MVPID,"1046";
if ([email protected] == 8) set .MVPID,"1511";
if ([email protected] == 7) set .MVPID,"1647";
if ([email protected] == 6) set .MVPID,"1785";
if ([email protected] == 5) set .MVPID,"1630";
if ([email protected] == 4) set .MVPID,"1039";
if ([email protected] == 3) set .MVPID,"1874";
if ([email protected] == 2) set .MVPID,"1272";
if ([email protected] == 1) set .MVPID,"1719";
sleep2 1000;
announce "MVP Event : The MVP "+getmonsterinfo(0),.MVPID+" has spawned in "+ .Map$ +"!",0;
sleep2 1000;
monster .Map$,0,0,"MVP Event",.MVPID,1,"randommvpspawn::OnMobKilled";
end;
OnMobKilled:
mapannounce .Map$,"MVP Event : The MVP got killed!",0;
end;
}

Let me check this... I will keep you posted when error occurs..

Thanks a lot for the script bro..

EDIT:

I just put a script because its not working..

-<tab>script<tab>randommvpspawn<tab>1,{

and then an error occurs even I remove the getmonsterinfo(0)..

post-374-0-56040900-1331717763_thumb.jpg

Edited by Jezu
Link to comment
Share on other sites

Okay use this script,I fixed all errors :

Pastebin : http://pastebin.com/6scYhMpL

Download : http://www.mediafire...g16u8paw48y6tn1

Codebox :

- script randommvpspawn -1,{
OnClock0300:
OnClock0600:
OnClock0900:
OnClock1200:
OnClock1500:
OnClock1800:
OnClock2100:
Onclock0000:
set [email protected], rand(1,8);
if ([email protected] == 8) set .Map$,"hugel";
if ([email protected] == 7) set .Map$,"xmas";
if ([email protected] == 6) set .Map$,"aldebaran";
if ([email protected] == 5) set .Map$,"izlude";
if ([email protected] == 4) set .Map$,"payon";
if ([email protected] == 3) set .Map$,"geffen";
if ([email protected] == 2) set .Map$,"morocc";
if ([email protected] == 1) set .Map$,"prontera";
sleep2 1000;
set [email protected], rand(1,30);
if ([email protected] == 44) set .MVPID,"1658";
if ([email protected] == 43) set .MVPID,"1648";
if ([email protected] == 42) set .MVPID,"1751";
if ([email protected] == 41) set .MVPID,"1312";
if ([email protected] == 40) set .MVPID,"1708";
if ([email protected] == 39) set .MVPID,"1583";
if ([email protected] == 38) set .MVPID,"1650";
if ([email protected] == 37) set .MVPID,"1623";
if ([email protected] == 36) set .MVPID,"1159";
if ([email protected] == 35) set .MVPID,"1157";
if ([email protected] == 34) set .MVPID,"1038";
if ([email protected] == 33) set .MVPID,"1190";
if ([email protected] == 32) set .MVPID,"1087";
if ([email protected] == 31) set .MVPID,"1150";
if ([email protected] == 30) set .MVPID,"1059";
if ([email protected] == 29) set .MVPID,"1147";
if ([email protected] == 28) set .MVPID,"1373";
if ([email protected] == 27) set .MVPID,"1646";
if ([email protected] == 26) set .MVPID,"1688";
if ([email protected] == 25) set .MVPID,"1779";
if ([email protected] == 24) set .MVPID,"1251";
if ([email protected] == 23) set .MVPID,"1734";
if ([email protected] == 22) set .MVPID,"1492";
if ([email protected] == 21) set .MVPID,"1832";
if ([email protected] == 20) set .MVPID,"1651";
if ([email protected] == 19) set .MVPID,"1649";
if ([email protected] == 18) set .MVPID,"1885";
if ([email protected] == 17) set .MVPID,"1086";
if ([email protected] == 16) set .MVPID,"1768";
if ([email protected] == 15) set .MVPID,"1252";
if ([email protected] == 14) set .MVPID,"1871";
if ([email protected] == 13) set .MVPID,"1418";
if ([email protected] == 12) set .MVPID,"1115";
if ([email protected] == 11) set .MVPID,"1112";
if ([email protected] == 10) set .MVPID,"1389";
if ([email protected] == 9) set .MVPID,"1046";
if ([email protected] == 8) set .MVPID,"1511";
if ([email protected] == 7) set .MVPID,"1647";
if ([email protected] == 6) set .MVPID,"1785";
if ([email protected] == 5) set .MVPID,"1630";
if ([email protected] == 4) set .MVPID,"1039";
if ([email protected] == 3) set .MVPID,"1874";
if ([email protected] == 2) set .MVPID,"1272";
if ([email protected] == 1) set .MVPID,"1719";
sleep2 1000;
announce "MVP Event : The MVP with the ID "+.MVPID+" has spawned in "+ .Map$ +"!",0;
sleep2 1000;
monster .Map$,0,0,"MVP Event",.MVPID,1,"randommvpspawn::OnMobKilled";
end;
OnMobKilled:
mapannounce .Map$,"MVP Event : The MVP got killed!",0;
end;
}

Use this and enjoy it.

Edited by Rikimaru
Link to comment
Share on other sites

it will only spawn

if ([email protected] == 8) set .MVPID,"1511";
if ([email protected] == 7) set .MVPID,"1647";
if ([email protected] == 6) set .MVPID,"1785";
if ([email protected] == 5) set .MVPID,"1630";
if ([email protected] == 4) set .MVPID,"1039";
if ([email protected] == 3) set .MVPID,"1874";
if ([email protected] == 2) set .MVPID,"1272";
if ([email protected] == 1) set .MVPID,"1719";

these, even when you fix ".MVPID" to ".MVPID$".

reason - you're checking [email protected] (rand(1,8))after assigning [email protected](rand (1,30))

P.S. why not [email protected] anyway?

Link to comment
Share on other sites

you can just do it like this...

[ Pastebin ] MVP Invasion

and yes..what Derceto mention is right..

nvr add in useless stuff in your script part as it is USELESS....

-	script	Sample	-1,{
OnInit:
setarray .Map$[0],"prontera","payon","izlude";
setarray .MVP[0],1658,1648,1751,1312;
end;

OnMinute00:
set .RandMap,rand( getarraysize( .Map$ ) );
set .RandMVP,rand( getarraysize( .MVP ) );
monster .Map$[ .RandMap ],0,0,"MVP Event",.MVP[ .RandMVP ],1,strnpcinfo(0)+"::OnKilled";
announce "MVP Event : "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" occur in "+.Map$[ .RandMap ]+" .",0;
end;

OnKilled:
announce "MVP Event : End...MVP Died",0;
end;

}

So, on this script.. Should I add the monster's ID on this line?

setarray .MVP[0]

EDIT:

@Emistry

Good work Mr. Emistry, It's working now.. anyway just a few questions regarding on this script..

How to make this after the OnMinute: and players didn't kill the MVP, can you add @killmonster2 so when the OnMinute: comes again, it will automatically trigger the command @killmonster2 on the last invaded map.

Thank you

Edited by Jezu
Link to comment
Share on other sites

add this below the OnMinute00:

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

So, this command 'killmonster' will be activated in the last map that invaded?

Link to comment
Share on other sites

what about a fail safe feature for example if nobody kills said mvp in 1 hour, the event ends and players will have to wait for the next opening?

Edited by archilles89
Link to comment
Share on other sites

add this below the OnMinute00:

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

Hello Emistry ahh at "OnMinute00:" what time does it actually start? is that every hour?

Link to comment
Share on other sites

hello, how may i add when a player kills a mvp, get  mvp point and then that mvp point exchange it for something with other npc?


 

i forgot to mention

also, how to make the players earns points too when killing out of the event?

Link to comment
Share on other sites

hello, how may i add when a player kills a mvp, get  mvp point and then that mvp point exchange it for something with other npc?

OnKilled:
announce "MVP Event : End...MVP Died",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;

 

also, how to make the players earns points too when killing out of the event?

to get points when killing a mvp

-	script	iounoin	-1,{
OnNPCKillEvent:
	if ( getmonsterinfo( killedrid,22 ) )// mvp exp
		set mvp_point, mvp_point + 1;// +1 mvp point
	end;
}
Link to comment
Share on other sites

hello, how may i add when a player kills a mvp, get  mvp point and then that mvp point exchange it for something with other npc?

OnKilled:
announce "MVP Event : End...MVP Died",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;

 

>also, how to make the players earns points too when killing out of the event?

to get points when killing a mvp

-	script	iounoin	-1,{
OnNPCKillEvent:
	if ( getmonsterinfo( killedrid,22 ) )// mvp exp
		set mvp_point, mvp_point + 1;// +1 mvp point
	end;
}

 

thanks o:!

do i need to create a table or something in sql? or a script? i just want to add a npc that exchanges that mvp points por some goods o:

Link to comment
Share on other sites

do i need to create a table or something in sql? or a script? i just

want to add a npc that exchanges that mvp points por some goods o:

the points are stored in mvp_point character variable. No need sql here. There is a lot of npc here to amke a trade, search.

 

can I haz Emistry's Script spawn every 3 hours instead of 1?

add

if( .event_timer%3 ) end;
.event_timer++;

after OnMinute00

Link to comment
Share on other sites

Oh thanks again o:!

so, this will make a player earns a mvp_point everytime they kill a mvp out of the event

-	script	iounoin	-1,{
OnNPCKillEvent:
	if ( getmonsterinfo( killedrid,22 ) )// mvp exp
		set mvp_point, mvp_point + 1;// +1 mvp point
	end;
}

and this will start the mvp invasion every 8 hours (i want it 8 hours instead of 3) and if the mvps were not killed, a @killmonster2 command will trigger and then the next invasion will start randomly, also this will make a player earn+1mvp_point when they kill the mvp on the invasion.

-	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:
killmonster .Map$[ .RandMap ],"All";
if( .event_timer%8 ) end; //<--- im not sure of this part, first it kills the mvps that were not killed on the last event
.event_timer++;//then if 8 hours transcurred after OnMinute00: the event will start ? because i see a end; there
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 )+" occurs in "+.Map$[ .RandMap ]+" .",0;
end;

OnKilled:
announce "Invasion MvP : All MvPs have been hunted",0;
set mvp_point, mvp_point + 1;// +1 mvp point
end;
}

so if all of this is correct, the next questions appears

when a player kills a mvp in the invasion event, it will earns 2 mvp_points right? because the mvp invasion gives +1 mvp_point and the first script gives another +1mvp when a player kills a mvp out of the event, basicsilly both scripts stack making the player earn +2 mvp points when they kill mvps on the event o:?

 

thanks in adivice o:!

Link to comment
Share on other sites

if( .event_timer%8 ) end; //<--- im not sure of this part, first it kills the mvps that were not killed on the last event
.event_timer++;//then if 8 hours transcurred after OnMinute00: the event will start ? because i see a end; there

.event_timer doesn't increase above 1

 

.event_timer value is 0 --> .event_timer%8 : rest 0 --> .event_timer increase

.event_timer value is 1 --> .event_timer%8 : rest 1 --> condition true, stop the script

 

I suggest to delete this 2 lines and replace

OnMinute00: 

by

OnHour00:
OnHour08:
//etc..

 

when a player kills a mvp in the invasion event, it will earns 2 mvp_points right?

No it won't, the emu only start one event attached to the monster (OnNPCKillEvent by default). In your script killing a monster will only trigger OnKilled event.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.