Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Help with bounty/cash items in shop

Junior Spellweaver
Joined
Nov 20, 2017
Messages
146
Reaction score
19
Hi Ragezone,
i am trying to change all bounty items to "FREE"
I want you to show up at the shop, like:

PkHMHpB - Help with bounty/cash items in shop - RaGEZONE Forums


I know this is where you edit this, but I don't know how to do it
i want something like
if cash (price, currency)
else (free)


PHP:
const char* szCurrency = bCash ? ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
    sprintf(sz, "%d %s", nPrice, szCurrency); //how can i separate cash from free?
    strcat(szBuf, sz);
    return szBuf;

Anyone who knows programming well, how do I do it?



const char* IShopEquipItemHandle_Purchase::GetPriceText( char* szBuf )
{
szBuf[0]=0;

bool bCash;
int nRentHour;
int nPrice;
if (!GetPrice(bCash, nRentHour, nPrice))
return szBuf;

char sz[256];
if (nRentHour != 0)
{
sprintf(sz, "(%d%s) ", nRentHour / 24, ZMsg(MSG_CHARINFO_DAY));
strcat(szBuf, sz);
}

const char* szCurrency = bCash ? ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
sprintf(sz, "%d %s", nPrice, szCurrency);
strcat(szBuf, sz);
return szBuf;
}
 

Attachments

You must be registered for see attachments list
Joined
Jul 11, 2012
Messages
786
Reaction score
190
I don't really remember GunZ source code files. But if you want to make all bounty items free for everyone, there is much easier way to do so.

If I recall right, you could just edit zitem.xml file (if I'm not mistaken, or shop.xml if I was) and make all items have 1 bounty (not 0, since there is something to do with SQL, that won't let 0 work), you can replace everything at once by using CTRL+H (however, find a unique text which won't miss up the whole file).
And all you need to do next is just edit the database, on creating a new character, such that when it does, it gives him like 99999 bounty or something.
Try searching for that I think there is a tutorial for it somewhere in the forums.

Now, every player can get any bounty item with "free" bounty.

If that's not what you're looking for, then I won't really be much of a help.
Sorry I come by here once in a while when I'm bored, and I try to help (with the stuff I remember)
Have a great day
 
Upvote 0
Junior Spellweaver
Joined
Nov 20, 2017
Messages
146
Reaction score
19
it was easier than i imagined!I asked some university friends for help, and they told me to do that:
change the value of the bounty items to 0, and write the following code
PHP:
if(nPrice == 0)
{
   sprintf(sz, "FREE");
   strcat(szBuf, sz);}

else
{
   const char* szCurrency = bCash ? ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
   sprintf(sz, "%d %s", nPrice, szCurrency);    strcat(szBuf, sz);    return szBuf;
}

then any item worth 0 it will be FREE
 
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
293
Reaction score
86
it was easier than i imagined!I asked some university friends for help, and they told me to do that:
change the value of the bounty items to 0, and write the following code
PHP:
if(nPrice == 0)
{
   sprintf(sz, "FREE");
   strcat(szBuf, sz);}

else
{
   const char* szCurrency = bCash ? ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
   sprintf(sz, "%d %s", nPrice, szCurrency);    strcat(szBuf, sz);    return szBuf;
}

then any item worth 0 it will be FREE

What code is this crazy '-'
It is easier for you to do it this way.
PHP:
if (bCash)
{            
    sprintf(sz, "%d %s", nPrice, "Cash");    
}
else{    
    sprintf(sz, "%s", "FREE");
}      
    strcat(szBuf, sz);
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
293
Reaction score
86
How to implement this to the source Orby? The code that you said.
The right place is at ZShopEquipItem.cpp
Search:
Code:
const char* IShopEquipItemHandle_Purchase::GetPriceText(char* szBuf)
:thumbup1:
 
Upvote 0
Newbie Spellweaver
Joined
Nov 25, 2016
Messages
69
Reaction score
0
good, could you pass me the cash in shop code please if it weren't a nuisance, and if it also works in vs2003 ?, thanks
.
 
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
293
Reaction score
86
good, could you pass me the cash in shop code please if it weren't a nuisance, and if it also works in vs2003 ?, thanks
.
I recommend using a more updated VS for a better job, but it also works in 2003.
 
Upvote 0
Back
Top