Jump to content
  • 0

@help using cash point to make quest


Question

Posted (edited)

//Made by Lunar
//Version 1.0
//12.28.08
- shop hat_shop -1,501:50
animeresort,163,187,4, script Hat Quest 479,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop",1;
npcshopattach "hat_shop";
end;

OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1),"Zeny"); set .e,.e+2) {}
npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"SZeny");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(Zeny < getarg(@i)) {
next;
mes "You do not have enough Zeny.";
mes "Please obtain ^FF0000" + (getarg(@i)-Zeny) + " more Zeny^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set Zeny,Zeny-getarg(@i);
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0),"announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000000,"SZeny",30169,1,"announce";

}
}

here script im using for quest

but i have some problem

how i can change 7227 to 100 cash point?

Edited by PapaZola

21 answers to this question

Recommended Posts

Posted

you can do in a easier way....

Change....

Change all "Zeny" into "Cash"

For Example :

for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);

set Zeny,Zeny-getarg(@i);

for(set @i,0; !compare(getarg(@i+1),"Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";

if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny";

into this

for(set @i,0; !compare(getarg(@i+1),"Cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );

for(set @i,0; !compare(getarg(@i+1),"Cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";

When setup.....do like this way... ( Change SZENY into Cash )

case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000,"Cash",30169,1,"announce";

Posted (edited)

1l10pn9gh9.png


//Made by Lunar
//Version 1.0
//12.28.08
- shop hat_shop -1,501:50
prontera,150,150,4, script Hat Quest 999,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop",1;
npcshopattach "hat_shop";
end;

OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1),"cash"); set .e,.e+2) {}
npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"Scash");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1),"cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1),"cash"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1),"cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0),"announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000,"Cash",30000,1,"announce";



}
}

got this error sir emistry

Edited by PapaZola
Posted (edited)

npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"Scash");

should be

npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1),"cash");

I'm pretty sure, if I'm reading this correctly.

Edited by vijay
Posted (edited)

Edit:

It should be "cash", not "Scash", don't change that back.

Also, those warnings are normal, compare is just telling you that you're comparing an int to a string, which isn't that bad (a conversion to a higher data type), it's because the script goes through the arguments until it hits the "Cash" argument, which is the only string, which is why you get all those messages beforehand (you'll basically get one of those messages per "Item,Price" you add).

So, it should be working fine, those messages don't pose a problem for you, unless you're extremely annoyed by it, in which case, I think there's an option somewhere to disable warnings...

I wonder if it'd be possible to cast integers as strings... hm, I guess you could always just make a temporary variable and set it equal to "" + getarg(.e+1), but uh, that sounds like too much extra trouble.

Edited by vijay
Posted

This error is caused by all calls of compare() inside your script.

compare() wants to compare two strings. Not an integer and a string.

Change the getarg(.e+1) and getarg(.e+0) inside the compare() functions to getarg(.e+1) + "" or getarg(.e+0) + "", this will force the script engine to cast it as string.

Posted

Here is an updated (but untested) version.

//Made by Lunar
//Version 1.0
//12.28.08
- shop hat_shop -1,501:50
prontera,150,150,4, script Hat Quest 999,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop",1;
npcshopattach "hat_shop";
end;
OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1) + "","cash"); set .e,.e+2) {}
npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1) + "","cash");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0) + "","announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000,"Cash",30000,1,"announce";
}
}

  • Upvote 2
Posted (edited)

regarding on the cash or zeny point in the case, what if i dont want any cash or zeny involved in the quest making, how can i remove the cash/zeny involvement /heh

Edited by LordOfHeRO
Posted (edited)

at the map server console, it was showing

[Warning]: itemdb_search: Item ID 0 does not exists in the item_db. Using dummy data.

ignore that error ? or troublesome ?

Edited by LordOfHeRO
Posted (edited) · Hidden by NeoGenesis, March 25, 2012 - no reason
Hidden by NeoGenesis, March 25, 2012 - no reason

my script not working .. how to fix that ?? can help me ?

this script not work in my server .. can help me how to fix that ??

