Seasonal spawns (was: I need your help, devs)

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
Flenix
Peon
Peon
Posts: 20
Joined: 26 Jun 2011, 16:14

Seasonal spawns (was: I need your help, devs)

Post by Flenix »

Hello the mana world, Image
  • I'm posting here for a little problem in teAthena script.
As you already know I was wanted to do an script that will spawn fluffy in nivalis only the summer (see thermin's topic).


I tried:

Code: Select all

019-1.gat,0,0,0	script	#Fluffyspawn	-1,{

OnInit:
	if (gettime(6) >= 6 && gettime(6) <= 9) 
			monster 019-1, 0, 0, "this", 1020, 100,"#Fluffyspawn::On1020";
end;
On1020:
		if (gettime(6) >= 6 && gettime(6) <= 9) monster "this", 0, 0, "Fluffy", 1020, 1,"#Fluffyspawn::On1020";
	set @mobID, 1020;
	callfunc "MobPoints";
end;
}
but it didn't work Image
if someone as a dev can help me to understand where the problem comes.
(the terminal said anything's wrong)

if only it could work ... Image
Last edited by Freeyorp101 on 10 Aug 2011, 21:57, edited 1 time in total.
Reason: Alter topic title to actually be descriptive
I'm the best fluffy
User avatar
Dark_Mag
Warrior
Warrior
Posts: 347
Joined: 18 Dec 2009, 20:14
Contact:

Re: I need your help, devs

Post by Dark_Mag »

Flenix wrote:Hello the mana world, Image
  • I'm posting here for a little problem in teAthena script.
As you already know I was wanted to do an script that will spawn fluffy in nivalis only the summer (see thermin's topic).


I tried:

Code: Select all

019-1.gat,0,0,0	script	#Fluffyspawn	-1,{

OnInit:
	if (gettime(6) >= 6 && gettime(6) <= 9) 
			monster 019-1, 0, 0, "this", 1020, 100,"#Fluffyspawn::On1020";
end;
On1020:
		if (gettime(6) >= 6 && gettime(6) <= 9) monster "this", 0, 0, "Fluffy", 1020, 1,"#Fluffyspawn::On1020";
	set @mobID, 1020;
	callfunc "MobPoints";
end;
}
but it didn't work Image
if someone as a dev can help me to understand where the problem comes.
(the terminal said anything's wrong)

if only it could work ... Image
Flenix,

Hm, at first you should create a timer, and only then check its time. Also you're using it (spawn and timer) a bit strange, I would advice you to read about timers in the commands tutorial.

Cheers, dark
Image
Image
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: I need your help, devs

Post by o11c »

That looks mostly right, but e.g. the map name needs to be in quotes. Otherwise it gets interpreted as the integer result of (019 - 1), which is an error if the parser does octal and 18 otherwise. Either way, when stringified, it is not a valid map name.

There is no need for a timer in this case, and timers should generally be avoided when feasible.

Note however that this might cause problems if the monsters are killed using GM commands.
Former programmer for the TMWA server.
alastrim
Novice
Novice
Posts: 139
Joined: 02 Jun 2009, 12:19
Location: Brasil

Re: Seasonal spawns (was: I need your help, devs)

Post by alastrim »

I could not think of a way to do this without using a timer and a "OnMonsterDeath" label.
As I was thinking, It would check the current month every minute and spawn the monsters in the right date. But if a gm kills them using "@killmonster2" it would mess with the respawn control.

But it would be interesting to see it work without a timer too.
User avatar
Flenix
Peon
Peon
Posts: 20
Joined: 26 Jun 2011, 16:14

Re: Seasonal spawns (was: I need your help, devs)

Post by Flenix »

thanks for your answers Image


@Dark_Mag: thanks for the link, I was using the Eathena commands http://wiki.themanaworld.org/images/9/97/Scripthelp.txt

@o11c: I tried (before posting) "this" for the map name instead of 19-1, but both don't work.

about the @killmonster command, why gm will want to kill fluffies Image, anyway we should add a debug in a NPC in the map (snow man as example)
something like that

Code: Select all

if (getgmlevel() >= 60) 
     menu 
"I did @killmonter", L_fluffy,
"nothing", -;
close;
L_fluffy:
      if (gettime(6) >= 6 && gettime(6) <= 9) monster "this", 0, 0, "Fluffy", 1020, 100,"#Fluffyspawn::On1020";
      if (gettime(6) >= 6 && gettime(6) <= 9) mes "Monster spawn";
      if (!(gettime(6) >= 6 && gettime(6) <= 9)) mes "Fail, you're not in the right season.";
close;
Last edited by Flenix on 12 Aug 2011, 10:24, edited 1 time in total.
I'm the best fluffy
User avatar
Flenix
Peon
Peon
Posts: 20
Joined: 26 Jun 2011, 16:14

Re: Seasonal spawns (was: I need your help, devs)

Post by Flenix »

I'll try to do the script right
I'm the best fluffy
Post Reply