Jump to content
  • 0

stat seller NPC || with limit of stat points to buy


Question

Posted

anyone have a script of stat seller that has a stat point limit per character??

like 1 character can only buy 10k stat points using Pods/TCG??

thnx in advance

12 answers to this question

Recommended Posts

  • 0
Posted (edited)

try this

 

 

PS. Stats sold from this NPC will be lost once the player use stat reset. To prevent this, you might want to edit your /conf/exp.conf and look for

 

use_statpoint_table: yes

 

and set it to

use_statpoint_table: no

 

EDIT: attached the updated script

stat seller with limitv2.txt

Edited by gleynn
  • Like 1
  • 0
Posted
    parse_callfunc: not enough arguments, expected ','
    19 :                                mes "Sorry, but don't have enough PODs in your inventory.";
    20 :                                mes " Please come back when you have enough.";
    21 :                                close;
    22 :                        }
    23 :                        else {
*   24 :                                set .@StatToBe = StatBought+(.@amount*.@SellStatPOD)';'
    25 :                                if (.@MaxStat < .@StatToBe) {
    26 :                                        mes "Sorry, but you're about to reach the max stat points that can be bought.";
    27 :                                        mes "You have already purchase "+StatBought+" stat points.";
    28 :                                        close;
    29 :                         

got error my friend

  • 0
Posted

here is the script

prontera,147,173,4	script	Stat Seller	899,{

	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatPOD, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 10000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = StatBought+(.@amount*.@SellStatPOD);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought,StatBought+(.@amount*.@SellStatPOD);
					close;
				}
			}
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = StatBought+(.@amount*.@SellStatTCG);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought,StatBought+(.@amount*.@SellStatTCG);
					close;
				}
			}
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}

and i got this error

  parse_callfunc: not enough arguments, expected ','
    19 :                                mes "Sorry, but don't have enough PODs in your inventory.";
    20 :                                mes " Please come back when you have enough.";
    21 :                                close;
    22 :                        }
    23 :                        else {
*   24 :                                set .@StatToBe = StatBought+(.@amount*.@SellStatPOD)';'
    25 :                                if (.@MaxStat < .@StatToBe) {
    26 :                                        mes "Sorry, but you're about to reach the max stat points that can be bought.";
    27 :                                        mes "You have already purchase "+StatBought+" stat points.";
    28 :                                        close;
    29 :                                }

thnx for the help ^_^

  • 0
Posted
1 hour ago, Capuche said:

Setting a variable is basic in NPC script. I can't help you if you don't help yourself.

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L1208

i made it work thnx

lastly i want it like the player can only purchase 10k stp after purchasing a total of 10k stp he cant purchase anymore on that character

but he can still purchase on the other character he/she have

its like 10k maximum of statpoints purchase per character

prontera,147,173,4	script	Stat Seller	899,{

	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatTCG, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 5000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = "StatBought+", (.@amount*.@SellStatPOD);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought,StatBought+(.@amount*.@SellStatPOD);
					delitem .@PODid[.@StatBought],.@amount;
					close;
				}
			}
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = "StatBought+",(.@amount*.@SellStatTCG);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought,StatBought+(.@amount*.@SellStatTCG);
					delitem .@TCGid[.@StatBought],.@amount;
					close;
				}
			}
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}

thnx for helping me

  • 0
Posted
7 hours ago, whodhell said:

i made it work thnx

lastly i want it like the player can only purchase 10k stp after purchasing a total of 10k stp he cant purchase anymore on that character

but he can still purchase on the other character he/she have

its like 10k maximum of statpoints purchase per character


prontera,147,173,4	script	Stat Seller	899,{

	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatTCG, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 5000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = "StatBought+", (.@amount*.@SellStatPOD);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought,StatBought+(.@amount*.@SellStatPOD);
					delitem .@PODid[.@StatBought],.@amount;
					close;
				}
			}
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe = "StatBought+",(.@amount*.@SellStatTCG);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought,StatBought+(.@amount*.@SellStatTCG);
					delitem .@TCGid[.@StatBought],.@amount;
					close;
				}
			}
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}

thnx for helping me

i suppose change this part

if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;

change into

if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're already reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;

 

  • 0
Posted
10 hours ago, hendra814 said:

i suppose change this part


if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;

change into


if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're already reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;

 

still same i can purchase multiple times eventhough i purchased total of 5k Stpoints

  • 0
Posted (edited)
10 hours ago, whodhell said:

still same i can purchase multiple times eventhough i purchased total of 5k Stpoints

sorry miss understanding .@statToBe with StatBought

try this

