Jump to content
  • 0

Spawn monsters on castle when WoE start


alphenz

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/09/13
  • Last Seen:  

Hello,
I've been playing Ragnarok for myself and I want
something interesting. So, I want to make a script that spawn monsters
when WoE starts.
I've made the monsters to spawn in a castle but I do not know how to make them disappear when WoE ends and spawn them again when WoE starts.
I also tried to change agit_main.txt but nothing happened.
Here is my script:

//==================================================
// aldeg_cas01
//==================================================
aldeg_cas01,0,0,0,0	monster	Cecil Damon	1638,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Kathryne Keyron	1639,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Margaretha Sorin	1637,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Howard Alt-Eisen	1636,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Eremes Guile	1635,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Seyren Windsor	1634,4,00,0,0
aldeg_cas01,0,0,0,0	monster	Randel	2221,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Flamel	2222,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Celia	2223,1,20000,0,0
aldeg_cas01,0,0,0,0	monster	Chen	2224,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Gertie	2225,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Alphoccio	2226,4,20000,0,0
aldeg_cas01,0,0,0,0	monster	Trentini	2227,4,20000,0,0

aldeg_cas01,216,23,0,0	monster	Cecil Damon	1638,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Kathryne Keyron	1639,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Margaretha Sorin	1637,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Howard Alt-Eisen	1636,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Eremes Guile	1635,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Seyren Windsor	1634,4,00,0,0
aldeg_cas01,216,23,0,0	monster	Randel	2221,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Flamel	2222,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Celia	2223,1,5000,0,0
aldeg_cas01,216,23,0,0	monster	Chen	2224,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Gertie	2225,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Alphoccio	2226,4,5000,0,0
aldeg_cas01,216,23,0,0	monster	Trentini	2227,4,5000,0,0

If you see, this is just a permanent monster spawn.

Can someone help me, please?

Thank you and sorry for bad English. :)

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


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

Try this one

-	script	spawn_woe	-1,{
OnAgitStart:// when woe start
	sleep 2;
	for( .@i = 0; .@i < .size_mob; .@i++ ) {
		for( .@j = 0; .@j < .size_map; .@j++ )
			monster .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i], .mob_count[.@i],"";
	}
	end;
OnAgitEnd:// when woe end
	sleep 2;
	for( .@i = 0; .@i < .size_map; .@i++ ) {
		sleep2 1;
		killmonsterall .map_woe$[.@i];
	}
	end;

OnNPCKillEvent:
	sleep2 1;
	if( agitcheck() && compare( .mob_id_c$, killedrid +"" ) && compare( .map_woe_c$, strcharinfo(3) ) )// check is woe on + if mob in .mob_ID list + map in .map_woe$ list
		monster strcharinfo(3),0,0,"--ja--", killedrid,1,"";
	end;

OnInit:
// ------- setting
	setarray .mob_ID, 1638, 1639; // add more mob id
	setarray .mob_count, 40, 40;// number of mobs summoned / .mob_ID array column
	setarray .map_woe$, "aldeg_cas01", "aldeg_cas02"; // yours woe map
//-------- end of setting
	.size_mob = getarraysize( .mob_ID );
	.size_map = getarraysize( .map_woe$ );
	for( .@i = 0; .@i < .size_mob; .@i++ )
		.@tmp$[.@i] = .mob_ID[.@i];
	.mob_id_c$ = implode( .@tmp$, "|" );
	.map_woe_c$ = implode( .map_woe$, "|" );
	end;
}

and add in npc/guild/agit_main.txt

donpcevent "spawn_woe::OnAgitStart";

after

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by the [" + getguildName(.@GID) + "] guild.",bc_all|bc_woe;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  08/29/12
  • Last Seen:  

Posted · Hidden by Euphy, March 24, 2013 - No reason given
Hidden by Euphy, March 24, 2013 - No reason given

Hello where you from? are you a owner or not? coz im looking a good owner in ragnarok thanks.

Link to comment

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

-	script	spawn_woe	-1,{
OnAgitStart:// when woe start
	for( .@i = 0; .@i < .size_mob; .@i++ )
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],4,strnpcinfo(0) +"::OnKillMob"+ .@i;
	end;
OnAgitEnd:// when woe end
	sleep 2;
	killmonsterall "aldeg_cas01";
	end;
OnKillMob0:
	if( agitcheck() ) {// check is woe on
		.@i = 0; // for OnKillMob0 event
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;// spawn 1 mob
	}
	end;
OnKillMob1:
	if( agitcheck() ) {
		.@i = 1;
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;

OnInit:
	setarray .mob_ID, 1638, 1639; // add more mob id
	.size_mob = getarraysize( .mob_ID );
	end;
}

It's an example with 2 mobs ID. If you add more mob ID, you must add more OnKillMobX event label.

 

It's not the only way, you can use OnNPCKillEvent label too.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/09/13
  • Last Seen:  

-	script	spawn_woe	-1,{
OnAgitStart:// when woe start
	for( .@i = 0; .@i < .size_mob; .@i++ )
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],4,strnpcinfo(0) +"::OnKillMob"+ .@i;
	end;
