I'm trying to get this NPC to check the items to make sure they are there and check zeny to make sure it's there. I can't seem to get the "getinventorylist" to work in my script no matter how I try to apply it. May anyone help me here? It keeps accepting Zeny without checking the items to make sure they are there.
//===== Heroes of Vanaheim Online =======================================
//= Item Quest
//============================================================
geffen,194,89,3 script Astrologer 64,{
setarray .@Items[0],501,1;
set .@n$,"[Astrologer]";
mes .@n$;
if(n_ring0 == 1) {
mes "You got them? You got them all? Terrific!";
close; }
mes "Oi, adventurer! I need some help.";
next;
if(select("What's up?:Nah.")==2) goto M_Leave;
mes .@n$;
mes "My magic isn't as strong enough to protect me against the new threats that dwell around...";
next;
mes .@n$;
mes "Please collect some materials for me to complete my.. rock collection.";
next;
if(select("Okay:No time")==2) goto M_Leave;
mes .@n$;
mes "I'll give you this ^FF0000Night Ring^000000. !";
next;
mes .@n$;
mes "Here's a list of the materials I need:";
mes "~ 300.000.000 Zeny";
for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+2) {
mes " ~ "+.@Items[.@i+1]+"x "+getitemname(.@Items[.@i]);
if (countitem(.@Items[.@i]) < .@Items[.@i+1]) set .@nr,1; }
next;
if(select("I got it all!:I'll go now.")==2) goto M_Leave;
mes .@n$;
if (.@nr) {
getinventorylist .@Items[.@i], .@Items[.@i+1];
if(Zeny < 300000000) goto Leave;
mes "You can't trick me! Go get those items.";
close; }
for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+2)
delitem .@Items[.@i], .@Items[.@i+1];
set Zeny, Zeny - 300000000;
getitem 35151,1;
announce "Congratulations!! ["+ strcharinfo(0) +"] has finished Item quest.",0;
set n_ring0, 1;
mes "Great job! You have all the items. Here are your ^FF0000Item^000000, as promised.";
emotion ET_CONGRATULATION;
close;
Leave:
mes .n$;
mes "Don't forget those stones. They are essential! ";
next;
M_Leave:
mes .@n$;
mes "Someone else will help, I'm sure...";
close;
OnInit:
waitingroom "Night Ring",0;
end;
}
Question
Rivers
I'm trying to get this NPC to check the items to make sure they are there and check zeny to make sure it's there. I can't seem to get the "getinventorylist" to work in my script no matter how I try to apply it. May anyone help me here? It keeps accepting Zeny without checking the items to make sure they are there.
//===== Heroes of Vanaheim Online ======================================= //= Item Quest //============================================================ geffen,194,89,3 script Astrologer 64,{ setarray .@Items[0],501,1; set .@n$,"[Astrologer]"; mes .@n$; if(n_ring0 == 1) { mes "You got them? You got them all? Terrific!"; close; } mes "Oi, adventurer! I need some help."; next; if(select("What's up?:Nah.")==2) goto M_Leave; mes .@n$; mes "My magic isn't as strong enough to protect me against the new threats that dwell around..."; next; mes .@n$; mes "Please collect some materials for me to complete my.. rock collection."; next; if(select("Okay:No time")==2) goto M_Leave; mes .@n$; mes "I'll give you this ^FF0000Night Ring^000000. !"; next; mes .@n$; mes "Here's a list of the materials I need:"; mes "~ 300.000.000 Zeny"; for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+2) { mes " ~ "+.@Items[.@i+1]+"x "+getitemname(.@Items[.@i]); if (countitem(.@Items[.@i]) < .@Items[.@i+1]) set .@nr,1; } next; if(select("I got it all!:I'll go now.")==2) goto M_Leave; mes .@n$; if (.@nr) { getinventorylist .@Items[.@i], .@Items[.@i+1]; if(Zeny < 300000000) goto Leave; mes "You can't trick me! Go get those items."; close; } for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+2) delitem .@Items[.@i], .@Items[.@i+1]; set Zeny, Zeny - 300000000; getitem 35151,1; announce "Congratulations!! ["+ strcharinfo(0) +"] has finished Item quest.",0; set n_ring0, 1; mes "Great job! You have all the items. Here are your ^FF0000Item^000000, as promised."; emotion ET_CONGRATULATION; close; Leave: mes .n$; mes "Don't forget those stones. They are essential! "; next; M_Leave: mes .@n$; mes "Someone else will help, I'm sure..."; close; OnInit: waitingroom "Night Ring",0; end; }
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.