Jump to content

.Devil.

Inactive Member
  • Posts

    64
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by .Devil.

  1. + Open shop.cpp
    + Search for CShop::Buy(LPCHARACTER ch, BYTE pos)
    + After:

    if (pos >= m_itemVector.size())
        {
            sys_log(0, "Shop::Buy : invalid position %d : %s", pos, ch->GetName());
            return SHOP_SUBHEADER_GC_INVALID_POS;
        }

    put:

    if (IsPCShop() && ch->GetGMLevel() > GM_PLAYER)
            return SHOP_SUBHEADER_GC_SOLD_OUT;

    I haven't tested it but should work.

    • Love 2
  2. Because not all compiler works with them nested. You can't, anyway, make a function inside another function (I've write this in the previous post but I was referring to local classes/structs).. For example with C++98 you can call/declare struct/classes only from the function where they are declared (but not as argument for another function, like you did). 

    • Love 1
  3.  

    struct FuncPurgeOnGround
    {
        void operator () (LPENTITY ent)
        {
            if (!ent->IsType(ENTITY_ITEM))
                return;
    
            M2_DESTROY_ITEM((LPITEM) ent);
        }
    };
    
    ACMD(do_purge_on_ground)
    {
        FuncPurgeOnGround func;
        
        LPSECTREE sectree = ch->GetSectree(); // only current map
        if (sectree)
            sectree->ForEachAround(func);
        else
            sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY());
    }

     

     

     

    • Love 1
  4. In char.cpp

    int CHARACTER::GetLimitPoint(BYTE type) const

    search:

    case POINT_ATT_SPEED:
                min_limit = 0;

                if (IsPC())
                    limit = 170;

    and change the 170 as you want.

     

    Its not work for me, more than 255+ bugg.

    It is not a bug. You must change the attack speed's data type in packets like TPacketGCCharacterUpdate and TPacketGCCharacterAdd.

    Poorly written, it was about the error.

    So.. what is your bug? I don't understand you and your problem, really.
    You want to increase attack speed.. so.. I replied why more than 255 doesn't work. I don't replied why there are crash..

    In any case, guys, you have to read about ani.cpp. If you want to decrease ninja's crashes try editing GET_ATTACK_SPEED's battle.cpp function.

    DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
    {
        if (NULL == ch)
            return 1000;
    
    	LPITEM item = ch->GetWear(WEAR_WEAPON);
    	DWORD default_bonus = SPEEDHACK_LIMIT_BONUS;    // 유두리 공속(기본 80)
    	DWORD riding_bonus = 0;
    
    	if (ch->IsRiding())
    	{
    		// 뭔가를 탔으면 추가공속 50
    		riding_bonus = 50;
    	}
    
    	DWORD ani_speed = ani_attack_speed(ch);
        DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
    
    	// 단검의 경우 공속 2배
    	if (item && item->GetSubType() == WEAPON_DAGGER)
    		real_speed /= 2;
    
        return real_speed;
    }

    To:

    DWORD GET_ATTACK_SPEED(LPCHARACTER ch)
    {
        if (NULL == ch)
            return 1000;
    
    	LPITEM item = ch->GetWear(WEAR_WEAPON);
    	DWORD default_bonus = SPEEDHACK_LIMIT_BONUS;    // 유두리 공속(기본 80)
    	DWORD riding_bonus = 0;
    
    	if (ch->IsRiding())
    	{
    		// 뭔가를 탔으면 추가공속 50
    		riding_bonus = 50;
    	}
    
    	DWORD ani_speed = ani_attack_speed(ch);
        DWORD real_speed = (ani_speed * 100) / (default_bonus + ch->GetPoint(POINT_ATT_SPEED) + riding_bonus);
    
        return real_speed;
    }

    But I think this is a wrong way to do this..
    Another thing you can do it is to disable the speed hack. But the same, it is the wrong way. The "right" thing to do is, in my opinion, editing combo_%d.msa in /data/(pc|pc2)/(asssin|shaman|...), but for this you need to understand how ani.cpp works. I've never tried to edit these files, so this method is not tested.

  5. In char.cpp

    int CHARACTER::GetLimitPoint(BYTE type) const

    search:

    case POINT_ATT_SPEED:
                min_limit = 0;

                if (IsPC())
                    limit = 170;

    and change the 170 as you want.

     

    Its not work for me, more than 255+ bugg.

    It is not a bug. You must change the attack speed's data type in packets like TPacketGCCharacterUpdate and TPacketGCCharacterAdd.

  6.  

     

    Hi all I have 2 questions for you guys:

    1º How can I see all config comands like, because I have allwip source but I dont know all config he have.

    eb40fb979a7dd9ec9024a945a85a5455.png

    2º How can I change the revision when I compile the game.

    P.D: I am new in this soo all help is good :D. Thanks for all

    1. open config.cpp and find config_load() or sth like that with "load" in name. You will see TOKEN("x") where x is a config input (in ex., START_LEVEL as shown on image)

    2. version.cpp file

     

    2º 

    fprintf(fp, "game perforce revision: %sn", __P4_VERSION__);
    fprintf(fp, "%s@%s:%sn", __USER__, __HOSTNAME__, __PWD__);
    fclose(fp);
     
    If i delet p4_version and put hm some numbers is ok?

     

    It's ok, but as string. If you'll need to write an integer change

    game perforce revision: %sn
    

    to

    game perforce revision: %dn
    
  7. I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found.

    Also, if I am trying to use game.core it says that this file does not exists.

    I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag.

    You need to read the core as i386 (x86). You can use:

    set gnutarget i386-marcel-freebsd
    file game
    core game.core
    [...]
    
    • Love 1
  8. About my method? It's a simple string manipulation.

    About that tool? I think it's a very good tool and if you want (and can) you can do many things with it. Personally, I've released one version some time ago in another forum that work only with a config file and that you can use from command line (e.g. PackMaker.exe --create <folder name> <iv name>).

    It supports types 3, 4 and the others. It also use a text file to pack a folder in a encrypted file (eix / epk). In conclusion, you can do anything you want.

  9.  

     

    for (i = 0; i < INVENTORY_MAX_NUM / 4; ++i)         // 0 to 45 (OK!)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid1.Put(i, 1, item->GetSize());
    }
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG!)(You're putting items of third and fourth inventory in the second!)(Right: 45 to 90)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid2.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
    }
    
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG!)(You're putting items of fourth inventory in the third!)(Right: 90 to 135)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid3.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
    }
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG! You're putting items of second and third inventory in the fourth!)(Right: 135 to 180)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid4.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
    }
    

    I think there is an error with exchange

    . (I've commented where're the issues.)

    And there left some checks of free space (always in CExchange::CheckSpace()).

     

    Yes of course.

     

    this was already solved by Zonni

    on the 9th and 11th pages of this topic

     

    Sorry, i've not noticed it, i watched only the first post.

    int iPos = s_grid1.FindBlank(1, item->GetSize());
       if (iPos >= 0)
       {
        s_grid1.Put(iPos, 1, item->GetSize());
       }
       else
       {
        iPos = s_grid2.FindBlank(1, item->GetSize());
        if (iPos >= 0)
        {
         s_grid2.Put(iPos, 1, item->GetSize());
        }
        else
        {
         iPos = s_grid3.FindBlank(1, item->GetSize());
         if (iPos >= 0)
         {
          s_grid3.Put(iPos, 1, item->GetSize());
         }
         else
         {
          iPos = s_grid4.FindBlank(1, item->GetSize());
          if (iPos >= 0)
          {
           s_grid4.Put(iPos, 1, item->GetSize());
          }
          else
          {
           iPos = s_grid5.FindBlank(1, item->GetSize());
           if (iPos >= 0)
           {
            s_grid5.Put(iPos, 1, item->GetSize());
           }
           else
           {
            return false;
           }
          }
         }
        }
       }
    

    Insted of this you can put the grids in array and after loop it. 

  10. for (i = 0; i < INVENTORY_MAX_NUM / 4; ++i)         // 0 to 45 (OK!)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid1.Put(i, 1, item->GetSize());
    }
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG!)(You're putting items of third and fourth inventory in the second!)(Right: 45 to 90)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid2.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); // (WRONG!)
    }
    
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG!)(You're putting items of fourth inventory in the third!)(Right: 90 to 135)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid3.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); // (WRONG!)
    }
    for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i) // 45 to 180 (WRONG! You're putting items of second and third inventory in the fourth!)(Right: 135 to 180)
    {
    	if (!(item = victim->GetInventoryItem(i)))
    		continue;
    
    	s_grid4.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize()); // (WRONG!)
    }
    

    I think there is an error with exchange. (I've commented where're the issues.)

    And there left some checks of free space (always in CExchange::CheckSpace()).

     

    --- Update ---

    static CGrid s_grid1(5, INVENTORY_MAX_NUM/5 / 2); // inven page 1
    static CGrid s_grid2(5, INVENTORY_MAX_NUM/5 / 2); // inven page 2
    static CGrid s_grid3(5, INVENTORY_MAX_NUM/5 / 2); // inven page 3
    static CGrid s_grid4(5, INVENTORY_MAX_NUM/5 / 2); // inven page 4
    

    This must be:

    static CGrid s_grid1(5, INVENTORY_MAX_NUM/5 / 4); // inven page 1
    static CGrid s_grid2(5, INVENTORY_MAX_NUM/5 / 4); // inven page 2
    static CGrid s_grid3(5, INVENTORY_MAX_NUM/5 / 4); // inven page 3
    static CGrid s_grid4(5, INVENTORY_MAX_NUM/5 / 4); // inven page 4
    
    
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.