Jump to content

Intel

Premium
  • Posts

    200
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    0%

Everything posted by Intel

  1. I don't think your players would enjoy to be inundated by low level/useless items anyway.. but you can choose not to show the common_drop_item stuff
  2. Ya I forgot a 0, uups (I mean, in my defense I had used the original incorrect number kek) Also during the copy of the code I fu**** the if, oh well. Screw lua anyway with love
  3. Also, to add what Syreldar said, when using server timers you cannot use qestlua_pc functions (no pc is selected in a server timer). Furthermore: if map_index >= 217000 and map_index < 217000 then I am pretty sure it should've been < 218000 (if it was meant for the exit from the dungeon when logging in): when login begin if pc.get_map_index() == 217 then pc.warp(exit_x*100, exit_y*100, 217) end elseif pc.get_map_index() >= 217000 and pc.get_map_index() < 218000 then pc.set_warp_location(217, exit_x, exit_y) end end 217000 to 217999 are all valid dungeon instances of the map with index 217
  4. Updated with biologist pulse (avoiding spamming of requests) and replaced GetPCForce with GetPC (with related checks) GetPCForce can lead to this crash: I am not sure if it's because of our questmanager refactor or not, but it's probably 99.99% of the times better this way.
  5. Oh, you were using fmt? Well then ahah Boost can be removed yeah, although I still use it: Btw gcc13 has been released, don't know when it will be officially available on freebsd pkg manager though
  6. fmt was an example (it's not used on metin2 server files). Try to clean all and recompile
  7. All these basic strings errors remind me to the same problem I already mentioned: compiling one thing with clang/++ and the other with gcc/++. There's a similar issue for example with the fmt library. A simple program: //myprogram.cpp #include <fmt/core.h> int main() { fmt::print("Hello, world!\n"); return 0; } would have linker errors related to std::__cxx11::basic_string if you compile fmt with clang and then do: g++ -lfmt myprogram.cpp
  8. Mmh, I cannot find anything about this, the only thing I could find was this: CryptoPP 8.7.0 to me is not crashing, at least in the metin2 implementation (except Ubuntu22.04, all tests passes but idk wtf happens with the packet encryption, even -O2, -O1 or older version. Ubuntu even uses gcc11, not 12). It also definitely compiles gcm.cpp: or the whole library for that matter:
  9. Wym it doesn't work? I've heard about this, but I've tried 32 and 64bit on FreeBSD 13.0 and GCC12.2 and I got no problem. The only problems I had with crypto were in Ubuntu 64bit lmao Meanwhile Ubuntu sadge:
  10. When compiling cryptopp you need to use gcc/g++ (same compiler used for the game/db). It probably compiled it with clang. You can edit the GNUmakefile and set CXX and CC: ########################################################### ##### System Attributes and Programs ##### ########################################################### CXX = g++ CC = gcc # [Hidden Content] # and [Hidden Content] SHELL = /bin/sh rest of the file
  11. Since y'all shared: if(!rVictim.isAttacking() && !rVictim.IsUsingMovingSkill() && !rVictim.__IsAttackMotion() && !rVictim.__IsKnockDownMotion() && !rVictim.__IsStandUpMotion() && !isAttacking()) { if(!rVictim.IsDoor() && !rVictim.IsBoss() && !rVictim.IsPC()) return FALSE; } This way every NPC/Monster/Metinstone can be passed trough, unless monsters are attacking you (not when they are moving when aggro-ed), or you are attacking
  12. There is a small bug with this when you put an interface right at the edges (with the limit flag). It can be fixed using >=0 and <= wndMgr.GetScreenWidth()/Heigth() although, this raises a new small "bug", where the first time the interfaces will open at 0,0 (and it might be fixed adding a new option to TWindowStatus like bool firstOpen and set it to true the first time the interface gets hidden)
  13. Updated to set all the values from settings.lua (or w/e file .lua you might load at startup besides settings.lua with similar characteristics) EX: --[[ structure: [QUEST_NAME,QUEST_ITEM,QUEST_CD,QUEST_PCT,QUEST_ITEM_TO_SEND] ]]-- add_biologist_info("ue_collect_item_lv30",30006,0,90,20) add_biologist_info("ue_collect_item_lv40",30055,0,90,20) add_biologist_info("ue_collect_item_lv50",30047,0,90,20) add_biologist_info("ue_collect_item_lv60",30324,0,90,25) add_biologist_info("ue_collect_item_lv70",30015,0,90,20) add_biologist_info("ue_collect_item_lv75",30050,3600,90,25) add_biologist_info("ue_collect_item_lv80",30198,7200,44,30) add_biologist_info("ue_collect_item_lv90",30166,10800,42,35) add_biologist_info("ue_collect_item_lv95",30495,10800,30,15) add_biologist_info("ue_collect_item_lv100",100029,14400,38,40) add_biologist_info("ue_collect_item_lv105",30329,14400,36,45) add_biologist_info("ue_collect_item_lv110",100039,18000,34,50) --[[ structure: [PCT_ADDER_VNUM,PCT_ADDER_PLUS_VNUM,TIME_DELETER_VNUM,ITEM_MAX_TO_SEND,PCT_ADDER,PCT_ADDER_PLUS] ]]-- add_biologist_globals(102529,102616,102517,5,10,20) Also found a little mistake: Git patch would be, well.. diff --git a/Locale/italy/settings.lua b/Locale/italy/settings.lua index ec787cd9..0eaa5e94 100644 --- a/Locale/italy/settings.lua +++ b/Locale/italy/settings.lua @@ -322,3 +322,29 @@ add_dungeon_party_size(4, 8) add_dungeon_party_size(5, 8) add_dungeon_party_size(11, 4) add_dungeon_party_size(12, 4) + + + ........................... @@ -2415,7 +2539,9 @@ namespace quest { "vid_is_near_to", _vid_is_near_to }, { "damage_to_vid", _damage_to_vid }, { "damage_to_vid_pct", _damage_to_vid_pct }, - + + { "add_biologist_info", _add_biologist_info }, + { "add_biologist_globals", _add_biologist_globals }, { NULL, NULL } probably incompatible?
  14. Jesus, I was thinking of only some damage visualizer for testing, you went beyond that with "small videos examples" Btw the integration with existing clients (even the official one) would be tricky because maybe considered a "cheat" (and I would avoid using overwolf even if it was a possible thing to use for metin2, f*** overwolf), but a standalone program is doable (videos aside because 1: I'd need those videos 2: it will take a tiny bit more time ahah)
  15. You mean tools for players to use to improve an already existing server (like giving feedback to a server owner) or just to look for example how much dmg they could do to something and stuff? I mean, yeah, sure, although obviously on private servers it's a bit tricky, I can do a whole program that checks damages, percentages and what not, but it will be based on w/e sql files I have on hand and obviously, every server owner has it's own stuff (well, tbf I could load data from txt and every owner could use their txts. It would actually be a nice side project )
  16. Me and a friend talked once about doing some sort of "dmg preview" for WoW to know beforehand all the possible dmg variations against a player and/or monsters, but I know very little of WoW Btw this is obviously not a Metin2 addon (like you intend for WoW), more a tool for a server owner to develop the gameplay (I've had to do something similar for my server where all our bonuses use the Gaussian bell). This program can be very well extended to look for more bonuses, with or without the average/skill bonus, extracting the logic from metin2 sources, maybe starting to create a base item class, a table for the item_attr etc. This is an Item class I had made (real values are for my server so don't mind it, but honestly the more I see it the more I can point to thousands of improvements lol) enum class ItemType { WEAPON, ARMOR, UNKNOWN_TYPE }; std::istream& operator>>(std::istream& is, ItemType& item_type) { int a; is >> a; item_type = static_cast<ItemType>(a); return is; } std::ostream& operator<<(std::ostream& os, const ItemType& item_type) { os << static_cast<int>(item_type); return os; } const int MAX_VALUES = 5; const int MAX_UPGRADE = 9; const int MIN_PHYS_WEAPON_POS = 3; const int MAX_PHYS_WEAPON_POS = 4; const int MIN_MAGIC_WEAPON_POS = 1; const int MAX_MAGIC_WEAPON_POS = 2; const int MIN_PHYS_ARMOR_POS = 2; const int MAX_PHYS_ARMOR_POS = 4; const int MIN_MAGIC_ARMOR_POS = 0; const int MAX_MAGIC_ARMOR_POS = 1; class Item { public: Item(std::vector<int> vec_values, ItemType item_type); ~Item(); void SetValues(std::vector<int> vec_values) { m_vec_values = vec_values; }; void SetType(ItemType item_type) { m_item_type = item_type; }; int GetValue(int value); void SetValue(int position, int value); std::vector<int> GetValuesVector(); void GenerateRealValues(int value5); ItemType GetItemType() { return m_item_type; }; void PrintRealValues(); void PrintValues(bool toFile = false); int GetMinPhysValue() { return real_phys_min_value; }; //to do: struct int GetMinMagicValue() { return real_magic_min_value; }; int GetMaxPhysValue() { return real_phys_max_value; }; int GetMaxMagicValue() { return real_magic_max_value; }; void SetName(std::string item_name) { m_item_name = item_name; } std::string GetName() { return m_item_name; } void PrintItemValues(); private: std::vector<int> m_vec_values; ItemType m_item_type; int real_phys_min_value = 0; int real_magic_min_value = 0; int real_phys_max_value = 0; int real_magic_max_value = 0; std::string m_item_name = ""; };
  17. Download I've made a simple program to test how much time and switchers a normal player would spend to find a certain value of the average damage bonus. It is possible to choose how many times you want the test to be done and, at the end, it will display how many times the bonus was over the values 30/40/50 and the average time spent to find the value desired. Pressing ESC it's possible to exit and see the results before it finds a bonus during a try (WINDOWS ONLY, but I'll probably make a Linux/OS X/BSD version). There's a define called METIN_ORIGINAL, when commented, it uses the standard library random generators, otherwise it follows the same logic used in the original sources. Example 5 tries, average bonus of value 50: Raw source code if you wanna use it without the ESC feature in other OSes (needs at least C++17 and the fmt library):
  18. Updated with check flagitems count in IsQuestStatusFindItem (download file already updated): --- Server/game/src/biologist_manager.cpp | 17 ++++++++++++++--- Server/game/src/biologist_manager.h | 2 +- Server/game/src/player_achievement_manager.cpp | 8 ++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Server/game/src/biologist_manager.cpp b/Server/game/src/biologist_manager.cpp index 23ed25be..02b17bde 100644 --- a/Server/game/src/biologist_manager.cpp +++ b/Server/game/src/biologist_manager.cpp @@ -22,7 +22,7 @@ bool CBiologistManager::IsValidQuestID(LPCHARACTER ch, const uint8_t questID) return true; } -bool CBiologistManager::IsQuestStatusFindItem(LPCHARACTER ch, std::string_view quest_name) +bool CBiologistManager::IsQuestStatusFindItem(LPCHARACTER ch, std::string_view quest_name, uint8_t questID) { auto pPC = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID()); std::string questName = utils::view_to_string(quest_name); @@ -30,8 +30,9 @@ bool CBiologistManager::IsQuestStatusFindItem(LPCHARACTER ch, std::string_view q auto findItemValue = quest::CQuestManager::Instance().GetQuestStateIndex(questName, questState); std::string questFlag = utils::string_view_concat(quest_name, ".__status"); + std::string questFlagItem = utils::string_view_concat(quest_name, utils::view_to_string(BiologistQuestFlagItemsDeliveredCount)); int questStateValue = pPC->GetFlag(questFlag); - + const uint32_t questFlagItemCount = pPC->GetFlag(questFlagItem); //if the quest has not started yet, the status can be 0 //therefore if 0, the interface cannot be opened if(questStateValue == 0) @@ -41,6 +42,10 @@ bool CBiologistManager::IsQuestStatusFindItem(LPCHARACTER ch, std::string_view q if(questStateValue != findItemValue) return false; //otherwise it's in a "finditem" state, + + if(questFlagItemCount >= BiologistQuestItemLimits[questID]) + return false; + return true; } @@ -64,7 +69,7 @@ bool CBiologistManager::CheckOpenInterface(LPCHARACTER ch) uint8_t iterVal = 0; for(const auto& val : BiologistQuestNames) { - if(IsQuestStatusFindItem(ch, val) == true){ + if(IsQuestStatusFindItem(ch, val, iterVal) == true){ SendBiologistManagerOpenCommand(ch, iterVal); return true; } @@ -238,6 +243,12 @@ void CBiologistManager::ExecuteDeliveryRequest(LPCHARACTER ch, uint8_t questID, void CBiologistManager::ResearchPacket(LPCHARACTER ch, const uint8_t questID, uint8_t subheader, uint8_t deliversCounter, uint8_t successDeliveries, uint8_t failedDeliveries, uint8_t timeDeleterUses, uint8_t elixirUses, uint8_t elixirPlusUses) { + if(ch == nullptr) + return; + + if(ch->GetDesc() == nullptr) + return; + time_t remainingTime = GetRemainingTime(ch, questID); TPacketGCBiologistManagerSendResearch p; diff --git a/Server/game/src/biologist_manager.h b/Server/game/src/biologist_manager.h index 2174854f..71b32342 100644 --- a/Server/game/src/biologist_manager.h +++ b/Server/game/src/biologist_manager.h @@ -61,7 +61,7 @@ class CBiologistManager : public singleton<CBiologistManager> CBiologistManager() = default; virtual ~CBiologistManager() = default; - bool IsQuestStatusFindItem(LPCHARACTER ch, std::string_view quest_name); + bool IsQuestStatusFindItem(LPCHARACTER ch, std::string_view quest_name, uint8_t questID); void SetQuestStateToBack(DWORD playerID, const uint8_t questID); void SendBiologistManagerOpenCommand(LPCHARACTER ch, const uint8_t questID); bool CheckOpenInterface(LPCHARACTER ch); --
  19. Well, it is basically the same thing I've said (for clarity I would define a new list of effects), but he asked that to be disabled in PvP, so I mixed the solutions Although it would be cleaner to be: if ( IS_NO_CLEAR_ON_DEATH_AFFECT(pkAff->dwType) || IS_NO_SAVE_AFFECT(pkAff->dwType) || NO_CLEAR_ON_DEATH_BUT_PVP(pkAff->dwType) ) //We assume we defined NO_CLEAR_ON_DEATH_BUT_PVP { if (!bIsPC() && NO_CLEAR_ON_DEATH_BUT_PVP(pkAff->dwType)) { ++it; continue; } else if(!NO_CLEAR_ON_DEATH_BUT_PVP(pkAff->dwType)) { ++it; continue; } }
  20. Visual Studio debugger, memory heap profiler, snapshot before and after a teleport and then having fun to track what the hell is leaking (most probably UI related stuff)
  21. Yes, everytime you tp the client will occupy additional 10~70MB of RAM and, after 4GB (because of the 32bit architecture) it would crash.
  22. The problem is not the transition to be done instantly (it's irrelevant as long as the client is still processing in the background) This is what happens when moving with W (so W pressed and left click on the bar at the same time without releasing it): [Hidden Content] This is what happens when moving just clicking left click once: [Hidden Content] Side note when I was banging my head to the wall, I stumbled upon a post saying:"Your application is most likely "freezing" because it has a WinMain loop similar to this: while (true) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } else { TickGame(); } } Guess what do we have here.. void CPythonApplication::Loop() { while (1) { if (IsMessage()) { if (!MessageProcess()) break; } else { if (!Process()) break; m_dwLastIdleTime=ELTimer_GetMSec(); } } } bool CMSApplication::IsMessage() { MSG msg; if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) return false; return true; } bool CMSApplication::MessageProcess() { MSG msg; if (!GetMessage(&msg, NULL, 0, 0)) return false; TranslateMessage(&msg); DispatchMessage(&msg); return true; }
  23. At least they compile ahah mine would print undefined references from libstdc++ (even for a simple hello word program) or verify_cgraph_node failed issues (I wanted to avoid to use fmt as an extern library and use it from the std, but oh well)
  24. Usually the default GNU-Makefile from their github (branch master) is fine, just select the same compiler as the game to not have undefined references to basic_string and what not. Also side note, gcc13 on freebsd 13.0/13.1 32bit from packages is utterly broken (at least on the latest ISOs I've tried)
×
×
  • 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.