Re: taxes
Michael Barton <[email protected]> Sat, 10 Dec 2005 14:42:08 -0600
| Newsgroups | gmane.games.devel.mud.rom |
|---|---|
| Message-ID | <[email protected]> |
That is strange, because it looks pretty good. This is one of those times that gdb is very helpful. If you don't know gdb, making a few send_to_char calls spread around there can tell you what parts of the code are being executed, what the values of variables are, etc. On 12/10/05, Maurice Visser <[email protected]> wrote: > I actually put my little code into the ITEM_MONEY > section there, but it doesn't seem to do anything. > Even without the check to see if it's coming from a > corpse. Strange. I'll keep looking. > > Maurice > > > > -----Original Message----- > > You can do it in do_get, search for ITEM_MONEY. It > should have something like: > if ( obj->item_type == ITEM_MONEY) > { > ch->silver += obj->value[0]; > ch->gold += obj->value[1]; > You might put something like this in next: > if (container && container->item_type == > ITEM_CORPSE_NPC) > { > ... > } > so it only affects money looted from mob corpses, not > money they drop > and pick up or whatever. > > Alternatively, you could work it into raw_kill in > fight.c, before the > call to make_corpse. In that case, you would pull the > money directly > from the mob's CHAR_DATA before it's made into a money > object. Then > the mob's gold would be in victim->gold. And there > wouldn't be an > obj. > > > On 12/10/05, Maurice Visser <[email protected]> wrote: > > Quick question. I'm trying to implement a clan tax > for > > my guild system. I'd like it to take clan.taxrate of > > the gold from killing a mob (mob's wealth) and put > it > > into the clan.account. I have the code set up > already. > > I'm just not sure where I have to put it. I'm > looking > > through do_get, but can't seem to figure it out. > > > > > > > > /* clan tax time */ > > > > > > > > if ( ( is_clan(ch) ) && > > ( > > clan_table[clan_lookup(player_clan(ch))].taxrate > 0 > ) > > ) > > { > > temp1 = ( obj->value[1] * > > /* <---- I need the variable name of the mob's > wealth > > */ > > ( > > clan_table[clan_lookup(player_clan(ch))].taxrate / > > 100) ); > > > > if ( (temp1 > .5) && (temp1 < 1) ) > > > > temp1 = 1; > > > > > > > > if ( (temp1 < .5) ) > > > > temp1 = 0; > > > > > > > > if ( temp1 > 0 ) > > > > { > > > > sprintf( buf, "{WYour clan taxes you > > {Y%d {Wcoins.{x\n\r", temp1 ); > > > > send_to_char( buf, ch ); > > > > > > > > > > clan_table[clan_lookup(player_clan(ch))].account += > > temp1; > > > > save_guilds( ch, "all" ); > > > > > > > > ch->gold -= temp1; > > > > } > > > > } > -- > ROM mailing list > [email protected] > Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom > -- ROM mailing list [email protected] Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom