Jump to content
  • 0

Rent npc


Takuyakii

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

Good day rA,

can someone help me to make a script that ff:

i don't know if my title is right, i just don't know what should i call it.

1. NPC that have will required you an item to enter the map Ex, Red potion.
2. it has option like 3 hours /1 day access for the map.
3. the player will automatically kick on that map. 
 (not all player, example Player 1 just availed 3 hours, when the 3 hours come Player 1 will be kicked, and the other player 2 3 4 5 6 can stay because they need to use their availed access)

i know this is to much to request because of this details. 

 

i also try to edit some script but im getting nowhere,

Thank you.

Edited by Takuyakii
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

@Pride can u help me this one? sorry for tagging you.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   11
  • Joined:  11/17/20
  • Last Seen:  

11 hours ago, Takuyakii said:

Good day rA,

can someone help me to make a script that ff:

i don't know if my title is right, i just don't know what should i call it.

1. NPC that have will required you an item to enter the map Ex, Red potion.
2. it has option like 3 hours /1 day access for the map.
3. the player will automatically kick on that map. 
 (not all player, example Player 1 just availed 3 hours, when the 3 hours come Player 1 will be kicked, and the other player 2 3 4 5 6 can stay because they need to use their availed access)

i know this is to much to request because of this details. 

 

i also try to edit some script but im getting nowhere,

Thank you.

i can just give a basic idea but the scripting should be done by you since my time is kinda limited 

1) make map which is not warpable or cannot be accessed by normal player using mapflag
2) use Variables to apply the ownership of the map then apply a timer, you can try to apply timer to variable as well
example 
 

#Entrypass = 10800+ gettimetick(2);
//before entering the room the NPC checks 
if(#Entrypass > gettimetick(2)) {
grant access 
}
else {
sorry rent this area again
}

10800 = 3 hours 

so to better have control over the map on how long the map should be rented i suggest u to make NPC disable and enable for a period of time 
example every 3 hours NPC appears for 5 mins on the map and then disappears. People need to rent the map within the time limit and then after the said time the npc disappears. when the NPC reappears again the next 3rd hour use OnClock label to kick the players out of the map. This will maintain uniformity of the players renting the map. 

id wish to help but i have my hands full but ive given u a basic idea. ? sorry again

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   11
  • Joined:  11/17/20
  • Last Seen:  

Try Refer this if u can, idk if u are looking for this

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

On 8/18/2022 at 3:44 PM, Pride said:

i can just give a basic idea but the scripting should be done by you since my time is kinda limited 

1) make map which is not warpable or cannot be accessed by normal player using mapflag
2) use Variables to apply the ownership of the map then apply a timer, you can try to apply timer to variable as well
example 
 

#Entrypass = 10800+ gettimetick(2);
//before entering the room the NPC checks 
if(#Entrypass > gettimetick(2)) {
grant access 
}
else {
sorry rent this area again
}

10800 = 3 hours 

so to better have control over the map on how long the map should be rented i suggest u to make NPC disable and enable for a period of time 
example every 3 hours NPC appears for 5 mins on the map and then disappears. People need to rent the map within the time limit and then after the said time the npc disappears. when the NPC reappears again the next 3rd hour use OnClock label to kick the players out of the map. This will maintain uniformity of the players renting the map. 

id wish to help but i have my hands full but ive given u a basic idea. ? sorry again

Thank you so much for giving me an idea, i will try to make this work, thank you again as always.

 

On 8/18/2022 at 3:58 PM, Pride said:

Try Refer this if u can, idk if u are looking for this

Hi @Pride Can u help me with this one, ? instead of 1 time ticket = 3 hours and lifetime ticket = 1 day? then after that hours they or day they purchased it will be resetted and they need to pay again, 


