function script specialbox {
setarray .i1[0],909,910; // Common Items
set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items
setarray .i2[0],911,912; // Rare Items
set .i2rand,rand(0,1); // Randomize Rare Items; just change max amount if you add items
setarray .i3[0],2199,1599; // Super Rare Items
set .i3rand,rand(0,1); //Randomize Super Rare Items; just change max amount if you add items
set .chance, rand(100);
// Super Rare Item 1%
if (.chance == 50){
getitem .i[.i3rand],1;
announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i3rand])+"] from the Special Box.",0;
end;
}
// Rare Item 10%
else if (.chance <= 2 && .chance >= 11){
getitem .i[.i2rand],1;
announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i2rand])+"] from the Special Box.",0;
end;
}
// Common Items
else {
getitem .i1[.i1rand],1;
end; }
}
When I was get the Super Rare items prize my name come out on the announcement in server BUT it shown like this :
" [GameMaster] won a [null] from the Special Box. "
And I don't even receive the prize after I opened the box with the announcement.
May I know whats the problem?
[Error]: buildin_getitem: Nonexistant item 0 requested.
[Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)
This error found at the same time.
Please guide me what to do. Thanks!
P/S: If I post on the wrong section please move me to the correct one. Thank you!
Question
NoWayHome
Hi Guys,
This Script was found on the rathena.
I'm facing a problem on this script below:
function script specialbox { setarray .i1[0],909,910; // Common Items set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items setarray .i2[0],911,912; // Rare Items set .i2rand,rand(0,1); // Randomize Rare Items; just change max amount if you add items setarray .i3[0],2199,1599; // Super Rare Items set .i3rand,rand(0,1); //Randomize Super Rare Items; just change max amount if you add items set .chance, rand(100); // Super Rare Item 1% if (.chance == 50){ getitem .i[.i3rand],1; announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i3rand])+"] from the Special Box.",0; end; } // Rare Item 10% else if (.chance <= 2 && .chance >= 11){ getitem .i[.i2rand],1; announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i2rand])+"] from the Special Box.",0; end; } // Common Items else { getitem .i1[.i1rand],1; end; } }
50013,Special_Box,Special Present,2,10000,,100,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "specialbox",1; },{},{}
When I was get the Super Rare items prize my name come out on the announcement in server BUT it shown like this :
" [GameMaster] won a [null] from the Special Box. "
And I don't even receive the prize after I opened the box with the announcement.
May I know whats the problem?
[Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): FAKE_NPC (invisible/not on a map)
This error found at the same time.
Please guide me what to do. Thanks!
P/S: If I post on the wrong section please move me to the correct one. Thank you!
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.