Jump to content
  • 0

exclusive map for specific castle holder help


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

so i create a script for a map that can be accessed only for the guild who conquers specific castle

i actually did it however i tried to like

1. when agit/woe starts the NPC will tell you that the "Woe is currently active you can't enter now"

what is actually happen is the NPC is just unclickable or no response

2. when woe/agit starts all of the guildmembers will be warped to save point

what is actually happens is the characters still stay inside the map

 

here is the script

	if (!agitcheck() && !agitcheck2() && !agitcheck3()) { // Check for agit active
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		mapwarp .map$, "prontera",149,138; // Map of the savepoint

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data
		if (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "goldroom.gat",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}
	}
end;	
}

thanks in advance

i know that there are some codes missing however i just dunno what is it

thanks again

EDIT:

i tried this one it has no errors but players inside the map are no being kicked or warped out

	if (!agitcheck() && !agitcheck2() && !agitcheck3()) { // Check for agit active
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		atcommand "@kickall"; // Map of the savepoint

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data
		if (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "goldroom.gat",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}
	}
end;	
}

thanks again

Edited by AinsLord
more info
Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

On 5/28/2023 at 11:33 AM, AinsLord said:

so i create a script for a map that can be accessed only for the guild who conquers specific castle

i actually did it however i tried to like

1. when agit/woe starts the NPC will tell you that the "Woe is currently active you can't enter now"

what is actually happen is the NPC is just unclickable or no response

2. when woe/agit starts all of the guildmembers will be warped to save point

what is actually happens is the characters still stay inside the map

 

here is the script

	if (!agitcheck() && !agitcheck2() && !agitcheck3()) { // Check for agit active
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		mapwarp .map$, "prontera",149,138; // Map of the savepoint

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data
		if (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "goldroom.gat",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}
	}
end;	
}

thanks in advance

i know that there are some codes missing however i just dunno what is it

thanks again

EDIT:

i tried this one it has no errors but players inside the map are no being kicked or warped out

	if (!agitcheck() && !agitcheck2() && !agitcheck3()) { // Check for agit active
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		atcommand "@kickall"; // Map of the savepoint

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data
		if (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "goldroom.gat",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}
	}
end;	
}

thanks again

Bump to the post

 

i try to make this script

so it actually works with inactive woe and while inside and you leave the guild you will be kicked out also

however when the woe/agit is active castle owner can still enter the map

i cant make it like whenever woe started no guildmember/master can enter the map and all of the guildmember/master

inside will be warped back to savepoint

here is the code

-	script	kickmap_guild	-1,{
	
	OnInit:
		.map$ = "prt_fild07";
		.interval = 1;
		
		setmapflag .map$, mf_loadevent;
		end;
		
	OnPCLoadMapEvent:
		if (strcharinfo(3) == .map$) {
			if (!agitcheck() && !agitcheck2() && !agitcheck3()) {
			.@gid = GetCastleData("prtg_cas01",0); // Castle Map Name and castle data

		 	if  (getcharid(2) == .@gid){
				mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
				next;
				warp "SavePoint",0,0;
			}
			else {
				addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
			}
		}
	}
		end;
}

and also i have this warning/debug msg

image.png.124dd1c8c795d1fa22357c835b3e9d7f.png

i know this is the line

.@gid = GetCastleData("prtg_cas01",0); // this line here

//if i make it like this no error however even the castle owner cant enter the map

.@gid = GetCastleData("prtg_cas01",1); // even castle owner cant enter

thanks for the help in advance very much appreciated

hope someone can help

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

you can try this, https://gist.github.com/Litro/afd8799bbcc6384ba324e1bc7cbbb5d0

ugh what is wrong with comment editor, I can't use code block feature

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

3 hours ago, Litro Endemic said:

you can try this, https://gist.github.com/Litro/afd8799bbcc6384ba324e1bc7cbbb5d0

ugh what is wrong with comment editor, I can't use code block feature

i just refresh the website earlier to use the code block

btw thanks for the help however this error shows in the console when woe started and guildmember/master is inside the map

image_2023-06-01_034452241.png.4d1829bd51029b9cadbcff3a495e9cf5.png

