Jump to content
  • 0

Paid warper npc


IvanD

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

[Warp],[Claim],[Cancel]

 

[Warp]:     Player one pays 3pcs ID:619 to be warp to Prontera, Payon or Morocc.... every warp the npc accumulate 1pc ID:619 on which chosen city. (accumulated separately)

[Claim]:    Player can claim the accumulated ID:619 if they're Wearing  ID:1000 for Prontera, ID:1001 for Payon, ID:1002 for Morocc. (Preview of how many ID:619 before claiming)

[Cancel]:  Exit npc

 

----Thank You in Advance---

Edited by IvanD
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  86
  • Reputation:   21
  • Joined:  10/02/13
  • Last Seen:  

Ok, you seem to be using an rAthena revision that does not support `clear` as an NPC command.

Try this adapted version.

///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
	mes "[^00cc00"+ .npc_name$ +"^000000]";
	mes "Hello, " + strcharinfo(0) + "!";
	next;
	switch (select("Warp:Claim:Cancel")) {
		case 1:
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Where would you like to warp to?";				
			WarpTo(select(.warps$));
		case 2:
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You have accumulated so far:";
			for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
				mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
			}
			mes "Which would you like to claim?";
			next;
			ClaimCurrency(select(implode(.warpable_cities$, ":")));
	}
	end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				next;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		next;
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

 

Edited by Tyrfing
Ooops, still some clears left to remove
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  86
  • Reputation:   21
  • Joined:  10/02/13
  • Last Seen:  

Here you go:

///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
		clear;
		mes "[^00cc00"+ .npc_name$ +"^000000]";
		mes "Hello, " + strcharinfo(0) + "!";
		switch (select("Warp:Claim:Cancel")) {
			case 1:
				mes "Where would you like to warp to?";				
				WarpTo(select(.warps$));
			case 2:
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "You have accumulated so far:";
				for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
					mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
				}
				mes "Which would you like to claim?";
				ClaimCurrency(select(implode(.warpable_cities$, ":")));
		}
		end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

 

Edited by Tyrfing
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

On 5/23/2018 at 7:16 PM, Tyrfing said:

Here you go:


///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  

//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
		clear;
		mes "[^00cc00"+ .npc_name$ +"^000000]";
		mes "Hello, " + strcharinfo(0) + "!";
		switch (select("Warp:Claim:Cancel")) {
			case 1:
				mes "Where would you like to warp to?";				
				WarpTo(select(.warps$));
			case 2:
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "You have accumulated so far:";
				for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
					mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
				}
				mes "Which would you like to claim?";
				ClaimCurrency(select(implode(.warpable_cities$, ":")));
		}
		end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

 

thanks but theres an error... it wont let me interract with the npc... problem with line 45.

Begin:
*        clear;
        mes "[^00cc00"+ .npc_name$ +"^000000]";
        mes "Hello, " + strcharinfo(0) + "!";
        switch (select("Warp:Claim:Cancel")) {

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  86
  • Reputation:   21
  • Joined:  10/02/13
  • Last Seen:  

///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
		mes "";
		clear;
		mes "[^00cc00"+ .npc_name$ +"^000000]";
		mes "Hello, " + strcharinfo(0) + "!";
		switch (select("Warp:Claim:Cancel")) {
			case 1:
				mes "Where would you like to warp to?";				
				WarpTo(select(.warps$));
			case 2:
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "You have accumulated so far:";
				for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
					mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
				}
				mes "Which would you like to claim?";
				ClaimCurrency(select(implode(.warpable_cities$, ":")));
		}
		end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

Try this one. Also, are you using the most current rAthena rev.?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

5 minutes ago, Tyrfing said:

///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
		mes "";
		clear;
		mes "[^00cc00"+ .npc_name$ +"^000000]";
		mes "Hello, " + strcharinfo(0) + "!";
		switch (select("Warp:Claim:Cancel")) {
			case 1:
				mes "Where would you like to warp to?";				
				WarpTo(select(.warps$));
			case 2:
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "You have accumulated so far:";
				for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
					mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
				}
				mes "Which would you like to claim?";
				ClaimCurrency(select(implode(.warpable_cities$, ":")));
		}
		end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				clear;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			clear;
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

Try this one. Also, are you using the most current rAthena rev.?

idk how to find out if my rathena is latest.... but still same problem pops

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  86
  • Reputation:   21
  • Joined:  10/02/13
  • Last Seen:  

