Jump to content

Elijah

Members
  • Content count

    15
  • Posts on chatbox

    9
  • Joined

  • Last visited

  • Days Won

    3

Elijah last won the day on October 1

Elijah had the most liked content!

Community Reputation

273 M2tec Advanced

About Elijah

  • Rank
    M2tec Member

Recent Profile Visitors

267 profile views
  1. You can fiind that in Rubinum source.
  2. Description: [Hidden Content] // 1. PythonPlayerInput.cpp // 1.0. Search: void CPythonPlayer::PickCloseItem() { ... } // 1.0. Add after: void CPythonPlayer::PickCloseItemVector() { CInstanceBase * pkInstMain = NEW_GetMainActorPtr(); if (!pkInstMain) return; TPixelPosition kPPosMain; pkInstMain->NEW_GetPixelPosition(&kPPosMain); std::vector<DWORD> itemVidList; CPythonItem& rkItem=CPythonItem::Instance(); if (!rkItem.GetCloseItemVector(pkInstMain->GetNameString(), kPPosMain, itemVidList)) return; if(itemVidList.empty()) return; for(int i = 0; i < itemVidList.size(); i++) SendClickItemPacket(itemVidList[i]); } // 2. PythonItem.cpp // 2.0. Search: bool CPythonItem::GetCloseItem (const std::string& myName, const TPixelPosition& c_rPixelPosition, DWORD* pdwItemID, DWORD dwDistance) { .... } // 2.0. Add after: bool CPythonItem::GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList) { DWORD dwCloseItemDistance = 1000 * 1000; TGroundItemInstanceMap::iterator i; for (i = m_GroundItemInstanceMap.begin(); i != m_GroundItemInstanceMap.end(); ++i) { TGroundItemInstance * pInstance = i->second; DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x); DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y)); DWORD dwDistance = DWORD(dwxDistance * dwxDistance + dwyDistance * dwyDistance); if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName)) { itemVidList.push_back(i->first); } } return true; } // 3. PythonItem.h // 3.0. Search: bool GetCloseMoney(const TPixelPosition & c_rPixelPosition, DWORD* dwItemID, DWORD dwDistance=300); // 3.0. Adauga sub: bool GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList); // 4. PythonPlayer.cpp // 4.0. Search and replace: void CPythonPlayer::SendClickItemPacket(DWORD dwIID) { if (IsObserverMode()) return; const char * c_szOwnerName; if (!CPythonItem::Instance().GetOwnership(dwIID, &c_szOwnerName)) return; if (strlen(c_szOwnerName) > 0) if (0 != strcmp(c_szOwnerName, GetName())) { CItemData * pItemData; if (!CItemManager::Instance().GetItemDataPointer(CPythonItem::Instance().GetVirtualNumberOfGroundItem(dwIID), &pItemData)) { Tracenf("CPythonPlayer::SendClickItemPacket(dwIID=%d) : Non-exist item.", dwIID); return; } if (!IsPartyMemberByName(c_szOwnerName) || pItemData->IsAntiFlag(CItemData::ITEM_ANTIFLAG_DROP | CItemData::ITEM_ANTIFLAG_GIVE)) { PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotPickItem", Py_BuildValue("()")); return; } } CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance(); rkNetStream.SendItemPickUpPacket(dwIID); } // 5. PythonPlayerModule.cpp // 5.0. Search: PyObject * playerPickCloseItem(PyObject* poSelf, PyObject* poArgs) { CPythonPlayer::Instance().PickCloseItem(); return Py_BuildNone(); } // 5.0. Add after: PyObject * playerPickCloseItemVector(PyObject* poSelf, PyObject* poArgs) { CPythonPlayer::Instance().PickCloseItemVector(); return Py_BuildNone(); } // 5.1. Search: { "PickCloseItem", playerPickCloseItem, METH_VARARGS }, // 5.1.Add after:: { "PickCloseItemVector", playerPickCloseItemVector, METH_VARARGS }, // 6. PythonPlayer,h // 6.0. Search: void PickCloseItem(); // 6.0. Add after: void PickCloseItemVector(); // 7. game.py // 7. Search: player.PickCloseItem() // 7. Replace with: player.PickCloseItemVector() // You can make option for fast pickup or not.
  3. Author of this system is ME. Remove password for arhive(FOR WHAT YOU DO THAT ?) and put the name of creator for this system into topic. And about problems, who has minimal knowledge about code, he can solve the problems. This sistem appear on internet because of resellers(that is not a problem), but i don't accept "your password" for arhive and the problem for nonexistent COPYRIGHT. Thanks. (Axel .Channel) - Wrong google account. Sorry
  4. def AppendMaterialToRefineDialog(self, vnum, count): ...
  5. Auto refine option when you upgrade the item with SCROLL or on NPC. I did all checks like example : When you have just one scroll in inventory, refine window will be close. When the item is already maximum upgrade. (+8 to +9 just in case will be succes) and more .. Preview: [Hidden Content] Download : [Hidden Content]
  6. // If you use my special storage, and ofc if you want add "ACMD(do_sort_special_storage);" too. ^ //////////// CMD.CPP //////////// Search : ACMD(do_stun); Add after : #ifdef ENABLE_SORT_INVENTORY ACMD(do_sort_items); ACMD(do_sort_special_storage); #endif Search: { "notice", do_notice, 0, POS_DEAD, GM_LOW_WIZARD }, Add after : #ifdef ENABLE_SORT_INVENTORY { "click_sort_items", do_sort_items, 0, POS_DEAD, GM_PLAYER }, { "click_sort_special_storage", do_sort_special_storage, 0, POS_DEAD, GM_PLAYER }, #endif //////////// CMD_GNERAL.CPP //////////// ADD THIS : #ifdef ENABLE_SORT_INVENTORY ACMD (do_sort_items) { if (ch->IsDead() || ch->GetExchange() || ch->IsShop() || ch->IsOpenSafebox() || ch->IsCubeOpen()) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sort your inventory with those windows open.")); return; } int lastSortInventoryPulse = ch->GetSortInventoryPulse(); int currentPulse = thecore_pulse(); if (lastSortInventoryPulse > currentPulse) { int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (currentPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); return; } for (int i = 0; i < INVENTORY_MAX_NUM; ++i) { LPITEM item = ch->GetInventoryItem(i); if(!item) continue; if(item->isLocked()) continue; if(item->GetCount() == g_bItemCountLimit) continue; if (item->IsStackable() && !IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK)) { for (int j = i; j < INVENTORY_MAX_NUM; ++j) { LPITEM item2 = ch->GetInventoryItem(j); if(!item2) continue; if(item2->isLocked()) continue; if (item2->GetVnum() == item->GetVnum()) { bool bStopSockets = false; for (int k = 0; k < ITEM_SOCKET_MAX_NUM; ++k) { if (item2->GetSocket(k) != item->GetSocket(k)) { bStopSockets = true; break; } } if(bStopSockets) continue; BYTE bAddCount = MIN(g_bItemCountLimit - item->GetCount(), item2->GetCount()); item->SetCount(item->GetCount() + bAddCount); item2->SetCount(item2->GetCount() - bAddCount); continue; } } } } ch->SetNextSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(60)); } ACMD (do_sort_special_storage) { if (ch->IsDead() || ch->GetExchange() || ch->IsShop() || ch->IsOpenSafebox() || ch->IsCubeOpen()) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sort your inventory with those windows open.")); return; } int lastSortSpecialStoragePulse = ch->GetSortSpecialStoragePulse(); int currentPulse = thecore_pulse(); if (lastSortSpecialStoragePulse > currentPulse) { int deltaInSeconds = ((lastSortSpecialStoragePulse / PASSES_PER_SEC(1)) - (currentPulse / PASSES_PER_SEC(1))); int minutes = deltaInSeconds / 60; int seconds = (deltaInSeconds - (minutes * 60)); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can sort your inventory again in %02d seconds."), seconds); return; } for (int m = 0; m < 3; m++) { for (int i = 0; i < SPECIAL_INVENTORY_MAX_NUM; ++i) { LPITEM item; switch(m) { case 0: item = ch->GetUpgradeInventoryItem(i); break; case 1: item = ch->GetBookInventoryItem(i); break; case 2: item = ch->GetStoneInventoryItem(i); break; default: item = ch->GetUpgradeInventoryItem(i); break; } if(!item) continue; if(item->isLocked()) continue; if(item->GetCount() == g_bItemCountLimit) continue; if (item->IsStackable() && !IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK)) { for (int j = i; j < SPECIAL_INVENTORY_MAX_NUM; ++j) { LPITEM item2; switch(m) { case 0: item2 = ch->GetUpgradeInventoryItem(j); break; case 1: item2 = ch->GetBookInventoryItem(j); break; case 2: item2 = ch->GetStoneInventoryItem(j); break; default: item2 = ch->GetUpgradeInventoryItem(j); break; } if(!item2) continue; if(item2->isLocked()) continue; if (item2->GetVnum() == item->GetVnum()) { bool bStopSockets = false; for (int k = 0; k < ITEM_SOCKET_MAX_NUM; ++k) { if (item2->GetSocket(k) != item->GetSocket(k)) { bStopSockets = true; break; } } if(bStopSockets) continue; BYTE bAddCount = MIN(g_bItemCountLimit - item->GetCount(), item2->GetCount()); item->SetCount(item->GetCount() + bAddCount); item2->SetCount(item2->GetCount() - bAddCount); continue; } } } } } ch->SetNextSortSpecialStoragePulse(thecore_pulse() + PASSES_PER_SEC(60)); } #endif //////////// char.cpp //////////// Search : m_iSyncHackCount = 0; Add after: #ifdef ENABLE_SORT_INVENTORY m_sortInventoryPulse = 0; m_sortSpecialStoragePulse = 0; #endif //////////// char.h //////////// Search : void GiveGold(INT iAmount); Add after : #ifdef ENABLE_SORT_INVENTORY void SetNextSortInventoryPulse(int pulse) { m_sortInventoryPulse = pulse; } int GetSortInventoryPulse() { return m_sortInventoryPulse; } void SetNextSortSpecialStoragePulse(int pulse) { m_sortSpecialStoragePulse = pulse; } int GetSortSpecialStoragePulse() { return m_sortSpecialStoragePulse; } #endif Search : LPSHOP m_pkShop; LPSHOP m_pkMyShop; std::string m_stShopSign; LPCHARACTER m_pkChrShopOwner; Add after : #ifdef ENABLE_SORT_INVENTORY int m_sortInventoryPulse; int m_sortSpecialStoragePulse; #endif /////// Service.h //////// Add this : #define ENABLE_SORT_INVENTORY Description : [Hidden Content]
  7. I think that need to moved from this section. ^
  8. Yes, my release ^^ Tutorial is in english ....
  9. What system, 3 lines of code ?
  10. I think this post need to be here, [Hidden Content]
  11. What missing ? (I am the author.)
  12. Isn't a best method ... ((LPITEM)*it)->RemoveFromCharacter(); ........ ((LPITEM)*it1)->AddToCharacter .......... Anyway, it's just a release. Thanks.
×