Jump to content

m2Ciaran

Active+ Member
  • Posts

    64
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by m2Ciaran

  1. 4 hours ago, MysteriousDev said:

    I got interested in this topic so I tried it myself. What I've found you can pretty easily enable antialiasing on dx9.

    Search for:

    int CGraphicDevice::Create

    Now scroll down where the parameters of ms_d3dPresentParameter are set.

     

    Add those two lines

    ms_d3dPresentParameter.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;
    ms_d3dPresentParameter.MultiSampleQuality = 0;

    And now that's a riddle. I haven't got too much time for a research, but ms_lpd3d->CheckDeviceMultiSampleType tells that multiSampling is indeed available, and it sets the quality to 1. But I can't get it working with it, so I left the quality set to 0, it still looks good enough, IDK what would be the difference.

     

    Also there's one more thing to set in the parameters, and I don't know the long term effects of this change, but it looks like it works just fine, like I said I don't have too much time for doing research atm.

    You'll be having a "D3DERR_INVALIDCALL" error if ms_d3dPresentParameter.Flags are set to D3DPRESENTFLAG_LOCKABLE_BACKBUFFER, and I don't know the answer for now, maybe I'm missing something, but setting the flag to 0 does the job.

    After the device is created with success you must write last line to make it work:

    ms_lpd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);

     

    And now you can enjoy those SMOOTH EDGES:

      Reveal hidden contents

    .png

     

    You just don't use the backbuffer with anti aliasing. With that said, the old screenshot method will not work, but this one might work:

    bool CPythonGraphic::SaveScreenShot(const char * c_pszFileName)
    {
        LPDIRECT3DSURFACE9 lpSurface;
        D3DSURFACE_DESC stSurfaceDesc;
    
        uint32_t uWidth = stSurfaceDesc.Width;
        uint32_t uHeight = stSurfaceDesc.Height;
        
        ms_lpd3dDevice->CreateOffscreenPlainSurface(uWidth, uHeight, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &lpSurface, NULL);   
        if(SUCCEEDED(ms_lpd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &lpSurface)))     
        {        
            D3DXSaveSurfaceToFile(c_pszFileName, D3DXIFF_JPG, lpSurface, NULL, NULL); 
        }        
        if(lpSurface)
        {
            lpSurface->Release();
            lpSurface = nullptr;
        }
    
        return true;
    }

    If I remember correctly there is also problem with transparency in e.g. tooltip but i dont go deep into it. Its cool for us, but players dont give a fuck about edges so... i just don't work on it ?

    • Good 1
  2. 18 minutes ago, FrozenShower said:

    1118 23:12:26178 :: 
    game.py(line:260) Open
    game.py(line:771) StartGame
    game.py(line:929) RefreshCharacter
    interfaceModule.py(line:830) RefreshCharacter
    uiCharacter.py(line:1235) RefreshCharacter
    uiCharacter.py(line:1282) __SetSkillSlotData
    uiCharacter.py(line:983) RefreshSkill
    uiCharacter.py(line:959) __RefreshSkillPage

    GameWindow.Open - <type 'exceptions.RuntimeError'>:skill.GetSkillType - Failed to find skill by 119

    1118 23:12:26179 :: ============================================================================================================
    1118 23:12:26179 :: Abort!!!!


    119 skill?

    I assume the error you posted is not related with this qol code (I work on clean files I don't know what code you have)

  3. 9 minutes ago, Filachilla said:

    I dont know if I do something wrong, but it works only for M1-M9 (M10 and more doesnt show anything)

    Edit: So its only for books? If yes, it would by nice when M10 to G1 is too showed and not only M1-M9

    Yes only for books and that is right, I forget about the "master" level.. crazy things. Dl is updated once again

    Just move the uitooltip if like that to make it work with m10 (master):

    		if skillLevel > 0:
    			if self.HasSkillLevelDescription(skillIndex, skillLevel):
    				self.AppendSpace(5)
    				if skillGrade == skill.SKILL_GRADE_COUNT:
    					pass
    				elif skillLevel == skillMaxLevelEnd:
    					self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
    				else:
    					self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
    				if app.ENABLE_SKILL_DESCRIPTION_RENEWAL:
    					if skillGrade == 1:
    						if self.HasSkillLevelDescription(skillIndex, skillLevel):
    							self.AppendTextLine(localeInfo.TOOLTIP_SKILL_BOOKS % (player.GetRemainingBooks(slotIndex), need_bookcount), 0xff375cd4)
    				self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)

     

    • Love 1
  4. 2 hours ago, SCOOB said:

    There is a problem. if you level up a skill from m3 -> m4 for example, the needed books don't reset to 0, only after teleport or reading another book. 

    https://metin2.download/video/nrUlvyuL2Z5D3VZr3gSp2wA20z0hUjQg/.mp4

    How to fix?

    I have updated the file, you should change char_skill.cpp

    First search

                            pPC->SetFlag(flag, 0);

    And remove

                            SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK);

    Now change this This

    #ifdef ENABLE_SKILL_DESCRIPTION_RENEWAL
    						m_pSkillLevels[dwSkillVnum].bBooks = 0;
    #else
    						pPC->SetFlag(flag, 0);
    #endif

    To this:

    #ifdef ENABLE_SKILL_DESCRIPTION_RENEWAL
    						m_pSkillLevels[dwSkillVnum].bBooks = 0;
    						SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK);
    #else
    						SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK);
    						pPC->SetFlag(flag, 0);
    #endif
  5. Looks like I got similar results. Kinda nice, also look good on weapons for example

    before

    spacer.png

    after

    spacer.png


     

    Spoiler

    spacer.png

    spacer.png

     


     

  6. 27 minutes ago, mihnea said:

    and how is the killer decided?

    Last hit is the killer, but the item drop is divided by damage dealt 
    You can see it in char_battle.cpp Reward function

                int iItemIdx = s_vec_item.size() - 1;
    
                std::priority_queue<std::pair<int, LPCHARACTER> > pq;
    
                int total_dam = 0;
    
                for (TDamageMap::iterator it = m_map_kDamage.begin(); it != m_map_kDamage.end(); ++it)
                {
                    int iDamage = it->second.iTotalDamage;
                    if (iDamage > 0)
                    {
                        LPCHARACTER ch = CHARACTER_MANAGER::instance().Find(it->first);
    
                        if (ch)
                        {
                            pq.push(std::make_pair(iDamage, ch));
                            total_dam += iDamage;
                        }
                    }
                }
    
                std::vector<LPCHARACTER> v;
    
                while (!pq.empty() && pq.top().first * 10 >= total_dam)
                {
                    v.push_back(pq.top().second);
                    pq.pop();
                }
    
                if (v.empty())
                {
                    // 데미지를 특별히 많이 준 사람이 없으니 소유권 없음
                    while (iItemIdx >= 0)
                    {
                        item = s_vec_item[iItemIdx--];
    
                        if (!item)
                        {
                            sys_err("item null in vector idx %d", iItemIdx + 1);
                            continue;
                        }
    
                        item->AddToGround(GetMapIndex(), pos);
                        // 10% 이하 데미지 준 사람끼리는 소유권없음
                        //item->SetOwnership(pkAttacker);
                        item->StartDestroyEvent();
    
                        pos.x = number(-7, 7) * 20;
                        pos.y = number(-7, 7) * 20;
                        pos.x += GetX();
                        pos.y += GetY();
    
                        sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
                    }
                }
                else
                {
                    // 데미지 많이 준 사람들 끼리만 소유권 나눠가짐
                    std::vector<LPCHARACTER>::iterator it = v.begin();
    
                    while (iItemIdx >= 0)
                    {
                        item = s_vec_item[iItemIdx--];
    
                        if (!item)
                        {
                            sys_err("item null in vector idx %d", iItemIdx + 1);
                            continue;
                        }
    
                        item->AddToGround(GetMapIndex(), pos);
    
                        LPCHARACTER ch = *it;
    
                        if (ch->GetParty())
                            ch = ch->GetParty()->GetNextOwnership(ch, GetX(), GetY());
    
                        ++it;
    
                        if (it == v.end())
                            it = v.begin();
    
                        if (CBattleArena::instance().IsBattleArenaMap(ch->GetMapIndex()) == false)
                        {
                            item->SetOwnership(ch);
                        }
    
                        item->StartDestroyEvent();
    
                        pos.x = number(-7, 7) * 20;
                        pos.y = number(-7, 7) * 20;
                        pos.x += GetX();
                        pos.y += GetY();
    
                        sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
                    }

    As you can see in this function SetOwnership is used when dealt at least 10% damage but this does not apply to gold reward the gold is reward for the killer. Worth to note that the chance for item drop is calculated for killer only:

    	if (ITEM_MANAGER::Instance().CreateDropItem(this, pkAttacker, s_vec_item))

    This means that only killer thief gloves are counted

    Im not sure this is the official clean code because I took it from random github but looks like. Have a nice day

    • Good 1
  7. 14 hours ago, SCOOB said:

    it causes bugs with Switchbot System. You can't place items in switchbot from inventory.

    	if (Cell.cell == DestCell.cell && SWITCHBOT != Cell.window_type && SWITCHBOT != DestCell.window_type)
    		return false;

     

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