Jump to content
  • 0

trade card 1.1 debug


luizinhomt

Question


  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1 
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points.
//============================================================
 
prontera,165,196,6	script	Card Trader	90,{
	mes "[Card Trader]";
	mes "Hi, "+strcharinfo(0)+"!";
	mes "What can I do for you?";
	next;
	switch(select(" > Information: > Trade in cards: > Point shop (^0055FF"+getd(.Points$)+"^000000): > Leave")) {
	case 1:
		mes "[Card Trader]";
		mes "Do you find that you've got";
		mes "useless cards lying around?";
		mes "I'll be glad to take them off";
		mes "your hands!";
		next;
		mes "[Card Trader]";
		mes "I'll give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each";
		mes "card you give me, and";
		mes "^0055FF"+.Points[1]+" Points^000000 for MVP cards.";
		mes "You can trade those points";
		mes "for items later on.";
		mes "How does that sound?";
		emotion e_cash;
		close;
	case 2:
		mes "[Card Trader]";
		mes "Select the cards you";
		mes "want to trade in.";
		if (.Level) {
			mes " ";
			mes "They must be dropped";
			mes "by monsters of level";
			mes .Level+" and above.";
		}
		deletearray @sold_nameid[0],getarraysize(@sold_nameid);
		callshop "card_shop",2;
		npcshopattach "card_shop";
		end;
	case 3:
		mes "[Card Trader]";
		mes "You have ^0055FF"+getd(.Points$)+"^000000 Point"+((getd(.Points$) == 1)?".":"s.");
		callshop "card_shop",1;
		npcshopattach "card_shop";
		end;
	case 4:
		mes "[Card Trader]";
		mes "*yawn*";
		mes "See you later!";
		emotion e_yawn;
		close;		
	}
 
OnSellItem:
	mes "Cards to sell:";
	mes "-----------------------------------";
	for(set .@i,0; .@i < getarraysize(@sold_nameid); set .@i,.@i+1)
		if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700) {
			if (.Level) {
				query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i],.@lv);
				if (.@lv < .Level) {
					dispbottom getitemname(@sold_nameid[.@i])+" is under the minimum level.";
					continue;
				}
			}
			set .@card_id[getarraysize(.@card_id)], @sold_nameid[.@i];
			set .@card_amt[getarraysize(.@card_amt)], @sold_quantity[.@i];
			set .@mvp, compare(.MVP$,""+@sold_nameid[.@i]);
			mes ((.@mvp)?"  ^FF0000":"  ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000";
			set .@card_total, .@card_total+(@sold_quantity[.@i]*((.@mvp)?.Points[1]:.Points[0]));
		}
	deletearray @sold_nameid[0], getarraysize(@sold_nameid);
	deletearray @sold_quantity[0], getarraysize(@sold_quantity);
	if (!.@card_id) {
		mes "  ^777777(none)^000000";
		emotion e_swt;
		close;
	}
	mes " ";
	mes "---------- Total: ^0055FF"+.@card_total+" pt.^000000 -------";
	next;
	if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) {
		mes "[Card Trader]";
		mes "Oh, okay...";
		emotion e_hmm;
		close;
	}
	for(set .@i,0; .@i < getarraysize(.@card_id); set .@i,.@i+1)
		delitem .@card_id[.@i],.@card_amt[.@i];
	setd .Points$, getd(.Points$)+.@card_total;
	mes "[Card Trader]";
	mes "All done!";
	emotion e_ho;
	close;
 
OnBuyItem:
	for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1)
		for(set .@j,0; .@j <getarraysize(.Shop); set .@j,.@j+2)
			if (@bought_nameid[.@i] == .Shop[.@j]) {
				set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
				break;
			}
	if (.@cost > getd(.Points$)) {
		mes "[Card Trader]";
		mes "You don't have enough Points.";
		emotion e_omg;
	}
	else {
		mes "Items purchased:";
		mes "-----------------------------------";
		for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1) {
			getitem @bought_nameid[.@i], @bought_quantity[.@i];
			mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
		}
		mes " ";
		mes "---------- Total: ^0055FF"+.@cost+" pt.^000000 -------";
		setd .Points$, getd(.Points$)-.@cost;
		emotion e_cash;
	}
	deletearray @bought_nameid[0], getarraysize(@bought_nameid);
	deletearray @bought_quantity[0], getarraysize(@bought_quantity);
	close;
 