prontera,147,173,4	script	Stat Seller	899,{

	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatTCG, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 5000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
				set .@StatToBe = StatBought+(.@amount*.@SellStatPOD);
				if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought,StatBought+(.@amount*.@SellStatPOD);
					delitem .@PODid[.@StatBought],.@amount;
					close;
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
				set .@StatToBe = StatBought+(.@amount*.@SellStatTCG);
				if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought,StatBought+(.@amount*.@SellStatTCG);
					delitem .@TCGid[.@StatBought],.@amount;
					close;
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}

 

Edited by hendra814
  • 0
Posted
10 hours ago, hendra814 said:

sorry miss understanding .@statToBe with StatBought

try this


prontera,147,173,4	script	Stat Seller	899,{

	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatTCG, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 5000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
				set .@StatToBe = StatBought+(.@amount*.@SellStatPOD);
				if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought,StatBought+(.@amount*.@SellStatPOD);
					delitem .@PODid[.@StatBought],.@amount;
					close;
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
				set .@StatToBe = StatBought+(.@amount*.@SellStatTCG);
				if (.@StatToBe >= .@MaxStat) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought,StatBought+(.@amount*.@SellStatTCG);
					delitem .@TCGid[.@StatBought],.@amount;
					close;
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}

 

character can still purchase statpoints even they purchase total of 5k

im also trying to figure this out

thnx for helping

  • 0
Posted
On 2/5/2018 at 4:11 AM, whodhell said:

    parse_callfunc: not enough arguments, expected ','
    19 :                                mes "Sorry, but don't have enough PODs in your inventory.";
    20 :                                mes " Please come back when you have enough.";
    21 :                                close;
    22 :                        }
    23 :                        else {
*   24 :                                set .@StatToBe = StatBought+(.@amount*.@SellStatPOD)';'
    25 :                                if (.@MaxStat < .@StatToBe) {
    26 :                                        mes "Sorry, but you're about to reach the max stat points that can be bought.";
    27 :                                        mes "You have already purchase "+StatBought+" stat points.";
    28 :                                        close;
    29 :                         

got error my friend

ohh, apologies, it should be using comma ( , ) instead an equal sign, here i have updated the script

stat seller with limitv2.txt

  • 0
Posted
1 hour ago, gleynn said:

ohh, apologies, it should be using comma ( , ) instead an equal sign, here i have updated the script

stat seller with limitv2.txt

just add on on ur script it wont consume TCG/PODS

so heres an update on your script so once you buy STP TCG/PODS will be consume

prontera,147,173,4	script	Stat Seller	899,{


	set .@SellStatPOD, 100;		//Stat Points per 1 POD
	set .@SellStatTCG, 50;		//Stat Points per 1 TCG
	set .@PODid, 7179;			//POD item id
	set .@TCGid, 7227;			//TCG item id
	set .@MaxStat, 10000;		//Maximum Stat Points allowed to sell

	mes "Hi ^FF0000"+strcharinfo(0)+"^000000!";
	mes "Do you wish to buy Stat points?";
	mes "1 POD = "+.@SellStatPOD+" stat points";
	mes "1 TCG = "+.@SellStatTCG+" stat points";
	mes "Maximum stat points can be purchase is "+.@MaxStat+".";
	switch(select(" ~ Yes, using PODs: ~ Yes, using TCGs: ~ No")) {
		case 1:
			mes "How many PODs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@PODid) < .@amount) {
				mes "Sorry, but don't have enough PODs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe, StatBought+(.@amount*.@SellStatPOD);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatPOD);
					set StatBought, StatBought+(.@amount*.@SellStatPOD);
					delitem .@PODid[.@StatBought],.@amount;
					close;
				}
			}
		case 2:
			mes "How many TCGs do you wish to exchange for stat points?";
			input .@amount;
			if (countitem(.@TCGid) < .@amount) {
				mes "Sorry, but don't have enough TCGs in your inventory.";
				mes " Please come back when you have enough.";
				close;
			}
			else {
				set .@StatToBe, StatBought+(.@amount*.@SellStatTCG);
				if (.@MaxStat < .@StatToBe) {
					mes "Sorry, but you're about to reach the max stat points that can be bought.";
					mes "You have already purchase "+StatBought+" stat points.";
					close;
				}
				else {
					mes "Here you go!";
					mes "Please use your stat point wisely.";
					set StatusPoint, StatusPoint+(.@amount*.@SellStatTCG);
					set StatBought, StatBought+(.@amount*.@SellStatTCG);
					delitem .@TCGid[.@StatBought],.@amount;
					close;
				}
			}
		case 3:
			mes "I understand, Please come back to me whenever you change your mind.";
			close;
	}
}	

thnx for your script

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...