Jump to content

[Help]Donation Npc


Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  241
  • Reputation:   0
  • Joined:  11/24/11
  • Last Seen:  

Sir may mali po kasi sa script, tama naman ung price ng item ko sa script pate sa ingame. pero pag bibilhin na, nagiiba bigla ung price. ang price kasi ng VA ko ay 50 Astro Coins. Tapos pag bibili sa ingame, nagiiba bigla ung price pag binibili na. hindi langn sa VA un kundi sa other items din. Like ung megs ko, 200Astro Coins. Pero nung sinubukan kong ibuy, 50 AC lang. please help me.

here's the script:

donations.txt

sorry bawal po kasi ung mahabang script eh. d ko alam kung pano ung codebox na may scroll bar.

Edited by Elixir
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   26
  • Joined:  12/07/11
  • Last Seen:  

hmm... pg bibili ng VA which is 50 Astro Coins ito ang mg rurun na script..

if(@bought_nameid[@i] == 2357){
	   if(countitem(29999) >= 10*@bought_quantity[@i]){
	    delitem 29999,10*@bought_quantity[@i];
	    getitem 2357, @bought_quantity[@i];
	  } else {
	    dispbottom "Donation Shop : Insufficient Astro Coins!";
mes "[Donation Shop]";
mes "Insufficient ^FF0000Astro Coins^000000!!!";
mes "Please get some Astro Coins Ticket to Obtain this Item.";
close;

Look at the if(countitem(29999) >= 10*@bought_quantity[@i]){

the 10 represents the no. of Astro Coins right? dba dpat >=50 cause 50 Astro Coins ang VA

same with delitem 29999,10*@bought_quantity[@i];..

dpat delitem 29999,50*@bought_quantity[@i];

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  241
  • Reputation:   0
  • Joined:  11/24/11
  • Last Seen:  

hmm eh sir bakit ung sa megs ang nakalgay 200AC pero pag binili, 50AC lang. you mean everytime na mag aadd ako ng items ay gagawa din ako nung countitem blah blah ??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   26
  • Joined:  12/07/11
  • Last Seen:  

pg bumilii ng megs ito ang mg rurun..

if(@bought_nameid[@i] == 2629){
    if(countitem(29999) >= 50*@bought_quantity[@i]){
	    delitem 29999,50*@bought_quantity[@i];
	    getitem 2629, @bought_quantity[@i];
	  } else {
	    dispbottom "Donation Shop : Insufficient Astro Coins!";
	    end;
    }
   }

tlgang 50 lang sya.. cause

if(countitem(29999) >= 50*@bought_quantity[@i]){

bibilangin nya kung higit paba or equal sa 50 *@bought_quantity[@i] (@bought_quantity[@i] = Ilan ang binili mo) ang AC na nasa Inventory mo.. if TRUE

delitem 29999,[b]50[/b]*@bought_quantity[@i];
getitem 2629, @bought_quantity[@i];

then 29999(AC) ay ma babawasan ng 50**@bought_quantity[@i] ( if isa lang ang binili , bawas 50.. if dalawa 100)

so make 50 to 200..

and everytime mg add ka ng item mg aad ka rn ng countitem at dapat tugma since AC ang dapat pm bili..

use Multi Currency Shop [ Version 3 ] by Emistry.. mas madali yun.. :)

http://rathena.org/board/topic/53320-%E2%99%A5-e-m-i-s-t-r-y-s-s-c-r-i-p-t-s-%E2%99%A5/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  241
  • Reputation:   0
  • Joined:  11/24/11
  • Last Seen:  

aw grabe ganun po ba ? :) grabe naman...btw pano gamitin ung bngay mong script ? d ko magets eh

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   26
  • Joined:  12/07/11
  • Last Seen:  

Multi Currency Shop [ Version 3 ] by Emistry

/*
prontera,155,170,4 script Sample Script 780,{
set .npcname$,"^00007f[Coin Exchanger]^000000";
setarray .@menu$, "Bronze -> Zeny:Silver -> Zeny:Gold -> Zeny:Reloaded Coin -> Zeny";
setarray .@value$[0], "200","500000","1000000","2000000";
setarray .@coinid$[0], "673","675","671","675";



 mes .npcname$;
 mes "Very well. Here is the list on how much each coin is worth:";
 mes "^996633Bronze Coin^000000: 500,000m Zeny";
 mes "^666666Silver Coin^000000: 1,000,000m Zeny";
 mes "^FFFF66Gold Coin^000000: 2,000,000m Zeny";
 mes "^99CCCCPoring Coin^000000: 50,000,000m Zeny";
 mes "Tell me, what coin would you like to get?";
 next;

switch(select("Coin -> Zeny","Zeny -> Coin")){
case 1:
//
 switch(select(.@menu$)){
  case 1:
   mes .npcname$;
   mes "How many coins would you like to give up?";
   set @mamount,0;
   input @mamount;
   if (@mamount < 0) goto L_No;
   if (@mamount == 0) goto L_No;
   if (countitem(.@coinid$[1]) < @mamount) goto L_No;
   set Zeny,(zeny + (.@value$[1]* @mamount));
   delitem .@coinid$[1],@mamount;
   goto L_Thanks;
   dispbottom "obtained "+@mamount+"zeny";
   break;
  case 2:
   mes .npcname$;
   mes "How many coins would you like to give up?";
   set @mamount,0;
   input @mamount;
   if (@mamount < 0) goto L_No;
   if (@mamount == 0) goto L_No;
   if (countitem(.@coinid$[2]) < @mamount) goto L_No;
   set Zeny,(zeny + (.@value$[2]* @mamount));
   delitem .@coinid$[2],@mamount;
   goto L_Thanks;
   dispbottom "obtained "+@mamount+"zeny";
   break;
  break;
  case 3:
   mes .npcname$;
   mes "How many coins would you like to give up?";
   set @mamount,0;
   input @mamount;
   if (@mamount < 0) goto L_No;
   if (@mamount == 0) goto L_No;
   if (countitem(.@coinid$[3]) < @mamount) goto L_No;
   set Zeny,(zeny + (.@value$[3]* @mamount));
   delitem .@coinid$[3],@mamount;
   goto L_Thanks;
   dispbottom "obtained "+@mamount+"zeny";
   break;
  break;
  case 4:
   mes .npcname$;
   mes "How many coins would you like to give up?";
   set @mamount,0;
   input @mamount;
   if (@mamount < 0) goto L_No;
   if (@mamount == 0) goto L_No;
   if (countitem(.@coinid$[4]) < @mamount) goto L_No;
   set Zeny,(zeny + (.@value$[4]* @mamount));
   delitem .@coinid$[4],@mamount;
   goto L_Thanks;
   dispbottom "obtained "+@mamount+"zeny";
   break;
  break;
 }
break;
case 2:
break;
//
}





mes .npcname$;
close;

L_No:
next;
mes .npcname$;
mes "Okay~ Bye!";
close2;
cutin "", 255;
close;
end;
L_Thanks:
next;
mes .npcname$;
mes "Pleasure doing business with you.";
close2;
cutin "", 255;
close;
end;


}


///===== By: ==================================================
//= CalciumKid
//= & Okira
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= eAthena 1.0 Final +
//===== Description: =========================================
//= quest Template
//============================================================
prontera,197,186,4 script Blue Dragon Hat#0 150,{
 //===== Config: ==============================================
 set .npcname$,"[^FF0000 Blue Dragon Hat ^000000]"; //Change to whatever you want the NPC name to be
 setarray .reqid[1],671,7446,7443,7451,7450; //Item IDs for the items, required for item checks
 setarray .reqn$[1],"Gold Coin","Blue_Bijou","Three-Headed_Dragon's_Head","Fire_Dragon_Scale","Skeletal_Armor_Piece"; //These are names of the required items, for the dialogue
 setarray .reqa[1],5000,200,20,100,100; //These are how many of each item is required
 set .prize,24086; //Change this to the Item ID of the item reward
 set .prizen$,"Blue Dragon Hat"; //Change this to the name of your reward
 set .prizea,1; //Change this to the amount of the prize item
 set .zeny,20000000; //Amount of zeny for quest (set to 0 to disable)
L_QUEST:
mes .npcname$;
mes "Hah! Hello there "+strcharinfo(0);
next;
mes .npcname$;
mes "I don't get many visitors, so I assume you're after my legendary ^FF0000"+.prizen$+"^000000?";
menu "Of course",-,"No way",L_EXIT;
next;
mes .npcname$;
mes "Great! I love business. I can make you a ^FF0000"+.prizen$+"^000000, but only if you bring me the materials required.";
next;
mes .npcname$;
mes "Would you like me to make one for you?";
menu "Yes",-,"No",L_EXIT;
 next;
 mes .npcname$;
 mes "I'll need the following:";
 for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
mes .reqa[.@x]+" ^FF0000"+.reqn$[.@x]+"^000000";
 }
 if (.zeny > 0) {
mes .zeny+" ^FF0000Zeny^000000";
 }
 next;
 mes .npcname$;
 mes "Do you have those items?";
 menu "Yes",-,"No",L_EXIT;
  next;
  mes .npcname$;
  for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) >= .reqa[.@x]) {mes "You've got enough ^00FF00"+.reqn$[.@x]+"^000000";} else {mes "You need more ^FF0000"+.reqn$[.@x]+"^000000";}
  }
  if (.zeny > 0) {
if (Zeny < .zeny) {mes "You're missing ^FF0000Zeny^000000";}
else {mes "You've got enough ^00FF00Zeny^000000";}
  }
  next;
  mes .npcname$;
  mes "Would you like to complete the quest?";
  menu "Yes please!",-,"No Thanks",L_EXIT;
  next;
  for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) < .reqa[.@x]) goto L_EXIT2;
  }
  if (.zeny > 0) {
if (Zeny < .zeny) goto L_EXIT2;
  }
  mes .npcname$;
  mes "Brilliant! Fantastic! Here you go.";
  for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
delitem .reqid[.@x],.reqa[.@x];
  }
  if (.zeny > 0) {
set Zeny, Zeny - .zeny;
  }
  goto L_FINAL2;
  close;
L_EXIT:
  next;
  mes .npcname$;
  mes "Eh. I don't need you either. Bah!";
  close;
L_EXIT2:
  next;
  mes .npcname$;
  mes "I'm sorry, you don't have enough!";
  close;
L_FINAL2:
  next;
  mes .npcname$;
  mes "Brilliant! Fantastic! Here you go.";
  getitem .prize,1;
  close;
}
*/
GM,45,56,4 script Vending Area  855,{
warp "Vending",50,50;
OnInit:
while(1) {
delwaitingroom;
waitingroom "Vending Area",0;
sleep 1000;
}

}

// Fixed some Bug. [ By Goddameit ]
// Leave this alone...
- shop Emistry_Shop -1,512:1

prontera,155,181,5 script Sample 757,{
// NPC Name
set .name$,"[^FF0000  Emistry Shop  ^000000]";
mes .name$;
mes "Each Shop Buy Item Using Different Items.";
mes "Which shop you like to look at it";
next;
deletearray .ItemLists[0],getarraysize( .ItemLists );
deletearray .ItemPrice[0],getarraysize( .ItemPrice );
npcshopitem "Emistry_Shop",512,1;
select("Shop 1:Shop 2:Shop 3");
callsub CaseCH,@menu;
npcshopdelitem "Emistry_Shop",512;
for(set .@i,0; .@i < getarraysize( .ItemLists ); set .@i,.@i+1)
npcshopadditem "Emistry_Shop",.ItemLists[.@i],.ItemPrice[.@i];
mes "Okay...wait awhile";
mes "This Shop use ^FF0000"+getitemname( @Currency )+"^000000 to buy the Items.";
close2;
callsub CaseCH,@menu;
callshop "Emistry_Shop",1;
npcshopattach "Emistry_Shop";
dispbottom "You currently have "+countitem( @Currency )+" "+getitemname( @Currency )+".";
end;
OnBuyItem:
callsub CaseCH,@menu;
for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
 for(set @j,0; @j < getarraysize( .ItemLists ); set @j,@j+1)
  if( .ItemLists[@j] == @bought_nameid[@i] )
  set @TotalCost,@TotalCost + ( .ItemPrice[@j] * @bought_quantity[@i] );
if( countitem( @Currency ) < @TotalCost )
{
 for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
 {
  mes "Item : ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
  mes "Quantity : ^0000FF"+@bought_quantity[@i]+"^000000";
 }
 mes "^00FF00____________________________^000000";
 mes "Total Cost : ^0000FF"+@TotalCost+" x "+getitemname( @Currency )+"^000000";
 mes "^00FF00____________________________^000000";
 mes "[ ^FF0000X^000000 ] You do not have enough ^0000FF"+getitemname( @Currency )+"^000000 to purchase this.";
} else {
 for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
 {
  getitem @bought_nameid[@i],@bought_quantity[@i];
  message strcharinfo(0),"Purchased "+getitemname( @bought_nameid[@i] );
 }
 delitem @Currency,@TotalCost;
 mes "Thank you for shopping.";
 mes "You now have "+countitem( @Currency )+" "+getitemname( @Currency )+" left.";
}
set @TotalCost,0;
deletearray @bought_nameid[0],getarraysize( @bought_nameid );
deletearray @bought_quantity[0],getarraysize( @bought_quantity );
close;
CaseCH:
switch(getarg(0))
{
 Case 1:
  // Item Currency
  set @Currency,7227;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
 Case 2:
  // Item Currency
  set @Currency,7539;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
 Case 3:
  // Item Currency
  set @Currency,909;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
 // Case 4,5,6.....etc...
 default:
  mes "Wrong Selection / Configurations";
  close;
}
}

First change thename of the npc to whatever you want.

set .name$,"[^FF0000 Emistry Shop ^000000]";

then the name of your shop

select("Shop 1:Shop 2:Shop 3");

and Edit this one.. ito ung mga Shop..

CaseCH:
switch(getarg(0))
{
// Shop 1
 Case 1:
  // Item Currency
  set @Currency,7227;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
// Shop 2
 Case 2:
  // Item Currency
  set @Currency,7539;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
// Shop 3
 Case 3:
  // Item Currency
  set @Currency,909;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;
 // Case 4,5,6.....etc...

for Ex.sa Shop1..

// Shop 1
Case 1:

replace 7227 to Astro Coin 29999( 7227 ay ang pangbili )

// Item Currency
  set @Currency,7227;

ito naman ang mga item na binibinta..

// Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;

at ang Price nila ..so 2301 is 1 (Astro Coin),,2302 is 2 (Astro Coin)....

// Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;

same sa Shop2 and so on..

if mag aad ka pa ng shop

Edit this one

select("Shop 1:Shop 2:Shop 3");

select("Shop 1:Shop 2:Shop 3:Shop 4");

then add case 4 sa CaseCH:

Case 4:
 //SHOP 4
  // Item Currency
  set @Currency,909;
  // Item ID Lists
  setarray .ItemLists[0],2301,2302,2303,2304,2305,2306;
  // Item Price
  setarray .ItemPrice[0],1,2,3,4,5,6;
  return;

Edited by Gerome
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
Reply to this topic...

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