OnInit:
	set .Level,0;		   // Minimum monster level to trade corresponding cards.
	set .Points$,"#Card_Points";	// Variable to store points.
	setarray .Shop[0],		// Card Shop items: <ID>,<point cost>
	  4001,1,4004,1,4033,1,4196,1,4197,25,4054,50,4174,75,4047,100;
	setarray .Points[0],1,5;	// Points per <normal card>,<MVP card>
	set .MVP$,			// List of MVP cards.
	  "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,"+
	  "4241,4263,4276,4302,4305,4318,4324,4330,4342,4357,4359,4361,4363,4365,4399,4403,4407";
	
	npcshopdelitem "card_shop",909;
	for(set .@i,0; .@i < getarraysize(.Shop); set .@i,.@i+2)
		npcshopadditem "card_shop",.Shop[.@i],.Shop[.@i+1];
	end;
}
-	shop	card_shop	-1,909:-1

I get debug in this script when buying or selling can anyone help me

[Debug]: npc_scriptcont: Card Trade (sd->npc_id=110012695) is not 'Unknown NPC' (id=0).

Edited by luizinhomt
edit
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   2
  • Joined:  08/27/13
  • Last Seen:  

21 hours ago, luizinhomt said:
//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1 
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points.
//============================================================
 
prontera,165,196,6	script	Card Trader	90,{
	mes "[Card Trader]";
	mes "Hi, "+strcharinfo(0)+"!";
	mes "What can I do for you?";
	next;
	switch(select(" > Information: > Trade in cards: > Point shop (^0055FF"+getd(.Points$)+"^000000): > Leave")) {
	case 1:
		mes "[Card Trader]";
		mes "Do you find that you've got";
		mes "useless cards lying around?";
		mes "I'll be glad to take them off";
		mes "your hands!";
		next;
		mes "[Card Trader]";
		mes "I'll give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each";
		mes "card you give me, and";
		mes "^0055FF"+.Points[1]+" Points^000000 for MVP cards.";
		mes "You can trade those points";
		mes "for items later on.";
		mes "How does that sound?";
		emotion e_cash;
		close;
	case 2:
		mes "[Card Trader]";
		mes "Select the cards you";
		mes "want to trade in.";
		if (.Level) {
			mes " ";
			mes "They must be dropped";
			mes "by monsters of level";
			mes .Level+" and above.";
		}
		deletearray @sold_nameid[0],getarraysize(@sold_nameid);
		callshop "card_shop",2;
		npcshopattach "card_shop";
		end;
	case 3:
		mes "[Card Trader]";
		mes "You have ^0055FF"+getd(.Points$)+"^000000 Point"+((getd(.Points$) == 1)?".":"s.");
		callshop "card_shop",1;
		npcshopattach "card_shop";
		end;
	case 4:
		mes "[Card Trader]";
		mes "*yawn*";
		mes "See you later!";
		emotion e_yawn;
		close;		
	}
 
OnSellItem:
	mes "Cards to sell:";
	mes "-----------------------------------";
	for(set .@i,0; .@i < getarraysize(@sold_nameid); set .@i,.@i+1)
		if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700) {
			if (.Level) {
				query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i],.@lv);
				if (.@lv < .Level) {
					dispbottom getitemname(@sold_nameid[.@i])+" is under the minimum level.";
					continue;
				}
			}
			set .@card_id[getarraysize(.@card_id)], @sold_nameid[.@i];
			set .@card_amt[getarraysize(.@card_amt)], @sold_quantity[.@i];
			set .@mvp, compare(.MVP$,""+@sold_nameid[.@i]);
			mes ((.@mvp)?"  ^FF0000":"  ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000";
			set .@card_total, .@card_total+(@sold_quantity[.@i]*((.@mvp)?.Points[1]:.Points[0]));
		}
	deletearray @sold_nameid[0], getarraysize(@sold_nameid);
	deletearray @sold_quantity[0], getarraysize(@sold_quantity);
	if (!.@card_id) {
		mes "  ^777777(none)^000000";
		emotion e_swt;
		close;
	}
	mes " ";
	mes "---------- Total: ^0055FF"+.@card_total+" pt.^000000 -------";
	next;
	if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) {
		mes "[Card Trader]";
		mes "Oh, okay...";
		emotion e_hmm;
		close;
	}
	for(set .@i,0; .@i < getarraysize(.@card_id); set .@i,.@i+1)
		delitem .@card_id[.@i],.@card_amt[.@i];
	setd .Points$, getd(.Points$)+.@card_total;
	mes "[Card Trader]";
	mes "All done!";
	emotion e_ho;
	close;
 
