Warper with payment(item) and Menu

karazu

New member
Messages
1,115
Points
0
Hello I found several scripts already with payment but it will only warp in 1 map

If its ok I would like to request to put menu in it.

like when u click it and u have the item it will warp you to the map.


the menu is like


prontera
payon
geffen and so on.

 
Here you go!
default_tongue.png


Code:
prontera,150,150,0	script	Sample	100,{	if ( countitem(.item_id) < .amount ) close;	mes .n$;	mes "Hey where would you like to go?";	next;	.@s = select(implode(.Maps$, ":")) - 1;	mes .n$;	mes "So you want to go to " +strtolower(.Maps$[.@s])+ "?";	next;	if ( select("Yes:No") - 1 ) close;	mes .n$;	mes "Bye!";	delitem .item_id, .amount;	warp strtolower(.Maps$[.@s]),0,0;	close;	OnInit:		setarray .Maps$[0],"Payon","Prontera","Geffen";		.item_id = 7227;		.amount = 5;		.n$ = "[" +strnpcinfo(1)+ "]";		end;}
 
Last edited by a moderator:
Hello, You again Patskie thank you for that. 

is it possible to put a coordinates please?

and is it possible that you will change the name for example


I will use Alias
example 

The City of Pride = prontera 150 150

The City of Genius = geffen 150 150
The City of Patskie = payon 150 150





 

 
Last edited by a moderator:
Ya it's possible however i need to re-write my script
default_tongue.png


 
Code:
prontera,150,150,0	script	Sample	100,{	if ( countitem(.item_id) < .amount ) close;	mes .n$;	mes "Hey where would you like to go?";	next;	for ( .@i = 0; .@i < .size; .@i++ ) {		.@menu$ += .Desc$[.@i];		.@menu$ += ":";	}	.@s = select(.@menu$) - 1;	mes .n$;	mes "So you want to go to " +strtolower(.Maps$[.@s])+ "?";	next;	if ( select("Yes:No") - 1 ) close;	mes .n$;	mes "Bye!";	delitem .item_id, .amount;	warp strtolower(.Maps$[.@s]),0,0;	close;	OnInit:		setarray .Desc$[0],"The City of Pride","The City of Genius","The City of Patskie";		setarray .Maps$[0],"payon","prontera","geffen";		.size = getarraysize(.Desc$);		.item_id = 7227;		.amount = 5;		.n$ = "[" +strnpcinfo(1)+ "]";		end;}
 
prontera,150,150,0 script Sample 100,{ if ( countitem(.item_id) < .amount ) close; mes .n$; mes "Hey where would you like to go?"; next; for ( .@i = 0; .@i < .size; .@i++ ) { .@menu$ += .Desc$[.@i]; .@menu$ += ":"; } .@s = select(.@menu$) - 1; mes .n$; mes "So you want to go to " +strtolower(.Maps$[.@s])+ "?"; next; if ( select("Yes:No") - 1 ) close; mes .n$; mes "Bye!"; delitem .item_id, .amount; warp strtolower(.Maps$[.@s]),0,0; close; OnInit: setarray .Desc$[0],"The City of Pride","The City of Genius","The City of Patskie"; setarray .Maps$[0],"payon","prontera","geffen"; .size = getarraysize(.Desc$); .item_id = 7227; .amount = 5; .n$ = "[" +strnpcinfo(1)+ "]"; end;} 
This is good already but i want with coordinates. because if u only put prontera you will be warped randomly in prontera right?

if possbile with coordinates.

I saw a PVP warper before he did it like this.

prontera,147,175,5 script Special Warper 10005,{set .@room1$,"PVP1";set .@room2$,"PVP2";set .@name$,"[Special Warper]"; //NPC Dialogue namemes .@name$;mes "Hello, I can warp you to some special area.";mes "Please choose an area do you want me to warp you.";switch(select("PVPAREA1:PVPAREA2")){case 1: warp .@room1$,50,50; end;case 2: if(Class >= 0 && Class <= 4215){ //Allows Rune Knight to Mechanic, no matter if they rebirthed before or not warp .@room2$,84,50; end; }} 
The problem with it is doesn't have payment, and also it has some limit according to JOB
 
Hmm. Make sure that this three arrays have same value size. If the first array have 3 values, the second and third array must have also 3 values otherwise you will receive errors :

setarray .Desc$[0],"The City of Pride","The City of Genius","The City of Patskie";setarray .Maps$[0],"payon","prontera","geffen";setarray .Coordinates$[0],"150:150","150:150","150:150";


@Edit : add a checkcell command because you may input an invalid coordinates and stuck those players who will use this npc

Code:
prontera,150,150,0	script	Sample	100,{    if ( countitem(.item_id) < .amount ) close;    mes .n$;    mes "Hey where would you like to go?";    next;    for ( .@i = 0; .@i < .size; .@i++ ) {        .@menu$ += .Desc$[.@i];        .@menu$ += ":";    }    .@s = select(.@menu$) - 1;    mes .n$;    mes "So you want to go to " +strtolower(.Maps$[.@s])+ "?";    next;    if ( select("Yes:No") - 1 ) close;    delitem .item_id, .amount;	explode(.@coord$, .Coordinates$[.@s], ":");	mes .n$;	if ( checkcell(strtolower(.Maps$[.@s]), .@coord$[0], .@coord$[1], cell_chkpass) ) {		mes "Bye!";		warp strtolower(.Maps$[.@s]),atoi(.@coord$[0]),atoi(.@coord$[1]);	} else mes "Invalid coordinates";    close;	    OnInit:        setarray .Desc$[0],"The City of Pride","The City of Genius","The City of Patskie";        setarray .Maps$[0],"payon","prontera","geffen";		setarray .Coordinates$[0],"150:150","150:150","343:143";        .size = getarraysize(.Desc$);        .item_id = 7227;        .amount = 5;        .n$ = "[" +strnpcinfo(1)+ "]";        end;}

 
Last edited by a moderator:
Thank you your the best.

Testing it now



EDIT:

Hmm. Make sure that this three arrays have same value size. If the first array have 3 values, the second and third array must have also 3 values otherwise you will receive errors :

Last Patskie
Can you make it 2 items please?

Like it requires 2 different items  to let this NPC warp you...

 
Last edited by a moderator:
Back
Top