Jump to content
  • 0

What am I doing wrong?


babycakestheman

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  04/11/15
  • Last Seen:  

This is embarrassing, but I cant seem to make this event work. trust me on this, I searched this forum for answers back to back, and yes they all worked.......with my other events. Except for this one though, i tried OnMinute,OnClock,etc all seem to fail. Why? What am I doing wrong?

and yes, I added this onto my scripts_custom.conf

just in case you're wondering.

-    script    Sample    -1,{
function Invasion;

OnInit:
setarray

.Maps$[0],"alberta","aldebaran","amatsu","ayothaya","comodo","einbroch","geffen","gonryun","hugel","jawaii","lighthalzen","louya

ng","morocc","moscovia","niflheim","payon","rachel","veins","umbala","xmas","yuno";
end;

OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
if( .Invasion ) end;
set .Invasion,1;
set .SelectedMap$,.Maps$[ rand( getarraysize(.Maps$) ) ];
switch( rand(4) ){
    default: end;
    // MAX : ~64 Different Monster in each Cases( 1 BOSS + 63 Normal )
    // Case <X>: Invasion( <BOSS>,<Amount>,<MOBID>,<AMOUNT>,....,<MOBID>,<AMOUNT> ); break;
    Case 0: Invasion( 1870,1,1898,30,1898,20,1898,10,1898,5 ); break;
}
initnpctimer;
end;

OnTimer3600000:
set .Invasion,0;
announce "Time's Up !!  Invasion End.",0;
killmonster .SelectedMap$,"All";
end;
OnMinute25:
function    Invasion    {
    monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
    for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
        monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
    announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0;

}

OnBossKilled:
// getitem 512,100;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ) ){
    mapannounce .SelectedMap$,"MAIN BOSS - Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ),0;
}else{
    killmonster .SelectedMap$,"All";
    mapannounce .SelectedMap$,"ALL Boss has been Killed, Treasure BOX has been Summoned",0;
    monster .SelectedMap$,0,0,"TREASURE BOX",1333,30,strnpcinfo(0)+"::OnBoxKilled";
}
end;

OnMobKilled:
// getitem 512,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){
    mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0;
}
end;

OnBoxKilled:
// getitem 607,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ) ){
    mapannounce .SelectedMap$,"Treasure Box Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ),0;
}else{
    announce "Zombie Simulator end Successfully.",0;
    stopnpctimer;
    set .Invasion,0;
}
end;

}
Edited by Emistry
codebox
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   10
  • Joined:  04/18/15
  • Last Seen:  

there's something wrong about how you declare or call your function, where  did you get this script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  04/11/15
  • Last Seen:  

there's something wrong about how you declare or call your function, where  did you get this script?

I'm sorry, I forgot who did I got this from, but its definitely from this forum. Anyway, is there anyway you could help me man?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   10
  • Joined:  04/18/15
  • Last Seen:  

you can follow emistry's advice in this topic https://rathena.org/board/topic/68812-help-automatic-monster-invasion/

and use the script in rep 4, it's very similar to yours and it works

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

OnMinute25:
function    Invasion    {
    monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
    for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
        monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
    announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0;

}

here you def the function but you don't execute it

function Invasion {
	monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
	for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
		monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
	announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0;
}
OnMinute25:
	Invasion;
	end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  04/11/15
  • Last Seen:  

you can follow emistry's advice in this topic https://rathena.org/board/topic/68812-help-automatic-monster-invasion/

and use the script in rep 4, it's very similar to yours and it works

 

OnMinute25:
function    Invasion    {
    monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
    for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
        monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
    announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0;

}

here you def the function but you don't execute it

function Invasion {
	monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
	for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
		monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
	announce "Zombie Simulator at "+.SelectedMap$+" .. Hurry Up !!.",0;
}
OnMinute25:
	Invasion;
	end;

Thank you for the help but, sadly it isnt working. Why is this script so difficult.

 

-    script    Sample    -1,{

function Invasion;

OnInit:

setarray .Maps$[0],"alberta","aldebaran","amatsu","ayothaya","comodo","einbroch","geffen","gonryun","hugel","jawaii","lighthalzen","louyang","morocc","moscovia","niflheim","payon","rachel","veins","umbala","xmas","yuno";

end;

OnWhisperGlobal:

if( getgmlevel() < 90 ) end;

if( .Invasion ) end;

OnMinute00:

OnMinute11:

set .Invasion,1;

set .SelectedMap$,.Maps$[ rand( getarraysize(.Maps$) ) ];

switch( rand(2) ){

    default: end;

    // MAX : ~64 Different Monster in each Cases( 1 BOSS + 63 Normal )

    // Case <X>: Invasion( <BOSS>,<Amount>,<MOBID>,<AMOUNT>,....,<MOBID>,<AMOUNT> ); break;

    Case 0: Invasion( 1399,1,1898,30,1898,20,1898,10,1898,5 ); break;

    Case 1: Invasion( 1808,1,1799,10,1800,10,1801,10,1802,10,1803,10,1804,10 ); break;

}

initnpctimer;

end;

OnTimer900000:

set .Invasion,0;

announce "Time's Up !!  Invasion End.",0;

killmonster .SelectedMap$,"All";

end;

function    Invasion    {

    monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";

    for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )

        monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";

    announce "Mob Invasion at "+.SelectedMap$+" .. Hurry Up !!.",0;

}