OnBuyItem:
	for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1)
		for(set .@j,0; .@j <getarraysize(.Shop); set .@j,.@j+2)
			if (@bought_nameid[.@i] == .Shop[.@j]) {
				set .@cost, .@cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
				break;
			}
	if (.@cost > getd(.Points$)) {
		mes "[Card Trader]";
		mes "You don't have enough Points.";
		emotion e_omg;
	}
	else {
		mes "Items purchased:";
		mes "-----------------------------------";
		for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1) {
			getitem @bought_nameid[.@i], @bought_quantity[.@i];
			mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
		}
		mes " ";
		mes "---------- Total: ^0055FF"+.@cost+" pt.^000000 -------";
		setd .Points$, getd(.Points$)-.@cost;
		emotion e_cash;
	}
	deletearray @bought_nameid[0], getarraysize(@bought_nameid);
	deletearray @bought_quantity[0], getarraysize(@bought_quantity);
	close;
 
OnInit:
	set .Level,0;		   // Minimum monster level to trade corresponding cards.
	set .Points$,"#Card_Points";	// Variable to store points.
	setarray .Shop[0],		// Card Shop items: <ID>,<point cost>
	  4001,1,4004,1,4033,1,4196,1,4197,25,4054,50,4174,75,4047,100;
	setarray .Points[0],1,5;	// Points per <normal card>,<MVP card>
	set .MVP$,			// List of MVP cards.
	  "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,"+
	  "4241,4263,4276,4302,4305,4318,4324,4330,4342,4357,4359,4361,4363,4365,4399,4403,4407";
	
	npcshopdelitem "card_shop",909;
	for(set .@i,0; .@i < getarraysize(.Shop); set .@i,.@i+2)
		npcshopadditem "card_shop",.Shop[.@i],.Shop[.@i+1];
	end;
}
-	shop	card_shop	-1,909:-1

I get debug in this script when buying or selling can anyone help me

[Debug]: npc_scriptcont: Card Trade (sd->npc_id=110012695) is not 'Unknown NPC' (id=0).

 

//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Psalm (Updated & Fixed)
//===== Current Version: =====================================
//= 1.2
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points and buy rewards.
//============================================================

prontera,165,196,6	script	Card Trader	90,{
	mes "[Card Trader]";
	mes "Hi, "+strcharinfo(0)+"!";
	mes "What can I do for you?";
	next;
	switch(select(" > Information: > Trade in cards: > Point shop (^0055FF"+getd(.Points$)+"^000000): > Leave")) {
		case 1:
			mes "[Card Trader]";
			mes "Do you find that you've got useless cards lying around?";
			mes "I'll be glad to take them off your hands!";
			next;
			mes "[Card Trader]";
			mes "I'll give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each card,";
			mes "and ^0055FF"+.Points[1]+" Points^000000 for MVP cards.";
			mes "Trade those points for items later on.";
			emotion e_cash;
			close;
		case 2:
			mes "[Card Trader]";
			mes "Select the cards you want to trade in.";
			if (.Level) {
				mes " ";
				mes "They must be from monsters level "+.Level+" and above.";
			}
			deletearray @sold_nameid[0], getarraysize(@sold_nameid);
			callshop "card_shop",2;
			end;
		case 3:
			mes "[Card Trader]";
			mes "You have ^0055FF"+getd(.Points$)+"^000000 Points.";
			callshop "card_shop",1;
			end;
		case 4:
			mes "[Card Trader]";
			mes "*yawn* See you later!";
			emotion e_yawn;
			close;
	}

OnSellItem:
	set .@card_total, 0;
	mes "Cards to sell:";
	mes "-----------------------------------";
	for (set .@i, 0; .@i < getarraysize(@sold_nameid); set .@i, .@i+1) {
		if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700) {
			if (.Level) {
				query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i], .@lv);
				if (.@lv < .Level) {
					dispbottom getitemname(@sold_nameid[.@i])+" is under the minimum level.";
					continue;
				}
			}
			set .@mvp, compare(.MVP$, ""+@sold_nameid[.@i]);
			mes ((.@mvp)?"  ^FF0000":"  ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000";
			set .@card_total, .@card_total + (@sold_quantity[.@i] * ((.@mvp) ? .Points[1] : .Points[0]));
		}
	}
	deletearray @sold_nameid[0], getarraysize(@sold_nameid);
	deletearray @sold_quantity[0], getarraysize(@sold_quantity);
	if (.@card_total == 0) {
		mes "  ^777777(none)^000000";
		emotion e_swt;
		close;
	}
	mes " ";
	mes "Total: ^0055FF"+.@card_total+" pt.^000000";
	next;
	if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) {
		mes "[Card Trader]";
		mes "Oh, okay...";
		emotion e_hmm;
		close;
	}
	setd .Points$, getd(.Points$) + .@card_total;
	mes "[Card Trader]";
	mes "All done!";
	emotion e_ho;
	close;

