I threw this together a couple weeks ago, after being inspired by playing the recent Leagues V release. An Echo Pickaxe equivalent for 2004!
varp config
[league_power_miner_rock]
type=int
dbtable config
[mining_table]
...
column=league_rock_name,string
column=league_smelt_product,namedobj
dbrow configs
[tin_rock_table]
table=mining_table
...
data=league_rock_name,tin rocks
[iron_rock_table]
table=mining_table
...
data=league_rock_name,iron rocks
data=league_smelt_product,steel_bar
[coal_rock_table]
table=mining_table
...
data=league_rock_name,coal rocks
obj config
// I just replaced the rune_pickaxe config to test, to do this properly:
// - create a new config
// - update pickaxe_checker.rs2 to register it for mining
// - macro_event_lost_pickaxe.rs2 if you want to support randoms breaking it
// - add a opheld2 trigger to check if the player can equip it
// - add a new seq holding the pickaxe
[rune_pickaxe]
...
name=Echo pickaxe
...
recol1s=15855
recol1d=8394
...
param=mining_rate,1
...
runescript
[label,get_ore_normal]
...
stat_advance(mining, db_getfield($data, mining_table:rock_exp, 0));
mes("You manage to mine some <db_getfield($data, mining_table:ore_name, 0)>.");
def_namedobj $product = db_getfield($data, mining_table:league_smelt_product, 0);
if ($product ! null) {
spotanim_pl(small_smokepuff, 124, 0);
// todo: call a smelting proc to get the real xp... scope creep is real
stat_advance(mining, 500);
} else {
$product = $output;
}
inv_add(bank, $product, 1);
mes("You bank the <oc_name($product)> you would have gained, giving you a total of <tostring(inv_total(bank, $product))>.");
%league_power_miner_rock = sub(%league_power_miner_rock, 1);
if (%league_power_miner_rock < 0) {
%league_power_miner_rock = 3;
}
def_string $rock_name = db_getfield($data, mining_table:league_rock_name, 0);
switch_int (%league_power_miner_rock) {
case 0 :
// deplete
def_int $respawn = divide(~scale_by_playercount(db_getfield($data, mining_table:rock_respawnrate, 0)), 2);
loc_change(loc_param(next_loc_stage_mining), $respawn);
anim(null, 0);
case 1 : mes("Your rock saving effect will not save the next <$rock_name>.");
case 2 : mes("Your rock saving effect will save the <$rock_name> from depleting for 1 more ore.");
case 3 : mes("Your rock saving effect will save the <$rock_name> from depleting for 2 more ores.");
}
if (%league_power_miner_rock > 0) {
p_oploc(1);
}
// copy above into get_ore_fast / get_ore_essence
The only thing I never got to was tracking each rock type as their own counter. I would guess they have a single varp and use a few bits for each rock – we don’t have varbits this early in 2004, so you’ll have to do it the manual way getting/settings bits.