Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lhz_dun03,239,78,4 script Bio Entrance 651,{
- function F_Warp;
- if (countitem(4359) > 0) goto case_1;
- end;
- case_1:
- //F_Warp("<map>",<x>,<y>,<item 1 ID>,<item 1 amount>{,<item 2 ID>,<item 2 amount>{...}}
- F_Warp("lhz_dun04",244,61,4359,5,4357,5,4367,5,4365,5,4363,5,4361,5);
- end;
- function F_Warp {
- .@map$ = getarg(0,"");
- .@x = getarg(1,0);
- .@y = getarg(2,0);
- //This loop fills a array with all the needed items
- for(.@i = 3; .@i < getargcount(); .@i += 2) {
- .@items[.@i2] = getarg(.@i);
- .@amount[.@i2] = getarg(.@i + 1);
- .@i2++;
- }
- //This loop checks for each item needed
- for (.@i = 0; .@i < getarraysize(.@items); .@i++) {
- if (countitem(.@items[.@i]) < .@amount[.@i]) {
- if (!.@header) {
- mes "I don't have enough items to use this warp. I still need:";
- .@header = true;
- }
- mes .@amount[.@i] + " " + mesitemlink(.@items[.@i]);
- .@missing = true;
- }
- }
- if (.@missing) return;
- //This loop removes each item needed
- for (.@i = 0; .@i < getarraysize(.@items); .@i++)
- delitem .@items[.@i], .@amount[.@i];
- warp .@map$, .@x, .@y;
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement