Probier es mal hiermit:
Öffne die PythonPlayerModule.cpp
suche nach:
- PyObject * playerGetItemLink(PyObject * poSelf, PyObject * poArgs)
Ersetz die ganze Funktion damit:
- PyObject * playerGetItemLink(PyObject * poSelf, PyObject * poArgs)
- {
- TItemPos Cell;
- switch (PyTuple_Size(poArgs))
- {
- case 1:
- if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
- return Py_BuildException();
- break;
- case 2:
- if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
- return Py_BuildException();
- if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
- return Py_BuildException();
- break;
- default:
- return Py_BuildException();
- }
- const TItemData * pPlayerItem = CPythonPlayer::Instance().GetItemData(Cell);
- CItemData * pItemData = NULL;
- char buf[1024];
- if (pPlayerItem && CItemManager::Instance().GetItemDataPointer(pPlayerItem->vnum, &pItemData))
- {
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- char itemlink[256 + 12];
- #else
- char itemlink[256];
- #endif
- int len;
- bool isAttr = false;
- len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x", pPlayerItem->vnum, pPlayerItem->flags, pPlayerItem->alSockets[0], pPlayerItem->alSockets[1], pPlayerItem->alSockets[2]);
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x", pPlayerItem->transmutation);
- #endif
- for (int i = 0; i < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++i)
- if (pPlayerItem->aAttr[i].bType != 0)
- {
- len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d",
- pPlayerItem->aAttr[i].bType, pPlayerItem->aAttr[i].sValue);
- isAttr = true;
- }
- if (GetDefaultCodePage() == CP_ARABIC) {
- if (isAttr)
-
- snprintf(buf, sizeof(buf), " |h|r[%s]|cffffc700|H%s|h", pItemData->GetName(), itemlink);
- else
- snprintf(buf, sizeof(buf), " |h|r[%s]|cfff1e6c0|H%s|h", pItemData->GetName(), itemlink);
- }
- else {
- if (isAttr)
-
- snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
- else
- snprintf(buf, sizeof(buf), "|cfff1e6c0|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
- }
- }
- else
- buf[0] = '\0';
- return Py_BuildValue("s", buf);
- }
Alles anzeigen
Dann gehst Du noch ins PythonChatModule, suchst dort nach:
- PyObject * chatGetLinkFromHyperlink(PyObject * poSelf, PyObject * poArgs)
und ersetzt die Func hiermit:
- PyObject * chatGetLinkFromHyperlink(PyObject * poSelf, PyObject * poArgs)
- {
- char * szHyperlink;
- if (!PyTuple_GetString(poArgs, 0, &szHyperlink))
- return Py_BuildException();
- std::string stHyperlink(szHyperlink);
- std::vector<std::string> results;
- split_string(stHyperlink, ":", results, false);
-
- if (0 == results[0].compare("item"))
- {
- if (results.size() < 6)
- return Py_BuildValue("s", "");
- CItemData * pItemData = NULL;
- if (CItemManager::Instance().GetItemDataPointer(htoi(results[1].c_str()), &pItemData))
- {
- char buf[1024] = { 0 };
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- char itemlink[256 + 12];
- #else
- char itemlink[256];
- #endif
- int len;
- bool isAttr = false;
- len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x", htoi(results[1].c_str()), htoi(results[2].c_str()), htoi(results[3].c_str()), htoi(results[4].c_str()), htoi(results[5].c_str()));
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x", htoi(results[6].c_str()));
- #endif
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- if (results.size() >= 9)
- #else
- if (results.size() >= 8)
- #endif
- {
- #ifdef ENABLE_CHANGELOOK_SYSTEM
- for (int i = 7; i < results.size(); i += 2)
- #else
- for (int i = 6; i < results.size(); i += 2)
- #endif
- {
- len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d",
- htoi(results[i].c_str()),
- atoi(results[i + 1].c_str()));
- isAttr = true;
- }
- }
- if (isAttr)
-
- snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
- else
- snprintf(buf, sizeof(buf), "|cfff1e6c0|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
- return Py_BuildValue("s", buf);
- }
- }
- return Py_BuildValue("s", "");
- }
Alles anzeigen