Jump to content
  • 0

@help using cash point to make quest


PapaZola

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

//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
Link to comment
Share on other sites

21 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

still have warning and debug

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

yeah

me already change

Link to comment
Share on other sites


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

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

hurmm

so its wont work?

Link to comment
Share on other sites


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

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

thx Kenpachi

its work fine

no more error

thx a lot to Kenpachi,Emistry,Variant

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

change

...1000,"Cash".....

to this

...0,"Cash".....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   0
  • Joined:  01/03/12
  • Last Seen:  

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
Link to comment

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   0
  • Joined:  01/03/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Any Error Shown ?? show it

and please use Codebox to wrap the script coz it is long..>.<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   0
  • Joined:  01/03/12
  • Last Seen:  

capture-20060110-133836.png

capture-20060110-133931.png

y cant get that ?? cash point me get .. all item get then exchange item not get .. -.-" help me emistry ..

sry bad english .. :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

change all

cash

to

#CASHPOINTS

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   0
  • Joined:  01/03/12
  • Last Seen:  

at where ??

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   0
  • Joined:  01/03/12
  • Last Seen:  

not working .. T.T

not working .. T.T

no working .. !!

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