then 2nd thing example a member leaves the guild and the player is inside the map

player is not kicked coz that player is no longer part of the guild

 

EDIT: even without players inside the map that error in console shows

Edited by AinsLord
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

6 hours ago, AinsLord said:

i just refresh the website earlier to use the code block

btw thanks for the help however this error shows in the console when woe started and guildmember/master is inside the map

image_2023-06-01_034452241.png.4d1829bd51029b9cadbcff3a495e9cf5.png

then 2nd thing example a member leaves the guild and the player is inside the map

player is not kicked coz that player is no longer part of the guild

 

EDIT: even without players inside the map that error in console shows

bumb to my post

i made some changes in the script like this

-	script	kickmap_guild	-1,{
	end;

OnInit:
	.map$ = "prt_fild07";
	.interval = 1;
	
	setmapflag .map$, mf_loadevent;
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	if (!agitcheck() && !agitcheck2() && !agitcheck3())
		end;
	.@num = getmapunits(BL_NPC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num; .@i++) {
		.@char_id = getcharid(0, .@name$[.@i]);
		if (.@char_id) {
			message .@name$[.@i], "Agit event has been started. You will be warped to the Save Point.";
			warp "SavePoint", 0, 0, .@char_id;
		}
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;
	
	if (agitcheck() || agitcheck2() || agitcheck3())
		end;

	// Better use constant, constant is made for more readable and can be understood easily
	//.@gid = getcastledata("prtg_cas01", 1);
	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	
	
	if (getcharid(2) != .@gid) {
		mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
		next;
		warp "SavePoint", 0, 0;
	}
	// looping timer is bad practice in my opinion on this case
	// there is an Event emited for agit event.
	//else {
	//	addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
	//}
	end;
}

i trim down the error to this

image.png.fb418609e1170e70a555e3f6e4b503e2.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

the problem is on here

.@num = getmapunits(BL_NPC, .map$, .@name$[0]);

it should be BL_PC coz you are looking for player in that map.

.@num = getmapunits(BL_PC, .map$, .@name$[0]);

i made mistake copy paste-ing from script doc without adjusting what needed fully.

if you look on name that used on getcharid like 'prtf017' that would be npc

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

6 hours ago, Litro Endemic said:

the problem is on here

.@num = getmapunits(BL_NPC, .map$, .@name$[0]);

it should be BL_PC coz you are looking for player in that map.

.@num = getmapunits(BL_PC, .map$, .@name$[0]);

i made mistake copy paste-ing from script doc without adjusting what needed fully.

if you look on name that used on getcharid like 'prtf017' that would be npc

thanks it works super appreciated

now no errors but once a member inside the map leave the guild it doesnt 

warp back to savepoin

example they joined the guild and after entering the map they leave the guild

player who leave the guild stays inside the map

 

didnt change the code

-	script	kickmap_guild	-1,{
	end;

OnInit:
	.map$ = "prt_fild07";
	.interval = 1;
	
	setmapflag .map$, mf_loadevent;
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	if (!agitcheck() && !agitcheck2() && !agitcheck3())
		end;
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		next;
		message .@name$[.@i], "You can enter again after Agit event";
		next;
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;
	
	if (agitcheck() || agitcheck2() || agitcheck3())
		end;

	// Better use constant, constant is made for more readable and can be understood easily
	//.@gid = getcastledata("prtg_cas01", 1);
	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	
	
	if (getcharid(2) != .@gid) {
		mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
		next;
		warp "SavePoint", 0, 0;
	}
	// looping timer is bad practice in my opinion on this case
	// there is an Event emited for agit event.
	//else {
	//	addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
	//}
	end;
}

what seems to be the problem

@LoneRanger

 

FIXED

it really need this line

else {
				addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
			}

if i remove that line if the agit event is inactive and guildmember inside the map leaves the guild

that player will stay inside the map

with that line inactive agit and player inside the map will be warped back to savepoint

 

already fixed thanks a lott ❤️

Edited by AinsLord
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

17 hours ago, AinsLord said:

FIXED

it really need this line

else {
				addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent";
			}

if i remove that line if the agit event is inactive and guildmember inside the map leaves the guild

that player will stay inside the map

with that line inactive agit and player inside the map will be warped back to savepoint

albeit fixed, 1 timer for each guild member will have many timer as many guild member, well.. you can use 1 timer for all npc and its duplicate, just iterate the town array in main npc, 1 timer for all

well it is just about performance and memory resource that will be used on the timer generated, say there will be 3 town for guild town and each its guild have 72 member 72 * 3 timer if all them on town

oh and this take 1 timer slot for it

well you can just ignore this if your host server has huge memory

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

5 hours ago, Litro Endemic said:

albeit fixed, 1 timer for each guild member will have many timer as many guild member, well.. you can use 1 timer for all npc and its duplicate, just iterate the town array in main npc, 1 timer for all

well it is just about performance and memory resource that will be used on the timer generated, say there will be 3 town for guild town and each its guild have 72 member 72 * 3 timer if all them on town

oh and this take 1 timer slot for it

well you can just ignore this if your host server has huge memory

im looking for solution for that line

if i do really remove that line inactive woe/agit if the player leave the guild

they stay in the map instead of being warped back coz they leave the guild

while inside the map

maybe this part "::OnPCLoadMapEvent" triggers the map event

Edited by AinsLord
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

-	script	kickmap_guild#template	-1,{
	end;

OnInit:
	.map$ = "prt_fild07";
	
	setmapflag .map$, mf_loadevent;

	// fallthrough as first check upon script loaded
OnTimer5000: // next timer after ini will run on 5 seconds after
	if (strnpcinfo(2) == "template") { // only this npc with hidden name "template" will do the timer		
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num;.@i++) {
			if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
				continue;
			message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);

		initnpctimer; // reinit the timer tick
	}
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	if (!agitcheck() && !agitcheck2() && !agitcheck3())
		end;
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;

	if (agitcheck() || agitcheck2() || agitcheck3())
		end;

	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);

	if (getcharid(2) != .@gid) {
		mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
		next;
		warp "SavePoint", 0, 0;
	}
	end;
}