OnBuyItem:
	set .@cost, 0;
	for (set .@i, 0; .@i < getarraysize(@bought_nameid); set .@i, .@i+1) {
		for (set .@j, 0; .@j < getarraysize(.Shop); set .@j, .@j+2) {
			if (@bought_nameid[.@i] == .Shop[.@j]) {
				set .@cost, .@cost + (.Shop[.@j+1] * @bought_quantity[.@i]);
				break;
			}
		}
	}
	if (.@cost > getd(.Points$)) {
		mes "[Card Trader]";
		mes "You don't have enough Points.";
		emotion e_omg;
	} else {
		mes "Items purchased:";
		mes "-----------------------------------";
		for (set .@i, 0; .@i < getarraysize(@bought_nameid); set .@i, .@i+1) {
			getitem @bought_nameid[.@i], @bought_quantity[.@i];
			mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
		}
		mes "Total: ^0055FF"+.@cost+" pt.^000000";
		setd .Points$, getd(.Points$) - .@cost;
		emotion e_cash;
	}
	deletearray @bought_nameid[0], getarraysize(@bought_nameid);
	deletearray @bought_quantity[0], getarraysize(@bought_quantity);
	close;

OnInit:
	set .Level, 0;
	set .Points$, "#Card_Points";
	setarray .Shop, 4001,1,4004,1,4033,1,4196,1,4197,25,4054,50,4174,75,4047,100;
	setarray .Points, 1, 5;
	set .MVP$, "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,4241,4263,4276";
	end;
}

Changes & Fixes:

Fixed npcshopattach Issue - Removed unnecessary npcshopattach "card_shop";.
Corrected Point Handling - Ensured correct getd(.Points$) usage for point calculations.
Improved Sell & Buy Logic - Ensured arrays are properly processed before deleting.
Refactored OnSellItem and OnBuyItem - More efficient iteration through sold/bought items.

Try testing this version, and let me know if you need further adjustments! 

Edited by Paul
Changes Authored
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   0
  • Joined:  04/03/25
  • Last Seen:  

It looks like the issue comes from an improper NPC continuation or a conflict with the NPC ID. The debug message [Debug]: npc_scriptcont... usually appears when the script tries to continue a dialogue, but the NPC context is no longer valid or has already ended.

Make sure the NPC name ("Card Trader") is consistent across the entire script, especially where npc_scriptcont is implicitly called. Also, double-check that there's no end; or close; being triggered too early before the OnSellItem or OnBuyItem labels run. It’s important that callshop is used before npcshopattach, which seems fine in your case.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

On 4/4/2025 at 11:27 AM, Paul said:

 

//===== rAthena Script =======================================
//= Card Trader
//===== By: ==================================================
//= Psalm (Updated & Fixed)
//===== Current Version: =====================================
//= 1.2
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Exchange cards for points and buy rewards.
//============================================================

