Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/28/19 in all areas

  1. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
    1 point
  2. Hello everyone, A lot of people might already know the issue. If you choose Arial as Font for Metin2, texts will be displayed in a weird way and with dots. There are a few reasons for this to happen and increasing font size fixes it, but no one wants huge texts everywhere and obviously, we wannt a nice font. Not a trial and error. So here's a partial fix for it. If you choose very small font sizes (e. g. font size 9px) in locale_game.txt it'll still look a bit off but it's definitely readable. With these changes, you'll have no problem with font sizes 14px and higher. Maybe someone wants to share different approaches or ideas. I think with these changes the problem is almost entirely fixed, no one needs size 9 especially with Arial.. First open your Binary source and search for "LOGFONT" (without "" of course). You'll find two matches where it's being used for initialization of new fonts: One in TextBar.cpp(CTextBar::__SetFont) and one in GrpFontTexture(CGraphicFontTexture::GetFont). And these are the two functions where we need to make some changes first. Under the line where LOGFONT is used, you're gonna add the following code: HDC hDC = m_dib.GetDCHandle(); if (hDC) { auto px = fontSize * 72 / 96; fontSize = -MulDiv(px, GetDeviceCaps(hDC, LOGPIXELSY), 72); } This code segment does two things: First it converst px -> pt, since LOGFONT expects pt. And on second, it calculates the correct displaying size according to the ppi and the cell height. This leads to the variable we need: The point size. Note that there's a minus, which means that we'll automatically choose the nearest possible size according to the specified font size. So everything's good here. Als note that you need add this segment to BOTH places where LOGFONT is being used for initialization. You have to change the name fontSize according to the files you edit. In TextBar.cpp the example above fits, for GrpFontTexture you just need to change fontSize to m_fontSize. Now change the following parts in both functions: logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; logFont.lfQuality = NONANTIALIASED_QUALITY; logFont.lfPitchAndFamily = VARIABLE_PITCH; Note: You can also change logFont.lfWeight from FONT_NORMAL to FONT_MEDIUM or any other font weight if you wanna add up a mit more strength to your fonts. I just left it to FONT_NORMAL, which is fine. Also note that I chose NONANTIALIASED_QUALITY since anti-aliasing didn't make any change (not sure if Arial is even compatible, at least not those small font sized that I tested it with..). You can also change them to something like ClearType to do the job, that's up to you. I wanted to display the fonts just like they are, no mangling with them. But depending on your needs you can tweak a bit here. that's almost it! Last but not least, we have to change the way our adapter hDC does it's job. Especially since the above calculation for point size is only 100% true for MapMode MM_TEXT. And that's what we're gonna establish now. If you are in CGraphicFontTexture::GetFont, you can just scroll a bit higher. You'll see the initialization of hdC (function CGraphicFontTexture::Create). just below SetBkColor(hDC, 0); you can add these two lines: SetGraphicsMode(hDC, GM_ADVANCED); SetMapMode(hDC, MM_TEXT); Aaand you're done! That's it! Compile and enjoy! Best Regards Vanilla
    1 point
  3. Try this one: quest skill_book begin state start begin function GetSkillList2(min_level) local skill_list = special.active_skill_list[pc.get_job()+1][pc.get_skill_group()] local vnum_list = {} local name_list = {} for i = 1,table.getn(skill_list) do local skill_vnum = skill_list[i] local skill_level = pc.get_skill_level(skill_vnum) if skill_level >= min_level and skill_level < 30 then table.insert(vnum_list, skill_list[i]) table.insert(name_list, locale.GM_SKILL_NAME_DICT[skill_vnum]) end end return vnum_list, name_list end when 52101.use or 52102.use or 52103.use or 52104.use with pc.can_warp() begin -- don't forget about checking warp status, otherwise one's can bug is using f.e trade glitch local id_to_job = {[52101] = 0, [52102] = 1, [52103] = 2, [52104] = 3} if pc.get_job() > id_to_job[item.get_vnum()] then say_title (item.get_name()) -- just print book's name say("") say("This book isn't for your race") say("") return end if pc.get_skill_group() == 0 then say_title (item.get_name()) -- just print book's name say("") say("you have no class yet") say("") return end local vnum_list, name_list = skill_book.GetSkillList2(20) if table.getn(vnum_list) == 0 then say_title (item.get_name()) -- just print book's name say("") say_reward ("No skill to upgrade") say("") return end say_title (item.get_name()) -- just print book's name say("") say("choose the skill to upgrade:") say("") table.insert(name_list, "Annulla") local s = select_table(name_list) if s == table.getn(name_list) then return end local skill_name = name_list[s] local skill_vnum = vnum_list[s] local skill_level = pc.get_skill_level(skill_vnum) say_title (item.get_name()) -- just print book's name say("") say("you choose: "..skill_name) say("are you sure to upgrade this?") local a = select("yes","No") if a == 2 then return end pc.set_skill_level (skill_vnum, skill_level+1) pc.remove_item(item.get_vnum(), 1) end end end
    1 point
  4. 1 point
  5. 1 point
  6. I'm sorry for the inconvenience. I'll definitely make one new rev and upload it. If there's more interest, I'll make further development. This new release focuses on another security batch and more stability since the last release indeed had some problems. I've fixed the query stuff and changed a bit here and there... I also added a new GM Rank that will help server admins keep control over the environment even if things are going bad (like e. g. some GM/Admin going crazy and stuff..) For now the new featureset looks like this: * c++2a compatibility * cryptopp 8.2.0 * boost 1.7.0 * changed DirectQuery implementation to always return unique pointers * DirectQuery: dropped variables for proper deallocation once they are no longer needed * Some minor and major code fixes (new rev was in development for a long time, couldn't get all the stuff that I changed) * Changed warning "not in unify mode" to just a small attention on boot-up. This makes it less "Oh no please stop!" and more like a hint * New GM Mode SUPERADMIN * Added compatibility to MySQL 8.0 which will be used in the future. * Removed unnecessary library dependencies * Changed Makefile to now compile and include debug/release libraries correctly SUPERADMIN is a new keyword. You can add it to your gmlist. It has all the privileges IMPLEMENTOR has but it has some protections to make sure you keep access. SUPERADMIN is protected against demotion for example. He does not have to elevate and can use GM powers without limitation. Additionally, the /promote command can not promote someone to SUPERADMIN. The only way to add it is via gmlist. Also /reload a does not affect Superadmin, only a server restart can promote/demote a super admin. SUPERADMIN cannot be /dc and have a godmode, so they can't be killed. Also they'll have all IMMUNE flags no matter what. Note that players with SUPERADMIN status should only be used as an emergency account. It is not meant to prevent damage when an Admin goes rampage. It's meant to be used as a counter-measurement to take back control of the server if something really goes bad or maybe demote admins Quest functions: + bool is_superadmin() returns true or false depending if the player has the SUPERADMIN rank or not. Commands: + /demote [PlayerName] Removes and deactivates elevation for the target user. Does not work on players with higher rank and does not work against SUPERADMIN. Demotion also applies a status that prevents the player from elevating again unless he relogs + /exile [PlayerName] Revokes elevation and strikes him from the gmtable+gmlist thusrendering him unable to elevate again. This comand does not work against SUPERADMIN. Also, this command does not work against players with higher rank and minium rank IMPLEMENTOR is needed. * /ban /dc /kill /warp /transfer These commands do not work on players with SUPERADMIN status. Note that players with SUPERADMIN can still use these commands. So this is the changelog for now. This is planned and I need some people to test it. Just drop me a pm and I'll gladly send you a test build within the next few days. Also, if you have any thoughts/suggestions/ideas I'd love to hear them.
    1 point
×
×
  • 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.