I am leaving some comment for you there well take a look and improvise as you need.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

8 hours ago, Litro Endemic said:
-	script	kickmap_guild#template	-1,{
	end;

OnInit:
	.map$ = "prt_fild07";
	
	setmapflag .map$, mf_loadevent;

	// fallthrough as first check upon script loaded
OnTimer5000: // next timer after ini will run on 5 seconds after
	if (strnpcinfo(2) == "template") { // only this npc with hidden name "template" will do the timer		
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num;.@i++) {
			if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
				continue;
			message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);

		initnpctimer; // reinit the timer tick
	}
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	if (!agitcheck() && !agitcheck2() && !agitcheck3())
		end;
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;

	if (agitcheck() || agitcheck2() || agitcheck3())
		end;

	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);

	if (getcharid(2) != .@gid) {
		mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
		next;
		warp "SavePoint", 0, 0;
	}
	end;
}

I am leaving some comment for you there well take a look and improvise as you need.

ill try this one later

thank you again for helping me out 🙂

very much appreciated

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

1. For entrance

	if ( agitcheck() || agitcheck2() || agitcheck3() ) {
		mes "[Entrance Guard]";
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		close;
	} else {
		/*
		// your code when woe is off
		*/
	}

2. Kick everyone when woe starts (I'm not sure if 'SavePoint' works but if it throws an error, you can change it to specific map/area)

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	mapwarp .map$, "SavePoint",0,0;
	end;
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

On 6/4/2023 at 1:05 AM, Magnetix said:

1. For entrance

	if ( agitcheck() || agitcheck2() || agitcheck3() ) {
		mes "[Entrance Guard]";
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		close;
	} else {
		/*
		// your code when woe is off
		*/
	}

2. Kick everyone when woe starts (I'm not sure if 'SavePoint' works but if it throws an error, you can change it to specific map/area)

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	mapwarp .map$, "SavePoint",0,0;
	end;

thank you man for sharing your thought about this ❤️ appreciated

ill try it when i came back from vacation 🙂

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

Bump to my post

@Magnetix

On 6/4/2023 at 1:05 AM, Magnetix said:

1. For entrance

	if ( agitcheck() || agitcheck2() || agitcheck3() ) {
		mes "[Entrance Guard]";
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		close;
	} else {
		/*
		// your code when woe is off
		*/
	}

i tried this one in my entrance NPC

it works while the agit is active but when agit is done

npc dont respond at all

here is the script of my entrance NPC

	if ( agitcheck() || agitcheck2() || agitcheck3() ) {
		mes "[Entrance Guard]";
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		close;

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data and only the guild who owns

		 if  (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "prt_fild07",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}
	}
end;	
}

no error in console

this part here

		.@gid = GetCastleData("prtg_cas01",1); // Castle Map Name and castle data and only the guild who owns

		 if  (getcharid(2) == .@gid){ 
			mes "You will be warped to Lost Midgard";
			next;
			warp "prt_fild07",0,0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";

it only allows the guild who owns prtg_cas01 to enter the map

 

this right here

} else {
		mes "[Lost Midgard Guardian]";
		mes "Your Guild did not conquer Krimhild Castle";
		dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";
		}

will be the NPC msg for those guild who did not conquer the prtg_cas01

and this one

	if ( agitcheck() || agitcheck2() || agitcheck3() ) {
		mes "[Entrance Guard]";
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
		close;

your sample script that i dunno where or how to put without problem entering

i dunno where to place the "ELSE" part

thanks again in advance

Edited by AinsLord
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   30
  • Joined:  06/08/23
  • Last Seen:  

Hi, I am that Litro Endemic.
And damn it I lost my previous account,  because that account isn't using my own email. that account owned by my old friend and lost contact so I created new account. duh what a lame story.

You put the check on bracket of condition when the agit event is on, that's why there is no response.

On 6/4/2023 at 12:05 AM, Magnetix said:

2. Kick everyone when woe starts (I'm not sure if 'SavePoint' works but if it throws an error, you can change it to specific map/area)

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	mapwarp .map$, "SavePoint",0,0;
	end;

*mapwarp script command unlike *warp doesn't support "SavePoint" parameter except you modified it, so it need to iterate player one by one.

 

@AinsLord

here updated script

prontera,150,150,0	script	Entrance Guard	112,{
	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "[Lost Midgard Guardian]";
			mes "Your Guild did not conquer Krimhild Castle";
			dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";	
		}
		else {
			mes "You will be warped to Lost Midgard";
			next;
			warp .map$, 0, 0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		}
	}
	close;

OnInit:
	.map$ = "prt_fild07";

	setmapflag .map$, mf_loadevent;

	// fallthrough as first check upon script loaded
OnTimer5000: // next timer after ini will run on 5 seconds after
	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
			continue;
		message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	initnpctimer; // reinit the timer tick
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;

	if (agitcheck() || agitcheck2() || agitcheck3()) {
		message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
		warp "SavePoint", 0, 0;
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
	}
	end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

On 6/8/2023 at 5:29 PM, Harvin said:

Hi, I am that Litro Endemic.
And damn it I lost my previous account,  because that account isn't using my own email. that account owned by my old friend and lost contact so I created new account. duh what a lame story.

You put the check on bracket of condition when the agit event is on, that's why there is no response.

*mapwarp script command unlike *warp doesn't support "SavePoint" parameter except you modified it, so it need to iterate player one by one.

 

@AinsLord

here updated script

prontera,150,150,0	script	Entrance Guard	112,{
	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "[Lost Midgard Guardian]";
			mes "Your Guild did not conquer Krimhild Castle";
			dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";	
		}
		else {
			mes "You will be warped to Lost Midgard";
			next;
			warp .map$, 0, 0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		}
	}
	close;

OnInit:
	.map$ = "prt_fild07";

	setmapflag .map$, mf_loadevent;

	// fallthrough as first check upon script loaded
OnTimer5000: // next timer after ini will run on 5 seconds after
	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
			continue;
		message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	initnpctimer; // reinit the timer tick
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;

	if (agitcheck() || agitcheck2() || agitcheck3()) {
		message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
		warp "SavePoint", 0, 0;
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
	}
	end;
}

 

