1-the npc is hiding how to enable it and how to hide the npc again ?
2- can you please make it if the player's weight more than 30% player cant get reward until he put all he's items in storage and back with less than 30% weight
3- can you make if players got the rewards they cant get it again even if they relog !!
prontera,152,183,4 script Reward Giver 83,{
.@name$ = " ^993300[Your NPC name]^000000";
for (.@i = 0 ; .@i < getarraysize(.prize)/2 ; .@i++) .@max += pow(2,.@i);
if (@rewardN == .@max) { mes .@name$,"I already gave you everything I have." ; close; }
deletearray @reward , getarraysize(@reward);
@duprewardN = @rewardN;
for (.@i = (getarraysize(.prize)-1)/2 ; .@i >= 0 ; .@i--) {
if (@duprewardN < pow(2,.@i)) { setarray @reward[.@i] , 1 ; .@n++; }
else @duprewardN -= pow(2,.@i) ;
}
mes .@name$;
mes "Hello "+strcharinfo(0)+". I have "+(.@n>1?"those":"this")+" item"+(.@n>1?"s":"")+" for you :";
for (.@i = 0 ; .@i < getarraysize(.prize)/2 ; .@i++)
if (@reward[.@i]) { mes "^0000ff"+.prize[(.@i*2)+1]+"^000000 ^ff3300"+getitemname(.prize[.@i*2])+"^000000" ; .@menu$ = .@menu$ +(.@i!=0?":":"")+ getitemname(.prize[.@i*2]); }
if (.@n > 1) .@menu$ = .@menu$ + ":Everything";
mes "What do you want?";
next;
.@select = select(.@menu$);
if (.@select != (.@n+1)) {
if (!checkweight(.prize[(.@select-1)*2],.prize[((.@select-1)*2)+1])) { mes .@name$,"You can't carry it, please come back lighter." ; close; }
@rewardN += .@select;
getitem .prize[(.@select-1)*2],.prize[((.@select-1)*2)+1];
mes .@name$;
mes "Here you go.";
close;
}
else {
for (.@i = 0 ; .@i < getarraysize(@reward) ; .@i++)
if (@reward[.@i]) { setarray .@duparray[getarraysize(.@duparray)] , .prize[.@i*2] ; setarray .@duparray2[getarraysize(.@duparray2)] , .prize[(.@i*2)+1]; }
if (!checkweight2(.@duparray,.@duparray2)) { mes .@name$,"You can't carry it, please come back lighter." ; close; }
@rewardN = .@max;
for (.@i = 0 ; .@i < getarraysize(.@duparray) ; .@i++) getitem .@duparray[.@i],.@duparray2[.@i];
mes .@name$;
mes "Here you go.";
close;
}
OnInit:
hideonnpc strnpcinfo(0);
//setarray .prize <item id>,<amount> , <item id>,<amount> {, <item id>,<amount> {...}};
setarray .prize , 512,10 , 513,20 , 514,30;
bindatcmd "reward",strnpcinfo(0)+"::OnReward",40,40;
end;
OnReward:
hideoffnpc strnpcinfo(0);
addrid(0);
@rewardN = 0;
announce "<Your announce here>",0;
end;
}
Question
Earnestinence
Hi guys
i got some questions for this script
1-the npc is hiding how to enable it and how to hide the npc again ?
2- can you please make it if the player's weight more than 30% player cant get reward until he put all he's items in storage and back with less than 30% weight
3- can you make if players got the rewards they cant get it again even if they relog !!
Thanks to Kurofly for making this script !
Edited by Ciel PhantomhiveLink to comment
Share on other sites
0 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.