Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Community Answers

  1. VegaS™'s post in LOCALE_STRING.TXT Korean bug was marked as the answer   
    Go to Settings -> Preferences -> MISC. -> Autodetect character encoding (deselect it)

    This is the hidden content, please Sign In or Sign Up  
     
  2. VegaS™'s post in Append price getItemCount was marked as the answer   
    root/uiToolTip.py
    This is the hidden content, please Sign In or Sign Up That is the simplest method, so you can easily adapt to it even if you have other functions that use or will use that function in the future.
  3. VegaS™'s post in Button, which have to remove group member role is not removing set group member bonus & leaving group is not removing set bonus too was marked as the answer   

    This is the hidden content, please Sign In or Sign Up The points were not properly updated, which resulted in a bug on that bonus; even if you leave the party, you still have the bonus, with this fix should be fine.
  4. VegaS™'s post in Block item swap when shopping or when exchanging was marked as the answer   
    I don't really understand what you're trying to do, but you should do it on the server side if you want to be safe.
    char_item.cpp Use the following code:

    This is the hidden content, please Sign In or Sign Up Inside of:

    This is the hidden content, please Sign In or Sign Up
  5. VegaS™'s post in Hide weapon when using emotion - unequipped weapon bug in emotion use was marked as the answer   
    I think this should be enough.

    This is the hidden content, please Sign In or Sign Up
  6. VegaS™'s post in How to fix Windows "Default Beep" for an ALT key shortcuts with other keys pressed? was marked as the answer   
    Ok, I just tested right now with a default metin2 client and that's not a real 'beep', it's an 'Asterisk' sound from Windows and it comes from PythonApplication.cpp:
    unsigned __GetWindowMode(bool windowed) { if (windowed) return WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; return WS_POPUP; } If you remove WS_SYSMENU from the style, you won't get the sound anymore but you won't see the buttons and icon too.


     
    UPDATE
    Alright, after some debugging:
    Here is a fast fix and should work fine, I didn't test it so well.
    UserInterface\PythonApplicationProcedure.cpp
    This is the hidden content, please Sign In or Sign Up Before: https://metin2.download/video/Oy3fg6R91i9BS2L98w35mUB54hTYJOhz/.mp4 (everywhere in the client)
    After: https://metin2.download/video/iNrVA5EmXXKplT3P325pTJ896q6V2p8j/.mp4
  7. VegaS™'s post in Polymorph G10 are give more values then polymorph P was marked as the answer   
    game/src/constants.cpp
    I didn't check the code, but the aiPolymorphPowerByLevel array it's missing a value by default, that one should be 0 when you've level 0 on the skill itself, then for level 1 (10), level 2 (11) [...].
    It should be like this:

    This is the hidden content, please Sign In or Sign Up
  8. VegaS™'s post in Affect list not updated was marked as the answer   
    I can't test this right now in-game, but from a fast check, it seems that hide_horse_state command is sent from the server-side when you unsummon the horse, which is defined in interfaceModule.py as HideHorseState:
    def HideHorseState(self): self.affectShower.SetHorseState(0, 0, 0) def UpdateHorseState(self, level, health, battery): self.affectShower.SetHorseState(level, health, battery) That means when you unsummon the horse, the SetHorseState function is called with (0, 0, 0) arguments, and there's a condition which check if the level is 0, then set the self.horseImage variable as a null value, without arrange the images.
    So, in theory, we just need to call the __ArrangeImageList function after that, and it should be fine, the images will be sorted again.
    root/uiAffectShower.py Search for the function:
    def SetHorseState(self, level, health, battery): [...] Replace it with:

    This is the hidden content, please Sign In or Sign Up
  9. VegaS™'s post in Cube window open check was marked as the answer   
    Srcs/game/questlua_pc.cpp namespace quest { [...] int pc_is_cube_open(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); lua_pushboolean(L, ch && ch->IsCubeOpen()); return 1; } [...] } luaL_reg pc_functions[] = { [...] { "is_cube_open", pc_is_cube_open }, [...] } share/locale/country/quest/quest_functions pc.is_cube_open your_quest.lua if pc.is_cube_open() then say("CUBE_WINDOW_IS_OPEN") return end  
  10. VegaS™'s post in Quest - Get items from table was marked as the answer   
    It should be like this:
    for key, value in ipairs(same_items) do pc.give_item2(unpack(value)) end
  11. VegaS™'s post in Little problem c++ was marked as the answer   
    It won't work because you just initialized the structure with the default values from the constructor, which means window_type will be always INVENTORY
    You already have the GetWindow function inside of CItem class, you can use it like this:
    if (MALL == item->GetWindow()) { [...] } Or if you really want to use TItemPos and the functions from it, you must initialize it properly:
    const TItemPos Cell(item->GetWindow(), item->GetCell());
  12. VegaS™'s post in spawn random boss??? help me was marked as the answer   
    Try this:

    This is the hidden content, please Sign In or Sign Up
  13. VegaS™'s post in [Py] Taskbar Skill Slot 'Hover' Problem was marked as the answer   
    The bug is caused by self.RefreshQuickSlot() which is called in OnUpdate() at each 0.5 seconds.
    It also affects the emotion slots, not just the skills.
    Inside of RefreshQuickSlot is the following snippet:
    elif player.SLOT_TYPE_SKILL == Type: [...] slot.SetCoverButton(slotNumber) elif player.SLOT_TYPE_EMOTION == Type: [...] slot.SetCoverButton(slotNumber) That part of the code resets the cover button for each slot and resets the up/over/down states.
    How-To-Fix:

    root/uiTaskBar.py # Search for: (x2 times) slot.SetCoverButton(slotNumber) # Replace it with: if not slot.HasCoverButton(slotNumber): slot.SetCoverButton(slotNumber) root/ui.py # Search for: def EnableCoverButton(self, slotIndex): wndMgr.EnableCoverButton(self.hWnd, slotIndex) # Add after: def HasCoverButton(self, slot_index): return wndMgr.HasCoverButton(self.hWnd, slot_index) Src/Client/EterPythonLib/PythonSlotWindow.h // Search for: void HideSlotBaseImage(DWORD dwIndex); // Add after: bool HasCoverButton(const DWORD slot_index) { TSlot * slot; if (!GetSlotPointer(slot_index, &slot)) return false; return slot->pCoverButton != nullptr; } Src/Client/EterPythonLib/PythonWindowManagerModule.cpp // Search for: PyObject * wndMgrHideSlotBaseImage(PyObject * poSelf, PyObject * poArgs) { [...] } // Add after: PyObject* wndMgrHasCoverButton(PyObject*, PyObject* poArgs) { UI::CWindow* window; PyTuple_GetWindow(poArgs, 0, &window); int slot_index; PyTuple_GetInteger(poArgs, 1, &slot_index); auto* const slot = dynamic_cast<UI::CSlotWindow*>(window); return Py_BuildValue("b", slot->HasCoverButton(slot_index)); } // Search for: { "HideSlotBaseImage", wndMgrHideSlotBaseImage, METH_VARARGS }, // Add after: { "HasCoverButton", wndMgrHasCoverButton, METH_VARARGS },
  14. VegaS™'s post in Hide characters behind was marked as the answer   
    root/introSelect.py
    This is the hidden content, please Sign In or Sign Up
  15. VegaS™'s post in Empire bonuses remaining time was marked as the answer   

    This is the hidden content, please Sign In or Sign Up
  16. VegaS™'s post in Stone spawning was marked as the answer   
    I didn't test it, let me know if it works.
    There are other solutions as well, with resurrection vnum, but you need a custom function since you want it with a spawn chance.
    Srcs/Server/game/src/char_battle.cpp
    This is the hidden content, please Sign In or Sign Up
  17. VegaS™'s post in Enable enter keys in confirm dialogs was marked as the answer   
    No, you've to do it like this:

    This is the hidden content, please Sign In or Sign Up
  18. VegaS™'s post in Enable enter keys in confirm dialogs was marked as the answer   
    Not tested.
    uiCommon.py
    This is the hidden content, please Sign In or Sign Up
     
  19. VegaS™'s post in Launcher binaries function that prints something in ingame chat was marked as the answer   
    C++ #include "PythonChat.h" #include "PythonPlayer.h" char buf[512 + 1]; _snprintf(buf, sizeof(buf), "Hello, %s!", CPythonPlayer::Instance().GetName()); CPythonChat::Instance().AppendChat(CHAT_TYPE_INFO, buf); Python:
    import chat import player chat.AppendChat(chat.CHAT_TYPE_INFO, "Hello, {}.".format(player.GetName())) Keep in mind that's a local message, will be visible just for your instance.
    If you want to send a message through the server that everyone can see it, you've to use this way:
    #include "PythonChat.h" #include "PythonPlayer.h" #include "PythonNetworkStream.h" char buf[512 + 1]; _snprintf(buf, sizeof(buf), "Hello, %s!", CPythonPlayer::Instance().GetName()); CPythonNetworkStream::Instance().SendChatPacket(buf, CHAT_TYPE_SHOUT);  
  20. VegaS™'s post in [HowTo] The "hello world" of metin2 was marked as the answer   
  21. VegaS™'s post in Please help me was marked as the answer   
    Hello, there're many topics like this, you should use the search button.
     
    https://www.youtube.com/results?search_query=how+to+create+a+metin2+private+server
     
  22. VegaS™'s post in ITEM_AWARD was marked as the answer   
  23. VegaS™'s post in Block auto attack on player was marked as the answer   
    ../Srcs/Client/UserInterface/PythonPlayerInput.cpp Replace the whole function void CPythonPlayer::__SetAutoAttackTargetActorID(DWORD dwVID) with:

    This is the hidden content, please Sign In or Sign Up
  24. VegaS™'s post in New item make quest. was marked as the answer   
    Delete all of the code which you added and follow the new tutorial:
    Srcs/Server/common/service.h #define ENABLE_REFINE_NOTICE_SUCCESS Srcs/Server/game/src/char_item.cpp
    This is the hidden content, please Sign In or Sign Up
  25. VegaS™'s post in Drop level difference was marked as the answer   
    Here're the references to understand how it's working step-by-step:
    char.cpp This is the hidden content, please Sign In or Sign Up
    constants.cpp #define MAX_EXP_DELTA_OF_LEV 31 #define PERCENT_LVDELTA(me, victim) aiPercentByDeltaLev[MINMAX(0, (victim + 15) - me, MAX_EXP_DELTA_OF_LEV - 1)] #define PERCENT_LVDELTA_BOSS(me, victim) aiPercentByDeltaLevForBoss[MINMAX(0, (victim + 15) - me, MAX_EXP_DELTA_OF_LEV - 1)] constants.cpp const int aiPercentByDeltaLevForBoss_euckr[MAX_EXP_DELTA_OF_LEV] = { 1, // -15 0 [...] 180 // 15 30 }; const int aiPercentByDeltaLev_euckr[MAX_EXP_DELTA_OF_LEV] = { 1, // -15 0 [...] 180 // 15 30 }; locale_service.cpp if (!aiPercentByDeltaLevForBoss) aiPercentByDeltaLevForBoss = aiPercentByDeltaLevForBoss_euckr; if (!aiPercentByDeltaLev) aiPercentByDeltaLev = aiPercentByDeltaLev_euckr;  
     
     
×
×
  • 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.