Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/29/19 in all areas

  1. Hi everyone, I would like to share a memory leak fix about pack type Hybrid, Hybrid with SDB and panama. I saw it while analyzing Webzen's new pack type. EterPack.cpp Search this: if( !m_pCSHybridCryptPolicy->DecryptMemory(std::string(filename), static_cast<const BYTE*>(*data), index->data_size, *zObj) ) { return false; } Replace with this if( !m_pCSHybridCryptPolicy->DecryptMemory(std::string(filename), static_cast<const BYTE*>(*data), index->data_size, *zObj) ) { delete zObj; return false; } Search this: if( !m_pCSHybridCryptPolicy->GetSupplementaryDataBlock(std::string(filename), pSDBData, iSDBSize) ) { return false; } Replace with this if( !m_pCSHybridCryptPolicy->GetSupplementaryDataBlock(std::string(filename), pSDBData, iSDBSize) ) { delete zObj; return false; } Search this: else if (COMPRESSED_TYPE_PANAMA == index->compressed_type) { CLZObject * zObj = new CLZObject; __Decrypt_Panama(filename, static_cast<const BYTE*>(*data), index->data_size, *zObj); out_file.BindLZObjectWithBufferedSize(zObj); *data = zObj->GetBuffer(); } Replace with this: else if (COMPRESSED_TYPE_PANAMA == index->compressed_type) { CLZObject * zObj = new CLZObject; if (!__Decrypt_Panama(filename, static_cast<const BYTE*>(*data), index->data_size, *zObj)) { delete zObj; return false; } out_file.BindLZObjectWithBufferedSize(zObj); *data = zObj->GetBuffer(); } Best Regards Ken
    3 points
  2. bool CShopManager::StartShopping(LPCHARACTER pkChr, LPCHARACTER pkChrShopKeeper, int iShopVnum) You're bound to give: pkChr = CQuestManager::instance().GetCurrentCharacterPtr(); pkChrShopKeeper = CQuestManager::instance().GetCurrentNPCCharacterPtr(); iShopVnum = (int) lua_tonumber(L, 1); If you want to open just from quest kinda letter, you must make a new boolean function to start shopping without pkChrShopKeeper.
    1 point
  3. int npc_open_shop(lua_State * L) { int iShopVnum = 0; if (lua_gettop(L) == 1) { if (lua_isnumber(L, 1)) iShopVnum = (int) lua_tonumber(L, 1); } if (CQuestManager::instance().GetCurrentNPCCharacterPtr()) CShopManager::instance().StartShopping(CQuestManager::instance().GetCurrentCharacterPtr(), CQuestManager::instance().GetCurrentNPCCharacterPtr(), iShopVnum); else sys_err(" !NPCCharacterPtr"); return 0; } Ok this is right. When you give it from LUA you can decide to use npc.shop_open() or npc.shop_open(SHOP_VNUM)
    1 point
  4. int npc_open_shop(lua_State * L) { int iShopVnum = 0; if (lua_gettop(L) == 1) { if (lua_isnumber(L, 1)) iShopVnum = (int) lua_tonumber(L, 1); } if (iShopVnum && CQuestManager::instance().GetCurrentNPCCharacterPtr()) CShopManager::instance().StartShopping(CQuestManager::instance().GetCurrentCharacterPtr(), CQuestManager::instance().GetCurrentNPCCharacterPtr(), iShopVnum); else sys_err("Wrong iShopVnum || !NPCCharacterPtr"); return 0; }
    1 point
  5. [Hidden Content] How it works: When player is trying to use buffs on npc/enemy then mouse target is automatically set to main character VID (You can't buff npc/enemy anyway from server side + You can't change target while using skills) UserInterface/PythonPlayerSkill.cpp Search: bool CPythonPlayer::__UseSkill(DWORD dwSlotIndex) Scroll down and search for: if (!pkInstTarget) { // ľ÷µĄŔĚĆ®ÇĎ°í.. __ChangeTargetToPickedInstance(); // ´Ů˝Ă ľňľîł˝´Ů. if (pSkillData->IsNeedCorpse()) pkInstTarget=__GetDeadTargetInstancePtr(); else pkInstTarget=__GetAliveTargetInstancePtr(); } Under: if (pkInstTarget) Paste this: if ((pkInstTarget->IsNPC() || pkInstTarget->IsEnemy() || pkInstTarget->IsStone() || pkInstTarget->IsStoneDoor()) && pSkillData->IsOnlyForAlliance()) { DWORD TargetVid = pkInstMain->GetVirtualID(); SetTarget(TargetVid, TRUE); } Should look like this: This is my way to solve the problem?
    1 point
  6. Hello guys, first sorry for my bad english. Thank you for share, i have just one reservation. Its a centering of string. Your centering is not good because if i have lenght > 1, i have the result more left. Here is my proposal to improvement startNumber = 0 for slot in self.quickslot: for i in xrange(4): slotNumber = i+startNumber (Type, Position) = player.GetLocalQuickSlot(slotNumber) if player.IsSkillCoolTime(Position): (coolTime, elapsedTime) = player.GetSkillCoolTime(Position) slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime) cooldownDelay = 0 cooldown = int(coolTime-elapsedTime+cooldownDelay) self.cooldownText[slotNumber].SetOutline() self.cooldownText[slotNumber].SetText("%d" % cooldown) cooldown = str(cooldown) if len(cooldown) <= 1: self.cooldownText[slotNumber].SetPosition(8,0) else: self.cooldownText[slotNumber].SetPosition(8 - (len(cooldown) + 2), 0) self.cooldownText[slotNumber].Show() else: self.cooldownText[slotNumber].Hide() startNumber += 4 if len(cooldown) <= 1: self.cooldownText[slotNumber].SetPosition(8,0) else: self.cooldownText[slotNumber].SetPosition(8 - (len(cooldown) + 2),0) self.cooldownText[slotNumber].Show() EDIT: This is good if i have bold:16. If you use more bold, u must change SetPosition(8 - (len(cooldown) + 2), 0) to SetPosition(8 - (len(cooldown) + x), 0). If your bold is highest, x is highest too. How much? You must try.
    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.