prontera,171,170,4	script	Monster Arena	648,{
cutin "arena_01",2;
strt:
mes "[^880000Arena Master^000000]";
mes "Good day ^008800"+strcharinfo(0)+"^000000 ";
mes "How may i help you?";

switch(select("^000088Enter Arena^000000:Information")){
//==========================arena room=======================
case 1:
next;
mes "[^880000Arena Master^000000]";
mes "Choose Arena Process";
next;
menu "1 Time ticket",-,"Lifetime ticket",L_ticket;
mes "[^880000Arena Master^000000]";
mes "Processing ticket...";
next;
if(countitem(3618) < 1) goto L_Later;
mes "[^880000Arena Master^000000]";
mes "1 Time ticket accepted";
mes "Lets go!..";
delitem 3618,1;
announce "[Monster Arena] "+strcharinfo(0)+" Has Entered using 1 time ticket.",0,0xFF6600;
warp "bat_b02" ,0,0;
close;

L_ticket:
mes "[^880000Arena Master^000000]";
mes "Processing ticket...";
next;
if(countitem(3619) < 1) goto L_Later;
mes "[^880000Arena Master^000000]";
mes "Lifetime ticket accepted";
mes "Lets go!..";
announce "[Monster Arena] "+strcharinfo(0)+" Has Entered using Lifetime ticket.",0,0xFF6600;
warp "bat_b02" ,0,0;
next;
goto strt;


L_Later:
mes "[^880000Arena Master^000000]";
mes "Dont waste my time!..";
next;
goto strt;

//==========================================information==============================================

case 2:
next;
mes "[^880000Arena Master^000000]";
mes "Monsters Inside The Room:";
mes "^880000Arena Dark Kades^000000";
mes "^880000Arena Dark Pyuriel^000000";
next;
mes "[^880000Arena Master^000000]";
mes "Mob Information";
mes "Element: ^880000Dark (lvl3)^000000";
mes "Size: ^880000Large^000000";
mes "Race: ^880000Demon^000000";
next;
mes "[^880000Arena Master^000000]";
mes "MVP Inside The Room";
mes "MVP: ^880000King Poring^000000";
mes "Element: ^880000Dark (lvl3)^000000";
mes "Size: ^880000Large^000000";
mes "Race: ^880000Demon^000000";
next;
goto strt;
}
}

























 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   11
  • Joined:  11/17/20
  • Last Seen:  

prontera,171,170,4	script	Monster Arena	648,{
cutin "arena_01",2;
strt:
mes "[^880000Arena Master^000000]";
mes "Good day ^008800"+strcharinfo(0)+"^000000 ";
mes "How may i help you?";

switch(select("^000088Enter Arena^000000:Information")){
//==========================arena room=======================
case 1:
next;
mes "[^880000Arena Master^000000]";
if(#Entrytimeticket > gettimetick(2)) {
mes "You can still Enter this place";
next;
warp "bat_b02" ,0,0;
close;
end;
}
if(#Entrylifetime > gettimetick(2)) {
mes "You can still Enter this place";
next;
warp "bat_b02" ,0,0;
close;
end;
}
mes "Choose Arena Process";
next;
menu "1 Time ticket",-,"Lifetime ticket",L_ticket;
mes "[^880000Arena Master^000000]";
mes "Processing ticket...";
next;
if(countitem(3618) < 1) goto L_Later;
mes "[^880000Arena Master^000000]";
mes "1 Time ticket accepted";
mes "Lets go!..";
delitem 3618,1;
#Entrytimeticket = 10800+ gettimetick(2);
announce "[Monster Arena] "+strcharinfo(0)+" Has Entered using 1 time ticket.",0,0xFF6600;
warp "bat_b02" ,0,0;
close;

L_ticket:
mes "[^880000Arena Master^000000]";
mes "Processing ticket...";
next;
if(countitem(3619) < 1) goto L_Later;
mes "[^880000Arena Master^000000]";
mes "Lifetime ticket accepted";
mes "Lets go!..";
delitem 3619,1;
#Entrylifetime = 86400+ gettimetick(2);
announce "[Monster Arena] "+strcharinfo(0)+" Has Entered using Lifetime ticket.",0,0xFF6600;
warp "bat_b02" ,0,0;
next;
goto strt;


L_Later:
mes "[^880000Arena Master^000000]";
mes "Dont waste my time!..";
next;
goto strt;

//==========================================information==============================================

case 2:
next;
mes "[^880000Arena Master^000000]";
mes "Monsters Inside The Room:";
mes "^880000Arena Dark Kades^000000";
mes "^880000Arena Dark Pyuriel^000000";
next;
mes "[^880000Arena Master^000000]";
mes "Mob Information";
mes "Element: ^880000Dark (lvl3)^000000";
mes "Size: ^880000Large^000000";
mes "Race: ^880000Demon^000000";
next;
mes "[^880000Arena Master^000000]";
mes "MVP Inside The Room";
mes "MVP: ^880000King Poring^000000";
mes "Element: ^880000Dark (lvl3)^000000";
mes "Size: ^880000Large^000000";
mes "Race: ^880000Demon^000000";
next;
goto strt;
}
}
-	script	Timercheck	-1,{
OnPCLoadMapEvent:
if( strcharinfo(3) == "bat_b02" && #Entrytimeticket > gettimetick(2) ){
Timesec = 3*60*60; // 3 hour
sleep2 1000*Timesec;
#Entrytimeticket = 0;
warp "SavePoint",0,0;
}
if( strcharinfo(3) == "bat_b02" && #Entrylifetime > gettimetick(2) ){
Timesec = 24*60*60; // 24 hour
sleep2 1000*Timesec;
#Entrylifetime = 0;
warp "SavePoint",0,0;
}
}