OnAgitEnd:// when woe end
	sleep 2;
	killmonsterall "aldeg_cas01";
	end;
OnKillMob0:
	if( agitcheck() ) {// check is woe on
		.@i = 0; // for OnKillMob0 event
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;// spawn 1 mob
	}
	end;
OnKillMob1:
	if( agitcheck() ) {
		.@i = 1;
		monster "aldeg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;

OnInit:
	setarray .mob_ID, 1638, 1639; // add more mob id
	.size_mob = getarraysize( .mob_ID );
	end;
}

It's an example with 2 mobs ID. If you add more mob ID, you must add more OnKillMobX event label.

 

It's not the only way, you can use OnNPCKillEvent label too.

Hi thank you for your help,

 

edited:

I've tried to add map name but I think it failed. So I just make a new script and change the map name like this:

-	script	prtg1_woe	-1,{
OnAgitStart:// when woe start
	for( .@i = 0; .@i < .size_mob; .@i++ )
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],4,strnpcinfo(0) +"::OnKillMob"+ .@i;
	end;
OnAgitEnd:// when woe end
	sleep 2;
	killmonsterall "prtg_cas01";
	end;
OnKillMob0:
	if( agitcheck() ) {// check is woe on
		.@i = 0; // for OnKillMob0 event
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;// spawn 1 mob
	}
	end;
