Help with bounty/cash items in shop

Results 1 to 8 of 8
  1. #1
    Proficient Member Pain is offline
    MemberRank
    Nov 2017 Join Date
    narutoverse lolLocation
    150Posts

    config Help with bounty/cash items in shop

    Hi Ragezone,
    i am trying to change all bounty items to "FREE"
    I want you to show up at the shop, like:



    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 Code:
    const charszCurrency bCash ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
        
    sprintf(sz"%d %s"nPriceszCurrency); //how can i separate cash from free?
        
    strcat(szBufsz);
        return 
    szBuf


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


    - - - Updated - - -

    Spoiler:
    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;
    }


  2. #2
    Yaaay! Tannous is offline
    MemberRank
    Jul 2012 Join Date
    KonohaLocation
    840Posts

    Re: Help with bounty/cash items in shop

    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

  3. #3
    Proficient Member Pain is offline
    MemberRank
    Nov 2017 Join Date
    narutoverse lolLocation
    150Posts

    Re: Help with bounty/cash items in shop

    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 Code:
    if(nPrice == 0)
    {
       
    sprintf(sz"FREE");
       
    strcat(szBufsz);}

    else
    {
       const 
    charszCurrency bCash ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
       
    sprintf(sz"%d %s"nPriceszCurrency);    strcat(szBufsz);    return szBuf;

    then any item worth 0 it will be FREE

  4. #4
    Orby? Orby ? @-@ Orby is offline
    MemberRank
    Oct 2015 Join Date
    AstraLocation
    277Posts

    Re: Help with bounty/cash items in shop

    Quote Originally Posted by Pain View Post
    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 Code:
    if(nPrice == 0)
    {
       
    sprintf(sz"FREE");
       
    strcat(szBufsz);}

    else
    {
       const 
    charszCurrency bCash ZMsg(MSG_CHARINFO_CASH) : ZMsg(MSG_CHARINFO_BOUNTY);
       
    sprintf(sz"%d %s"nPriceszCurrency);    strcat(szBufsz);    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 Code:
    if (bCash)
    {            
        
    sprintf(sz"%d %s"nPrice"Cash");    
    }
    else{    
        
    sprintf(sz"%s""FREE");
    }      
        
    strcat(szBufsz); 
    Last edited by Orby; 23-04-20 at 06:48 PM.

  5. #5
    Valued Member Zer0nix is online now
    MemberRank
    Aug 2020 Join Date
    109Posts

    Re: Help with bounty/cash items in shop

    How to implement this to the source Orby? The code that you said.

  6. #6
    Orby? Orby ? @-@ Orby is offline
    MemberRank
    Oct 2015 Join Date
    AstraLocation
    277Posts

    Re: Help with bounty/cash items in shop

    Quote Originally Posted by Zer0nix View Post
    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)

  7. #7
    Member Gunzlatinov3 is offline
    MemberRank
    Nov 2016 Join Date
    PeruLocation
    74Posts

    Re: Help with bounty/cash items in shop

    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
    .

  8. #8
    Orby? Orby ? @-@ Orby is offline
    MemberRank
    Oct 2015 Join Date
    AstraLocation
    277Posts

    Re: Help with bounty/cash items in shop

    Quote Originally Posted by Gunzlatinov3 View Post
    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.



Advertisement