Jump to content

hachiwari

Active Member
  • Posts

    299
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by hachiwari

  1. Check with 

    for i in range(0,90*2):
            attachedSlotType = player.INVENTORY
            attachedInvenType = player.SlotTypeToInvenType(attachedSlotType)
            itemVnum = player.GetItemIndex(attachedInvenType, i)
    
    	if itemVnum == SWITCH_RARE_VNUM:
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "Odłamek znaleziony")
                    net.SendExchangeItemAddPacket(attachedInvenType, i, exslot)
    		exslot += 1
    

     

  2. 6 godzin temu, Raylee napisał:

    Why are you criticizing someone who tries to share a work for the community what he has created?
    I didn't take a look on the code..

    But why you don't give any code improvement suggestions?
    That would help the creators more to understand how to do something better!
    Your comment is meaningless in this regard!

    You have never released anything... I can't understand why you can't say just thank you ..



    P.S:
    @Whisy thank you for the release :)


    Best regards
    Raylee

    Sorry, but my level of english doesnt allow me to write all suggestions :X I write only simple opinion.

    I didnt released, hmm.. because I think same about my code :)

     

    // edit

     I think that it will be better if my code is on gitlab as private repository xd And i published some topics, but not here, only worse forum .I hope you will undestand me.

    • Love 1
  3. 2 minuty temu, .Elijah napisał:

    I actually have a 512MB ram VPS and everything is working good.

    The code can be improved. Now is working just fine. If you don't want to use it just don't use it.

     

    dont be negative about our comments, its not hate :/

    • Love 1
  4. 	std::string NumberToMoneyString(long long n)
    {
        std::string s;
        int cnt = 0;
        do
        {
            s.insert(0, 1, char('0' + n % 10));
            n /= 10;
    	        if (++cnt == 3 && n)
            {
                s.insert(0, 1, '.');
                cnt = 0;
            }
        } while (n);
    	    return s;
    }
    	

    whose better?

  5. 23 godziny temu, xP3NG3Rx napisał:

    Me neither see the server side codes why :unsure:.

    Also the official version is client side only.

    Anyway thanks.

      Odkryj ukrytą treść
    
    
                        {'name': 'ELEMENT_IMG_PATH',
                         'type': 'dict',
                         'value': {2048: 'd:/ymir work/ui/game/12zi/element/elect.sub',
                                   4096: 'd:/ymir work/ui/game/12zi/element/fire.sub',
                                   8192: 'd:/ymir work/ui/game/12zi/element/ice.sub',
                                   16384: 'd:/ymir work/ui/game/12zi/element/wind.sub',
                                   32768: 'd:/ymir work/ui/game/12zi/element/earth.sub',
                                   65536: 'd:/ymir work/ui/game/12zi/element/dark.sub'}},
    
    
    int __cdecl nonplayerGetAttElementFlagByVID(int a1, int a2)
    {
    	int iVID; // [esp+1Ch] [ebp-Ch]
    	int dwVnum; // [esp+20h] [ebp-8h]
    	_DWORD *pCInstanceBase; // [esp+24h] [ebp-4h]
    
    	if ( !PyTuple_GetULong(a2, 0, &dwVnum) )
    		return Py_BuildException(0);
    	pCInstanceBase = (_DWORD *)(*(int (__thiscall **)(signed int, int))(MEMORY[4] + 8))(4, dwVnum);
    	if ( !pCInstanceBase )
    		return python27_Py_BuildValue("i", 0);
    	iVID = CInstanceBase::GetVirtualNumber(pCInstanceBase);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 2048) )
    		return python27_Py_BuildValue("i", 2048);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 4096) )
    		return python27_Py_BuildValue("i", 4096);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 8192) )
    		return python27_Py_BuildValue("i", 8192);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 16384) )
    		return python27_Py_BuildValue("i", 16384);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 32768) )
    		return python27_Py_BuildValue("i", 32768);
    	if ( CPythonNonPlayer::IsRaceFlagByVnum(0, iVID, 65536) )
    		return python27_Py_BuildValue("i", 65536);
    	return python27_Py_BuildValue("i", 0);
    }
    
    bool __thiscall CPythonNonPlayer::IsRaceFlagByVnum(char *this, int a2, int a3)
    {
    	int v4; // [esp+4h] [ebp-8h]
    	bool v5; // [esp+Bh] [ebp-1h]
    
    	v4 = CPythonNonPlayer::GetTable(this, a2);
    	if ( v4 )
    		v5 = (a3 & *(_DWORD *)(v4 + 84)) != 0;
    	else
    		v5 = 0;
    	return v5;
    }
    
    /*
    Why I'm sure in that the +84 is the race flag?
    	fprintf(f, "vnum = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "name = %s\n", buf);
    	buf += 25;
    	fprintf(f, "localized_name = %s\n", buf);
    	buf += 25;
    	fprintf(f, "type = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "rank = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "battle_type = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "level = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "scale = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "size = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "gold_min = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "gold_max = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "exp = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "max_hp = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "regen_cycle = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "regen_pct = %d\n", (*(BYTE*)buf));
    	buf += 1;
    	fprintf(f, "def = %d\n", (*(WORD*)buf));
    	buf += 2;
    	fprintf(f, "aiflag = %d\n", (*(DWORD*)buf));
    	buf += 4;
    	fprintf(f, "raceflag = %d\n", (*(DWORD*)buf));
    
    	4+25+25+1+1+1+1+1+1+4+4+4+4+1+1+2+4 = 84 :)
    */

     

     

    Hmm dict type :o can you show more? ;3

  6. function GetMonsterRaceFlag is in source

    anyway this topic, your, my version work, but topic version have a extend packet (bad! for me), and your is good, but way is wrong (so wrong)

    its my opinion!

    20 godzin temu, metin2-factory napisał:

    At first i tried only client side but there were 2 down sides. first, the flags are declared only in server side that means you'd have to add a new enum in

    client side which is pointless. and second, for some reason a few raceflag do not show properly on client side. also, i prefer the logic to remain in server side.

    It doesn't matter much and i rather keep the code clean and easier to work with. also, server side check is required for the element icon over player target which ill add later on.

    this addition is simple and you extended packet so every target packet is bigger.. this is not optimal.

×
×
  • 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.