OnKillMob1:
	if( agitcheck() ) {
		.@i = 1;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob2:
	if( agitcheck() ) {
		.@i = 2;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob3:
	if( agitcheck() ) {
		.@i = 3;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob4:
	if( agitcheck() ) {
		.@i = 4;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob5:
	if( agitcheck() ) {
		.@i = 5;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob6:
	if( agitcheck() ) {
		.@i = 6;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob7:
	if( agitcheck() ) {
		.@i = 7;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob8:
	if( agitcheck() ) {
		.@i = 8;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],1,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob9:
	if( agitcheck() ) {
		.@i = 9;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob10:
	if( agitcheck() ) {
		.@i = 10;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob11:
	if( agitcheck() ) {
		.@i = 11;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob12:
	if( agitcheck() ) {
		.@i = 12;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;
OnKillMob13:
	if( agitcheck() ) {
		.@i = 13;
		monster "prtg_cas01",0,0,"--ja--", .mob_ID[.@i],6,strnpcinfo(0) +"::OnKillMob"+ .@i;
	}
	end;

OnInit:
	setarray .mob_ID, 1638, 1639, 1637, 1636, 1635, 1634, 2221, 2222, 2223, 2224, 2225, 2226, 2227; // add more mob id
	.size_mob = getarraysize( .mob_ID );
	end;
}

However, everytime Emperium broken the monster spawned twice.

Is there something wrong?

Edited by alphenz
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:  

No when you kill a monster, you spawn 4 or 6 monsters in each map this way.

 

Try this

-	script	spawn_woe	-1,{
OnAgitStart:// when woe start
	sleep 2;
	for( .@i = 0; .@i < .size_mob; .@i++ ) {
		for( .@j = 0; .@j < .size_map; .@j++ )
			monster .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i], .mob_count[.@i],"";
	}
	end;
OnAgitEnd:// when woe end
	sleep 2;
	for( .@i = 0; .@i < .size_map; .@i++ )
		killmonsterall .map_woe$[.@i];
	end;

OnNPCKillEvent:
	if( agitcheck() && compare( .mob_id_c$, killedrid +"" ) && compare( .map_woe_c$, strcharinfo(3) ) )// check is woe on + if mob in .mob_ID list + map in .map_woe$ list
		monster strcharinfo(3),0,0,"--ja--", killedrid,1,"";
	end;

OnInit:
// ------- setting
	setarray .mob_ID, 1638, 1639; // add more mob id
	setarray .mob_count, 40, 40;// number of mobs summoned / .mob_ID array column
	setarray .map_woe$, "aldeg_cas01", "aldeg_cas02"; // yours woe map
//-------- end of setting
	.size_mob = getarraysize( .mob_ID );
	.size_map = getarraysize( .map_woe$ );
	for( .@i = 0; .@i < .size_mob; .@i++ )
		.@tmp$[.@i] = .mob_ID[.@i];
	.mob_id_c$ = implode( .@tmp$, "|" );
	.map_woe_c$ = implode( .map_woe$, "|" );
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/09/13
  • Last Seen:  

The problem that monster spawned twice has been solved. Thanks.

The last script you give is more easy to use. But, may I ask one more thing? Is it possible to make the monster spawned again after the emperium broken? Like 1 or 2 minutes after that happen.

I really want to learn to use script commands but don't know where to start. where do you learn it?

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:  

The last script you give is more easy to use. But, may I ask one more

thing? Is it possible to make the monster spawned again after the

emperium broken? Like 1 or 2 minutes after that happen.

I don't get this part.

The script is like a spawn permanent, you kill one monster, this one is spawn randomly in the castle.

 

Spawn again... maybe you don't want a permanent spawn and the monsters are all re-spawn 2 min after the emp is broken ?

 

 

 

 

I really want to learn to use script commands but don't know where to start. where do you learn it?

Read the doc/script_commands.txt

I read the whole file + some npc script.. the docs are the basis

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/09/13
  • Last Seen:  

The last script you give is more easy to use. But, may I ask one more

thing? Is it possible to make the monster spawned again after the

emperium broken? Like 1 or 2 minutes after that happen.

I don't get this part.

The script is like a spawn permanent, you kill one monster, this one is spawn randomly in the castle.

Spawn again... maybe you don't want a permanent spawn and the monsters are all re-spawn 2 min after the emp is broken ?

>

I really want to learn to use script commands but don't know where to start. where do you learn it?

Read the doc/script_commands.txt

I read the whole file + some npc script.. the docs are the basis

I've tried using the script you made.

at first all the monsters were spawned. I kill one monster and it re-spawn somewhere, but after I break the emperium, all monster killed and didn't re-spawn again. I want permanent re-spawn and also I want the monster to re-spawn after the emp is broken.

I hope I didn't make you confused :(

 

edited:

my mapserv-sql.bat shows this:

[Warning]: npc_event: player's event queue is full, can't add event 'spawn_woe::
OnNPCKillEvent' !
[Warning]: npc_event: player's event queue is full, can't add event 'spawn_woe::
OnNPCKillEvent' !
[Warning]: npc_event: player's event queue is full, can't add event 'spawn_woe::
OnNPCKillEvent' !
[Warning]: npc_event: player's event queue is full, can't add event 'spawn_woe::
OnNPCKillEvent' !

 

Edited by alphenz
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  03/09/13
  • Last Seen:  

Thank you very much for your hard work :)

Problem solved.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

does this spawn monster everytime the emperium breaks(also clear the previous ones) and do the monsters spawned also hit the current guild owners?

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:  

does this spawn monster everytime the emperium breaks(also clear the previous ones)

yes

 

do the monsters spawned also hit the current guild owners?

yes

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

 

do the monsters spawned also hit the current guild owners?

yes

 

can we disable this by script (no src)?; like monsters only attack enemy guilds/players and ignore the current castle owner and threat them as allies

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:  

can we disable this by script (no src)?; like monsters only attack enemy

guilds/players and ignore the current castle owner and threat them as

allies

Like guardian system ?

 

-	script	spawn_woe	-1,{
OnAgitStart:// when woe start
	sleep 2;
	for( .@i = 0; .@i < .size_mob; .@i++ ) {
		for( .@j = 0; .@j < .size_map; .@j++ ) {
			if( GetCastleData( .map_woe$[.@j],1 ) ) {
				for( .@k = 0; .@k < .mob_count[.@i]; .@k++ )
					guardian .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i];
			}
			else
				monster .map_woe$[.@j],0,0,"--ja--", .mob_ID[.@i], .mob_count[.@i],"";
		}
	}
	end;
OnAgitEnd:// when woe end
	sleep 2;
	for( .@i = 0; .@i < .size_map; .@i++ ) {
		sleep2 1;
		killmonsterall .map_woe$[.@i];
	}
	end;
OnNPCKillEvent:
	sleep2 1;
	if( agitcheck() && compare( .mob_id_c$, killedrid +"" ) && compare( .map_woe_c$, strcharinfo(3) ) ) {// check is woe on + if mob in .mob_ID list + map in .map_woe$ list
		if( GetCastleData( strcharinfo(3),1 ) )
			guardian strcharinfo(3),0,0,"--ja--", killedrid;
		else
			monster strcharinfo(3),0,0,"--ja--", killedrid,1,"";
	}
	end;

OnInit:
// ------- setting
	setarray .mob_ID, 1638, 1639; // add more mob id
	setarray .mob_count, 40, 40;// number of mobs summoned / .mob_ID array column
	setarray .map_woe$, "aldeg_cas01", "aldeg_cas02"; // yours woe map
//-------- end of setting
	.size_mob = getarraysize( .mob_ID );
	.size_map = getarraysize( .map_woe$ );
	for( .@i = 0; .@i < .size_mob; .@i++ )
		.@tmp$[.@i] = .mob_ID[.@i];
	.mob_id_c$ = implode( .@tmp$, "|" );
	.map_woe_c$ = implode( .map_woe$, "|" );
	end;
}

 

 

 

Add in guild/agit_main.txt

killmonsterall strcharinfo(3);

after

// The Emperium has been broken.
OnAgitBreak:
	set .@GID,getcharid(2);

 

 

and

donpcevent "spawn_woe::OnAgitStart";

after

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by the [" + getguildName(.@GID) + "] guild.",bc_all|bc_woe;
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

Like guardian system ?

 

yes like guardian system; spawns on agitstart/respawn when emp break for the new guild owners(wipes old spawned ones); guild owner friendly (may assist them); attacks enemies.

 

thanks for helping, i'll try it later. keep up the good job /no1  +1

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