I've recently implemented Druids Currency System perfectly and all's working well there just one
annoying thing and I can't for the life of me gear my brain up to deal with it so I'm hoping you
guy's can help point me in the right direction.
Here's the problem; With AutoGold switched on, it does 3 do_get's to recover the 3 coin types from
a corpse. Each attempt responds like below (Assuming there is no gold, 5 silver and no copper).
I see nothing like that in the corpse.
You get 5 silver coins from the corpse of the guard
I see nothing like that in the corpse.
I wish to stop it from reporting those lines concerning gold, silver and copper and replace it with:
You lift a coin purse from the corpse.
There is 0 Gold, 5 Silver and 0 Copper in the purse which you take.
I still want it to come up with the normal message's when looting gold from corpses and containers
(Treasure Chests and so on) when AutoGold is not on or is typed manually (get gold coins chest/corpse).
It's purely for AutoGold I would like the message to differ.
I know do_get use get_obj to recover the coins and add them to a player's total and I originally thought
that perhaps the answer lies there but the attempts I've tried to modify it to my needs have failed.
It's probably something simple like a couple of if/else if checks but I simply can't see it. Been staring
at it for a good 2 hour's now too, probably doesn't help.
Note: specific_damage is originally damage but I've modified the way my damage and combat flows in the mud.
So in case you was wondering why it was called that or where the damage function was, that's why.
Taken from fight.c
Function: specific_damage
annoying thing and I can't for the life of me gear my brain up to deal with it so I'm hoping you
guy's can help point me in the right direction.
Here's the problem; With AutoGold switched on, it does 3 do_get's to recover the 3 coin types from
a corpse. Each attempt responds like below (Assuming there is no gold, 5 silver and no copper).
I see nothing like that in the corpse.
You get 5 silver coins from the corpse of the guard
I see nothing like that in the corpse.
I wish to stop it from reporting those lines concerning gold, silver and copper and replace it with:
You lift a coin purse from the corpse.
There is 0 Gold, 5 Silver and 0 Copper in the purse which you take.
I still want it to come up with the normal message's when looting gold from corpses and containers
(Treasure Chests and so on) when AutoGold is not on or is typed manually (get gold coins chest/corpse).
It's purely for AutoGold I would like the message to differ.
I know do_get use get_obj to recover the coins and add them to a player's total and I originally thought
that perhaps the answer lies there but the attempts I've tried to modify it to my needs have failed.
It's probably something simple like a couple of if/else if checks but I simply can't see it. Been staring
at it for a good 2 hour's now too, probably doesn't help.
Note: specific_damage is originally damage but I've modified the way my damage and combat flows in the mud.
So in case you was wondering why it was called that or where the damage function was, that's why.
Taken from fight.c
Function: specific_damage
/* Autogold by Scryn 8/12 */
/* Gold/Copper/Silver Support -Druid */
if ( xIS_SET(ch->act, PLR_AUTOGOLD) )
{
init_gold = ch->gold;
init_silver = ch->silver;
init_copper = ch->copper;
/* This is the call to do_get which then cals get_obj which causes the message to appear. */
do_get( ch, "'gold coins' corpse" );
do_get( ch, "'silver coins' corpse" );
do_get( ch, "'copper coins' corpse" );
new_gold = ch->gold;
new_silver = ch->silver;
new_copper = ch->copper;
gold_diff = (new_gold - init_gold);
silver_diff = (new_silver - init_silver);
copper_diff = (new_copper - init_copper);
/* This is what I'd rather they see then the 3 messages of getting coins or not getting coins */
ch_printf( ch, "You lift a coin purse from the corpse.\n\r" );
ch_printf( ch, "There is %d Gold, %d Silver and %d Copper in the purse which you take.\n\r", gold_diff, silver_diff, copper_diff );
if (gold_diff > 0)
{
sprintf(buf1,"%d gold",gold_diff);
do_split( ch, buf1 );
}
if (silver_diff > 0)
{
sprintf(buf1,"%d silver",silver_diff);
do_split( ch, buf1 );
}
if (copper_diff > 0)
{
sprintf(buf1,"%d copper",copper_diff);
do_split( ch, buf1 );
}
}