celeron0134 Posted February 9, 2020 Share Posted February 9, 2020 how will i add the preview item on this script? prontera,157,149,5 script Proof of Donation#1 955,{ mes "Your["+getitemname(.Cost)+"]["+countitem(.Cost)+"]"; mes "^E217171 Proof of Donation = 25 PHP"; close2; callshop "dyn_shop"+.a,1; npcshopattach "dyn_shop"+.a; end; OnInit: set .a,strnpcinfo(2); //========================================= set .Cost,7179; //========================================= setarray .buy_id[0],1228; setarray .buy_co[0],40; //========================================= npcshopitem "dyn_shop1",.buy_id[0],.buy_co[0]; for(set .ik,1;.ik<getarraysize(.buy_id);set .ik,.ik+1){ npcshopadditem "dyn_shop"+.a,.buy_id[.ik],.buy_co[.ik]; } end; OnBuyItem: getinventorylist; if(@bought_quantity[@i] <= 0){ goto OnEnrd; end; } for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){ //KeyWorld set [email protected], getiteminfo( @bought_nameid[[email protected]], 2 ); if ( [email protected] == 4 || [email protected] == 5 || [email protected] == 7 || [email protected] == 8 ) set [email protected], [email protected] + 1; else { for( set [email protected],0; [email protected]<@inventorylist_count; set [email protected], [email protected]+1 ) if ( @inventorylist_id[[email protected]] == @bought_nameid[[email protected]] ) break; if ( [email protected] == @inventorylist_count ) set [email protected], [email protected]+1 ; } for(set @i2,0;@i2<getarraysize(.buy_id);set @i2,@i2+1){ if(@bought_nameid[@i]==.buy_id[@i2]){ set @gh,@gh+.buy_co[@i2]*@bought_quantity[@i]; set @wh,@wh+getiteminfo(@bought_nameid[@i],6)*@bought_quantity[@i]; } } } if ( [email protected]count + @inventorylist_count > 100 ) { announce "[D-Shop]: Can't hold more than 100 items.",bc_self; goto OnEnrd; } if(countitem(.Cost)<@gh){ announce "[D-Shop]:["+getitemname(.Cost)+"] isn't enough",bc_self; goto OnEnrd; end; }else{ if(@wh>(MaxWeight-Weight)){ announce "[D-Shop]:Too heavy",bc_self; goto OnEnrd; end; }else{ delitem .Cost,@gh; for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){ getitem @bought_nameid[@i],@bought_quantity[@i]; } } } OnEnrd: set @gh,0; set @wh,0; set @i,0; set @i2,0; deletearray @bought_quantity,getarraysize(@bought_quantity); deletearray @bought_nameid,getarraysize(@bought_nameid); end; } so that there would be an option for preview and purchase the item Quote Link to comment Share on other sites More sharing options...
0 BeWan Posted February 9, 2020 Share Posted February 9, 2020 use this one instead. https://github.com/rathena/rathena/blob/master/npc/custom/quests/quest_shop.txt Quote Link to comment Share on other sites More sharing options...
how will i add the preview item on this script?
so that there would be an option for preview and purchase the item
Link to comment
Share on other sites