Please, can you provide a screenshot of the error in map_serv?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

11 hours ago, Tyrfing said:

Ok, you seem to be using an rAthena revision that does not support `clear` as an NPC command.

Try this adapted version.


///////////////////////////////////////////////////////
//  ___________               _____.__                
//  \__    ___/__.__.________/ ____\__| ____    ____  
//    |    | <   |  |\_  __ \   __\|  |/    \  / ___\ 
//    |    |  \___  | |  | \/|  |  |  |   |  \/ /_/  >
//    |____|  / ____| |__|   |__|  |__|___|  /\___  / 
//            \/       Scripts             \//_____/  
//
//=====================================================
// Name: Paid Warper
//
// Description:
// At a cost of items, a player will be warped to a map,
// and he may retrieve 1/3 of them by talking to the NPC.
//
// Customizations:
// .currency: set to the Item ID you would like the NPC
// to trade for the warps.
//
// .cost: Amount of .currency item to give for each city.
// .equip: Equipment ID to be wearing when claiming items.
//=====================================================
///////////////////////////////////////////////////////
-	script	Paid Warper	56,{
	function WarpTo;
	function ClaimCurrency;
	
	set .npc_name$, "Paid Warper";
	set .currency, 619;
	setarray .warpable_cities$[0], "Prontera", "Payon", "Morocc";
	setarray .cost[0], 3, 3, 3;
	setarray .equip[0], 2293, 2294, 2295;
	
	if (!.initialized) {
		// Sets .warps$ to the valid warps according to the map the NPC is in
		for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
			set .warps$, .warps$ + (strtolower(.warpable_cities$[.@i]) == strnpcinfo(4) ? "" : .warpable_cities$[.@i]);
			if (.@i + 1 != getarraysize(.warpable_cities$))
				set .warps$, .warps$ + ":";
		}
		set .initialized, 1;
	}
	
	Begin:
	mes "[^00cc00"+ .npc_name$ +"^000000]";
	mes "Hello, " + strcharinfo(0) + "!";
	next;
	switch (select("Warp:Claim:Cancel")) {
		case 1:
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Where would you like to warp to?";				
			WarpTo(select(.warps$));
		case 2:
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You have accumulated so far:";
			for (.@i = 0; .@i < getarraysize(.warpable_cities$); .@i++) {
				mes .warpable_cities$[.@i] + ": " + warp_accumulator[.@i] + " " + getitemname(.currency);
			}
			mes "Which would you like to claim?";
			next;
			ClaimCurrency(select(implode(.warpable_cities$, ":")));
	}
	end;
	
	function WarpTo	{
		set .@city, getarg(0) - 1;
		mes "To warp to " + .warpable_cities$[.@city] + ", you need to provide "+ .cost[.@city] +" "+ getitemname(.currency) + ".";
		mes "Is that okay?";
		if (select("Yes:No") == 1) {
			if (countitem(.currency) < .cost[.@city]) {			
				next;
				mes "[^00cc00"+ .npc_name$ +"^000000]";
				mes "I am sorry, you need " + .cost[.@city] + " " + getitemname(.currency) + " to warp, but you only have " + countitem(.currency) + ".";
				next;
				goto Begin;
			}
			delitem .currency,.cost[.@city];
			warp_accumulator[.@city]++;
			atcommand "@go " + .warpable_cities$[.@city];
			next;
		}
		next;
		goto Begin;
		return;
	}
	
	function ClaimCurrency	{
		set .@city, getarg(0) - 1;
		set .@necessary_equip, .equip[.@city];
		if (warp_accumulator[.@city] == 0) {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "You don't have any "+ getitemname(.currency) +"s to retrieve.";
			next;
		} else if(isequipped(.@necessary_equip)) {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "Here you are!";
			getitem .currency,warp_accumulator[.@city];
			warp_accumulator[.@city] = 0;
			next;
		} else {
			mes "[^00cc00"+ .npc_name$ +"^000000]";
			mes "I'm sorry, you need to be wearing " + getitemname(.@necessary_equip) + " to retrieve your items.";
			next;
		}
		goto Begin;
		return;
	}
}

prontera,163,184,4	duplicate(Paid Warper)	Paid Warper#prt	56
payon,177,104,4	duplicate(Paid Warper)	Paid Warper#pay	56
morocc,152,97,4	duplicate(Paid Warper)	Paid Warper#moc	56

 

it works thank you very much sir... youre the BEST!

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