thanks again man ill try this one later

the forum is a bit strange lately so i just checked it today 🙂

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

Update on the script

@Litro Endemic @Harvin

so i put some mobs to the script

1. mobs that give gold (for now)

2. mobs give guild points

successfully made it right

is there like simplest way to add the mobs at this script

i made it OnKill for guild points mobs and OnMobKill for gold mobs

here is the script

mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active can't enter right now"; // NPC message when woe is active
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "[Lost Midgard Guardian]";
			mes "Your Guild did not conquer Krimhild Castle";
			dispbottom "[Guild Message]: Only Guild who owns Kriemhild can enter here!";	
		}
		else {
			mes "You will be warped to Lost Midgard";
			next;
			warp .map$, 0, 0;
			dispbottom "[Guild Message]: Welcome to Lost Midgard";
		}
	}
	close;

OnKill:    
        if ( .rate > rand( 10 ) ) {
            .@point = rand( .guild_amount[0],.guild_amount[1] );
            #GUILDPOINTS += .@point;
            dispbottom "Gained "+.@point+" Point. You got "+F_InsertComma( #GUILDPOINTS )+" Points now.";
        }
			monster .map$, 0,0, "[DG]Flower", 1934,1, strnpcinfo(0)+"::OnKill";
			monster .map$, 0,0, "[DG]Flower", 1935,1, strnpcinfo(0)+"::OnKill";

        end;



OnMobKill:

	.@r = rand(100);

		if ( .@r < 3 )

	getitem 969,50;

		else if ( .@r < 5 )

	getitem 969,20;

		else if ( .@r < 25 )

	getitem 969,5;

		else if ( .@r < 50 )

	getitem 969,3;


	else

	getitem 969,1;

			monster .map$, 0,0, "[DG]Gold", 1369,1, strnpcinfo(0)+"::OnMobKill";
			monster .map$, 0,0, "[DG]Gold", 1840,1, strnpcinfo(0)+"::OnMobKill";
end;


OnInit:
	//Castle Map
	.map$ = "prt_fild07";
	setmapflag .map$, mf_loadevent;
        // Guiild points random amount
        setarray .guild_amount,1,3;
	// rate to get Gpoints
        .rate = 100;

	monster .map$, 0,0, "[DG]Gold", 1369,100, strnpcinfo(0)+"::OnMobKill";
	monster .map$, 0,0, "[DG]Gold", 1840,100, strnpcinfo(0)+"::OnMobKill";
	monster .map$, 0,0, "[DG]Flower", 1934,50, strnpcinfo(0)+"::OnKill";
	monster .map$, 0,0, "[DG]Flower", 1935,50, strnpcinfo(0)+"::OnKill";


	// fallthrough as first check upon script loaded
OnTimer5000: // next timer after ini will run on 5 seconds after
	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
			continue;
		message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	initnpctimer; // reinit the timer tick
	end;

OnAgitStart:
OnAgitStart2:
OnAgitStart3:
	.@num = getmapunits(BL_PC, .map$, .@name$[0]);
	freeloop(1);
	for (.@i = 0; .@i < .@num;.@i++) {
		message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
		warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
	}
	freeloop(0);
	end;

OnPCLoadMapEvent:
	if (strcharinfo(3) != .map$)
		end;

	if (agitcheck() || agitcheck2() || agitcheck3()) {
		message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
		warp "SavePoint", 0, 0;
	}
	else {
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
	}
	end;
}

and also how can i make it like for multiple maps possible like prt_fild07 / prt_fild08 / etc

 

thanks again

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

Hello,

you could do it something like this.

prontera,150,150,0	script	Entrance Guard	112,{
	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active you can't enter right now";
		close;
	}

	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	if (getcharid(2) != .@gid) {
		mes "[Entrance Guard]";
		mes "Your Guild did not conquer Krimhild Castle!";
		dispbottom "[Guild Message]: Only the Guild that owns Kriemhild Castle can enter here!";
		close;
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;

    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);

        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];

            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .maps$[0], "prt_fild07", "prt_fild08";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
            setmapflag .maps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .maps$[.@i], .mobs;
        }

	// fallthrough as first check upon script loaded
	OnTimer5000: // next timer after ini will run on 5 seconds after
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num;.@i++) {
			if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
				continue;
			
			message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
		initnpctimer; // reinit the timer tick
	end;

	OnAgitStart:
	OnAgitStart2:
	OnAgitStart3:
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num; .@i++) {
			message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
	end;

	OnPCLoadMapEvent:
		if (strcharinfo(3) != .map$)
			end;

		if (agitcheck() || agitcheck2() || agitcheck3()) {
			message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
			warp "SavePoint", 0, 0;
			end;
		}

		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

3 hours ago, Winterfox said:

Hello,

you could do it something like this.

prontera,150,150,0	script	Entrance Guard	112,{
	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active you can't enter right now";
		close;
	}

	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	if (getcharid(2) != .@gid) {
		mes "[Entrance Guard]";
		mes "Your Guild did not conquer Krimhild Castle!";
		dispbottom "[Guild Message]: Only the Guild that owns Kriemhild Castle can enter here!";
		close;
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;

    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);

        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];

            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .maps$[0], "prt_fild07", "prt_fild08";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
            setmapflag .maps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .maps$[.@i], .mobs;
        }

	// fallthrough as first check upon script loaded
	OnTimer5000: // next timer after ini will run on 5 seconds after
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num;.@i++) {
			if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
				continue;
			
			message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
		initnpctimer; // reinit the timer tick
	end;

	OnAgitStart:
	OnAgitStart2:
	OnAgitStart3:
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num; .@i++) {
			message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
	end;

	OnPCLoadMapEvent:
		if (strcharinfo(3) != .map$)
			end;

		if (agitcheck() || agitcheck2() || agitcheck3()) {
			message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
			warp "SavePoint", 0, 0;
			end;
		}

		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
}

 

thanks for this one im really looking how will i trim down my script 🙂

i forgot to mention i also adding a boss monster that will spawn every 2hrs i forgot to put on my script

drop will be cash coupons and a rare custom item

 

thanks in advance

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

bump to this post

there was like this kind of a warning with the script

image.png.68f183ad01f11566f318e58689a8753d.png

On 6/22/2023 at 10:33 AM, Winterfox said:

Hello,

you could do it something like this.

prontera,150,150,0	script	Entrance Guard	112,{
	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "Woe is currently active you can't enter right now";
		close;
	}

	.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
	if (getcharid(2) != .@gid) {
		mes "[Entrance Guard]";
		mes "Your Guild did not conquer Krimhild Castle!";
		dispbottom "[Guild Message]: Only the Guild that owns Kriemhild Castle can enter here!";
		close;
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;

    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);

        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];

            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .maps$[0], "prt_fild07", "prt_fild08";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
            setmapflag .maps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .maps$[.@i], .mobs;
        }

	// fallthrough as first check upon script loaded
	OnTimer5000: // next timer after ini will run on 5 seconds after
		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num;.@i++) {
			if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it.
				continue;
			
			message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
		initnpctimer; // reinit the timer tick
	end;

	OnAgitStart:
	OnAgitStart2:
	OnAgitStart3:
		.@num = getmapunits(BL_PC, .map$, .@name$[0]);
		freeloop(1);
		for (.@i = 0; .@i < .@num; .@i++) {
			message .@name$[.@i], "Agit event has been started, You will be warped to Save Point";
			warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]);
		}
		freeloop(0);
	end;

	OnPCLoadMapEvent:
		if (strcharinfo(3) != .map$)
			end;

		if (agitcheck() || agitcheck2() || agitcheck3()) {
			message strcharinfo(0), "Agit event is on going, You will be warped to Save Point";
			warp "SavePoint", 0, 0;
			end;
		}

		.@gid = getcastledata("prtg_cas01", CD_GUILD_ID);
		if (getcharid(2) != .@gid) {
			mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!";
			next;
			warp "SavePoint", 0, 0;
		}
}

 

with this script

@Winterfox

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

