Jump to content
  • 0

Requesting a dynamic shop with skull_points


Question

Posted

Hi... i've this script:

poring_w02,97,202,5	script	Skull Points	63,{
	.@char_id = getcharid(0);
	.@count = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, .@char_id, 0 );	// can't exchange his own skull

	mes "You have "+ .@count +" skull.";
	if ( .@count == 0 ) close;
	mes "Exchange your pvp skulls ?";
	next;
	if ( select( "~ Yes", "~ No" ) -1 ) end;
	.@count = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, .@char_id, 0 );
	getinventorylist;
	while( .@i < @inventorylist_count && .@j < .@count ) {
		if ( @inventorylist_id[.@i] == 7420 && @inventorylist_card3[.@i] != .@char_id ) {
			delitem2 7420, @inventorylist_amount[.@i],1,0,0, @inventorylist_card1[.@i], 0, @inventorylist_card3[.@i], 0;
			.@j++;
		}
		.@i++;
	}
	#skull_points = #skull_points + .@count;
	mes "You got "+ .@count +" Skull points. Total: "+ #skull_points +" Skull points.";
	close;
}

works but i tried to use this: http://svn.code.sf.net/p/rathena/svn/trunk/npc/custom/quests/quest_shop.txt

 

but just i can't.... i tried alot of times changing but i cant :C anyone can help me?

 

i also tried with this.... but the npc doesnt count me the skull_points and neither show me the items...

poring_w02,103,203,5	script	Skull Trader	405,{
	mes .name$;
	mes "Tenes "+countitem(.slulltcg_item)+" "+getitemname(.skulltcg_item);
	mes "¿Queres mirar los items?";
	next;
	if(select("Si:No") == 2) {
	close;
}
	close2;
	callshop "SKULLTCG_SHOP",1;
	npcshopattach "SKULLTCG_SHOP";
	dispbottom "Tenes "+countitem(.skulltcg_item)+" "+getitemname(.skulltcg_item);
	end;

OnBuyItem:
	for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
	for(set @j,0; @j < getarraysize(.SKULLTCG_ITEMS); set @j,@j+2) {
	if(.SKULLTCG_ITEMS[@j] == @bought_nameid[@i]) {
	set @itemcost,(.SKULLTCG_ITEMS[(@j+1)]*@bought_quantity[@i]);
	set @totalcost,(@totalcost+@itemcost);
	break;
}
}
}
	if(@totalcost > countitem(.skulltcg_item)) {
	dispbottom "No tenes suficientes "+getitemname(.skulltcg_item);
}
	else {
	for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
	getitem @bought_nameid[@i],@bought_quantity[@i];
}
	delitem .skulltcg_item,@totalcost;
	dispbottom "Gracias por tu compra.";
	dispbottom "Tenes "+countitem(.skulltcg_item)+" "+getitemname(.skulltcg_item);
}
	set @totalcost,0;
	deletearray @bought_nameid[0],128;
	deletearray @bought_quantity[0],128;
	end;

OnInit:
	npcshopdelitem "SKULLTCG_SHOP",909;                   // Deja esto
	set .name$,"[Trading Card Game Shop]";
	set .skulltcg_item,#skull_points;                               // Mete la Id de las TCG Card
	setarray .SKULLTCG_ITEMS[0],29111,50,29112,50,29113,50,29114,50,29115,50,29188,75,29189,75,12903,1,12904,1,12905,1,12906,1,12907,1,12908,1,7959,2,13607,3,7091,1;       // Aca pones los items que quieras IdItem,Precio
	for(set .@i,0; .@i < getarraysize(.TCG_ITEMS); set .@i,.@i+2) {
	npcshopadditem "SKULLTCG_SHOP",.SKULLTCG_ITEMS[.@i],.SKULLTCG_ITEMS[(.@i+1)];
}
}

-	shop	SKULLTCG_SHOP	139,909:1


please help ^^

 

6 answers to this question

Recommended Posts

Posted

try using


-%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}
<map name>,<x>,<y>,<facing>%TAB%itemshop%TAB%<NPC Name>%TAB%<sprite id>,<costitemid>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}
Posted

Try

-%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}
<map name>,<x>,<y>,<facing>%TAB%pointshop%TAB%<NPC Name>%TAB%<sprite id>,<costvariable>{:<discount>},<itemid>:<price>{,<itemid>:<price>...}

where <costvariable> is your variable name #skull_points

Posted (edited)

now i understand thx ^^ solved <3

 

ok.... i guess i understand.... but im kinda.... slow i guess.... after i tried to test the script dont load... i got this

poring_w02,177,176,5	pointshop	Mvp Points Trader	112,#monster_points,116,7539:1

i guess the structure after <costvariable> confuse me :s

Edited by ItsFree

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