-
Posts
656 -
Joined
-
Last visited
-
Days Won
187 -
Feedback
100%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by VegaS™
-
-
Try this.
Search for:
self.itemSlot = self.GetChild("item_slot")
Add after:
self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem)) self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
Search for:
self.itemSlot.SetOverInItemEvent = lambda arg = vnum: self.OverInItem(arg) self.itemSlot.SetOverOutItemEvent = lambda arg = self.tooltipItem: self.OverOutItem(arg)
Replace it with:
# Clear the tooltip line. self.tooltipItem.ClearToolTip() # Insert the description of item. self.tooltipItem.SetInventoryItem(vnum) # Hide the tooltip line because after you insert a description, the ShowToolTip is called. self.tooltipItem.HideToolTip()
Search for:
def OverInItem(self, vnum): self.tooltipItem.SetInventoryItem(vnum) self.tooltipItem.Show() def OverOutItem(self, tooltip): self.tooltipItem.HideToolTip() self.tooltipItem.ClearToolTip()
Replace it with:
def OverInItem(self): if self.tooltipItem: self.tooltipItem.ShowToolTip() def OverOutItem(self): if self.tooltipItem: self.tooltipItem.HideToolTip()
- 2
-
-
-
-
Users:
- 3
- 1
- 13
-
In your case WARP_SCROLLS is the index not the tuple or list that you are searching, because it is non-iterable type, you are getting this error.
m2devList = [1000, 2000, 3000] for item in m2devList: print item >> 1000 >> 2000 >> 3000
You're attempting to check if 22010 is in itemVnum, which does not make sense.
in smth
operator expects an iterable object on the right side but you are providing an integer.Either use:
#elif itemVnum in WARP_SCROLLS: elif itemVnum == WARP_SCROLLS: # do smth
Or fix your problem, go in uiToolTip.py and replace:
WARP_SCROLLS=22010
With:
WARP_SCROLLS = (22010, )
- 1
-
-
Wrong arguments.
-- pc_set_another_quest_flag pc.setf('channel_syserr','open', 999) -- pc_get_another_quest_flag local value = pc.getf("channel_syserr", "open")
- 1
-
#ifdef ENABLE_EXTENDED_ALIGNMENT_SYSTEM const auto itor = g_TitleNameMap.find(iAlignmentGrade); #else std::map<int, std::string>::iterator itor = g_TitleNameMap.find(iAlignmentGrade); #endif
- 1
-
On 2/24/2019 at 4:59 PM, xP3NG3Rx said:
Btw, here is my reversed class for the Monstercard render target, you can check it for your own ideas.
This one is still not compatible with this base, so you have to code it by yourself to make it work.
Practice .Haha, i did it long time ago, now you make it public, danke sexy p3nger.
I think i will post my full version, soon.
- 10
-
I don't know why you need it, but have fun.
How-To-Use:
# General: chrmgr.GetPlayerID(vid) # Example: uiTarget.py import chat, chrmgr def SetTargetVID(self, vid): self.vid = vid chat.AppendChat(chat.CHAT_TYPE_INFO, 'SetTargetVID - vid({:d}), pid({:d})'.format(self.vid, chrmgr.GetPlayerID(self.vid)))
- Src/Client/UserInterface/InstanceBase.h
//1.1) Search for: public: const TPixelPosition& NEW_GetDstPixelPositionRef(); //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT public: void SetPlayerID(const DWORD dwPID) { m_dwPlayerID = dwPID; } const DWORD GetPlayerID() { return m_dwPlayerID; } protected: DWORD m_dwPlayerID; #endif
- Src/Client/UserInterface/InstanceBase.cpp
//1.1) Search for: SetVirtualID(c_rkCreateData.m_dwVID); //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT if (IsPC()) SetPlayerID(c_rkCreateData.m_dwPlayerID); #endif //2.1) Search for: m_dwEmoticonTime = 0; //2.2) Add after: #ifdef ENABLE_PID_TO_CLIENT m_dwPlayerID = 0; #endif
- Src/Client/UserInterface/PythonCharacterManagerModule.cpp
//1.1) Search for: { "RegisterTitleColor", chrmgrRegisterTitleColor, METH_VARARGS }, //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT { "GetPlayerID", chrmgGetPID, METH_VARARGS }, #endif //2.1) Search for: { "RegisterTitleColor", chrmgrRegisterTitleColor, METH_VARARGS }, //2.2) Add after: #ifdef ENABLE_PID_TO_CLIENT PyObject * chrmgGetPID(PyObject* poSelf, PyObject* poArgs) { int nVID; if (!PyTuple_GetInteger(poArgs, 0, &nVID)) return Py_BadArgument(); CPythonCharacterManager & rkChrMgr = CPythonCharacterManager::Instance(); CInstanceBase * pkInstBase = rkChrMgr.GetInstancePtr(nVID); if (!pkInstBase) return Py_BuildValue("i", 0); return Py_BuildValue("i", (pkInstBase->IsPC()) ? pkInstBase->GetPlayerID() : 0); } #endif
- Src/Client/UserInterface/NetworkActorManager.cpp
//1.1) Search for: CInstanceBase::SCreateData kCreateData; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT kCreateData.m_dwPlayerID=rkNetActorData.m_dwPlayerID; #endif //2.1) Search in SNetworkActorData::SNetworkActorData() for: m_dwVID=0; //2.2) Add after: #ifdef ENABLE_PID_TO_CLIENT m_dwPlayerID = 0; #endif //3.1) Search in void SNetworkActorData::__copy__(const SNetworkActorData& src) for: m_dwVID = src.m_dwVID; //3.2) Add after: #ifdef ENABLE_PID_TO_CLIENT m_dwPlayerID = src.m_dwPlayerID; #endif
- Src/Client/UserInterface/NetworkActorManager.h
//1.1) Search for: DWORD m_dwVID; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT DWORD m_dwPlayerID; #endif
- Src/Client/UserInterface/PythonNetworkStreamPhaseGameActor.cpp
//1.1) Search for: kNetActorData.m_stName = chrInfoPacket.name; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT kNetActorData.m_dwPlayerID = chrInfoPacket.dwPlayerID; #endif
- Src/Client/UserInterface/Packet.h
//1.1) Search in packet_char_additional_info for: DWORD dwVID; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT DWORD dwPlayerID; #endif
Src/Client/UserInterface/Locale_inc.h
#define ENABLE_PID_TO_CLIENT
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
- Src/Server/game/src/char.cpp
//1.1) Search for: addPacket.bEmpire = m_bEmpire; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT addPacket.dwPlayerID = IsPC() ? GetPlayerID() : 0; #endif
- Src/Server/game/src/packet.h
//1.1) Search in packet_char_additional_info for: DWORD dwVID; //1.2) Add after: #ifdef ENABLE_PID_TO_CLIENT DWORD dwPlayerID; #endif
- Src/Server/common/service.h
#define ENABLE_PID_TO_CLIENT
- 1
-
You can use:
- localeInfo.NumberToMoneyString
def NumberToMoneyString(n) : if n <= 0 : return "0 %s" % (MONETARY_UNIT0) return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0)
The current function return a value + MONETARY_UNIT0, you can split it and don't need any new function.
print localeInfo.NumberToMoneyString(2147483647) #Result: 2.147.483.647 Yang print localeInfo.NumberToMoneyString(2147483647).split(' ')[0] #Result: 2.147.483.647
I don't know what structure you have in hpMobsList, but here's a example.
maxHP = self.hpMobsList[chr.GetRace()] minHP = int(float(hpPercentage) / 100.00 * float(maxHP)) self.textHP.SetText("TP: {:s}/{:s}".format(localeInfo.NumberToMoneyString(minHP).split(' ')[0], localeInfo.NumberToMoneyString(int(maxHP)).split(' ')[0]))
-
-
Try to replace:
vnums = sorted(vnums)
With:
vnums.sort()
- 1
-
M2 Download Center
( Internal )
( GitHub )
Metin2 Color Formatter
A simple class writted for Python and C++ which convert the param-values into an string by a specific color rgb as hexadecimals.
-
Color constants module:
https://www.webucator.com/blog/2015/03/python-color-constants-module/ https://www.color-hex.com/color/ccffff
-
Python:
from cff import CFF text = CFF.format('Metin2', 'green') text = CFF.format(8000, 'banana') text = CFF.format(412.55, 'red') text = CFF.format('Pending', '#113355') text = CFF.format('Item name:', 'springgreen', CFF.FLAG_NEW_TAB) + CFF.format(item.GetItemName(), 'chocolate') text = CFF.multi_format(('a', 'b', 'c'), 'red') # text[0], text[1], text[2]
-
C++:
#include "cff.h" std::string text = CFF::format("Metin2", "green"); std::string text = CFF::format(std::to_string(8000), "banana"); std::string text = CFF::format(std::to_string(412.55), "red"); std::string text = CFF::format("Pending", "#113355"); std::string text = CFF::format("Item name:", "springgreen", CFF::FLAG_NEW_TAB) + CFF::format(pItemData->GetName(), "chocolate"); std::vector<string> text = CFF::multi_format({"a", "b", "c"}, "red"); // text[0], text[1], text[2]
Github repository:
- 25
- 1
- 1
- 5
- 3
- 22
-
Color constants module:
-
- 2
-
- https://metin2dev.org/board/index.php?/topic/20625-nul-nul-in-syserr/ - 07:38
- https://metin2dev.org/board/index.php?/topic/20626-nul-nul-in-syserr/ - 07:45
(1.3) Spamming
Do not spam in this board. Posting a topic or a question once is enough. If you don't get an answer maybe your question needs more description. Or nobody is able to help you there. Double post aswell as double threads will be punished with an infraction.
- 1
-
Good idea, but you should return false if GetDesc is nullptr, not true.
static const bool __FN_check_ip_ptr(const LPCHARACTER pkChr, const LPCHARACTER pkTargetChr) { if (!pkChr || !pkTargetChr) return false; const LPDESC pkDesc = pkChr->GetDesc(); const LPDESC pkTargetDesc = pkTargetChr->GetDesc(); if (!pkDesc || !pkTargetDesc) return false; const std::string & stIPAddress1 = pkDesc->GetHostName(); const std::string & stIPAddress2 = pkTargetDesc->GetHostName(); return (!stIPAddress1.compare(stIPAddress2)); } static const bool __FN_check_ip_str(const std::string & stIPAddress1, const std::string & stIPAddress2) { return (!stIPAddress1.compare(stIPAddress2)); } // const bool bIsSameIP = __FN_check_ip_ptr(ch, tch); // const bool bIsSameIP = __FN_check_ip_str(row[0], row[1]);
It's a little bit useless if two guys play metin2 from same network connection, as @Chyu ^^ said.
We can use HWID (Hardware Identification) for this detection, much better.- 5
-
Nice idea, but I'd use crypt.triple_des, for save data, like:
# write open(fileName, 'wb').write((crypt.triple_des(unhex(your_hex_str))).encrypt(cPickle.dumps({'userID': userID, 'userPassword': userPassword}), ' ')) # read self.loginDataDict = cPickle.loads((crypt.triple_des(unhex(your_hex_str))).decrypt(open(fileName, "rb").read(), ' '))
- 2
- 1
-
self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE % self.selectedItem.GetName())
- 1
-
I rewritted the localeInfo.py many years ago and erased all the code which isn't used like korean characters < bad encoding and more checks. (from 900+ lines to 400)
- 2
-
2 minutes ago, PeaceMaker said:
Yeah but having an F next to Alignment makes no sense xD
QuoteTitle names for female are just for test, you can replace them how you want.
In many games the alignment or grades are by specific sex.
- 1
-
Your compiler doesn't support this feature (list initialization (since C++11)).
Replace:
const std::vector<const std::string> vecTitleName{c_szTitleNameF, c_szTitleNameM};
With:
std::vector<const std::string> vecTitleName; vecTitleName.push_back(c_szTitleNameF); vecTitleName.push_back(c_szTitleNameM);
Or:
const char * c_szTitles[] = {c_szTitleNameF, c_szTitleNameM}; const std::vector<const std::string> vecTitleName(c_szTitles, c_szTitles + sizeof(c_szTitles) / sizeof(c_szTitles[0]));
- 1
- 3
-
This fix is very bad, you can use RE library and fix it with 3-4 lines.
m = re.search('\|c([a-zA-Z0-9]+)\|h', '|cFF29bfbf|hMetin2 is dead.') # TODO: Replace |h|r with: str() # TODO: Replace |c + m.groups()[0] + |h with: str()
Is just an example, good luck.
- 2
- 1
- 6
Glass of Insight - block using on shout chat
in Community Support - Questions & Answers
Posted · Edited by VegaS™
Yes, we can do this in server/client-side, but need some extra-checks for item attr/scokets + if exists in inventory.
But have no sense to fix it since you don't want the players to do this.
Why you don't disable the function chatGetLinkFromHyperlink from source client and python and showing just the tooltip when you put the mouse over the link, remove ALT+LEFT CLICK.
//#define ENABLE_LINK_FROM_HYPERLINK // Enable copy a item link from hyperlink with ALT+CLICK.