Re: Currency System

From: Mark Garringer (zizazat@HOTMAIL.COM)
Date: 10/05/02


>currency should be used. This is just a very new topic for me and Iīm not
>sure how I should proceede. I seached the archives for anything relavant to
>money, currency, and economy but didnīt really find anything that addressed
>this type of question.
>
>Any adivice (abtract or specific) would be wonderful!

Much to my suprise, this was easier than I thought I would be.

I defined my MONEY types.

I updated the player->points.gold from a plain (int) to an array (int gold
[NUM_MONEY]). Of course I updated the save/load parts of the ascii pfile to
support this also.

I defined an float array with the values of the currency in them and a char
array with the names.

I defined a GET_MONEY(ch, i) (ch->points.gold[i])

Updated the gold and score commands to do a for loop to print out which
currency types you have and how much.

I was really suprised that the hacks to shop.c were as easy as they were. I
created a function to conver the currency, and wrapped that around the
buy_price and sell_price, and then changed the GET_GOLD calls to GET_MONEY
calls and everything seems to be working fine.

About all I need to do now if finish changing all the GET_GOLD calls to
GET_MONEY, and make the db load of mobs take the set gold value they should
have and change it to whatever the regional currency type is.

--Ziz

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT