Jump to content
  • 0

Duplicate unique name


mrmtsuruya

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  02/05/12
  • Last Seen:  

anyway.

can you help me with this script?

- shop Donation -1,501:500

prontera,187,209,5 script Donation 757,{
// NPC Name
set .name$,"[^FF0000 Charity Worker ^000000]";
mes .name$;
mes "Are you here to donate? if so please choose from the following categories. ";
next;
select("Valkyrie Shop:Diablo's Shop Items:Cards Shop");
callsub CaseCH,@menu;
npcshopitem "Donation",501,20;
npcshopdelitem "Donation",501;
for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
npcshopadditem "Donation",@ItemLists[.@i],@ItemPrice[.@i];
mes .name$;
mes "Please take note that each of the following items are bought using ^008800"+getitemname( @Currency )+"^000000 and not zennies. The zennies only indicate the prices";
next;
callsub CaseCH,@menu;
callshop "Donation",1;
npcshopattach "Donation";
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 ^FF0000"+countitem( @Currency )+" "+getitemname( @Currency )+"^000000 left.";
}
set @TotalCost,0;
deletearray @bought_nameid[0],getarraysize( @bought_nameid );
deletearray @bought_quantity[0],getarraysize( @bought_quantity );
deletearray @ItemLists[0],getarraysize( @ItemLists );
deletearray @ItemPrice[0],getarraysize( @ItemPrice );
close;
CaseCH:
deletearray @ItemLists[0],getarraysize( @ItemLists );
deletearray @ItemPrice[0],getarraysize( @ItemPrice );
switch( getarg(0) ){
Case 1:
// Item Currency
set @Currency,7179;
// Item ID Lists
setarray @ItemLists[0],2524,5171,2357,2421,2115;
// Item Price
setarray @ItemPrice[0],10,10,10,10,10;
return;
Case 2:
// Item Currency
set @Currency,7179;
// Item ID Lists
setarray @ItemLists[0],5808,2375,2374,2537,2433;
// Item Price
setarray @ItemPrice[0],30,30,30,30,30;
return;
Case 3:
// Item Currency
set @Currency,7179;
// Item ID Lists
setarray @ItemLists[0],4357,4359,4361,4363,4365,4367;
// Item Price
setarray @ItemPrice[0],300,500,200,100,100,200;
return;
// Case 4,5,6.....etc...
default:
mes "Wrong Selection / Configurations";
close;
}
OnInit:
waitingroom "Donation Items Here",0;
end;
}
morocc,289,215,5 duplicate(Donation) - shop Donation -1,501:500 757
[/codeBOX]

i want to duplicate this npc.

i got this error: 71150467.jpg

i don't know what's wrong...sorry i'm still learning how to script, i'm not really good.

help would be appreciated.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

morocc,289,215,5 duplicate(Donation) - shop Donation -1,501:500 757

Change the second "Donation" to "Donation#2".

  • Upvote 1
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...