Initial upload

Initial upload
This commit is contained in:
Jaysyn904
2023-09-25 18:13:22 -04:00
parent 684ef76c20
commit 499aba4eb3
5734 changed files with 4843758 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include "cs_misc_function"
void main()
{
object oPlayer = GetItemActivatedTarget();
int iGoldToTake = 10000;
int iGoldOnPlayer = GetGold(oPlayer);
int iGoldInBank = cs_GetGoldInBank(oPlayer);
object oActivator = GetItemActivator();
//
// Take the Gold from the player if they have enough to cover, if not, then
// take it from their bank account giving them a negative balance if necessary.
//
if (GetIsPC(oPlayer)) {
AssignCommand(oPlayer, TakeGoldFromCreature(iGoldToTake, oPlayer, TRUE));
if (iGoldOnPlayer < iGoldToTake) {
SendMessageToPC(oActivator, IntToString(iGoldOnPlayer) + " was taken from " + GetName(oPlayer) + ". The rest came out of their bank account.");
cs_SetGoldInBank(oPlayer, iGoldInBank - (iGoldToTake - iGoldOnPlayer));
} else {
SendMessageToPC(oActivator, IntToString(iGoldToTake) + " was taken from " + GetName(oPlayer));
}
GiveGoldToCreature(oActivator, iGoldToTake);
}
}