Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. Thanks for the remark, but I never used this command in game as a player, this should be active just for debug as GM's, no sense for players. About the fix, could be done directly from here too: File: cmd_general.cpp costume Search for: snprintf(buf, bufferSize, FN_point_string(attr.bType), attr.sValue); Replace it with: [Hidden Content] hair Search for: offset = snprintf(buf, bufsiz, FN_point_string(aff->bApplyOn), aff->lApplyValue); Replace it with: const char * cPointString = FN_point_string(aff->bApplyOn); if (!*cPointString) return false; offset = snprintf(buf, bufsiz, cPointString, aff->lApplyValue); There's no sense for showing to a player 'UNK... 23%' since he don't know what it's.. I think it's better just to ignore the type if doesn't exist and don't show it in the chat. If you really want to do something like this, you can add a sys_log as an error to see the bonus missing and add it into the function.
  2. Good idea, the part of GetCompareIndex could be improved for better customization, by that people can add easily new types/subtypes. To: [Hidden Content] To: [Hidden Content]
  3. Search for: if (!kTextFileLoader.SplitLineByTab(i, &kTokenVector)) continue; Add after: if (kTokenVector.size() != MONSTER_CARD_MAX_NUM) { Tracef("CPythonPlayer::LoadMonsterCard(%s) - Strange Token Count [Line:%d / TokenCount:%d]\n", c_szFileName, i, kTokenVector.size()); continue; } for (auto & token : kTokenVector) token.erase(std::remove_if(token.begin(), token.end(), isspace), token.end()); Search for: int pkGroup = std::stoi(kTokenVector[MONSTER_CARD_GROUP]); int pkIndex = std::stoi(kTokenVector[MONSTER_CARD_INDEX]); int pkVnum = std::stoi(kTokenVector[MONSTER_CARD_VNUM]); int pkType = std::stoi(kTokenVector[MONSTER_CARD_TYPE]); int pkMap1 = std::stoi(kTokenVector[MONSTER_CARD_MAP1]); pkMap2 = std::stoi(kTokenVector[MONSTER_CARD_MAP2]); pkMap3 = std::stoi(kTokenVector[MONSTER_CARD_MAP3]); Replace with: [Hidden Content] And change # to ## from .txt file or delete them.
  4. There's no 'fast cloud' related about increasing fps. So, are useless those modifications and if we talk about fix clipping what @Nirray release, that's another subject. About speed hack fix detection you didn't mentioned the source of fix. ?
  5. Btw, instead of adding a .SetDelay() to all objects, you could do do a simple change. for all visual ani_image from screen. root/ui.py Search for: if True == value.has_key("delay"): window.SetDelay(value["delay"]) Replace with: [Hidden Content] So, you don't have to any part of python from tutorial, just this.
  6. root/uiTaskBar.py, search for this and replace with your code. net.SendChatPacket("/in_game_mall")
  7. emotion.py introCreate.py introSelect.py localeInfo.py playerSettingsModule.py uiAffectShower.py uiCharacter.py uiGuild.py uiScriptLocale.py uiToolTip.py Try to download a client which already has the wolfman defined and search for: app.ENABLE_WOLFMAN_CHARACTER.
  8. Go in /share/locale/germany/questlib.lua and add at the end of file: -- common/length.h -- enum EWearPositions local wearPositionsTable = { 'WEAR_BODY', 'WEAR_HEAD', 'WEAR_FOOTS', 'WEAR_WRIST', 'WEAR_WEAPON', 'WEAR_NECK', 'WEAR_EAR', 'WEAR_UNIQUE1', 'WEAR_UNIQUE2', 'WEAR_ARROW', 'WEAR_SHIELD', 'WEAR_ABILITY1', 'WEAR_ABILITY2', 'WEAR_ABILITY3', 'WEAR_ABILITY4', 'WEAR_ABILITY5', 'WEAR_ABILITY6', 'WEAR_ABILITY7', 'WEAR_ABILITY8', 'WEAR_COSTUME_BODY', 'WEAR_COSTUME_HAIR', 'WEAR_COSTUME_MOUNT', 'WEAR_COSTUME_SASH', 'WEAR_COSTUME_WEAPON', 'WEAR_RING1', 'WEAR_RING2', 'WEAR_BELT', 'WEAR_PENDANT', } for wearPos, wearName in ipairs(wearPositionsTable) do if type(wearName) == 'string' and string.find(wearName, "^WEAR_") then _G[wearName] = wearPos - 1 end end So, now you can use in all quests: [Hidden Content]
  9. PythonCharacterManager.cpp Search for: if (fRadiusDistance < 1500.0f) m_vecTargetInstance.push_back(pkInstTarget); Replace it with: [Hidden Content]
  10. class okno(ui.BoardWithTitleBar): def __init__(self): You forgot to initialize the BoardWithTitleBar class: ui.BoardWithTitleBar.__init__(self) For adding a button you can use: ui.MakeButton(parent, x, y, tooltipText, path, up, over, down) Also for importing excepting modules you could do something better: for (moduleName, shortModuleName) in (('playerm2g2', 'player'), ('chatm2g', 'chat'), ('chrmgrm2g', 'chrmgr')): try: module = __import__(moduleName) except: module = __import__(shortModuleName) globals()[shortModuleName] = module So, this is the whole script: [Hidden Content]
  11. I'm sure that are his hands.. @DevChuckNorris
  12. [Hidden Content] #define ITEM_SOCKET_MAX_NUM 3 int main() { long lSockets[ITEM_SOCKET_MAX_NUM] = { 1, 2, 3 }; long lSockets2[ITEM_SOCKET_MAX_NUM] = { 1, 2, 3 }; cout << (memcmp(lSockets, lSockets2, sizeof(long) * ITEM_SOCKET_MAX_NUM) == 0) << endl; return 0; } //>> 1
  13. For those who need FN_compare_item_socket function and also with fixed 'memory leak' which already is public. Srcs/game/src/char_item.cpp 1.0) Add at the beginning of file: static bool FN_compare_item_socket(const LPITEM pkItemSrc, const LPITEM pkItemDest) { if (!pkItemSrc || !pkItemDest) return false; return memcmp(pkItemSrc->GetSockets(), pkItemDest->GetSockets(), sizeof(long) * ITEM_SOCKET_MAX_NUM) == 0; } 2.0) Search for: 2.1) Replace it with: [Hidden Content]
  14. You can do it directly with python, without doing a new function in binary. item.SelectItem(changelookvnum) print(item.GetItemName()) And if you really need it, you can do it as: [Hidden Content]
  15. @PACI That's right, i just wrote it fast without thinking about current pc and selected one. So basically after i checked again, seems that the're two ways to get this: You don't have a party at all. You've a party but your leader is offline and his character pointer is marked as null pointer since he got disconnected. I think that's why @Gurgarath said it's very rarely this crash, because of offline>null leader and trying to access the function GetVID() of it. So, if you want to show a message in game while doing the action, you could put this check before accessing the vid and do something with it, players will know that they doesn't satisfy one of these conditions. if (npc.get_leader_vid() == 0) then syschat("You don't have a party or the leader is offline.") return end And you need to modify the function like this for being able to do this check. [Hidden Content]
  16. Thanks for the fix, ymir left a lot of shits like these, this is an official quest example where you could get this crash core. Normally, if you want to get the party leader vid in some functions, of course we need to check if there's a party before accessing the function and don't even call it. You just have to use party.is_party before calling the function and everything will be fine, also you could put a message in your quests that player will know there's a problem (not just an error in server side that you will don't know where it comes from). So with that everybody will know that they're missing a condition and will stop the event/dungeon or something else. if not party.is_party() then syschat("You need a party for doing this.") return end This is an example of how should be the quest: (based on official example < spiderKingEgg) when 8002.kill with party.is_party() begin local npc_leader_vid = npc.get_leader_vid() syschat(string.format("%d", npc_leader_vid)) end So, by doing that you can leave the function without the syserr which is irrelevant since is a condition from game and if something happens the result will be 0 all time. [Hidden Content]
  17. If you want to translate the fields from datetime module which they're translated depending of locale, you need to change the locale name, from: locale.setlocale(locale.LC_ALL, 'turkish') To: (you don't need to use also LC_ALL, since you use the module just for time) locale.setlocale(locale.LC_TIME, 'english') If you want to translate automatically based on player OS default language with a correct way and safe, i tried to do something like this for test, works fine. ? [Hidden Content]
  18. There's no reason to use pids instead of names, for doing that you've to re-code the whole structure of the system. Ymir did when you change your name to delete all fields from table that match with the old name (account or companion). So in this case, instead of deleting the whole list you can simply update it. Srcs/Server/game/src/questlua_pc.cpp [Hidden Content] Or: std::auto_ptr<SQLMsg> pUpdate(DBManager::instance().DirectQuery( "UPDATE messenger_list SET " "account = CASE WHEN account = '%s' THEN '%s' ELSE account END, " "companion = CASE WHEN companion = '%s' THEN '%s' ELSE companion END", ch->GetName(), szName, ch->GetName(), szName);
  19. Skill levels depends of skill grade also you've to clean the tooltip each time. [Hidden Content]
  20. Why you modify the buffer size to 512? Your file name has more than 225 characters? I'm sure not, it's enough 256. Also you should do a check if your water texture file exists in your path for sure, otherwise everything will be fucked up with the array when trying to get texture pointer and function D3D texture. (possible crash because of nullptr) So, you should change: m_WaterInstances[i].SetImagePointer((CGraphicImage *)CResourceManager::Instance().GetResourcePointer(buf)); With: if (CResourceManager::Instance().IsFileExist(buf)) m_WaterInstances[i].SetImagePointer(dynamic_cast<CGraphicImage *>(CResourceManager::Instance().GetResourcePointer(buf))); Also, instead of change everywhere 30 with 99 or what value you want, you should do a constant variable and use it everywhere. [Hidden Content] Also this is the good method for accessing the array with a safe method. STATEMANAGER.SetTexture(0, m_WaterInstances[((ELTimer_GetMSec() / 70) % 30)].GetTexturePointer()->GetD3DTexture()); [...] auto pImageInstance = m_WaterInstances[(ELTimer_GetMSec() / 70) % _countof(m_WaterInstances)]; if (pImageInstance.GetTexturePointer()) STATEMANAGER.SetTexture(0, pImageInstance.GetTexturePointer()->GetD3DTexture());
  21. This method is good for old compilers, but I would use regex right now, you've an example in a tool what i did some time ago. [Hidden Content] Should look like: [Hidden Content]
  22. The basic changes are: From: def __SelectSkillGroup(self, index): for btn in self.skillGroupButton: btn.SetUp() self.skillGroupButton[index].Down() if self.__CanUseHorseSkill(): if 0 == index: index = net.GetMainActorSkillGroup()-1 elif 1 == index: index = self.PAGE_HORSE self.curSelectedSkillGroup = index self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire()) To: [Hidden Content] After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code. Without skill group +/- horse riding: [Hidden Content] With skill group +/- horse riding: [Hidden Content]
×
×
  • 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.