Jump to content
  • 0

Need Party dungeon Warper script


narien123

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

 Min Members 3,  request item gold coin , must be party leader to accept this quest .. map warp flame_dun  , waiting room ( Fire Dungeon ) 

instance.

Edited by narien123
Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  177
  • Reputation:   10
  • Joined:  04/02/12
  • Last Seen:  

Make it an instance. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

I need a few details because I'm an idiot  :P

 

I think making an instance is not necessary because what you want to do seems pretty basic,but it depends on how you want to do it.

 

When you make a reservation and get access to the dungeon, would you have access to it for a duration or till everybody dies? If you die in the dungeon can you still access it?

Is the gold coin required for each party member or just for the party leader?

Do you really want it to be a quest (maybe with a reward) or just an access giving.

 

With this, I think I'll be able to make what you want.

Edited by Kurofly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

I need a few details because I'm an idiot  :P

 

I think making an instance is not necessary because want you want to do seems pretty basic,but it depends on how you want to do it.

 

When you make a reservation and get access to the dungeon, would you have access to it for a duration or till everybody dies? If you die in the dungeon can you still access it?

Is the gold coin required for each party member or just for the party leader?

Do you really want it to be a quest (maybe with a reward) or just an access giving.

 

With this, I think I'll be able to make what you want.

Only  Party Leader pay for the entry , Till Everyone die , cant access after u die ,  no need reward , it's only for access 

thx you for willing to help me with it .. i try alot of it but seem bug / erro , coz im using 3ceam 140 stable .

I need a few details because I'm an idiot  :P

 

I think making an instance is not necessary because want you want to do seems pretty basic,but it depends on how you want to do it.

 

When you make a reservation and get access to the dungeon, would you have access to it for a duration or till everybody dies? If you die in the dungeon can you still access it?

Is the gold coin required for each party member or just for the party leader?

Do you really want it to be a quest (maybe with a reward) or just an access giving.

 

With this, I think I'll be able to make what you want.

warp to this mus_arena01 62 48

the exit will be mus_arena03 116 193

thx you

Edited by narien123
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

I'm on ra so I don't know if that'll work with you but we can at least try.


Is the exit a NPC or a warp?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

I'm on ra so I don't know if that'll work with you but we can at least try.

Is the exit a NPC or a warp?

Exit prontera 155 177

Edited by narien123
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

I started to work on the script this evening, here is what I planned to do, please tell me if that's what you're looking for:

 

the NPC will allow a party leader of a 3 or more online players group to go into the dungeon untill every member is dead. Costs 1 gold coin.

Only one group can be allowed to be in the dungeon at the same time.

If a group is already in the dungeon, you will be placed in a queue and informed when t's your turn to go into the dungeon.

 

-Once a group is given access, if no member goes into the dungeon after a certain delay, the access will be given to the next group.

-If someone dies in the dungeon, he and every of his characters cannot access it again.

-If someone logs out in the dungeon, he's counted as dead and so cannot enter it again. On relog he'll be warped to somewhere else.

-After a certain delay, if only 2 of 3 members entered the dungeon but died in, the dungeon closes for the current group.

 

Is it good for you or do you want to modify/add anything?

 

I don't think I'll have time to script this week so you may have to wait for the week-end to get it, sorry :P

Edited by Kurofly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

I started to work on the script this evening, here is what I planned to do, please tell me if that's what you're looking for:

 

the NPC will allow a party leader of a 3 or more online players group to go into the dungeon untill every member is dead. Costs 1 gold coin.

Only one group can be allowed to be in the dungeon at the same time.

If a group is already in the dungeon, you will be placed in a queue and informed when t's your turn to go into the dungeon.

 

-Once a group is given access, if no member goes into the dungeon after a certain delay, the access will be given to the next group.

-If someone dies in the dungeon, he and every of his characters cannot access it again.

-If someone logs out in the dungeon, he's counted as dead and so cannot enter it again. On relog he'll be warped to somewhere else.

-After a certain delay, if only 2 of 3 members entered the dungeon but died in, the dungeon closes for the current group.

 

Is it good for you or do you want to modify/add anything?

 

I don't think I'll have time to script this week so you may have to wait for the week-end to get it, sorry :P

it's ok take your time .. that's all i need ^^ 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Try this:

morocc,155,99,4	script	party_dungeon_warper	96,{
	.@nom$ = "["+strnpcinfo(0)+"]";
	mes .@nom$;
	mes "Hello there, I'm in charge of managing the entrance to "+.dungeon_name$+".";
	next;
	mes .@nom$;
	mes "I can only give access to a party of ^0000ff"+.min_party_size+" players or more^000000.";
	mes "Only the ^0000ffparty leader^000000 can ask for the entrance access.";
	mes "";
	mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
	next;
	mes .@nom$;
	if (.Dungeon) { //someone is in the dungeon
		mes "A group of "+.PlayerCount+" players has currently access to the dungeon";
		mes .AlivePlayerCount+" of them are still alive";
		mes "^0000ff"+.WaitingCount+"^000000 group(s) are waiting for the entrance access.";
	}
	else mes "No one is currently in the dungeon.";
	mes "";
	mes "What do you want to do?";
	getpartymember getcharid(1),1 ; getpartymember getcharid(1),2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ )
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
			.@count_online++;
	.@DungeonReserved = 0;
	for (.@i = 0 ; .@i < getarraysize(.PartyIDs) ; .@i++)
		if (getcharid(1) == .PartyIDs[.@i])
			.@DungeonReserved = 1;
	switch(select("Enter the dungeon:Reserve access:Leave")) { next ; mes .@nom$;

	case 1:
	if (!.@DungeonReserved) { //the dugeon isn't reserved yet
		mes "You didn't reserve access yet.";
		mes "Please reserve access before entering the dungeon.";
		close;
	}
	else if (.PartyIDs[0] != getcharid(1)) { //dungeon reserved but in the waiting room
		mes "You are in the waiting list sir, you cannot enter the dungeon yet.";
		mes "Your position in the waiting list : ^0000ff"+callsub(S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (@dungeon == 0) { //player already died in the dungeon
		mes "You already died in the dungeon and so cannot enter it again.";
		close;
	}
	else if (@warped == 1) { //player warped out of the dungeon
		mes "You warped out of the dungeon and so cannot enter it again.";
		close;
	}
	@warped = 1;
	.PlayerCount = .@count_online;
	.EnteredPlayers++ ; .AlivePlayerCount++;
	warp .warpzone$,.warpx,.warpy;
	end;
	
	case 2:
	if (.@DungeonReserved) { //has already reserved access
		mes "You already reserved access to the dungeon.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		if (callsub (S_Position,getcharid(1))) mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (.@count_online < .min_party_size) { //not enough players online or not in a party
		mes "You need a party of "+.min_party_size+" players online to reserve the dungeon.";
		close;
	}
	else if (getpartyleader(getcharid(1),1) != getcharid(3)) { //not party leader
		mes "Only the party leader can reserve access to the dungeon.";
		close;
	}
	else if (getarraysize(.PartyIDs)) { //people already waiting
		setarray .PartyIDs[getarraysize(.PartyIDs)] , getcharid(1);
		mes "You successfully reserved the entrance.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	if (countitem(.item) < .amount) {
		mes "You don't have "+.amount+" "+getitemname(.item)+".";
		mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
		close;
	}
	delitem .item,.amount;
	.Dungeon = 1;
	setarray .PartyIDs[0] , getcharid(1);
	mes "^ff0000You can now enter the dungeon.^000000";
	mes "If none of the party members enter the dungeon before "+.delay+" minutes, the dungeon will be automatically closed.";
	initnpctimer ; .TimeDelay = 0;
	addrid(2,0,.PartyIDs[0]) ; @dungeon = 1 ; @warped = 0;
	end;
	
	case 3:
	end;
	}

OnTimer300000:
	.TimeDelay = 1;
	if (.AlivePlayerCount == 0) callsub S_NextParty;
	end;

S_Position:
	for (.@i = 0 ; .@i < getarraysize(.PartyIDs) ; .@i++) if (.PartyIDs[.@i] == getarg(0)) .@j = .@i;
	return .@j;

S_CheckCount:
	debugmes "checkcount";
	if (.AlivePlayerCount == 0 /*|| (.Delay && .AlivePlayerCount == .EnteredPlayers)*/) callsub S_NextParty;
	return;

S_NextParty:
	addrid(2,0,.PartyIDs[0]);
	announce "Everyone is dead, you lost access to the dungeon.";
	deletearray .PartyIDs[0],1;
	if (.PartyIDs[0]) {
		detachrid ; addrid(2,0,.PartyIDs[0]);
		announce "Your party can now enter the dungeon.",bc_self;
		announce "Please enter it before a "+.delay+" minutes delay, else you will loose access.",bc_self;
		initnpctimer;
		.TimeDelay = 0;
	}
	end;
	
OnPCDieEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) @dungeon = 0 ; .AlivePlayerCount -= 1 ; warp .exitzone$,.exitx,.exity ; callsub S_CheckCount;
	end;
	
OnPCLogoutEvent: //if player logs out in the dungeon, he's counted as dead
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) @dungeon = 0 ; .AlivePlayerCount -= 1 ; callsub S_CheckCount;
	end;

OnPCLoginEvent: //if player logs in in the dungeon, he's warped out of it
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) warp .exitzone$,.exitx,.exity;
	end;
	
OnInit:
//===============================set this up==========================================
	.dungeon_name$ = "the Fire dungeon";
	.item = 671; //item required (gold coin)
	.amount = 1; //amount required
	.min_party_size = 1; //minimum amount of players needed to enter the dungeon
	.delay = 5; //delay after wich dungeon is closed if all the players in it are dead
	.warpzone$ = "mus_arena01" ; .warpx = 62 ; .warpy = 48; //entrance warp coordinates
	.exitzone$ = "mus_arena03" ; .exitx = 116 ; .exity = 193; //exit coordinates
//=============================end of user setup======================================
	mapwarp .warpzone$,.exitzone$,.exitx,.exity;
	.Dungeon = .PlayerCount = .AlivePlayerCount = .WaitingCount = 0;
	setarray .PartyIDs[0],0;
}

It's not the final product cause I couldn't test it to its limits so it may have bugs xd

tell me if it works for you and if you want to add/change anything.

 

don't forget to edit the user setup, the NPC location and the NPC sprite ID.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

Try this:

morocc,155,99,4	script	party_dungeon_warper	96,{
	.@nom$ = "["+strnpcinfo(0)+"]";
	mes .@nom$;
	mes "Hello there, I'm in charge of managing the entrance to "+.dungeon_name$+".";
	next;
	mes .@nom$;
	mes "I can only give access to a party of ^0000ff"+.min_party_size+" players or more^000000.";
	mes "Only the ^0000ffparty leader^000000 can ask for the entrance access.";
	mes "";
	mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
	next;
	mes .@nom$;
	if (.Dungeon) { //someone is in the dungeon
		mes "A group of "+.PlayerCount+" players has currently access to the dungeon";
		mes .AlivePlayerCount+" of them are still alive";
		mes "^0000ff"+.WaitingCount+"^000000 group(s) are waiting for the entrance access.";
	}
	else mes "No one is currently in the dungeon.";
	mes "";
	mes "What do you want to do?";
	getpartymember getcharid(1),1 ; getpartymember getcharid(1),2;
	for ( .@i = 0; .@i < $@partymembercount; .@i++ )
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
			.@count_online++;
	.@DungeonReserved = 0;
	for (.@i = 0 ; .@i < getarraysize(.PartyIDs) ; .@i++)
		if (getcharid(1) == .PartyIDs[.@i])
			.@DungeonReserved = 1;
	switch(select("Enter the dungeon:Reserve access:Leave")) { next ; mes .@nom$;

	case 1:
	if (!.@DungeonReserved) { //the dugeon isn't reserved yet
		mes "You didn't reserve access yet.";
		mes "Please reserve access before entering the dungeon.";
		close;
	}
	else if (.PartyIDs[0] != getcharid(1)) { //dungeon reserved but in the waiting room
		mes "You are in the waiting list sir, you cannot enter the dungeon yet.";
		mes "Your position in the waiting list : ^0000ff"+callsub(S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (@dungeon == 0) { //player already died in the dungeon
		mes "You already died in the dungeon and so cannot enter it again.";
		close;
	}
	else if (@warped == 1) { //player warped out of the dungeon
		mes "You warped out of the dungeon and so cannot enter it again.";
		close;
	}
	@warped = 1;
	.PlayerCount = .@count_online;
	.EnteredPlayers++ ; .AlivePlayerCount++;
	warp .warpzone$,.warpx,.warpy;
	end;
	
	case 2:
	if (.@DungeonReserved) { //has already reserved access
		mes "You already reserved access to the dungeon.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		if (callsub (S_Position,getcharid(1))) mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (.@count_online < .min_party_size) { //not enough players online or not in a party
		mes "You need a party of "+.min_party_size+" players online to reserve the dungeon.";
		close;
	}
	else if (getpartyleader(getcharid(1),1) != getcharid(3)) { //not party leader
		mes "Only the party leader can reserve access to the dungeon.";
		close;
	}
	else if (getarraysize(.PartyIDs)) { //people already waiting
		setarray .PartyIDs[getarraysize(.PartyIDs)] , getcharid(1);
		mes "You successfully reserved the entrance.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	if (countitem(.item) < .amount) {
		mes "You don't have "+.amount+" "+getitemname(.item)+".";
		mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
		close;
	}
	delitem .item,.amount;
	.Dungeon = 1;
	setarray .PartyIDs[0] , getcharid(1);
	mes "^ff0000You can now enter the dungeon.^000000";
	mes "If none of the party members enter the dungeon before "+.delay+" minutes, the dungeon will be automatically closed.";
	initnpctimer ; .TimeDelay = 0;
	addrid(2,0,.PartyIDs[0]) ; @dungeon = 1 ; @warped = 0;
	end;
	
	case 3:
	end;
	}

OnTimer300000:
	.TimeDelay = 1;
	if (.AlivePlayerCount == 0) callsub S_NextParty;
	end;

S_Position:
	for (.@i = 0 ; .@i < getarraysize(.PartyIDs) ; .@i++) if (.PartyIDs[.@i] == getarg(0)) .@j = .@i;
	return .@j;

S_CheckCount:
	debugmes "checkcount";
	if (.AlivePlayerCount == 0 /*|| (.Delay && .AlivePlayerCount == .EnteredPlayers)*/) callsub S_NextParty;
	return;

S_NextParty:
	addrid(2,0,.PartyIDs[0]);
	announce "Everyone is dead, you lost access to the dungeon.";
	deletearray .PartyIDs[0],1;
	if (.PartyIDs[0]) {
		detachrid ; addrid(2,0,.PartyIDs[0]);
		announce "Your party can now enter the dungeon.",bc_self;
		announce "Please enter it before a "+.delay+" minutes delay, else you will loose access.",bc_self;
		initnpctimer;
		.TimeDelay = 0;
	}
	end;
	
OnPCDieEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) @dungeon = 0 ; .AlivePlayerCount -= 1 ; warp .exitzone$,.exitx,.exity ; callsub S_CheckCount;
	end;
	
OnPCLogoutEvent: //if player logs out in the dungeon, he's counted as dead
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) @dungeon = 0 ; .AlivePlayerCount -= 1 ; callsub S_CheckCount;
	end;

OnPCLoginEvent: //if player logs in in the dungeon, he's warped out of it
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) warp .exitzone$,.exitx,.exity;
	end;
	