-	script	EXCLUSIVE_GUILD_MAPS	FAKE_NPC,{
    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);
        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];

            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .castleMaps$[0], "prtg_cas01", "prtg_cas02";
		
		// Exclusive Map
		setarray .exclusiveMaps$[0], "prt_fild07", "prt_fild08";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
            setmapflag .exclusiveMaps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .exclusiveMaps$[.@i], .mobs;
        }
}

prontera,150,150,0	script	Entrance Guard	112,{
	copyarray .cpyCastleMaps$[0], getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"));
	copyarray .cpyExclusiveMaps$[0], getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"));

	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "WoE is currently active you can't enter right now";
		close;
	}

    if(getcharid(2) == 0) {
		mes "Your need to be in a Guild, for me to be able to assist you.";
		close;
    }

	.@index = 0;
	for(.@i = 0; .@i < getarraysize(.cpyCastleMaps$); .@i++) {
		if(getcastledata(.cpyCastleMaps$[.@i], CD_GUILD_ID) == getcharid(2)) {
			.@ownedCastleIndexes[.@index] = .@i;
			.@index++;
		}
	}

	.@ownedCastlesCount = getarraysize(.@ownedCastleIndexes);
	if (.@ownedCastlesCount == 0 && .@index == 0) {
		mes "You don't own a Castle. Come back when you do.";
		close;
	}

	if(.@ownedCastlesCount == 0)
		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[0]];

	if(.@ownedCastlesCount > 0) {
		for(.@i = 0; .@i < .@ownedCastlesCount; .@i++)
            .@ownedCastleNames$[.@i] = getcastlename(.cpyCastleMaps$[.@ownedCastleIndexes[.@i]]);

		mes "You own multiple Castles, select to which Castles exclusive map you want to teleport.";
		next;
		select(implode(.@ownedCastleNames$, ":"));

		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[@menu - 1]];
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .@map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

no spawn of monster

tried to modify some lines in "callsub MobSpawn" still no monster

 

here is the script and i commented the line that i tried to modify

-	script	EXCLUSIVE_GUILD_MAPS	FAKE_NPC,{
    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);
        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];

            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .castleMaps$[0], "prtg_cas01","aldeg_cas05";
		
		// Exclusive Map
		setarray .exclusiveMaps$[0], "prt_fild07","prt_fild09";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
            setmapflag .exclusiveMaps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .exclusiveMaps$[.@i], .mobs[0]; // tried to modify this part from "callsub MobSpawn, .exclusiveMaps$[.@i], .mobs;" to "callsub MobSpawn, .exclusiveMaps$[.@i], .mobs[0];" still no spawn monster
        }
}

byako,152,144,0	script	FarmGuild	1,{

	copyarray .cpyCastleMaps$[0], getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"));
	copyarray .cpyExclusiveMaps$[0], getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"));

	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "WoE is currently active you can't enter right now";
		close;
	}

    if(getcharid(2) == 0) {
		mes "Your need to be in a Guild, for me to be able to assist you.";
		close;
    }

	.@index = 0;
	for(.@i = 0; .@i < getarraysize(.cpyCastleMaps$); .@i++) {
		if(getcastledata(.cpyCastleMaps$[.@i], CD_GUILD_ID) == getcharid(2)) {
			.@ownedCastleIndexes[.@index] = .@i;
			.@index++;
		}
	}

	.@ownedCastlesCount = getarraysize(.@ownedCastleIndexes);
	if (.@ownedCastlesCount == 0 && .@index == 0) {
		mes "You don't own a Castle. Come back when you do.";
		close;
	}

	if(.@ownedCastlesCount == 0)
		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[0]];

	if(.@ownedCastlesCount > 0) {
		for(.@i = 0; .@i < .@ownedCastlesCount; .@i++)
            .@ownedCastleNames$[.@i] = getcastlename(.cpyCastleMaps$[.@ownedCastleIndexes[.@i]]);

		mes "You own multiple Castles, select to which Castles exclusive map you want to teleport.";
		next;
		select(implode(.@ownedCastleNames$, ":"));

		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[@menu - 1]];
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .@map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;
}

sir @Winterfox

Edited by AinsLord
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

I missed a variable. This should spawn monsters now:

-	script	EXCLUSIVE_GUILD_MAPS	FAKE_NPC,{
    OnGuildpointmobDeath:
            if ( .rate > rand( 10 ) ) {
                .@point = rand( .guild_amount[0], .guild_amount[1] );
                #GUILDPOINTS += .@point;
                dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now.";
            }

            callsub MobSpawn, strcharinfo(3), .respawnGPmobs;
    end;

    OnGoldmobDeath:
        .@r = rand(100);
        if ( .@r < 3 )
            getitem 969, 50;
        else if ( .@r < 5 )
            getitem 969, 20;
        else if ( .@r < 25 )
            getitem 969, 5;
        else if ( .@r < 50 )
            getitem 969, 3;
        else
            getitem 969, 1;

        callsub MobSpawn, strcharinfo(3), .respawnGoldmobs;
    end;

    MobSpawn:
        .@map$ = getarg(0);

        for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) {
            .@mobId = getelementofarray(getarg(1), .@i);
            .@mobType = getelementofarray(getarg(1), .@i + 1);
            .@mobAmt = getelementofarray(getarg(1), .@i + 2);
            .@mobTypeName$ = .mobTypeNames$[.@mobType];
            .@mobLabel$ =.labels$[.@mobType];
            monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$;
        }
    return;

    OnInit:
        //Castle Maps
        setarray .castleMaps$[0], "prtg_cas01","aldeg_cas05";
		
		// Exclusive Map
		setarray .exclusiveMaps$[0], "prt_fild07","prt_fild09";

        // Guildpoints random amount
        setarray .guild_amount, 1, 3;

        // Rate to get Guildpoints
        .rate = 100;

		// Mob Spawn
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .mobs[0],
        1369, 0, 100,
        1840, 0, 100,
        1934, 1, 50,
        1935, 1, 50;


		// Respawn Mobs Gold
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGoldmobs[0],
        1369, 0, 1,
        1840, 0, 1;

		// Respawn Mobs Guildpoints
		// ID, Type (0 = Gold, 1 = Guildpoints), Amount
        setarray .respawnGPmobs[0],
        1934, 1, 1,
        1935, 1, 1;

        setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower";
        setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath";

        for(.@i = 0; .@i < getarraysize(.exclusiveMaps$); .@i++) {
            setmapflag .exclusiveMaps$[.@i], MF_LOADEVENT;
            callsub MobSpawn, .exclusiveMaps$[.@i], .mobs;
        }
}

byako,152,144,0	script	FarmGuild	1,{

	copyarray .cpyCastleMaps$[0], getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"));
	copyarray .cpyExclusiveMaps$[0], getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"));

	mes "[Entrance Guard]";
	if (agitcheck() || agitcheck2() || agitcheck3()) {
		mes "WoE is currently active you can't enter right now";
		close;
	}

    if(getcharid(2) == 0) {
		mes "Your need to be in a Guild, for me to be able to assist you.";
		close;
    }

	.@index = 0;
	for(.@i = 0; .@i < getarraysize(.cpyCastleMaps$); .@i++) {
		if(getcastledata(.cpyCastleMaps$[.@i], CD_GUILD_ID) == getcharid(2)) {
			.@ownedCastleIndexes[.@index] = .@i;
			.@index++;
		}
	}

	.@ownedCastlesCount = getarraysize(.@ownedCastleIndexes);
	if (.@ownedCastlesCount == 0 && .@index == 0) {
		mes "You don't own a Castle. Come back when you do.";
		close;
	}

	if(.@ownedCastlesCount == 0)
		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[0]];

	if(.@ownedCastlesCount > 0) {
		for(.@i = 0; .@i < .@ownedCastlesCount; .@i++)
            .@ownedCastleNames$[.@i] = getcastlename(.cpyCastleMaps$[.@ownedCastleIndexes[.@i]]);

		mes "You own multiple Castles, select to which Castles exclusive map you want to teleport.";
		next;
		select(implode(.@ownedCastleNames$, ":"));

		.@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[@menu - 1]];
	}

	mes "You will be warped to Lost Midgard";
	next;
	warp .@map$, 0, 0;
	dispbottom "[Guild Message]: Welcome to Lost Midgard";
	end;
}

 

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