prontera,133,217,5 script Item Test 4_M_MANAGER,{
getinventorylist;
for (.@i = 0; .@i < @inventorylist_count; .@i++) {
.@id = @inventorylist_id[.@i];
.@inventory_amount = @inventorylist_amount[.@i];
.@is_equipped = @inventorylist_equip[.@i];
.@is_refined = @inventorylist_refine[.@i];
.@is_carded = @inventorylist_card1[.@i];
mes getitemname(.@id) + ": ID=" + .@id + ", equipped=" + .@is_equipped + ", refined=" + .@is_refined + ", carded=" + .@is_carded;
.@storage_count = getd("$global_storage" + .@id);
if (!.@is_equipped) {
setd("$global_storage" + .@id, .@storage_count + .@inventory_amount);
}
mes .@storage_count + " -> " + getd("$global_storage" + .@id);
}
close;
}
I wrote a small script to see the contents of the arrays that are populated by getinventorylist.
The first time I speak to the NPC on a character, I get the output that I expect.
However, every subsequent attempt to speak to the NPC, nothing happens. A dialogue box doesn't open, and no errors are logged in the console. If I restart the server, the NPC still won't talk to me. If I make a new character, then the NPC will talk to me exactly one time again.
Does anyone know why this might be?
EDIT: You can remove this thread, in my loop header I had a typo:
getinventorylist;
for (.@i = 0; .@i < @inventorylist_count; .@i++) {
.@id = @inventorylist_id[.@i];
.@inventory_amount = @inventorylist_amount[.@i];
.@is_equipped = @inventorylist_equip[.@i];
.@is_refined = @inventorylist_refine[.@i];
.@is_carded = @inventorylist_card1[.@i];
mes getitemname(.@id) + ": ID=" + .@id + ", equipped=" + .@is_equipped + ", refined=" + .@is_refined + ", carded=" + .@is_carded;
.@storage_count = getd("$global_storage" + .@id);
if (!.@is_equipped) {
setd("$global_storage" + .@id, .@storage_count + .@inventory_amount);
}
mes .@storage_count + " -> " + getd("$global_storage" + .@id);
}
close;
}
I wrote a small script to see the contents of the arrays that are populated by getinventorylist.
The first time I speak to the NPC on a character, I get the output that I expect.
However, every subsequent attempt to speak to the NPC, nothing happens. A dialogue box doesn't open, and no errors are logged in the console. If I restart the server, the NPC still won't talk to me. If I make a new character, then the NPC will talk to me exactly one time again.
Does anyone know why this might be?
EDIT: You can remove this thread, in my loop header I had a typo:
Code:
for (.@i = 0; i < @inventorylist_count; i++)
Last edited by a moderator: