mirror of
https://github.com/gooba42/AdventureLandScripts.git
synced 2026-10-14 11:59:30 -05:00
53 lines
1.4 KiB
JavaScript
53 lines
1.4 KiB
JavaScript
var hp_potion = 'hpot0'; //+200 HP Potion = 'hpot0', +400 HP Potion = 'hpot1' [always keep '' around it]
|
|
var mp_potion = 'mpot0'; //+300 MP Potion = 'mpot0', +500 MP Potion = 'mpot1' [always keep '' around it]
|
|
|
|
|
|
//Returns the item slot and the item given the slot to start from and a filter.
|
|
function find_item_filter(filter, search_slot) {
|
|
let slot = search_slot;
|
|
if (!slot)
|
|
slot = 0
|
|
|
|
for (let i = slot; i < character.items.length; i++) {
|
|
let item = character.items[i];
|
|
|
|
if (item && filter(item))
|
|
return [i, character.items[i]];
|
|
}
|
|
|
|
return [-1, null];
|
|
}
|
|
|
|
//Returns the item information from parent.G.items of the item.
|
|
function item_info(item) {
|
|
return parent.G.items[item.name];
|
|
}
|
|
|
|
function isInsideBank() {
|
|
//!character.bank
|
|
return character.map === "bank";
|
|
}
|
|
|
|
function depositItems() {
|
|
set_message("GT Bank");
|
|
smart_move({to: "bank"});
|
|
if (isInsideBank()) {
|
|
if (character.esize === 42) return; //empty inventory
|
|
for (item in character.items) {
|
|
if (item == 0) continue;
|
|
if (!character.items[item]) continue;
|
|
bank_store(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
function turnStuffIn() {
|
|
use_skill("town");
|
|
send_gold("TradeyBoy", 1000000);
|
|
if (character.esize === 42) return; //empty inventory
|
|
for (item in character.items) {
|
|
//if (item == 0) continue;
|
|
if (!character.items[item]) continue;
|
|
send_item("TradeyBoy", item);
|
|
}
|
|
} |