OnInit:
//===============================set this up==========================================
	.dungeon_name$ = "the Fire dungeon";
	.item = 671; //item required (gold coin)
	.amount = 1; //amount required
	.min_party_size = 1; //minimum amount of players needed to enter the dungeon
	.delay = 5; //delay after wich dungeon is closed if all the players in it are dead
	.warpzone$ = "mus_arena01" ; .warpx = 62 ; .warpy = 48; //entrance warp coordinates
	.exitzone$ = "mus_arena03" ; .exitx = 116 ; .exity = 193; //exit coordinates
//=============================end of user setup======================================
	mapwarp .warpzone$,.exitzone$,.exitx,.exity;
	.Dungeon = .PlayerCount = .AlivePlayerCount = .WaitingCount = 0;
	setarray .PartyIDs[0],0;
}

It's not the final product cause I couldn't test it to its limits so it may have bugs xd

tell me if it works for you and if you want to add/change anything.

 

don't forget to edit the user setup, the NPC location and the NPC sprite ID.

Cant Click it .. i think it's not complete 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

It works for me and I haven't experienced any bug yet.

if you can't even click it you must have errors I don't have, probably because you are on 3ceam.

 

Please show me these errors.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  39
  • Reputation:   0
  • Joined:  03/06/15
  • Last Seen:  

It works for me and I haven't experienced any bug yet.

if you can't even click it you must have errors I don't have, probably because you are on 3ceam.

 

Please show me these errors.

error.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Are you sure you copied the whole script? Because I don't see anything before the left curly '{'

You can't have errors on a variable assignation xd.


I never used 3ceam so maybe you can't assigne variables by doing .@var = value

Try to change change the second line into set .@nom$ , "["+strnpcinfo(0)+"]"; and check if the error is still the same (we never know)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  142
  • Reputation:   8
  • Joined:  02/11/13
  • Last Seen:  

in 3ceam you'll need to use set for variables ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

oh damn xd

 

EDIT: I don't have time to do it right now, I'll post it tomorrow

Edited by Kurofly
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Erm... I'm really late  /hmm

morocc,155,99,4	script	party_dungeon_warper	96,{
	set .@nom$ , "["+strnpcinfo(0)+"]";
	mes .@nom$;
	mes "Hello there, I'm in charge of managing the entrance to "+.dungeon_name$+".";
	next;
	mes .@nom$;
	mes "I can only give access to a party of ^0000ff"+.min_party_size+" players or more^000000.";
	mes "Only the ^0000ffparty leader^000000 can ask for the entrance access.";
	mes "";
	mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
	next;
	mes .@nom$;
	if (.Dungeon) { //someone is in the dungeon
		mes "A group of "+.PlayerCount+" players has currently access to the dungeon";
		mes .AlivePlayerCount+" of them are still alive";
		mes "^0000ff"+.WaitingCount+"^000000 group(s) are waiting for the entrance access.";
	}
	else mes "No one is currently in the dungeon.";
	mes "";
	mes "What do you want to do?";
	getpartymember getcharid(1),1 ; getpartymember getcharid(1),2;
	for ( set .@i , 0 ; .@i < $@partymembercount ; set .@i , .@i + 1 )
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
			set .@count_online , .@count_online + 1;
	set .@DungeonReserved , 0;
	
	for (set .@i , 0 ; .@i < getarraysize(.PartyIDs) ; set .@i , .@i + 1)
		if (getcharid(1) == .PartyIDs[.@i])
			set .@DungeonReserved , 1;
	switch(select("Enter the dungeon:Reserve access:Leave")) { next ; mes .@nom$;

	case 1:
	if (!.@DungeonReserved) { //the dugeon isn't reserved yet
		mes "You didn't reserve access yet.";
		mes "Please reserve access before entering the dungeon.";
		close;
	}
	else if (.PartyIDs[0] != getcharid(1)) { //dungeon reserved but in the waiting room
		mes "You are in the waiting list sir, you cannot enter the dungeon yet.";
		mes "Your position in the waiting list : ^0000ff"+callsub(S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (@dungeon == 1) { //player already died in the dungeon
		mes "You already died in the dungeon and so cannot enter it again.";
		close;
	}
	else if (@warped == 1) { //player warped out of the dungeon
		mes "You warped out of the dungeon and so cannot enter it again.";
		close;
	}
	set @warped , 1;
	set .PlayerCount , .@count_online;
	set .EnteredPlayers , .EnteredPlayers + 1 ; set .AlivePlayerCount , .AlivePlayerCount + 1;
	warp .warpzone$,.warpx,.warpy;
	end;
	
	case 2:
	if (.@DungeonReserved) { //has already reserved access
		mes "You already reserved access to the dungeon.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		if (callsub (S_Position,getcharid(1))) mes "You will be informed when you can enter the dungeon.";
		close;
	}
	else if (.@count_online < .min_party_size) { //not enough players online or not in a party
		mes "You need a party of "+.min_party_size+" players online to reserve the dungeon.";
		close;
	}
	else if (getpartyleader(getcharid(1),1) != getcharid(3)) { //not party leader
		mes "Only the party leader can reserve access to the dungeon.";
		close;
	}
	else if (getarraysize(.PartyIDs)) { //people already waiting
		setarray .PartyIDs[getarraysize(.PartyIDs)] , getcharid(1);
		mes "You successfully reserved the entrance.";
		mes "Your position in the waiting list : ^0000ff"+callsub (S_Position,getcharid(1))+"^000000.";
		mes "You will be informed when you can enter the dungeon.";
		close;
	}
	if (countitem(.item) < .amount) {
		mes "You don't have "+.amount+" "+getitemname(.item)+".";
		mes "^ff0000It costs "+.amount+" "+getitemname(.item)+" to reserve an access.^000000";
		close;
	}
	delitem .item,.amount;
	set .Dungeon , 1;
	setarray .PartyIDs[0] , getcharid(1);
	mes "^ff0000You can now enter the dungeon.^000000";
	mes "If none of the party members enter the dungeon before "+.delay+" minutes, the dungeon will be automatically closed.";
	initnpctimer ; set .TimeDelay , 0;
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
	for ( set .@i , 0 ; .@i < $@partymembercount ; set .@i , .@i + 1 ) {
		if (attachrid($@partymemberaid[.@i])) { set @dungeon , 0 ; set @warped , 0; }
	}
	end;
	
	case 3:
	end;
	}

OnTimer300000:
	set .TimeDelay , 1;
	if (.AlivePlayerCount == 0) callsub S_NextParty;
	end;

S_Position:
	for (set .@i , 0 ; .@i < getarraysize(.PartyIDs) ; set .@i , .@i + 1) if (.PartyIDs[.@i] == getarg(0)) set .@j , .@i;
	return .@j;

S_CheckCount:
	debugmes "checkcount";
	if (.AlivePlayerCount == 0 || (.Delay && .AlivePlayerCount == .EnteredPlayers)) callsub S_NextParty;
	return;

S_NextParty:
	addrid(2,0,.PartyIDs[0]);
	announce "Everyone is dead, you lost access to the dungeon.";
	deletearray .PartyIDs[0],1;
	if (.PartyIDs[0]) {
		detachrid ; addrid(2,0,.PartyIDs[0]);
		announce "Your party can now enter the dungeon.",bc_self;
		announce "Please enter it before a "+.delay+" minutes delay, else you will loose access.",bc_self;
		initnpctimer;
		set .TimeDelay , 0;
	}
	end;
	
OnPCDieEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) { set @dungeon , 1 ; set .AlivePlayerCount , .AlivePlayerCount - 1 ; warp .exitzone$,.exitx,.exity ; callsub S_CheckCount; }
	end;
	
OnPCLogoutEvent: //if player logs out in the dungeon, he's counted as dead
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) { set @dungeon = 1 ; set .AlivePlayerCount , .AlivePlayerCount - 1 ; callsub S_CheckCount; }
	end;

OnPCLoginEvent: //if player logs in in the dungeon, he's warped out of it
	getmapxy(.@map$,.@x,.@y,0);
	if (.@map$ == .warpzone$) warp .exitzone$,.exitx,.exity;
	end;
	
OnInit:
//===============================set this up==========================================
	set .dungeon_name$ , "the Fire dungeon";
	set .item , 671; //item required (gold coin)
	set .amount , 1; //amount required
	set .min_party_size , 1; //minimum amount of players needed to enter the dungeon
	set .delay , 5; //delay after wich dungeon is closed if all the players in it are dead (in minutes)
	set .warpzone$ , "mus_arena01" ; .warpx = 62 ; .warpy = 48; //entrance warp coordinates
	set .exitzone$ , "mus_arena03" ; .exitx = 116 ; .exity = 193; //exit coordinates
//=============================end of user setup======================================
	mapwarp .warpzone$,.exitzone$,.exitx,.exity;
	set .Dungeon , 0 ; set .PlayerCount , 0 ; set .AlivePlayerCount , 0 ; set .WaitingCount , 0;
	setarray .PartyIDs[0],0;
} 

I'm really sorry to have you waited so long just to replace some '=', I had a crazy week and wanted to get over with another script first.

That won't happen anymore!

 

So here it is, as I said, this is definitely not the final product, I just want you to test it and tell me I you find any bug or anything you want to change/improve.

I tested it a week ago I and didn't experience any bug but I didn't push it to its limits

 

Don't forget to edit this part

//===============================set this up==========================================
	set .dungeon_name$ , "the Fire dungeon";
	set .item , 671; //item required (gold coin)
	set .amount , 1; //amount required
	set .min_party_size , 1; //minimum amount of players needed to enter the dungeon
	set .delay , 5; //delay after wich dungeon is closed if all the players in it are dead (in minutes)
	set .warpzone$ , "mus_arena01" ; .warpx = 62 ; .warpy = 48; //entrance warp coordinates
	set .exitzone$ , "mus_arena03" ; .exitx = 116 ; .exity = 193; //exit coordinates
//=============================end of user setup======================================
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...