OnBossKilled:

// getitem 616,20;

if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ) ){

    mapannounce .SelectedMap$,"MAIN BOSS - Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ),0;

}else{

    killmonster .SelectedMap$,"All";

    mapannounce .SelectedMap$,"ALL Boss has been Killed, Treasure BOX has been Summoned",0;

    monster .SelectedMap$,0,0,"TREASURE BOX",1333,30,strnpcinfo(0)+"::OnBoxKilled";

}

end;

OnMobKilled:

// getitem 512,1;

if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){

    mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0;

}

end;

OnBoxKilled:

// getitem 607,1;

if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ) ){

    mapannounce .SelectedMap$,"Treasure Box Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ),0;

}else{

    announce "Mob Invasion end Successfully.",0;

    stopnpctimer;

    set .Invasion,0;

}

end;

}

 

So after days of playing around with the time code,it finally worked but, its missing some things like the mob count, slaves dying when MVP is killed and the treasure box is not showing up after all mobs are dead. plus when I checked my map server, it was showing this.

 

 

post-32369-0-62297800-1430655988_thumb.png

Edited by babycakestheman
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Ha yes maybe you forgot the args?

Invasion( 1870,1,1898,30,1898,20,1898,10,1898,5 );
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

yes, it's written by me ..

 

the OnMinute part should be under these line

OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
// OnMinute25:        // <------------- HERE
sample ...

https://rathena.org/board/topic/68812-help-automatic-monster-invasion/?p=178899

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  04/11/15
  • Last Seen:  

 I finally got the time working, but now, The mob count doesnt work, why is this script %$#king me so hard in the #ss. What am I missing now, the mob count seemed to work before. what did I erase?

 

yes, it's written by me ..
 
the OnMinute part should be under these line

OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
// OnMinute25:        // <------------- HERE
sample ...
https://rathena.org/board/topic/68812-help-automatic-monster-invasion/?p=178899

 

 

 

-    script    Sample    -1,{
function Invasion;

OnInit:
setarray .Maps$[0],"alberta","aldebaran","amatsu","ayothaya","comodo","einbroch","geffen","gonryun","hugel","jawaii","lighthalzen","louyang","morocc","moscovia","niflheim","payon","rachel","veins","umbala","xmas","yuno";
end;

OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
OnMinute11:
if( .Invasion ) end;
set .Invasion,1;
set .SelectedMap$,.Maps$[ rand( getarraysize(.Maps$) ) ];
switch( rand(2) ){
    default: end;
    // MAX : ~64 Different Monster in each Cases( 1 BOSS + 63 Normal )
    // Case <X>: Invasion( <BOSS>,<Amount>,<MOBID>,<AMOUNT>,....,<MOBID>,<AMOUNT> ); break;
    Case 0: Invasion( 1399,1,1898,30,1898,20,1898,10,1898,5 ); break;
    Case 1: Invasion( 1808,1,1799,10,1800,10,1801,10,1802,10,1803,10,1804,10 ); break;
}
initnpctimer;
end;

OnTimer1500000:
set .Invasion,0;
announce "Time's Up !!  Invasion End.",0;
killmonster .SelectedMap$,"All";
end;

function    Invasion    {
    monster .SelectedMap$,0,0,"INVASION BOSS",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
    for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
        monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
    announce "Invasion STARTED at "+.SelectedMap$+" .. Hurry Up !!.",0;
}

OnBossKilled:
// getitem 512,100;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ) ){
    mapannounce .SelectedMap$,"MAIN BOSS - Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ),0;
}else{
    killmonster .SelectedMap$,"All";
    mapannounce .SelectedMap$,"ALL Boss has been Killed, Treasure BOX has been Summoned",0;
    monster .SelectedMap$,0,0,"TREASURE BOX",1333,30,strnpcinfo(0)+"::OnBoxKilled";
}
end;

OnMobKilled:
// getitem 512,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){
    mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0;
}
end;

OnBoxKilled:
// getitem 607,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ) ){
    mapannounce .SelectedMap$,"Treasure Box Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ),0;
}else{
    announce "Invasion Event end Successfully.",0;
    stopnpctimer;
}
end;

}

 

Ha yes maybe you forgot the args?

Invasion( 1870,1,1898,30,1898,20,1898,10,1898,5 );

Look at my updated script, am i forgetting the args somewhere else?

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   3
  • Joined:  04/11/15
  • Last Seen:  

yes, it's written by me ..

 

the OnMinute part should be under these line

OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
// OnMinute25:        // <------------- HERE
sample ...

https://rathena.org/board/topic/68812-help-automatic-monster-invasion/?p=178899

 

Now this is weird. I tried loading your script without modifying it, It still shows this error. This didnt happen before, i experienced the feature where the treasure chests shows up after you kill all mobs or the boss alone.

post-32369-0-44368500-1430828751_thumb.png

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...