Jump to content
  • 0

warp custom with item


skuray

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

hello rathena.
I need a npc warp that asks for an item in return.
Only 1 warp map.
Obrigado

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

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

prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	mes "Warp to "+.map$+" ?";
	if (.item_id_size) {
		for (.@i = 0; .@i < .item_id_size; .@i++) {
			mes "> "+.item_qty[.@i]+"x "+getitemname(.item_id[.@i]);
			if (countitem(.item_id[.@i]) < .item_qty[.@i])
				.@failed++;
		}
	}
	if (select("Warp", "Cancel") == 1) {
		if (.@failed) {
			mes "You didnt have enough items.";
		}
		else {
			if (.item_id_size)
				for (.@i = 0; .@i < .item_id_size; .@i++)
					delitem .item_id[.@i], .item_qty[.@i];
			warp .map$, 0, 0;
		}
	}
	close;
	
	OnInit:
		.map$ = "prontera";
		setarray .item_id, 501, 502, 503;
		setarray .item_qty, 100, 200, 300;
		.item_id_size = getarraysize(.item_id);
		end;
}

 

  • Upvote 2
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

prontera,150,150,4	script	Warpme!	999,{
	.@itemreq = 501;
	.@itemamt = 10;
	mes "What do you want?";
	next;
	if(select("Warp me!","Cancel") == 2) close;
	
		if(countitem(.@itemreq) < .@itemamt){
			mes "Im sorry you dont have enough items in your inventory.";
			end;
		}
		delitem .@itemreq,.@itemamt;
		warp "payon",0,0; // change this to you map
	end;
}

 

Edited by Radian
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

mes "warp me";
next;
switch(select("Yes:No"){
  case 1:
  	if (countitem(item_id) < 1){
          mes "You need XXX item to use our service";
          close;
      }
  	warp "prontera",156,182;
  	end;
  case 2:
    close;
}
 

 

Edited by melv0
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   3
  • Joined:  12/10/18
  • Last Seen:  

1 hour ago, melv0 said:

mes "warp me";
next;
switch(select("Yes:No"){
  case 1:
  	if (countitem(item_id) < 1){
          mes "You need XXX item to use our service";
          close;
      }
  	warp "prontera",156,182;
  	end;
  case 2:
    close;
}
 

 

Hey melv0

 

how would you make this script look for multiple items before warping the player

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

8 horas atrás, melv0 disse:



   
  	   
      
   

 



   

não funciona ?

Edited by skuray
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

18 hours ago, crossworld said:

Hey melv0

 

how would you make this script look for multiple items before warping the player

if (countitem(item_id) < 1 || countitem(item_id) < 1)

 

11 hours ago, skuray said:

não funciona ?

can u tell me what error on console?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   3
  • Joined:  12/10/18
  • Last Seen:  

13 minutes ago, skuray said:

not the sequence of errors, just does not work
??


prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

its be cause you only have 1 case when its made for 2

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

3 minutes ago, crossworld said:

its be cause you only have 1 case when its made for 2

how could be the casa 2?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   3
  • Joined:  12/10/18
  • Last Seen:  

17 minutes ago, skuray said:

how could be the casa 2?

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){   <---------------HERE ONE CASE
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:                          <----------------HERE SECOND CASE
    close;
}
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

4 minutes ago, crossworld said:

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){   <---------------HERE ONE CASE
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:                          <----------------HERE SECOND CASE
    close;
}

thank u!!! 
can u help me in the this script pls?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   23
  • Joined:  04/28/12
  • Last Seen:  

2 hours ago, skuray said:

not the sequence of errors, just does not work
??


prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

You're having problems because (1) You're using a select function with only one menu option "Game of Thrones", and (2), you do not have balanced braces.

Syntax error, expected )

switch(select("Game of Thrones"){

Has 2 open braces (
and only one close brace )

switch(select("Game of Thrones", "Option 2")){

Checking for multiple conditions

You can check for multiple conditions using the conditional operators AND or OR.

if (countitem(501) > 0 && countitem(601) > 0) {
	mes "You have red potion AND fly wing at the same time!";
}

if (countitem(501) > 0 || countitem(601) > 0) {
	mes "You have red potion or a fly wing... or BOTH!";
}

See doc/script_commands for a full guide on NPC and item scripting.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

7 hours ago, iwillnot said:

Você está tendo problemas porque (1) você está usando uma  função de seleção com apenas uma opção de menu "Game of Thrones", e (2), você não tem chaves equilibradas.

Erro de sintaxe, esperado)


Tem 2 chaves abertas (
e apenas uma chave fechada )


Verificando várias condições

Você pode verificar várias condições usando os operadores condicionais AND ou OR .



Veja doc / script_commands  para um guia completo sobre NPC e scripts de itens.

Thank u s2

6 hours ago, Radian said:

	
	  
	  
	  
	
		  
		 

 

Thank U

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  29
  • Reputation:   1
  • Joined:  07/16/18
  • Last Seen:  

21 minutes ago, melv0 said:

can u tell me what error on console?

not the sequence of errors, just does not work
??

prontera,145,199,5	script	Game of Thrones	485,{
switch(select("Game of Thrones"){
  case 1:
  	if (countitem(8966) < 1){
          mes "your mes!";
          close;
      }
  	warp "verus03",248,170;
  	end;
  case 2:
    close;
}

 

Edited by skuray
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...