prontera,165,196,6	script	Card Trader	90,{
	mes "[Card Trader]";
	mes "Hi, "+strcharinfo(0)+"!";
	mes "What can I do for you?";
	next;
	switch(select(" > Information: > Trade in cards: > Point shop (^0055FF"+getd(.Points$)+"^000000): > Leave")) {
		case 1:
			mes "[Card Trader]";
			mes "Do you find that you've got useless cards lying around?";
			mes "I'll be glad to take them off your hands!";
			next;
			mes "[Card Trader]";
			mes "I'll give you ^0055FF"+.Points[0]+" Point"+((.Points[0] == 1)?"":"s")+"^000000 for each card,";
			mes "and ^0055FF"+.Points[1]+" Points^000000 for MVP cards.";
			mes "Trade those points for items later on.";
			emotion e_cash;
			close;
		case 2:
			mes "[Card Trader]";
			mes "Select the cards you want to trade in.";
			if (.Level) {
				mes " ";
				mes "They must be from monsters level "+.Level+" and above.";
			}
			deletearray @sold_nameid[0], getarraysize(@sold_nameid);
			callshop "card_shop",2;
			end;
		case 3:
			mes "[Card Trader]";
			mes "You have ^0055FF"+getd(.Points$)+"^000000 Points.";
			callshop "card_shop",1;
			end;
		case 4:
			mes "[Card Trader]";
			mes "*yawn* See you later!";
			emotion e_yawn;
			close;
	}

OnSellItem:
	set .@card_total, 0;
	mes "Cards to sell:";
	mes "-----------------------------------";
	for (set .@i, 0; .@i < getarraysize(@sold_nameid); set .@i, .@i+1) {
		if (@sold_nameid[.@i] > 4000 && @sold_nameid[.@i] < 4700) {
			if (.Level) {
				query_sql("SELECT `LV` FROM `mob_db` WHERE `DropCardid` = "+@sold_nameid[.@i], .@lv);
				if (.@lv < .Level) {
					dispbottom getitemname(@sold_nameid[.@i])+" is under the minimum level.";
					continue;
				}
			}
			set .@mvp, compare(.MVP$, ""+@sold_nameid[.@i]);
			mes ((.@mvp)?"  ^FF0000":"  ^777777")+@sold_quantity[.@i]+"x "+getitemname(@sold_nameid[.@i])+"^000000";
			set .@card_total, .@card_total + (@sold_quantity[.@i] * ((.@mvp) ? .Points[1] : .Points[0]));
		}
	}
	deletearray @sold_nameid[0], getarraysize(@sold_nameid);
	deletearray @sold_quantity[0], getarraysize(@sold_quantity);
	if (.@card_total == 0) {
		mes "  ^777777(none)^000000";
		emotion e_swt;
		close;
	}
	mes " ";
	mes "Total: ^0055FF"+.@card_total+" pt.^000000";
	next;
	if(select(" > ^0055FFComplete trade...^000000: > ^777777Cancel^000000") == 2) {
		mes "[Card Trader]";
		mes "Oh, okay...";
		emotion e_hmm;
		close;
	}
	setd .Points$, getd(.Points$) + .@card_total;
	mes "[Card Trader]";
	mes "All done!";
	emotion e_ho;
	close;

OnBuyItem:
	set .@cost, 0;
	for (set .@i, 0; .@i < getarraysize(@bought_nameid); set .@i, .@i+1) {
		for (set .@j, 0; .@j < getarraysize(.Shop); set .@j, .@j+2) {
			if (@bought_nameid[.@i] == .Shop[.@j]) {
				set .@cost, .@cost + (.Shop[.@j+1] * @bought_quantity[.@i]);
				break;
			}
		}
	}
	if (.@cost > getd(.Points$)) {
		mes "[Card Trader]";
		mes "You don't have enough Points.";
		emotion e_omg;
	} else {
		mes "Items purchased:";
		mes "-----------------------------------";
		for (set .@i, 0; .@i < getarraysize(@bought_nameid); set .@i, .@i+1) {
			getitem @bought_nameid[.@i], @bought_quantity[.@i];
			mes "  ^777777"+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+"^000000";
		}
		mes "Total: ^0055FF"+.@cost+" pt.^000000";
		setd .Points$, getd(.Points$) - .@cost;
		emotion e_cash;
	}
	deletearray @bought_nameid[0], getarraysize(@bought_nameid);
	deletearray @bought_quantity[0], getarraysize(@bought_quantity);
	close;

OnInit:
	set .Level, 0;
	set .Points$, "#Card_Points";
	setarray .Shop, 4001,1,4004,1,4033,1,4196,1,4197,25,4054,50,4174,75,4047,100;
	setarray .Points, 1, 5;
	set .MVP$, "4121,4123,4128,4131,4132,4134,4135,4137,4142,4143,4144,4145,4146,4147,4148,4168,4236,4241,4263,4276";
	end;
}

Changes & Fixes:

Fixed npcshopattach Issue - Removed unnecessary npcshopattach "card_shop";.
Corrected Point Handling - Ensured correct getd(.Points$) usage for point calculations.
Improved Sell & Buy Logic - Ensured arrays are properly processed before deleting.
Refactored OnSellItem and OnBuyItem - More efficient iteration through sold/bought items.

Try testing this version, and let me know if you need further adjustments! 

thank you I will test

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   1
  • Joined:  01/05/13
  • Last Seen:  

9 hours ago, NullHawk said:

It looks like the issue comes from an improper NPC continuation or a conflict with the NPC ID. The debug message [Debug]: npc_scriptcont... usually appears when the script tries to continue a dialogue, but the NPC context is no longer valid or has already ended.

Make sure the NPC name ("Card Trader") is consistent across the entire script, especially where npc_scriptcont is implicitly called. Also, double-check that there's no end; or close; being triggered too early before the OnSellItem or OnBuyItem labels run. It’s important that callshop is used before npcshopattach, which seems fine in your case.

thanks for the answer

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