bat_b02	mapflag	loadevent

Untested please test it out and let me know.  The Timer counts as soon as the player enters the map and after 3 hours it will kick the person out from the map if hes still on the map. For better working of this script please disable @warp and @jump and other teleport skills

Edited by Pride
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

close;
end;

@Pride

The end; is not needed here because close; also does end;. If using close2; you would need an end;. There is also close3; which removes cutin and then does end;.

Also just a personal thing but using the TAB key to space things out helps a lot for readability.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   11
  • Joined:  11/17/20
  • Last Seen:  

copy thanks, was in a hurry i didnt really check what i wrote xD

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

prontera,155,181,5	script	Sample	757,{
	mes "Give me Red Potion.";
	if (select("Enter", "Cancel") == 1) {
		if (!countitem(501)) {
			mes "You dont have it.";
		}
		else {
			TIME_LEFT = gettimetick(2) + (3 * 3600);
			addtimer (3 * 3600 * 1000), strnpcinfo(3)+"::OnExpire";
			warp "prt_fild01", 0, 0;
		}
	}
	close;
	
	OnPCLoginEvent:
		.@time_left = TIME_LEFT - gettimetick(2);
		if (.@time_left > 0) {
			addtimer (.@time_left * 1000), strnpcinfo(3)+"::OnExpire";
		}
		end;
	
	OnExpire:
		TIME_LEFT = 0;
		warp "prontera", 155, 181;
		end;
}

 

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

On 8/20/2022 at 8:51 AM, Emistry said:
prontera,155,181,5	script	Sample	757,{
	mes "Give me Red Potion.";
	if (select("Enter", "Cancel") == 1) {
		if (!countitem(501)) {
			mes "You dont have it.";
		}
		else {
			TIME_LEFT = gettimetick(2) + (3 * 3600);
			addtimer (3 * 3600 * 1000), strnpcinfo(3)+"::OnExpire";
			warp "prt_fild01", 0, 0;
		}
	}
	close;
	
	OnPCLoginEvent:
		.@time_left = TIME_LEFT - gettimetick(2);
		if (.@time_left > 0) {
			addtimer (.@time_left * 1000), strnpcinfo(3)+"::OnExpire";
		}
		end;
	
	OnExpire:
		TIME_LEFT = 0;
		warp "prontera", 155, 181;
		end;
}

 

Forgot to delitem the redpot ?

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