914
edits
(Add exception to prevent summoningMaxhit from being seen as a combat stat for Familiars) |
(Add function to grab item value (sellsfor) based on item name or item object) |
||
(One intermediate revision by one other user not shown) | |||
Line 112: | Line 112: | ||
if result == nil and ZeroIfNil then result = 0 end | if result == nil and ZeroIfNil then result = 0 end | ||
return result | return result | ||
end | |||
function p.getItemValue(item) | |||
function isGP(itemName) | |||
return itemName == 'GP' or itemName == 'Gold Pieces' | |||
end | |||
if type(item) == 'string' then | |||
if isGP(item:upper()) then | |||
return 1 | |||
end | |||
item = p.getItem(item) | |||
end | |||
if item then | |||
return item.sellsFor | |||
end | |||
return nil | |||
end | end | ||
Line 171: | Line 191: | ||
-- the checked stat is summoningMaxhit, the result is ignored. | -- the checked stat is summoningMaxhit, the result is ignored. | ||
function isNonZeroStat(statName, statVal) | function isNonZeroStat(statName, statVal) | ||
if | if statName == 'summoningMaxhit' and (p._canItemUseSlot(item, 'Summon1') or p._canItemUseSlot(item, 'Summon2')) then | ||
return false | return false | ||
end | end |
edits