//Made by Lunar
//Version 1.0
//12.28.08
- shop hat_shop -1,501:50
prontera,150,150,4, script Hat Quest 999,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop",1;
npcshopattach "hat_shop";
end;
OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1) + "","cash"); set .e,.e+2) {}
npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1) + "","cash");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0) + "","announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000,"Cash",30000,1,"announce";
}
}

//Made by Lunar
//Version 1.0
//12.28.08
- shop hat_shop -1,501:50
prontera,155,171,4 script Hat Quest 62,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop",1;
npcshopattach "hat_shop";
end;
OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1) + "","cash"); set .e,.e+2) {}
npcshopadditem "hat_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1) + "","cash");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0) + "","announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,7539,100,7420,120,7227,200,1000,"Cash",5170,1,"announce";
}
}

New_Quest1.txt

Edited by Arcenciel
Codeboxed
Posted (edited)

help me fix this .. all item have but no item get .. cash point problem .. have cash but item can get why ?? -.-"

//Made by Lunar
//Version 1.0
//12.28.08
-	shop	hat_shop3	-1,501:50
quiz_02,367,353,4	script	Hat Lower Quest	550,{
set @i,0;
mes "[shop Quest NPC]";
mes "Please Select Ur Item Quest?";
mes "Select only one.";
callshop "hat_shop3",1;
npcshopattach "hat_shop3";
end;
OnBuyItem:
if(.BuildQuest) {
for(set .e,0; !compare(getarg(.e+1) + "","cash"); set .e,.e+2) {}
npcshopadditem "hat_shop3",getarg(.e+2),getarg(.e)*compare(getarg(.e+1) + "","cash");
setarray .Shop[.i],getarg(.e+2);
set .i,.i+1;
goto Hat_Setup;
}
if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Hat_Setup; }
for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Hat_Setup; }
mes "[shop Quest NPC]";
mes "I require the following:";
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
if(getarg(@i)) mes "^FF0000" + ((#CASHPOINTS>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Cash Points";
mes "^000000In exchange, I will give you:^0000FF";
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
case 1:
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
next;
mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
close;
}
if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}
for(set @i,0; !compare(getarg(@i+1) + "","cash"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
set #CASHPOINTS,#CASHPOINTS - getarg( @i );
for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
if (compare(getarg(@i,0) + "","announce")) announce strcharinfo(0) + " Have Make Quest " + getitemname(@bought_nameid) + "!",bc_all;
close;
case 2:
set @bottomview, getlook(3);
set @topview, getlook(4);
set @midview, getlook(5);
addtimer 1000, strnpcinfo(3)+"::On_Leave";
set @equip,getiteminfo(@bought_nameid, 5);
set @view, getiteminfo(@bought_nameid, 11);
if(@equip != -1 && @view > 0) {
if(@equip & 1) atcommand "@changelook 3 " + @view;
if(@equip & 256) atcommand "@changelook 1 " + @view;
if(@equip & 512) atcommand "@changelook 2 " + @view;
}
next;
goto OnBuyItem;
case 3:
close;
}
On_Leave:
atcommand "@changelook 1 " + @topview;
atcommand "@changelook 2 " + @midview;
atcommand "@changelook 3 " + @bottomview;
set @equip,0;
set @view,0;
set @topview,0;
set @midview,0;
set @bottomview,0;
end;
OnInit:
npcshopitem "hat_shop3",0,0;
set .BuildQuest,1;
set .i,1;
Hat_Setup:
switch(.i) {
default: set .BuildQuest,0; set .e,0; set .i,0; end;
case 1: callsub OnBuyItem,671,500,673,500,674,500,675,500,677,500,7539,500,7420,300,7227,2000,30396,50,1000,"cash",30364,1,"announce";
}
}

Edited by Arcenciel
Codeboxed
Posted

at here

if(cash < getarg(@i)) {
next;
mes "You do not have enough cash.";
mes "Please obtain ^FF0000" + (getarg(@i)-cash) + " more cash^000000.";
close;
}

change all

cash

to

#CASHPOINTS

  • Upvote 1

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