Golden Decoration v1
851
lvl: 23

ID:

61

Author:

Boekie

Rarity:

unique

Status:

Approved

Description:

This decoration is so expensive that it is only used by kings.

Latest Upload Comment:

Restored from 1.10
Rich
Whilst carried by a tower, this item increases the interest rate of the player by [0.4 x carrier's goldcost / 2500]%.
Specials:
+10% bounty collected (+0.4%/lvl)
Download

Toggle Triggers

Header

goldcost: 0
    globals
        MultiboardValues InterestBonusMB
    endglobals
    
    //Do not remove or rename this function!
    //Put your initialization tasks here, this function will be called on map init
    private function init takes nothing returns nothing
        set InterestBonusMB = MultiboardValues.create(1)
        call InterestBonusMB.setKey(0,"Interest Bonus")
    endfunction

On Item Creation

goldcost: 0
function onCreate takes Item itm returns nothing
set itm.userReal = 0
endfunction

On Item Drop

goldcost: 0
function onDrop takes Item itm returns nothing
call itm.getOwner().modifyInterestRate(-itm.userReal)
endfunction

On Item Pickup

goldcost: 750
function onPickup  takes Item itm returns nothing
local Tower tower = itm.getCarrier()

set itm.userReal = 0.004 * (tower.getGoldcost() / 2500.0)
call itm.getOwner().modifyInterestRate(itm.userReal)
endfunction

On Tower Details

goldcost: 0
function onTowerDetails takes Item itm returns MultiboardValues
    call InterestBonusMB.setValue(0, formatPercent(itm.userReal, 3))
    return InterestBonusMB
endfunction