Jump to content

Sonitex

Premium
  • Posts

    521
  • Joined

  • Days Won

    12
  • Feedback

    100%

Everything posted by Sonitex

  1. void CQuestManager::CancelServerTimers(DWORD arg) { vector<pair<string, DWORD>> ServerTimersToDelete; for (auto& kv : m_mapServerTimer) { if (kv.first.second == arg) { LPEVENT event = kv.second; event_cancel(&event); ServerTimersToDelete.push_back(kv.first); } } // Delete all the required server timers for (auto &timer : ServerTimersToDelete) m_mapServerTimer.erase(timer); // Clean up ServerTimersToDelete.clear(); } Crash occurs because the game is deleting timers while iterating through them. Code above should fix this issue
  2. When hovering over a skill, it's recharge duration in tooltip is always the same because it ignores player's casting speed. In PythonSkill.cpp search for : PyObject * skillGetSkillCoolTime(PyObject * poSelf, PyObject * poArgs) Replace with: PyObject * skillGetSkillCoolTime(PyObject * poSelf, PyObject * poArgs) { int iSkillIndex; if (!PyTuple_GetInteger(poArgs, 0, &iSkillIndex)) return Py_BadArgument(); float fSkillPoint; if (!PyTuple_GetFloat(poArgs, 1, &fSkillPoint)) return Py_BadArgument(); CPythonSkill::SSkillData * c_pSkillData; if (!CPythonSkill::Instance().GetSkillData(iSkillIndex, &c_pSkillData)) return Py_BuildException("skill.GetSkillCoolTime - Failed to find skill by %d", iSkillIndex); DWORD dwSkillCoolTime = c_pSkillData->GetSkillCoolTime(fSkillPoint); int iCastingSpeed = CPythonPlayer::Instance().GetStatus(POINT_CASTING_SPEED); int iSpd = 100 - iCastingSpeed; if (iSpd > 0) iSpd = 100 + iSpd; else if (iSpd < 0) iSpd = 10000 / (100 - iSpd); else iSpd = 100; dwSkillCoolTime = dwSkillCoolTime * iSpd / 100; return Py_BuildValue("i", dwSkillCoolTime); }
  3. section npc 20383 item 11295 1 item 30509 10 item 30516 10 item 30514 10 reward 20000 1 gold 100000 category ARMOR percent 5 end I think it should be clear now that success chance from 5%~50% does not exist and neither does MINDshop Metin2Wiki is often edited by players and you can see the image has been edited since there are 2 different fonts used.
  4. I agree with the idea of moving water texture setting to the map itself. It is much easier to handle and works perfectly fine on my client. Default water texture is no biggie either, one more if statement. Great job and thank you for your contributions with the WorldEditor
  5. Why bother with rewriting a whole system when you can create a new item and make it add and remove affect upon using it. If it is active, set socket(0) to 1 and edit the function that handles active/unactive effect in the inventory and taskbar, you can copy most of it since it is the same for elixirs. For the pet permanent functionality: when you reach 200 days cancel the real time event on the item and add a check so it never starts again if the item has 200 days or more. On the client side modify the code to hide the remaining time if the item has more than 200 days remaning. I hope I could help you :).
  6. CGraphicImageInstance m_WaterInstances[30]; Edit this part in the MapOutdoor.h as well . STATEMANAGER.SetTexture(0, m_WaterInstances[((ELTimer_GetMSec() / 70) % 30)].GetTexturePointer()->GetD3DTexture()); And this in the MapOutdoorWater.cpp. And I believe that buffer is used for the path of the texture and not the actual size of the texture.
  7. If someone has the same issues as me with elements sometimes being shown wrong replace this part of function in char.cpp: for (int i = RACE_FLAG_ATT_ELEC; i <= RACE_FLAG_ATT_DARK; i *= 2) { int diff = raceFlag - i; if (abs(diff) <= 1024) break; } to this: for (int i = RACE_FLAG_ATT_ELEC; i <= RACE_FLAG_ATT_DARK; i *= 2) { curElementBase++; if (raceFlag & i) break; }
  8. I get this part and it is actually very easy to do. What I am stuck with is sending the arguments from server to client. I don't know how to store them actually, this is the biggest issue for me.
  9. void CHARACTER::AutoRecoveryItemProcess(const EAffectTypes type) char_item.cpp
  10. Heya everyone! I got stuck at sending arguments from server to client. Could anyone give me a hint on how to do this or enlighten me how official servers did it? Thank you in advance!
  11. Woah, thank you so much! If someone experiences compile errors regarding std::shared_ptr, include <memory> inside Thing.h & ModelInstance.h!
  12. Did not know that, never mind then hah ?
  13. And what happens when you have two chars with names Mali61 & mali61 online at the same time? Rare case, but there is a reason it should be case sensitive.
  14. You have defined a variable pointing to <Owner_Cheque_Icon> at uiExchange.py at line 43 in the LoadDialog function. It should be loaded from exchangedialog.py or from exchangedialog_new.py as I can see from the tutorial files, but your problem probably lays at exchangedialog.py which was not updated in the tutorial. This is the official code, you will need to change some names but should work just fine import uiScriptLocale import localeInfo import app ROOT = "d:/ymir work/ui/game/" if app.ENABLE_CHEQUE_SYSTEM : BOARD_WIDTH = 290 BOARD_HEIGHT = 189 window = { "name" : "ExchangeDialog", "x" : 0, "y" : 0, "style" : ("movable", "float",), "width" : BOARD_WIDTH, "height" : BOARD_HEIGHT, "children" : ( { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, "y" : 0, "width" : BOARD_WIDTH, "height" : BOARD_HEIGHT, "children" : ( ## Title { "name" : "TitleBar", "type" : "titlebar", "style" : ("attach",), "x" : 8, "y" : 8, "width" : 276, "color" : "gray", "children" : ( { "name":"TitleName", "type":"text", "x":133, "y":3, "text":uiScriptLocale.EXCHANGE_TITLE, "text_horizontal_align":"center" }, ), }, ## MiddleBar { "name" : "Middle_Bar", "type" : "expanded_image", "x" : (BOARD_WIDTH / 2) - 3, "y" : 31, "x_scale" : 1.0, "y_scale" : 1.16, "image" : ROOT + "windows/middlebar.sub", }, ## Owner { "name" : "Owner", "type" : "window", "x" : 150, "y" : 33, "width" : 130, "height" : 146, "children" : ( { "name" : "Owner_Slot", "type" : "grid_table", "start_index" : 0, "x" : 0, "y" : 0, "x_count" : 4, "y_count" : 3, "x_step" : 32, "y_step" : 32, "x_blank" : 0, "y_blank" : 0, "image" : "d:/ymir work/ui/public/slot_base.sub", }, { "name" : "Owner_Cheque", "type" : "button", "x" : 0, "y" : 102, #"image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "default_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Owner_Cheque_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Owner_Money", "type" : "button", "x" : 0, "y" : 124, #"image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "default_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Owner_Money_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Owner_Accept_Light", "type" : "button", "x" : 95, "y" : 102, "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", }, { "name" : "Owner_Accept_Button", "type" : "toggle_button", "x" : 85, "y" : 124, "text" : uiScriptLocale.EXCHANGE_ACCEPT, "default_image" : "d:/ymir work/ui/public/small_button_01.sub", "over_image" : "d:/ymir work/ui/public/small_button_02.sub", "down_image" : "d:/ymir work/ui/public/small_button_03.sub", }, { "name" : "strOwner_Cheque", "type" : "text", "x" : 67, "y" : 104, "text" : localeInfo.CHEQUE_SYSTEM_UNIT_WON, }, { "name" : "strOwner_Yang", "type" : "text", "x" : 67, "y" : 126, "text" : localeInfo.CHEQUE_SYSTEM_UNIT_YANG, }, ), }, ## Target { "name" : "Target", "type" : "window", "x" : 10, "y" : 33, "width" : 130, "height" : 130, "children" : ( { "name" : "Target_Slot", "type" : "grid_table", "start_index" : 0, "x" : 0, "y" : 0, "x_count" : 4, "y_count" : 3, "x_step" : 32, "y_step" : 32, "x_blank" : 0, "y_blank" : 0, "image" : "d:/ymir work/ui/public/slot_base.sub", }, { "name" : "Target_Cheque", "type" : "image", "x" : 0, "y" : 102, "image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Target_Cheque_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Target_Money", "type" : "image", "x" : 0, "y" : 124, "image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Target_Money_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Target_Accept_Light", "type" : "button", "x" : 95, "y" : 102, "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", }, { "name" : "strTarget_Cheque", "type" : "text", "x" : 67, "y" : 104, "text" : localeInfo.CHEQUE_SYSTEM_UNIT_WON, }, { "name" : "strTarget_Yang", "type" : "text", "x" : 67, "y" : 126, "text" : localeInfo.CHEQUE_SYSTEM_UNIT_YANG, }, ), }, ), }, ), } else : window = { "name" : "ExchangeDialog", "x" : 0, "y" : 0, "style" : ("movable", "float",), "width" : 282, "height" : 167, "children" : ( { "name" : "board", "type" : "board", "style" : ("attach",), "x" : 0, "y" : 0, "width" : 282, "height" : 167, "children" : ( ## Title { "name" : "TitleBar", "type" : "titlebar", "style" : ("attach",), "x" : 8, "y" : 8, "width" : 266, "color" : "gray", "children" : ( { "name":"TitleName", "type":"text", "x":133, "y":3, "text":uiScriptLocale.EXCHANGE_TITLE, "text_horizontal_align":"center" }, ), }, ## MiddleBar { "name" : "Middle_Bar", "type" : "image", "x" : 139, "y" : 31, "image" : ROOT + "windows/middlebar.sub", }, ## Owner { "name" : "Owner", "type" : "window", "x" : 144, "y" : 33, "width" : 130, "height" : 130, "children" : ( { "name" : "Owner_Slot", "type" : "grid_table", "start_index" : 0, "x" : 0, "y" : 0, "x_count" : 4, "y_count" : 3, "x_step" : 32, "y_step" : 32, "x_blank" : 0, "y_blank" : 0, "image" : "d:/ymir work/ui/public/slot_base.sub", }, { "name" : "Owner_Money", "type" : "button", "x" : 0, "y" : 102, #"image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "default_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "over_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "down_image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Owner_Money_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Owner_Accept_Light", "type" : "button", "x" : 62, "y" : 101, "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", }, { "name" : "Owner_Accept_Button", "type" : "toggle_button", "x" : 85, "y" : 101, "text" : uiScriptLocale.EXCHANGE_ACCEPT, "default_image" : "d:/ymir work/ui/public/small_button_01.sub", "over_image" : "d:/ymir work/ui/public/small_button_02.sub", "down_image" : "d:/ymir work/ui/public/small_button_03.sub", }, ), }, ## Target { "name" : "Target", "type" : "window", "x" : 10, "y" : 33, "width" : 130, "height" : 130, "children" : ( { "name" : "Target_Slot", "type" : "grid_table", "start_index" : 0, "x" : 0, "y" : 0, "x_count" : 4, "y_count" : 3, "x_step" : 32, "y_step" : 32, "x_blank" : 0, "y_blank" : 0, "image" : "d:/ymir work/ui/public/slot_base.sub", }, { "name" : "Target_Money", "type" : "image", "x" : 0, "y" : 102, "image" : "d:/ymir work/ui/public/parameter_slot_02.sub", "children" : ( { "name" : "Target_Money_Value", "type" : "text", "x" : 59, "y" : 2, "text" : "1234567", "text_horizontal_align" : "right", }, ), }, { "name" : "Target_Accept_Light", "type" : "button", "x" : 62, "y" : 101, "default_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "over_image" : "d:/ymir work/ui/game/windows/accept_button_off.sub", "down_image" : "d:/ymir work/ui/game/windows/accept_button_on.sub", }, ), }, ), }, ), }
  15. bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time) -> battle.cpp This kind of protection already exists, just not sure how accurate it actually is.
  16. If you would pay attention to what Python is trying to message you, you would love it even more ? At line 178 you have OPTION_FOG_ON variable which should be in locale_interface.txt but clearly you are missing it.
  17. Amm my bad, you actually have to multiply coordinates by 100... I modified source to avoid this so I thought it is like that originally. Your function should look like this: d.new_jump (MAP_INDEX, 4411 * 100, 12282 * 100)
  18. d.new_jump(map_index, (map_base_x + x_coordinate) * 100, (map_base_y + y_coordinate) * 100) Map base coordinates without 00 at the end.
  19. --Init loop timer on dungeon entrance & dungeon limit timer server_loop_timer("timenotice",300,d.get_map_index()) --Timer will be triggered each 300 seconds in this exact dungeon map, changing map will destroy timer d.setf("time", get_global_time()+60*60*1) --This dungeon has a limit of 60 minutes --When timer is triggered, inform players about time when purgatorytimenotice.server_timer begin if d.select(get_server_timer_arg()) then local secondsLeft = (d.getf("time") - get_global_time()) local minutesLeft = math.ceil(secondsLeft / 60) d.notice("Time Left: "..minutesLeft.." minutes!") end end
×
×
  • 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.