Help: Script Invasor

OmarAcero

New member
Messages
173
Points
0
Location
Lima-Perú
Github
https://github.com/OmarAcero
Emulator
Hello friends, good day,
Can  someone with a good heart help me with this console error please?, I'm stuck there.

yE0EggR.jpg
The script only requires editing:
-In ./src/map/map.h, configure the following text line to avoid reaching the event queue limit:

#define MAX_EVENTQUEUE 12   //  [Ivion]
Attached this is the example script for hercules: The_Invasor.txt

Note1: GMs can enter to the Control Panel whispering to NPC:invasor . The Control Panel allows GMs to start a new custom invasion event or end the current one. Example: [NPC:invasor] [ open ] , whispear open or start to npc:invasor.

Note2: At the end I will share the script without errors for all.

 
Last edited by a moderator:
you need to have 12 monsters:

First 9 would be normal mob and other 3 as boss monster, but.you specified only 11 id

Onc1,"Aqua",1001,1002,1002,1002,1002,1001,1002,1001,1002,1001,1002;

 
@Dastgir  Thank you very much brother, the console error is no longer displayed.

I can ask you another question, please, now apparently the script works, I can start an invasion, but I have a problem with the monsters.
When the invasion begins the monsters appear, but they are instantly destroyed. I do not understand why, I'm stuck.

lhrmYZA.jpg
- Could you please guide me? Maybe something I need to edit ... 

-  Original Files: HERE

 
Last edited by a moderator:
your profile said you are using Hercules
but when I test the script all kinds of errors pop up

Code:
[Error]: script_add_str: detected possible use of wrong case in a script. Found
'setBattleFlag', probably meant to be 'setbattleflag' (in 'npc/zzz.txt').
[Error]: script error in file 'npc/zzz.txt' line 158 column 3
    parse_line: expect command, missing function name or calling undeclared func
tion
   155:
   156:         // Restore experience rates:
   157:         if(checkcell("prontera",0,0,cell_water)) {
*  158:                 setBattleFlag "base_exp_rate",getBattleFlag("base_exp_rate") - $TIbr;
        ~~~~~~~~~~~~~~~~^
   159:                 setBattleFlag "job_exp_rate",getBattleFlag("job_exp_rate") - $TIjr;
   160:                 set $TIbr,0;
   161:                 set $TIjr,0;
Code:
[Error]: script error in file 'npc/zzz.txt' line 158 column 46
    parse_line: need ';'
   155:
   156:         // Restore experience rates:
   157:         if(checkcell("prontera",0,0,cell_water)) {
*  158:                 setbattleflag "base_exp_rate",getBattleFlag("base_exp_rate") - $TIbr;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   159:                 setbattleflag "job_exp_rate",getBattleFlag("job_exp_rate") - $TIjr;
   160:                 set $TIbr,0;
   161:                 set $TIjr,0;
Code:
[Error]: script error in file 'npc/zzz.txt' line 332 column 48
    parse_line: expect command, missing function name or calling undeclared funtion
   329:         end;
   330:
   331: OnPCDieEvent:
*  332:         if((.a > 0) && (getsavepoint(0) == .c2$[.b])) save .s$,.sx,.sy;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   333:         end;
   334:
   335: OnWhisperGlobal:
this script is not meant for Hercules

ok the script loads fine in rathena

Code:
[Warning]: buildin_monster: Attempted to spawn non-existing monster class 2503
[Debug]: Source (NPC): invasor (invisible/not on a map)
[Warning]: buildin_monster: Attempted to spawn non-existing monster class 1228
[Debug]: Source (NPC): invasor (invisible/not on a map)
can you just read the map-server.exe for all the errors ?

this is a bad ... script ... unreadable ...
why I have to refer to what the t1 c1 c2 t2 means ...
why not just make a proper variable name like .t1 = .min_time , .t3 = .duration

I cannot read this script, I'm out

 
Last edited by a moderator:
@AnnieRuru  hmmm I do not get any error!! 

bY3pG3f.jpg
 My Emulator is Hercules update 15-04-2018
Use my file, I'm attaching it in .zip....

Note: I have disabled all the columns of types of monsters for the invasions, only the column of aqua is enabled, therefore, please try only to activating the invasion of monster type aqua. Until we can solve this problem.

View attachment The_Invasor.zip

 
Last edited by a moderator:
remember, the sleep type timer can run multiple times,
and when *awake, will cancel ALL running timer

Code:
prontera,155,185,5	script	dhskfshfd	1_F_MARIA,{
	sleep 30000;
	announce .t++ +" times", bc_all;
	end;
OnInit:
	bindatcmd "ev", strnpcinfo(0)+"::Onaaa";
	end;
Onaaa:
	awake strnpcinfo(0);
	end;
}
click on the npc as many times as possible to queue up the timer
and when type @ev, all gets execute at once

my guess is you make the sleep for auto-invasion and the time remaining in the same npc
so when you do a *awake, instead of you want only the timer for next invasion gets awaken, but the event in-progress timer also gets cancel
since you have the "inv_msg" npc, make use of that to run another kind of npc timer

yup, 1 npc, 1 timer

@OmarAcero

and, yeah, VERY bad script,
should make the script read in linear form, not jump here and there

 
Last edited by a moderator:
@AnnieRuru I did not understand very well, but could you improve that script and make it work?....
The original script was made for eathena, maybe with some small adjustments the script can work on hercules too.

it's a good script just need to adjust the small details...  lf you can get the script to work, I'd appreciate it for the rest of your life. ty.

 
Last edited by a moderator:
Last edited by a moderator:
Back
Top