Added increase_gold/bank funcs to prevent cash overflow

This commit is contained in:
JamDog 2010-11-26 14:08:54 +00:00
parent a95ac76ef7
commit 4892b22a51
13 changed files with 230 additions and 101 deletions

View file

@ -193,7 +193,7 @@ SPECIAL(dump)
if (GET_LEVEL(ch) < 3)
gain_exp(ch, value);
else
GET_GOLD(ch) += value;
increase_gold(ch, value);
}
return (TRUE);
}
@ -311,8 +311,8 @@ static void npc_steal(struct char_data *ch, struct char_data *victim)
/* Steal some gold coins */
gold = (GET_GOLD(victim) * rand_number(1, 10)) / 100;
if (gold > 0) {
GET_GOLD(ch) += gold;
GET_GOLD(victim) -= gold;
increase_gold(ch, gold);
decrease_gold(victim, gold);
}
}
}
@ -621,7 +621,7 @@ SPECIAL(pet_shops)
send_to_char(ch, "You don't have enough gold!\r\n");
return (TRUE);
}
GET_GOLD(ch) -= PET_PRICE(pet);
decrease_gold(ch, PET_PRICE(pet));
pet = read_mobile(GET_MOB_RNUM(pet), REAL);
GET_EXP(pet) = 0;
@ -674,8 +674,8 @@ SPECIAL(bank)
send_to_char(ch, "You don't have that many coins!\r\n");
return (TRUE);
}
GET_GOLD(ch) -= amount;
GET_BANK_GOLD(ch) += amount;
decrease_gold(ch, amount);
increase_bank(ch, amount);
send_to_char(ch, "You deposit %d coins.\r\n", amount);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (TRUE);
@ -688,8 +688,8 @@ SPECIAL(bank)
send_to_char(ch, "You don't have that many coins deposited!\r\n");
return (TRUE);
}
GET_GOLD(ch) += amount;
GET_BANK_GOLD(ch) -= amount;
increase_gold(ch, amount);
decrease_bank(ch, amount);
send_to_char(ch, "You withdraw %d coins.\r\n", amount);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (TRUE);