IF
ObjectFlagSet("HEA_DBG_GiveGold", _Player, _ID)
AND
DB_HEA_DBG_GoldGiven(_Player, _Count)
AND
_Count < 5000
AND
IntegerSum(_Count, 250, _Sum)
THEN
CharacterAddGold((CHARACTERGUID)_Player, 250);
ObjectClearFlag(_Player, "HEA_DBG_GiveGold", _ID);
NOT DB_HEA_DBG_GoldGiven(_Player, _Count);
DB_HEA_DBG_GoldGiven(_Player, _Sum);