Jump to content

Search the Community

Showing results for tags '[c++]'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Forum
    • Anuncios
    • FAQ
  • DEV servidores
    • Metin2
  • Classificados
    • Trocas e Vendas
    • Outros
  • Hardware
    • Geral
    • Duvidas
  • Software
    • Download
    • Geral
    • Duvidas
  • Sistemas Operativos
    • FreeBSD
    • Windows
  • Programacao
    • PHP
    • C / C++ / C#
    • SQL
    • Python
  • Websites
    • Design
    • Codificado
  • Design
    • Galeria
    • Geral
    • Ferramentas
  • SysAdmin
    • Geral
    • Duvidas
  • Outros jogos
    • Geral
    • Downloads
  • Off-topic
    • Geral

Categories

  • Metin2
    • Quests
    • Clientes
    • Serverfiles
    • Tools
    • Other Downloads
    • Weapons & Armors
    • NPC & MOB
  • Software
  • Operating Systems
    • Windows
  • Honor Room

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Jabber


AIM


ICQ


Yahoo! Messenger


Skype


Facebook


Twitter


Google Analytics Client ID

Found 25 results

  1. Fix crash core: Open input_main.cpp and search: PCHARACTER m_pkChrTarget = CHARACTER_MANAGER::instance().Find(p->dwVID); Add under that function this: if (!ch || !m_pkChrTarget) return; Need looks like this: Download 1 : [Hidden Content] Download 2 : [Hidden Content] Good luck
  2. Hi folks! With this Tutorial you are building your python dll and lib folder into your binary. PROJECT.rar First of all download the Project.rar and place the lib into your binary libary folder, and the Python folder into your include folder. ScriptLib/PythonUtils.cpp Change it like this: #include "StdAfx.h" #include "PythonUtils.h" #define PyLong_AsLong PyLong_AsLongLong #define PyLong_AsUnsignedLong PyLong_AsUnsignedLongLong IPythonExceptionSender * g_pkExceptionSender = NULL; bool __PyCallClassMemberFunc_ByCString(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, PyObject** poRet); bool __PyCallClassMemberFunc_ByPyString(PyObject* poClass, PyObject* poFuncName, PyObject* poArgs, PyObject** poRet); bool __PyCallClassMemberFunc(PyObject* poClass, PyObject* poFunc, PyObject* poArgs, PyObject** poRet); PyObject * Py_BadArgument() { PyErr_BadArgument(); return NULL; } PyObject * Py_BuildException(const char * c_pszErr, ...) { if (!c_pszErr) PyErr_Clear(); else { char szErrBuf[512+1]; va_list args; va_start(args, c_pszErr); vsnprintf(szErrBuf, sizeof(szErrBuf), c_pszErr, args); va_end(args); PyErr_SetString(PyExc_RuntimeError, szErrBuf); } return Py_BuildNone(); //return NULL; } PyObject * Py_BuildNone() { Py_INCREF(Py_None); return Py_None; } void Py_ReleaseNone() { Py_DECREF(Py_None); } bool PyTuple_GetObject(PyObject* poArgs, int pos, PyObject** ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject * poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = poItem; return true; } bool PyTuple_GetLong(PyObject* poArgs, int pos, long* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyLong_AsLong(poItem); return true; } bool PyTuple_GetDouble(PyObject* poArgs, int pos, double* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyFloat_AsDouble(poItem); return true; } bool PyTuple_GetFloat(PyObject* poArgs, int pos, float* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject * poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = float(PyFloat_AsDouble(poItem)); return true; } bool PyTuple_GetByte(PyObject* poArgs, int pos, unsigned char* ret) { int val; bool result = PyTuple_GetInteger(poArgs,pos,&val); *ret = unsigned char(val); return result; } bool PyTuple_GetInteger(PyObject* poArgs, int pos, unsigned char* ret) { int val; bool result = PyTuple_GetInteger(poArgs,pos,&val); *ret = unsigned char(val); return result; } bool PyTuple_GetInteger(PyObject* poArgs, int pos, WORD* ret) { int val; bool result = PyTuple_GetInteger(poArgs,pos,&val); *ret = WORD(val); return result; } bool PyTuple_GetInteger(PyObject* poArgs, int pos, int* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyLong_AsLong(poItem); return true; } bool PyTuple_GetUnsignedLong(PyObject* poArgs, int pos, unsigned long* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject * poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyLong_AsUnsignedLong(poItem); return true; } bool PyTuple_GetUnsignedInteger(PyObject* poArgs, int pos, unsigned int* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyLong_AsUnsignedLong(poItem); return true; } bool PyTuple_GetString(PyObject* poArgs, int pos, char** ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; if (!PyString_Check(poItem)) return false; *ret = PyString_AsString(poItem); return true; } bool PyTuple_GetBoolean(PyObject* poArgs, int pos, bool* ret) { if (pos >= PyTuple_Size(poArgs)) return false; PyObject* poItem = PyTuple_GetItem(poArgs, pos); if (!poItem) return false; *ret = PyLong_AsLong(poItem) ? true : false; return true; } bool PyCallClassMemberFunc(PyObject* poClass, PyObject* poFunc, PyObject* poArgs) { PyObject* poRet; // NOTE : NULL ĂĽĹ© Ăß°ˇ.. - [levites] if (!poClass) { Py_XDECREF(poArgs); return false; } if (!__PyCallClassMemberFunc(poClass, poFunc, poArgs, &poRet)) return false; Py_DECREF(poRet); return true; } bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs) { PyObject* poRet; // NOTE : NULL ĂĽĹ© Ăß°ˇ.. - [levites] if (!poClass) { Py_XDECREF(poArgs); return false; } if (!__PyCallClassMemberFunc_ByCString(poClass, c_szFunc, poArgs, &poRet)) return false; Py_DECREF(poRet); return true; } bool PyCallClassMemberFunc_ByPyString(PyObject* poClass, PyObject* poFuncName, PyObject* poArgs) { PyObject* poRet; // NOTE : NULL ĂĽĹ© Ăß°ˇ.. - [levites] if (!poClass) { Py_XDECREF(poArgs); return false; } if (!__PyCallClassMemberFunc_ByPyString(poClass, poFuncName, poArgs, &poRet)) return false; Py_DECREF(poRet); return true; } bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, bool* pisRet) { PyObject* poRet; if (!__PyCallClassMemberFunc_ByCString(poClass, c_szFunc, poArgs, &poRet)) return false; if (PyNumber_Check(poRet)) *pisRet = (PyLong_AsLong(poRet) != 0); else *pisRet = true; Py_DECREF(poRet); return true; } bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, long * plRetValue) { PyObject* poRet; if (!__PyCallClassMemberFunc_ByCString(poClass, c_szFunc, poArgs, &poRet)) return false; if (PyNumber_Check(poRet)) { *plRetValue = PyLong_AsLong(poRet); Py_DECREF(poRet); return true; } Py_DECREF(poRet); return false; } /* * ŔĚ ÇÔĽö¸¦ Á÷Á˘ ČŁĂâÇĎÁö ľĘµµ·Ď ÇŃ´Ů. * şÎµćŔĚ ÇĎ°Ô Á÷Á˘ ČŁĂâÇŇ °ćżěżˇ´Â ąÝµĺ˝Ă false °ˇ ¸®ĹĎ µĆŔ» ¶§ * Py_DECREF(poArgs); ¸¦ ÇŘÁŘ´Ů. */ bool __PyCallClassMemberFunc_ByCString(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, PyObject** ppoRet) { if (!poClass) { Py_XDECREF(poArgs); return false; } PyObject * poFunc = PyObject_GetAttrString(poClass, (char *)c_szFunc); // New Reference if (!poFunc) { PyErr_Clear(); Py_XDECREF(poArgs); return false; } if (!PyCallable_Check(poFunc)) { Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } PyObject * poRet = PyObject_CallObject(poFunc, poArgs); // New Reference if (!poRet) { if (g_pkExceptionSender) g_pkExceptionSender->Clear(); PyErr_Print(); if (g_pkExceptionSender) g_pkExceptionSender->Send(); Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } *ppoRet = poRet; Py_DECREF(poFunc); Py_XDECREF(poArgs); return true; } bool __PyCallClassMemberFunc_ByPyString(PyObject* poClass, PyObject* poFuncName, PyObject* poArgs, PyObject** ppoRet) { if (!poClass) { Py_XDECREF(poArgs); return false; } PyObject * poFunc = PyObject_GetAttr(poClass, poFuncName); // New Reference if (!poFunc) { PyErr_Clear(); Py_XDECREF(poArgs); return false; } if (!PyCallable_Check(poFunc)) { Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } PyObject * poRet = PyObject_CallObject(poFunc, poArgs); // New Reference if (!poRet) { if (g_pkExceptionSender) g_pkExceptionSender->Clear(); PyErr_Print(); if (g_pkExceptionSender) g_pkExceptionSender->Send(); Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } *ppoRet = poRet; Py_DECREF(poFunc); Py_XDECREF(poArgs); return true; } bool __PyCallClassMemberFunc(PyObject* poClass, PyObject * poFunc, PyObject* poArgs, PyObject** ppoRet) { if (!poClass) { Py_XDECREF(poArgs); return false; } if (!poFunc) { PyErr_Clear(); Py_XDECREF(poArgs); return false; } if (!PyCallable_Check(poFunc)) { Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } PyObject * poRet = PyObject_CallObject(poFunc, poArgs); // New Reference if (!poRet) { PyErr_Print(); Py_DECREF(poFunc); Py_XDECREF(poArgs); return false; } *ppoRet = poRet; Py_DECREF(poFunc); Py_XDECREF(poArgs); return true; } ScriptLib/PythonUtils.h Change it like this: #pragma once #define SET_EXCEPTION(x) PyErr_SetString(PyExc_RuntimeError, #x) bool PyTuple_GetString(PyObject* poArgs, int pos, char** ret); bool PyTuple_GetInteger(PyObject* poArgs, int pos, unsigned char* ret); bool PyTuple_GetInteger(PyObject* poArgs, int pos, int* ret); bool PyTuple_GetInteger(PyObject* poArgs, int pos, WORD* ret); bool PyTuple_GetByte(PyObject* poArgs, int pos, unsigned char* ret); bool PyTuple_GetUnsignedInteger(PyObject* poArgs, int pos, unsigned int* ret); bool PyTuple_GetLong(PyObject* poArgs, int pos, long* ret); bool PyTuple_GetUnsignedLong(PyObject* poArgs, int pos, unsigned long* ret); bool PyTuple_GetFloat(PyObject* poArgs, int pos, float* ret); bool PyTuple_GetDouble(PyObject* poArgs, int pos, double* ret); bool PyTuple_GetObject(PyObject* poArgs, int pos, PyObject** ret); bool PyTuple_GetBoolean(PyObject* poArgs, int pos, bool* ret); bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs); bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, bool* pisRet); bool PyCallClassMemberFunc(PyObject* poClass, const char* c_szFunc, PyObject* poArgs, long * plRetValue); bool PyCallClassMemberFunc_ByPyString(PyObject* poClass, PyObject* poFuncName, PyObject* poArgs); bool PyCallClassMemberFunc(PyObject* poClass, PyObject* poFunc, PyObject* poArgs); PyObject * Py_BuildException(const char * c_pszErr = NULL, ...); PyObject * Py_BadArgument(); PyObject * Py_BuildNone(); PyObject * Py_BuildEmptyTuple(); Userinterface/UserInterface.cpp #pragma comment( lib, "python27.lib" ) OR #pragma comment( lib, "python22.lib" ) Change to: #pragma comment( lib, "Python_Shabba.lib" ) Delete this: static const char * sc_apszPythonLibraryFilenames[] = { "UserDict.pyc", "__future__.pyc", "copy_reg.pyc", "linecache.pyc", "ntpath.pyc", "os.pyc", "site.pyc", "stat.pyc", "string.pyc", "traceback.pyc", "types.pyc", "\n", }; Delete this: bool CheckPythonLibraryFilenames() { for (int i = 0; *sc_apszPythonLibraryFilenames[i] != '\n'; ++i) { std::string stFilename = "lib\\"; stFilename += sc_apszPythonLibraryFilenames[i]; if (_access(stFilename.c_str(), 0) != 0) { return false; } MoveFile(stFilename.c_str(), stFilename.c_str()); } return true; } Delete this: if (!CheckPythonLibraryFilenames()) { __ErrorPythonLibraryIsNotExist(); goto Clean; } ///////UPDATE///////////// //Delete this too, i missed this part sorry. void __ErrorPythonLibraryIsNotExist() { LogBoxf("FATAL ERROR!! Python Library file not exist!"); } Scriptlib/PythonLauncher.cpp #include <Python-2.2/frameobject.h> OR #include <Python-2.2/frameobject.h> Change: #include <Python_Shabba/frameobject.h> Scriptlib/PythonLauncher.h #include <Python-2.2/frameobject.h> OR #include <Python-2.2/frameobject.h> Change: #include <Python_Shabba/frameobject.h> Scriptlib/PythonMarshal.cpp #include <Python-2.2/longintrepr.h> OR #include <Python-2.2/longintrepr.h> Change: #include <Python_Shabba/longintrepr.h> Scriptlib/StdAfx.h #include <Python-2.2/python.h> #include <Python-2.2/python.h> #include <Python-2.2/node.h> #include <Python-2.2/grammar.h> #include <Python-2.2/token.h> #include <Python-2.2/parsetok.h> #include <Python-2.2/errcode.h> #include <Python-2.2/compile.h> #include <Python-2.2/symtable.h> #include <Python-2.2/eval.h> #include <Python-2.2/marshal.h> ////////////////////////////////////OR//////////////////////// #include <Python-2.7/python.h> #include <Python-2.7/python.h> #include <Python-2.7/node.h> #include <Python-2.7/grammar.h> #include <Python-2.7/token.h> #include <Python-2.7/parsetok.h> #include <Python-2.7/errcode.h> #include <Python-2.7/compile.h> #include <Python-2.7/symtable.h> #include <Python-2.7/eval.h> #include <Python-2.7/marshal.h> Change: #include <Python_Shabba/python.h> #include <Python_Shabba/python.h> #include <Python_Shabba/node.h> #include <Python_Shabba/grammar.h> #include <Python_Shabba/token.h> #include <Python_Shabba/parsetok.h> #include <Python_Shabba/errcode.h> #include <Python_Shabba/compile.h> #include <Python_Shabba/symtable.h> #include <Python_Shabba/eval.h> #include <Python_Shabba/marshal.h> And now you can delete the lib folder from your client (where you can find the pack, bgm etc folders) and delete the python27.dll or python22.dll whatever you use. From now on you will use Python2.7 with this libary. Here you can find what kind of dll-s do you need to start the client, the others are useless. [Hidden Content] Good luck!
  3. Guest

    [C++] Item delete packet

    Hi folks! Client source: //ClientSide - Userinterface/Packet.h //Add this after the includes if you don't have: #include "Locale_inc.h" //Search for: HEADER_CG_ITEM_DROP2 = 20, //Add under: #ifdef ENABLE_REMOVE_PACKET HEADER_CG_ITEM_DESTROY = 21, #endif //Search for: } TPacketCGItemDrop2; //Add under: #ifdef ENABLE_REMOVE_PACKET typedef struct command_item_destroy { BYTE header; TItemPos pos; } TPacketCGItemDestroy; #endif //ClientSide - Userinterface/PythonNetworkStreamPhaseGameItem.cpp //Add this after the includes if you don't have: #include "Locale_inc.h" //Search for: bool CPythonNetworkStream::SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count) //After the definition of SendItemDropPacketNew add under: #ifdef ENABLE_REMOVE_PACKET bool CPythonNetworkStream::SendItemDestroyPacket(TItemPos pos) { if (!__CanActMainInstance()) return true; TPacketCGItemDestroy itemDestroyPacket; itemDestroyPacket.header = HEADER_CG_ITEM_DESTROY; itemDestroyPacket.pos = pos; if (!Send(sizeof(itemDestroyPacket), &itemDestroyPacket)) { Tracen("SendItemDestroyPacket Error"); return false; } return SendSequence(); } #endif //ClientSide - Userinterface/PythonNetworkStreamModule.cpp //Add this after the includes if you don't have: #include "Locale_inc.h" //Search for: PyObject* netSendItemDropPacket(PyObject* poSelf, PyObject* poArgs) //After the definition of netSendItemDropPacket add under: #ifdef ENABLE_REMOVE_PACKET PyObject* netSendItemDestroyPacket(PyObject* poSelf, PyObject* poArgs) { TItemPos Cell; if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell)) return Py_BuildException(); CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance(); rkNetStream.SendItemDestroyPacket(Cell); return Py_BuildNone(); } #endif //Search for this: { "SendItemDropPacketNew", netSendItemDropPacketNew, METH_VARARGS }, //Add under: #ifdef ENABLE_REMOVE_PACKET { "SendItemDestroyPacket", netSendItemDestroyPacket, METH_VARARGS }, #endif //ClientSide - Userinterface/PythonNetworkStream.h //Add this after the includes if you don't have: #include "Locale_inc.h" //Search for: bool SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count); //Add under: #ifdef ENABLE_REMOVE_PACKET bool SendItemDestroyPacket(TItemPos pos); #endif //ClientSide - Userinterface/PythonApplicationModule.cpp //Add this after the includes if you don't have: #include "Locale_inc.h" //Search for: PyModule_AddIntConstant(poModule, "CAMERA_STOP", CPythonApplication::CAMERA_STOP); //Add under: #ifdef ENABLE_REMOVE_PACKET PyModule_AddIntConstant(poModule, "DELETE_ITEM_PACKET", 1); #else PyModule_AddIntConstant(poModule, "DELETE_ITEM_PACKET", 0); #endif //ClientSide - Userinterface/Locale_inc.h //Add this: #define ENABLE_REMOVE_PACKET Server source: //Serverside - game/Packet.h //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: HEADER_CG_ITEM_DROP2 = 20, //Add under: #ifdef ENABLE_REMOVE_PACKET HEADER_CG_ITEM_DESTROY = 21, #endif //Search for: } TPacketCGItemDrop2; //Add Under: #ifdef ENABLE_REMOVE_PACKET typedef struct command_item_destroy { BYTE header; TItemPos Cell; } TPacketCGItemDestroy; #endif //Serverside - game/Packet_info.cpp //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: Set(HEADER_CG_ITEM_DROP2, sizeof(TPacketCGItemDrop2), "ItemDrop2", true); //Add under: #ifdef ENABLE_REMOVE_PACKET Set(HEADER_CG_ITEM_DESTROY, sizeof(TPacketCGItemDestroy), "ItemDestroy", true); #endif //Serverside - game/Input_main.cpp //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data) //After the definition of ItemDrop2 add this: #ifdef ENABLE_REMOVE_PACKET void CInputMain::ItemDestroy(LPCHARACTER ch, const char * data) { struct command_item_destroy * pinfo = (struct command_item_destroy *) data; if (ch) ch->DestroyItem(pinfo->Cell); } #endif //Search for: case HEADER_CG_ITEM_DROP2: //Add under: #ifdef ENABLE_REMOVE_PACKET case HEADER_CG_ITEM_DESTROY: if (!ch->IsObserverMode()) ItemDestroy(ch, c_pData); break; #endif //Serverside - game/Char.cpp //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) //After the definition of DropItem add this: #ifdef ENABLE_REMOVE_PACKET bool CHARACTER::DestroyItem(TItemPos Cell) { LPITEM item = NULL; if (!CanHandleItem()) { if (NULL != DragonSoul_RefineWindow_GetOpener()) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°*E*AcA» ?¬ »óAÂ?!1*´Â 3AAIAUA» ?A±a 1ö 3o1A´I´U.")); return false; } if (IsDead()) return false; if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) return false; if (item->IsExchanging()) return false; if (true == item->isLocked()) return false; if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true) return false; if (item->GetCount() <= 0) return false; SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 255); ITEM_MANAGER::instance().RemoveItem(item); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Du hast %s zerstoert."), item->GetName()); return true; } #endif //Serverside - game/Char.h //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: bool DropItem(TItemPos Cell, BYTE bCount=0); //Add Under: #ifdef ENABLE_REMOVE_PACKET bool DestroyItem(TItemPos Cell); #endif //Serverside - game/Input.h //Add this after the includes if you don't have: #include "../../common/service.h" //Search for: void ItemDrop2(LPCHARACTER ch, const char * data); //Add Under: #ifdef ENABLE_REMOVE_PACKET void ItemDestroy(LPCHARACTER ch, const char * data); #endif //Serverside - common/service.h //Add this: #define ENABLE_REMOVE_PACKET Python: #root/uiCommon.py #Search for: class QuestionDialog(ui.ScriptWindow): #Add this above: if app.DELETE_ITEM_PACKET: class QuestionDialogItem(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.__CreateDialog() def __del__(self): ui.ScriptWindow.__del__(self) def __CreateDialog(self): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/newquestiondialogitem.py") self.board = self.GetChild("board") self.textLine = self.GetChild("message") self.acceptButton = self.GetChild("accept") self.destroyButton = self.GetChild("destroy") self.cancelButton = self.GetChild("cancel") def Open(self): self.SetCenterPosition() self.SetTop() self.Show() def Close(self): self.Hide() def SetWidth(self, width): height = self.GetHeight() self.SetSize(width, height) self.board.SetSize(width, height) self.SetCenterPosition() self.UpdateRect() def SAFE_SetAcceptEvent(self, event): self.acceptButton.SAFE_SetEvent(event) def SAFE_SetCancelEvent(self, event): self.cancelButton.SAFE_SetEvent(event) def SetAcceptEvent(self, event): self.acceptButton.SetEvent(event) def SetDestroyEvent(self, event): self.destroyButton.SetEvent(event) def SetCancelEvent(self, event): self.cancelButton.SetEvent(event) def SetText(self, text): self.textLine.SetText(text) def SetAcceptText(self, text): self.acceptButton.SetText(text) def SetCancelText(self, text): self.cancelButton.SetText(text) def OnPressEscapeKey(self): self.Close() return TRUE #root/game.py #Search for this: def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount): #After that Search for this: itemDropQuestionDialog = uiCommon.QuestionDialog() #Replace with: if app.DELETE_ITEM_PACKET: itemDropQuestionDialog = uiCommon.QuestionDialogItem() else: itemDropQuestionDialog = uiCommon.QuestionDialog() #Search for this: itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg)) #Add under: if app.DELETE_ITEM_PACKET: itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg)) #Search for this: def RequestDropItem(self, answer): #After the definition of RequestDropItem add under: if app.DELETE_ITEM_PACKET: def RequestDestroyItem(self, answer): if not self.itemDropQuestionDialog: return if answer: dropType = self.itemDropQuestionDialog.dropType dropNumber = self.itemDropQuestionDialog.dropNumber if player.SLOT_TYPE_INVENTORY == dropType: if dropNumber == player.ITEM_MONEY: return else: self.__SendDestroyItemPacket(dropNumber) self.itemDropQuestionDialog.Close() self.itemDropQuestionDialog = None constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0) #Search for: def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY): #After the definition of __SendDropItemPacket add under: if app.DELETE_ITEM_PACKET: def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY): if uiPrivateShopBuilder.IsBuildingPrivateShop(): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP) return net.SendItemDestroyPacket(itemVNum) #locale/ui/locale_interface.txt #Add this: DESTROY Destroy uiscript.rar
  4. View File [C++] Wom2 branch release Contains: Server source Client source Client unpacked Client structure Patcher maker Serverfiles share folder From 2014 leak. Submitter Tierri Lopes Submitted 12/05/2017 Category Other Downloads
  5. Boas Malta, Recentemente precisava de meter fumos nos trajes, visto que não existia um tutorial aqui na comunidade decidi partilhar um. Aqui vai: Source do cliente: Ir a: UserInterface/InstanceBase.cpp Procurar por: case CItemData::ITEM_TYPE_ARMOR: Adicionar em cima: #ifdef __ENABLE_EFFECT_COSTUME__ case CItemData::ITEM_TYPE_COSTUME: if (pItem->GetSubType() == CItemData::COSTUME_BODY) // Check if you have fitted suit { long m_dwVnum_eff_1 = 41003; // Costum Sihastru (M) long m_dwVnum_eff_2 = 41004; // Costum Sihastru (F) long m_dwVnum_eff_3 = 41307; // Costum Cobra (M) long m_dwVnum_eff_4 = 41308; // Costum Cobra (F) long m_dwVnum_eff_5 = 41311; // Costum Sihastru Black (M) long m_dwVnum_eff_6 = 41312; // Costum Sihastru Black (F) long m_dwVnum_eff_7 = 41324; // Costum Sihastru Brown (M) long m_dwVnum_eff_8 = 41325; // Costum Sihastru Brown (F) DWORD vnum = pItem->GetIndex(); if (m_dwVnum_eff_1 <= vnum && vnum <= m_dwVnum_eff_2 | m_dwVnum_eff_3 <= vnum && vnum <= m_dwVnum_eff_4 | m_dwVnum_eff_5 <= vnum && vnum <= m_dwVnum_eff_6 | m_dwVnum_eff_7 <= vnum && vnum <= m_dwVnum_eff_8) // check vnum { __AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL); // efect } } #endif Ir a: UserInterface/Locale_inc.cpp Adicionar: #define __ENABLE_EFFECT_COSTUME__ // efeitos Alguma dúvida só perguntarem. Para a parte de adicionar mais efeitos no Binário irei trazer um tutorial também. Cumpz
  6. Go to file root/intrologin.py Look for: "WRONGPWD" : localeInfo.LOGIN_FAILURE_WRONG_PASSWORD, Add this bellow: "HWBANNED" : "Login from this computer has been blocked", Client source Go to UserInterface/AccountConnector.cpp Look for: bool CAccountConnector::__AuthState_RecvEmpty() { BYTE byEmpty; Recv (sizeof (BYTE), &byEmpty); return true; } Add this bellow: //hardware ban revised #include <intrin.h> #include <Iphlpapi.h> #pragma comment(lib, "iphlpapi.lib") const char* GetMacAddress() { PIP_ADAPTER_INFO AdapterInfo; DWORD dwBufLen = sizeof(AdapterInfo); char *mac_addr = (char*)malloc(17); AdapterInfo = (IP_ADAPTER_INFO *)malloc(sizeof(IP_ADAPTER_INFO)); if (!AdapterInfo) { return ""; } if (GetAdaptersInfo(AdapterInfo, &dwBufLen) == ERROR_BUFFER_OVERFLOW) { AdapterInfo = (IP_ADAPTER_INFO *)malloc(dwBufLen); if (!AdapterInfo) { return ""; } } CHAR _MACFORMAT[] = { '%', '0', '2', 'X', ':', '%', '0', '2', 'X', ':', '%', '0', '2', 'X', ':', '%', '0', '2', 'X', ':', '%', '0', '2', 'X', ':', '%', '0', '2', 'X', 0x0 }; //"%02X:%02X:%02X:%02X:%02X:%02X" if (GetAdaptersInfo(AdapterInfo, &dwBufLen) == NO_ERROR) { PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; do { sprintf(mac_addr, _MACFORMAT, pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2], pAdapterInfo->Address[3], pAdapterInfo->Address[4], pAdapterInfo->Address[5]); return mac_addr; pAdapterInfo = pAdapterInfo->Next; } while (pAdapterInfo); } free(AdapterInfo); return NULL; } //hardware ban revised Inside: bool CAccountConnector::__AuthState_RecvPhase() Look for: strncpy (LoginPacket.name, m_strID.c_str(), ID_MAX_NUM); strncpy (LoginPacket.pwd, m_strPassword.c_str(), PASS_MAX_NUM); Add this bellow: //hardware ban revised strncpy(LoginPacket.cHWInfo, GetMacAddress(), sizeof(LoginPacket.cHWInfo) - 1); //hardware ban revised Look for: LoginPacket.name[ID_MAX_NUM] = '\0'; LoginPacket.pwd[PASS_MAX_NUM] = '\0'; Add this bellow: //hardware ban revised LoginPacket.cHWInfo[255] = '\0'; //hardware ban revised Go to file UserInterface/Packet.h Look for: typedef struct command_login3 { BYTE header; char name[ID_MAX_NUM + 1]; char pwd[PASS_MAX_NUM + 1]; DWORD adwClientKey[4]; } TPacketCGLogin3; Replace with: typedef struct command_login3 { BYTE header; char name[ID_MAX_NUM + 1]; char pwd[PASS_MAX_NUM + 1]; DWORD adwClientKey[4]; char cHWInfo[255 + 1]; //hardware ban revised } TPacketCGLogin3; Game source Go to file game/Packet.h Look for: typedef struct command_login3 { BYTE header; char login[LOGIN_MAX_LEN + 1]; char passwd[PASSWD_MAX_LEN + 1]; DWORD adwClientKey[4]; } TPacketCGLogin3; Replace with: typedef struct command_login3 { BYTE header; char login[LOGIN_MAX_LEN + 1]; char passwd[PASSWD_MAX_LEN + 1]; DWORD adwClientKey[4]; char cHWInfo[255 + 1]; // hardware ban revised } TPacketCGLogin3; Go to file game/input_auth.cpp Look for: if (false == FN_IS_VALID_LOGIN_STRING (login)) { sys_log (0, "InputAuth::Login : IS_NOT_VALID_LOGIN_STRING(%s) desc %p", login, get_pointer (d)); LoginFailure (d, "NOID"); return; } Add this bellow: //hardware ban revised char query[1024]; snprintf(query, sizeof(query),"SELECT hwid FROM account.hwid_ban WHERE hwid = '%s'", pinfo->cHWInfo); std::auto_ptr<SQLMsg> execquery(DBManager::instance().DirectQuery(query)); if (execquery->Get()->uiNumRows >= 1) { LoginFailure(d, "HWBANNED"); return; } //hardware ban revised Go to file game/db.cpp Look for: char szQuery[1024]; snprintf (szQuery, sizeof (szQuery), "UPDATE account SET last_play=NOW() WHERE id=%u", dwID); std::auto_ptr<SQLMsg> msg (DBManager::instance().DirectQuery (szQuery)); Add this bellow: //hardware ban revised char szHwid[255 * 2 + 1]; DBManager::instance().EscapeString(szHwid, sizeof(szHwid), pinfo->cHWInfo, strlen(pinfo->cHWInfo)); char szQuery2[1024]; snprintf (szQuery2, sizeof (szQuery2), "UPDATE account SET hwid='%s' WHERE id=%u", szHwid, dwID); //Updates hwid of the account std::auto_ptr<SQLMsg> msg2 (DBManager::instance().DirectQuery (szQuery2)); //hardware ban revised Run this queries inside account database: DROP TABLE IF EXISTS `hwid_ban`; CREATE TABLE `hwid_ban` ( `id` int(11) NOT NULL AUTO_INCREMENT, `hwid` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE `account` ADD COLUMN `hwid` text DEFAULT NULL;
  7. Go to EterLib/MSWindow.cpp Under: #include "MsWindow.h" Add: #include "../EterLib/Splash.h" Under: bool CMSWindow::Create (const char *c_szName, int brush, DWORD cs, DWORD ws, HICON hIcon, int iCursorResource) { Add: //splash CSplash splash1(TEXT("Protect.bmp"), RGB(128, 128, 128)); //Relative path to binary of the file, this case Protect.bmp splash1.ShowSplash(); Sleep(3000); //Time in miliseconds to show splash image splash1.CloseSplash(); //end splash Download files in attachment. Put files in your EterLib folder (where MSWindow.cpp is located) At Visual Studio: Right-click EterLib project Choose Add --> Add existing item Select Splash.cpp and Splash.h and click Add Recompile client binary and put your Protect.bmp in the relative location defined above Class by: VertexBrasil Splash.cpp Splash.h
  8. Este sistema evita que jogadores matem lojas fora do circulo, pode ser útil para alguém. char_battle.cpp Procurar por: bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType) E depois de: if (pkVictim->CanBeginFight()) pkVictim->BeginFight(this); Adicionar por baixo: if (pkVictim->GetMyShop()) { return false; } battle.cpp Procurar por: bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim) E depois de: if (victim->IsDead()) return false; Adicionar por baixo: if (victim->GetMyShop()) return false; Compilar e está feito.
  9. Copyright Descobri este tutorial algures na net, mas sinceramente não me recordo onde porque apenas hoje o fui testar. Se alguém souber o forum\owner... que faça reply e eu actualizo! A ideia desta função é simples. Sempre que o jogador faz login, o servidor procura todos os itens com bónus no inventário deste jogador e faz um cruzamento de valores com a base de dados. Se o item estiver com bónus inferiores\superiores ao permitido, o item irá ser automaticamente rodado para novos bonus e será enviada uma messangem para o jogador. Tutorial //#input_login.cpp // #char.cpp Sistema testado e a funcionar quase na perfeição. Nota 7/10 ;P
  10. Example: Go to file EterLib/MSWindow.cpp Look for: LRESULT CMSWindow::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { switch (uiMsg) { case WM_SIZE: OnSize(wParam, lParam); break; case WM_ACTIVATEAPP: m_isActive = (wParam == WA_ACTIVE) || (wParam == WA_CLICKACTIVE); break; } return DefWindowProc(hWnd, uiMsg, wParam, lParam); } Replace all with: LRESULT CMSWindow::WindowProcedure (HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { //make borderless window static int xClick; static int yClick; switch (uiMsg) { case WM_SIZE: OnSize (wParam, lParam); break; case WM_ACTIVATEAPP: m_isActive = (wParam == WA_ACTIVE) || (wParam == WA_CLICKACTIVE); break; case WM_LBUTTONDOWN: //Tierri todo: Prevent the first click if CTRL is holded. Code at PyAppPro and PyAppEve if (GetKeyState (VK_CONTROL) & 0x8000) { //Tierri: Restrict mouse input to current window SetCapture (hWnd); POINT mousei; GetMousePosition (&mousei); //Tierri: Get the click position xClick = mousei.x; yClick = mousei.y; } break; case WM_LBUTTONUP: //Rui: Window no longer requires all mouse input ReleaseCapture(); break; case WM_MOUSEMOVE: { if (GetCapture() == hWnd && (GetKeyState (VK_CONTROL) & 0x8000)) { //Rui: Check if this window has mouse input //Rui: Get the window's screen coordinates RECT rc; POINT mouse; GetClientRect (&rc); GetMousePosition (&mouse); int windowWidth = (rc.right - rc.left); int windowHeight = (rc.bottom - rc.top); //Rui: Get the current mouse coordinates int xMouse = LOWORD (lParam); int yMouse = HIWORD (lParam); //Tierri: Calculate the new window coordinates int xWindow = (rc.left + mouse.x) - xClick; int yWindow = (rc.top + mouse.y) - yClick; //Tierri: Set the window's new screen position //SetPosition(xWindow, yWindow); //Rui: Was meant for debug at my client, DO NOT USE ClientToScreen (hWnd, &mouse); MoveWindow (hWnd, mouse.x - windowWidth / 2, mouse.y - windowHeight / 2, windowWidth, windowHeight, TRUE); //Tierri: Adjust center of window into mosue coords } break; } } return DefWindowProc (hWnd, uiMsg, wParam, lParam); } Look for: bool CMSWindow::Create(const char* c_szName, int brush, DWORD cs, DWORD ws, HICON hIcon, int iCursorResource) { Destroy(); const char* c_szClassName = RegisterWindowClass(cs, brush, MSWindowProcedure, hIcon, iCursorResource); m_hWnd = CreateWindow( c_szClassName, c_szName, ws, 0, 0, 0, 0, NULL, NULL, ms_hInstance, NULL); if (!m_hWnd) return false; SetWindowLong(m_hWnd, GWL_USERDATA, (DWORD) this); return true; } Replace with: bool CMSWindow::Create (const char *c_szName, int brush, DWORD cs, DWORD ws, HICON hIcon, int iCursorResource) { /* //make splash Tierri: Splash thing for board CSplash splash1(TEXT("Protect.bmp"), RGB(128, 128, 128)); splash1.ShowSplash(); Sleep(3000); splash1.CloseSplash(); //end splash */ //window creation //assert(ms_hInstance != NULL); Destroy(); const char *c_szClassName = RegisterWindowClass (cs, brush, MSWindowProcedure, hIcon, iCursorResource); m_hWnd = CreateWindow ( c_szClassName, //Rui todo: Integrate new ClassName with antihacking analyser c_szName, WS_POPUP, //Tierri: HOLLY MOLLY THE SKILLS 0, 0, 0, 0, NULL, NULL, ms_hInstance, NULL); if (!m_hWnd) { return false; } SetWindowLong (m_hWnd, GWL_USERDATA, (DWORD) this); return true; } To move the window, hold CTRL while holding and dragging LEFT MOUSE BUTTON
  11. Version 1.0.0

    109 downloads

    Contains: Server source Client source Client unpacked Client structure Patcher maker Serverfiles share folder From 2014 leak.
  12. client/UserInterface/PythonItem.cpp Add this after the other includes: #include "PythonSkill.h" #include "PythonNonPlayer.h" Look for: void CPythonItem::CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop) Replace with: #ifdef __BOOK_NAME__ void CPythonItem::CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, long lSocket0, bool bDrop) #else void CPythonItem::CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop) #endif Look for: rkTextTail.RegisterItemTextTail ( dwVirtualID, pItemData->GetName(), &pGroundItemInstance->ThingInstance); Replace with: #ifdef __BOOK_NAME__ std::string sItemName = pItemData->GetName(); switch (pItemData->GetType()) { case CItemData::ITEM_TYPE_SKILLBOOK: case CItemData::ITEM_TYPE_SKILLFORGET: if (lSocket0 > 0) { CPythonSkill::SSkillData * c_pSkillData; if (CPythonSkill::Instance().GetSkillData(lSocket0, &c_pSkillData)){ sItemName = c_pSkillData->GradeData[0].strName.c_str(); sItemName += " ";} sItemName += pItemData->GetName();} break; case CItemData::ITEM_TYPE_POLYMORPH: if (lSocket0 > 0) { sItemName = CPythonNonPlayer::Instance().GetMonsterName(lSocket0); sItemName += " "; sItemName += pItemData->GetName();} break; } const char * cItemName = sItemName.c_str(); rkTextTail.RegisterItemTextTail( dwVirtualID, cItemName, &pGroundItemInstance->ThingInstance); #else rkTextTail.RegisterItemTextTail ( dwVirtualID, pItemData->GetName(), &pGroundItemInstance->ThingInstance); #endif client/UserInterface/PythonItem.h Look for: void CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true); Replace with: #ifdef __BOOK_NAME__ void CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, long lSocket0 = 0, bool bDrop = true); #else void CreateItem (DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true); #endif client/UserInterface/Packet.h Look for: typedef struct packet_ground_add_item { BYTE bHeader; long lX; long lY; long lZ; DWORD dwVID; DWORD dwVnum; } TPacketGCItemGroundAdd; Replace with: typedef struct packet_ground_add_item { BYTE bHeader; long lX; long lY; long lZ; DWORD dwVID; DWORD dwVnum; #ifdef __BOOK_NAME__ long lSocket0; #endif } TPacketGCItemGroundAdd; client/UserInterface/PythonNetworkStreamPhaseGameItem.cpp Inside bool CPythonNetworkStream::RecvItemGroundAddPacket() Look for: CPythonItem::Instance().CreateItem(packet_item_ground_add.dwVID, packet_item_ground_add.dwVnum, packet_item_ground_add.lX, packet_item_ground_add.lY, packet_item_ground_add.lZ); Replace with: #ifdef __BOOK_NAME__ CPythonItem::Instance().CreateItem (packet_item_ground_add.dwVID, packet_item_ground_add.dwVnum, packet_item_ground_add.lX, packet_item_ground_add.lY, packet_item_ground_add.lZ, packet_item_ground_add.lSocket0); #else CPythonItem::Instance().CreateItem(packet_item_ground_add.dwVID, packet_item_ground_add.dwVnum, packet_item_ground_add.lX, packet_item_ground_add.lY, packet_item_ground_add.lZ); #endif client/UserInterface/Locale_inc.h Add the following: #define __BOOK_NAME__ Server game/src/Packet.h Look for: typedef struct packet_item_ground_add { BYTE bHeader; long x, y, z; DWORD dwVID; DWORD dwVnum; } TPacketGCItemGroundAdd; Replace with: typedef struct packet_item_ground_add { BYTE bHeader; long x, y, z; DWORD dwVID; DWORD dwVnum; #ifdef __BOOK_NAME__ long lSocket0; #endif } TPacketGCItemGroundAdd; game/src/item.cpp Inside void CItem::EncodeInsertPacket (LPENTITY ent) Look for: pack.dwVID = m_dwVID; Add this AFTER: #ifdef __BOOK_NAME__ pack.lSocket0 = ((GetType() == ITEM_SKILLBOOK || GetType() == ITEM_SKILLFORGET || GetType() == ITEM_POLYMORPH) ? GetSocket(0) : 0); #endif common/service.h Add the following: #define __BOOK_NAME__
  13. Go to file char_item.cpp After: ITEM_METIN: Look for: ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (METIN)"); Replace with: item->SetCount(item->GetCount() - 1); Then you can make your stone stackable and it will only remove 1 stone instead of the stack when adding to equip. Note: Not tested, someone test and tell it if worked, thanks. Edit: tested and working
  14. Boas Malta, Eu queria meter entre 25 a 20 membros no máximo por guild. Como posso fazer? O Código que tenho é este: int CGuild::GetMaxMemberCount() { // GUILD_IS_FULL_BUG_FIX if ( m_iMemberCountBonus < 0 || m_iMemberCountBonus > 18 ) m_iMemberCountBonus = 0; // END_GUILD_IS_FULL_BUG_FIX if ( LC_IsHongKong() == true ) { quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetMasterPID()); if ( pPC != NULL ) { if ( pPC->GetFlag("guild.is_unlimit_member") == 1 ) { return INT_MAX; } } } return 32 + 2 * (m_data.level-1) + m_iMemberCountBonus; } Cumpz
  15. Guest

    [C++] Maintenance system

    Hi folks! [ Karbantartás érkezik = Incoming maintenance 59 perc 58 mp múltva! = 59 minutes 58 seconds left! Várható időtartama = Maintenance duration 10 perc = 10 minutes ] Lets start with the Python because its almost nothing! root/game.py #Search for: def BINARY_Cube_Open(self, npcVNUM): #Add above: if app.ENABLE_MAINTENANCE_SYSTEM: def BINARY_Maintenance(self, sec, dur): sec = int(sec) dur = int(dur) self.interface.StartMaintenance(sec,dur) root/interfacemodule.py #Search for: import guild #Add under: if app.ENABLE_MAINTENANCE_SYSTEM: import uimaintenance #Search for: self.wndGuildBuilding = None #Add under: if app.ENABLE_MAINTENANCE_SYSTEM: self.wndMaintenanceInfo = None #Search for: if self.wndGameButton: self.wndGameButton.Destroy() #Add under: if app.ENABLE_MAINTENANCE_SYSTEM: if self.wndMaintenanceInfo: self.wndMaintenanceInfo.Destroy() #Search for: del self.wndItemSelect #Add under: if app.ENABLE_MAINTENANCE_SYSTEM: del self.wndMaintenanceInfo #Search for: def EmptyFunction(self): pass #Add under: if app.ENABLE_MAINTENANCE_SYSTEM: def StartMaintenance(self, timeLimit, duration): if not self.wndMaintenanceInfo: self.wndMaintenanceInfo = uimaintenance.MaintenanceInfoBoard() if timeLimit > 0: self.wndMaintenanceInfo.SetTimeLimit(timeLimit, duration) self.wndMaintenanceInfo.Show() else: self.wndMaintenanceInfo.Hide() root/localeinfo.py #Search for: return text + insertingText + backText #Add under: def SecondToDHMS(time): second = int(time % 60) minute = int((time / 60) % 60) hour = int(((time / 60) / 60) % 24) day = int(((time / 60) / 60) / 24) text = "" if day > 0: if day == 1: text += str(day) + " Day " else: text += str(day) + " Day " if hour > 0: text += str(hour) + " " + "Hour" + " " if minute > 0: text += str(minute) + " " + "Minute" + " " if second > 0 or (day == 0 and hour == 0 and minute == 0): text += str(second) + " " + "Sec" + " " return text[:-1] Create a file which is called: uimaintenance.py import ui import wndMgr import localeInfo import uiScriptLocale import app class MaintenanceInfoBoard(ui.ThinBoard): BOARD_WIDTH = 420 BOARD_HEIGHT = 40 SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0) def __init__(self): ui.ThinBoard.__init__(self) self.AddFlag("float") self.timeLimitEnd = 0 self.duration = 0 text1 = ui.TextLine() text1.SetParent(self) text1.SetText("Incoming Maintenance") text1.SetPosition(10,8) text1.SetPackedFontColor(self.SPECIAL_TITLE_COLOR) text1.Show() self.text1 = text1 timeTextLine = ui.TextLine() timeTextLine.SetParent(self) timeTextLine.SetPosition(10,25) timeTextLine.Show() self.timeTextLine = timeTextLine text2 = ui.TextLine() text2.SetParent(self) text2.SetText("Maintenance Duration") text2.SetPosition(10,25+17) text2.SetPackedFontColor(self.SPECIAL_TITLE_COLOR) text2.Show() self.text2 = text2 timeTextLine2 = ui.TextLine() timeTextLine2.SetParent(self) timeTextLine2.SetPosition(10,25+17*2) timeTextLine2.Show() self.timeTextLine2 = timeTextLine2 self.SetPosition(wndMgr.GetScreenWidth() - 180, 165) self.SetSize(self.BOARD_WIDTH, self.BOARD_HEIGHT) def __del__(self): ui.ThinBoard.__del__(self) def SetTimeLimit(self, timeLimit, duration=0): if timeLimit > 0: self.timeLimitEnd = timeLimit self.duration = duration self.__Refresh() else: self.timeLimitEnd = 0 self.duration = 0 self.Hide() def __Refresh(self): self.timeTextLine.SetText("%s |cffFFC700left!" % (localeInfo.SecondToDHMS(self.timeLimitEnd))) self.timeTextLine2.SetText("%s" % (localeInfo.SecondToDHMS(self.duration))) def Close(self): self.Hide() ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Binary/packet.h //Add this to the includes if you don't have: #include "Locale_inc.h" //Search for: HEADER_CG_SCRIPT_SELECT_ITEM = 114, //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM HEADER_GC_MAINTENANCE = 155, #endif //Search for: #pragma pack(pop) //Add above: #ifdef ENABLE_MAINTENANCE_SYSTEM typedef struct SPacketGCGetMaintenance { BYTE header; int seconds; int duration; } TPacketGCMaintenance; #endif Binary/PythonApplicationModule.cpp //Add this to the includes if you don't have: #include "Locale_inc.h" //Search for: PyModule_AddIntConstant(poModule, "CAMERA_STOP", CPythonApplication::CAMERA_STOP); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM PyModule_AddIntConstant(poModule, "ENABLE_MAINTENANCE_SYSTEM", 1); #else PyModule_AddIntConstant(poModule, "ENABLE_MAINTENANCE_SYSTEM", 0); #endif Binary/PythonNetworkStream.cpp //Add this to the includes if you don't have: #include "Locale_inc.h" //Search for: Set(HEADER_GC_DRAGON_SOUL_REFINE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET)); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM Set(HEADER_GC_MAINTENANCE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCMaintenance), STATIC_SIZE_PACKET)); #endif Binary/PythonNetworkStream.h //Add this to the includes if you don't have: #include "Locale_inc.h" //Search for: DWORD EXPORT_GetBettingGuildWarValue(const char* c_szValueName); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM bool RecvMaintenance(); #endif Binary/PythonNetworkStreamPhaseGame.cpp //Add this to the includes if you don't have: #include "Locale_inc.h" //Search for: case HEADER_GC_DRAGON_SOUL_REFINE: ret = RecvDragonSoulRefine(); break; //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM case HEADER_GC_MAINTENANCE: ret = RecvMaintenance(); break; #endif //Search for: struct PERF_PacketInfo { [...] }; //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM bool CPythonNetworkStream::RecvMaintenance() { TPacketGCMaintenance packet; if (!Recv(sizeof(packet), &packet)) return false; PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_Maintenance", Py_BuildValue("(ii)", packet.seconds, packet.duration)); return true; } #endif Source/game/cmd.cpp //Add this to the includes if you don't have: #include "../common/service.h" //Search for: ACMD (do_clear_affect); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM ACMD(do_maintenance); #endif //Search for: { "do_clear_affect", do_clear_affect, 0, POS_DEAD, GM_LOW_WIZARD}, //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM { "maintenance", do_maintenance, 0, POS_DEAD, GM_IMPLEMENTOR}, #endif Source/game/cmd_gm.cp //Add this to the includes if you don't have: #include "../common/service.h" //Search for: ACMD (do_ds_list) { [...] } //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM EVENTINFO(maintenance_event_data) { int seconds; int duration; maintenance_event_data() : seconds( 0 ), duration( 0 ) { } }; EVENTFUNC(maintenance_event) { maintenance_event_data* info = dynamic_cast<maintenance_event_data*>( event->info); if ( info == NULL ) { sys_err( "maintenance_event> <Factor> Null pointer" ); return 0; } int * pSec = & (info->seconds); int iDur = info->duration; const DESC_MANAGER::DESC_SET & c_set_desc = DESC_MANAGER::instance().GetClientSet(); for (itertype(c_set_desc) it = c_set_desc.begin(); it != c_set_desc.end(); it++) { LPDESC d = *(it); if (d->IsPhase(PHASE_P2P)) { TPacketGCMaintenance p; p.header = HEADER_GG_MAINTENANCE; p.seconds = info->seconds; p.duration = iDur; d->Packet(&p, sizeof(p)); } if(d->GetCharacter()) { TPacketGCMaintenance p; p.header = HEADER_GC_MAINTENANCE; p.seconds = info->seconds; p.duration = iDur; d->Packet(&p, sizeof(p)); } } if (pSec > 0) --*pSec; return passes_per_sec; } LPEVENT m_pkMantenanceEvent = NULL; ACMD(do_maintenance) { if (m_pkMantenanceEvent) event_cancel(&m_pkMantenanceEvent); if (!ch) return; if (ch->GetGMLevel() < GM_IMPLEMENTOR) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You have to be an Server Admin.")); return; } char arg1[256]; char arg2[256]; two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)); if (!*arg1 || !*arg2) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Usage: maintenance <time> <durration min>(0 to off) (1m 30s)")); return; } int StartSec = parse_time_str(arg1); int DurSec = parse_time_str(arg2); if (StartSec < 0) { if (ch) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("=> 10s, 10m, 1m 30s")); } return; } maintenance_event_data* info = AllocEventInfo<maintenance_event_data>(); info->seconds = StartSec; info->duration = DurSec; m_pkMantenanceEvent = event_create(maintenance_event, info, 1); } #endif Source/game/input.h //Add this to the includes if you don't have: #include "../common/service.h" //Search for: void IamAwake(LPDESC d, const char * c_pData); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM void Maintenance(const char * c_pData); #endif Source/game/input_p2p,cpp //Add this to the includes if you don't have: #include "../common/service.h" //Search for: void CInputP2P::IamAwake(LPDESC d, const char * c_pData) { [...] } //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM struct FuncMaintenance { int seconds; int duration; FuncMaintenance(int x, int y) : seconds(x), duration(y) { } void operator () (LPDESC d) { if(!d->GetCharacter()) return; TPacketGCMaintenance p; p.header = HEADER_GC_MAINTENANCE; p.seconds = seconds; p.duration = duration; d->Packet(&p, sizeof(p)); } }; void CInputP2P::Maintenance(const char * c_pData) { TPacketGCMaintenance* p = (TPacketGCMaintenance*) c_pData; const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet(); std::for_each(c_ref_set.begin(), c_ref_set.end(), FuncMaintenance(p->seconds, p->duration)); } #endif //Search for: case HEADER_GG_CHECK_AWAKENESS: IamAwake(d, c_pData); break; //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM case HEADER_GG_MAINTENANCE: Maintenance(c_pData); break; #endif Source/game/packet.h //Add this to the includes if you don't have: #include "../common/service.h" //Search for: HEADER_CG_SCRIPT_SELECT_ITEM = 114, //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM HEADER_GC_MAINTENANCE = 155, #endif //Search for: HEADER_GC_QUEST_CONFIRM = 46, //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM HEADER_GG_MAINTENANCE = 47, #endif //Search for: #pragma pack() //Add above: #ifdef ENABLE_MAINTENANCE_SYSTEM typedef struct SPacketGCGetMaintenance { BYTE header; int seconds; int duration; } TPacketGCMaintenance; #endif Source/game/packet_info.cpp //Add this to the includes if you don't have: #include "../common/service.h" //Search for: Set(HEADER_GG_CHECK_AWAKENESS, sizeof(TPacketGGCheckAwakeness), "CheckAwakeness", false); //Add under: #ifdef ENABLE_MAINTENANCE_SYSTEM Set(HEADER_GG_MAINTENANCE, sizeof(TPacketGCMaintenance), "Maintenance", false); #endif Locale_inc.h & service.h #define ENABLE_MAINTENANCE_SYSTEM Usage: Login with a GM IMPLEMENTOR character and type: /maintenance 1h 10m So this will set the maintenance time to 1 hour and the duration to 10 minutes...
  16. Go to file char_battle.cpp Look for: dam += GetPoint(POINT_DEF_GRADE) * (100 + GetPoint(POINT_DEF_BONUS)) / 100; Add this after: EffectPacket(SE_PENETRATE); Do this twice on the file.
  17. Version 5.6.1

    44 downloads

    Source used to create cryptlib-5.6.1MT.lib and cryptlib-5.6.1MTd.lib Open cryptlib.2010.sln, choose desired toolset and compile.
  18. View File [C++] Cryptopp source (cryptlib-5.6.1MT.lib) Source used to create cryptlib-5.6.1MT.lib and cryptlib-5.6.1MTd.lib Open cryptlib.2010.sln, choose desired toolset and compile. Submitter Tierri Lopes Submitted 11/16/2017 Category Ferramentas/Software
  19. Yolo! ServerSource / game / exchange.cpp Search for bool CExchange::CheckSpace() Replace with this and don't forget to edit it for yourself! bool CExchange::CheckSpace() { int INVENTORY_PAGE_COUNT = 9; //your max inventory page int INVENTORY_PAGE_SIZE = 63; //your max inventory size (In my case its 9*7 check your inventorywindow.py slot func and make some math with it) CGrid* pGrids[INVENTORY_PAGE_COUNT]; for (int i = 0; i < INVENTORY_PAGE_COUNT; ++i) { pGrids[i] = new CGrid(9, INVENTORY_PAGE_SIZE / 9); //Setup with your inventory page pGrids[i]->Clear(); } LPCHARACTER victim = GetCompany()->GetOwner(); LPITEM item; for (int iPage = 0; iPage < INVENTORY_PAGE_COUNT; ++iPage) { int iAdd = iPage * INVENTORY_PAGE_SIZE; for (int i = 0; i < INVENTORY_PAGE_SIZE; ++i) { if (!(item = victim->GetInventoryItem(iAdd + i))) continue; pGrids[iPage]->Put(i, 1, item->GetSize()); } } for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i) { if (!(item = m_apItems[i])) continue; bool bFree = false; for (int iPage = 0; iPage < INVENTORY_PAGE_COUNT; ++iPage) { int iPos = pGrids[iPage]->FindBlank(1, item->GetSize()); if (iPos >= 0) { pGrids[iPage]->Put(iPos, 1, item->GetSize()); bFree = true; break; } } if (!bFree) { for (int i = 0; i < INVENTORY_PAGE_COUNT; ++i) M2_DELETE(pGrids[i]); return false; } } for (int i = 0; i < INVENTORY_PAGE_COUNT; ++i) M2_DELETE(pGrids[i]); return true; }
  20. Hi folks! Basically you check the version from the client src and from the auth version file and if its not correct the client will give you a popup msg at the login phase like: "Your client is outdated as fun , please use the patcher program!" Lets go: Binary / packet.h Search for: typedef struct command_login3 Add this into the list: DWORD dwClientKey; Binary / AccountConnector.cpp Add #include "Locale_inc.h" into your includes Search for: m_strPassword = ""; You can see this little friend right there: for (DWORD i = 0; i < 4; ++i) LoginPacket.adwClientKey[i] = g_adwEncryptKey[i]; Replace with this: for (DWORD i = 0; i < 4; ++i) LoginPacket.adwClientKey[i] = g_adwEncryptKey[i]; LoginPacket.dwClientKey = KLIENS_VERZIO_SZAMSOR; Binary / Locale_inc.h Add this: #define KLIENS_VERZIO_SZAMSOR 3333 Server Source / game / packet.h Search for: typedef struct command_login3 Add this into the list: DWORD dwClientNumber; Server Source / game / input_auth.cpp Search for: TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) c_pData; Add above: DWORD dwClientNumber; str_to_number(dwClientNumber, g_stClientVersion.c_str()); Search for this: if (!g_bAuthServer) { sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", inet_ntoa(d->GetAddr().sin_addr)); d->DelayedDisconnect(5); return; } Add under this: if (dwClientNumber != pinfo->dwClientNumber) { LoginFailure(d, "VERSION"); return; } Now go to your cd /usr/game/auth folder -Create a file named VERSION -Write 3333 into it Client / root / intrologin.py Search for this: self.loginFailureMsgDict={ Add this into the list: "VERSION" : "Your client is outdated as fun ;) , please use the patcher program!", Have fun with it! EDIT: If you don't have the client version check enabled: Server Source / game / config.cpp Search for this: // END_OF_LOG_KEEP_DAYS_EXTEND Add under this: LoadClientVersion();
  21. Boas Venho trazer um sistema que coloca outro membro da guild como sublider mostrando o nome sublider no membro Vamos lá Codificação: ONURSTEEL Data: 6.04.2017, 22:30 Propriedades do sistema; Instantaneamente, o líder da guilda ou general da guilda mostrará sua tag com o nome da guild. EX. [Guild Lideri] - nome personagem, [Guild Generali] - nome personagem, --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Ficheiro original link Fonte Freakgamers tradução google e eu
  22. NOTE: The following must be done twice because theres two occurrences of each "Look for" inside of the CHARACTER::Damage. Go to file char_battle.cpp Inside: bool CHARACTER::Damage (LPCHARACTER pAttacker, int dam, EDamageType type) Look for: IsCritical = true; dam *= 2; EffectPacket (SE_CRITICAL); if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } Replace with: LPCHARACTER ch = quest::CQuestManager::instance().GetCurrentCharacterPtr(); if (CPVPManager::Instance().IsFighting (ch)) { IsCritical = false; ChatPacket (CHAT_TYPE_INFO, "[Debug] A critical hit has been denied."); //You can remove this, is here for debug purposes to see if was working } else { IsCritical = true; dam *= 2; EffectPacket (SE_CRITICAL); if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } } Look for: IsPenetrate = true; if (test_server) { ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("°üÅë Ãß°¡ µ¥¹ÌÁö %d"), GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100); } dam += GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100; if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } Replace with: LPCHARACTER ch = quest::CQuestManager::instance().GetCurrentCharacterPtr(); if (CPVPManager::Instance().IsFighting (ch)) { IsPenetrate = false; ChatPacket (CHAT_TYPE_INFO, "[Debug] A penetration hit has been denied."); //You can remove this, is here for debug purposes to see if was working } else { IsPenetrate = true; if (test_server) { ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("°üÅë Ãß°¡ µ¥¹ÌÁö %d"), GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100); } dam += GetPoint (POINT_DEF_GRADE) * (100 + GetPoint (POINT_DEF_BONUS)) / 100; if (IsAffectFlag (AFF_MANASHIELD)) { RemoveAffect (AFF_MANASHIELD); } } Skip the following steps if you already installed IsFighting function. Go to file pvp.cpp Look for: void CPVPManager::ConnectEx (LPCHARACTER pkChr, bool bDisconnect) Add this BEFORE: bool CPVPManager::IsFighting (LPCHARACTER pkChr) { if (!pkChr) { return false; } return IsFighting (pkChr->GetPlayerID()); } bool CPVPManager::IsFighting (DWORD dwPID) { CPVPSetMap::iterator it = m_map_pkPVPSetByID.find (dwPID); if (it == m_map_pkPVPSetByID.end()) { return false; } TR1_NS::unordered_set<CPVP *>::iterator it2 = it->second.begin(); while (it2 != it->second.end()) { CPVP *pkPVP = *it2++; if (pkPVP->IsFight()) { return true; } } return false; } Go to file pvp.h Look for: virtual ~CPVPManager(); Add this AFTER: bool IsFighting (LPCHARACTER pkChr); bool IsFighting (DWORD dwPID);
  23. Boas quem joga metin2 ja deve ter passado pela grandes secas com nabos que ligavam sura só para remover bem o que vos trago agora vai resolver esse problema o que faz Se a diferença de níveis entre você e sua vítima for maior do que a dada (10), a habilidade não removerá as devidas da vítima. //@Source/Game/char_skill.cpp //1.) [PT] procurar: // [EN] Search: if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_REMOVE_GOOD_AFFECT)) //2.) [PT] Trocar por: // [EN] Replaces with: if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_REMOVE_GOOD_AFFECT)) { int level_atacator = m_pkChr->GetLevel(); int level_tinta = pkChrVictim->GetLevel(); int diferenta_level = 10; if ((level_atacator-diferenta_level <= level_tinta)) { int iAmount2 = (int) m_pkSk->kPointPoly2.Eval(); int iDur2 = (int) m_pkSk->kDurationPoly2.Eval(); iDur2 += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS); if (number(1, 100) <= iAmount2) { pkChrVictim->RemoveGoodAffect(); pkChrVictim->AddAffect(m_pkSk->dwVnum, POINT_NONE, 0, AFF_PABEOP, iDur2, 0, true); } } } //[PT] A diferença de nível aplica-se apenas a atacantes menores do que a vítima escolhida. //[EN] The level difference applies only to smaller attackers than the victim chosen. fonte m2tec
  24. Guest

    [C++] HP-MP Overflow fix

    Hi folks. Char.cpp void CHARACTER::ComputePoints() Replace the whole function with this: void CHARACTER::ComputePoints() { long lStat = GetPoint(POINT_STAT); long lStatResetCount = GetPoint(POINT_STAT_RESET_COUNT); long lSkillActive = GetPoint(POINT_SKILL); long lSkillSub = GetPoint(POINT_SUB_SKILL); long lSkillHorse = GetPoint(POINT_HORSE_SKILL); long lLevelStep = GetPoint(POINT_LEVEL_STEP); long lAttackerBonus = GetPoint(POINT_PARTY_ATTACKER_BONUS); long lTankerBonus = GetPoint(POINT_PARTY_TANKER_BONUS); long lBufferBonus = GetPoint(POINT_PARTY_BUFFER_BONUS); long lSkillMasterBonus = GetPoint(POINT_PARTY_SKILL_MASTER_BONUS); long lHasteBonus = GetPoint(POINT_PARTY_HASTE_BONUS); long lDefenderBonus = GetPoint(POINT_PARTY_DEFENDER_BONUS); long lHPRecovery = GetPoint(POINT_HP_RECOVERY); long lSPRecovery = GetPoint(POINT_SP_RECOVERY); memset(m_pointsInstant.points, 0, sizeof(m_pointsInstant.points)); BuffOnAttr_ClearAll(); m_SkillDamageBonus.clear(); SetPoint(POINT_STAT, lStat); SetPoint(POINT_SKILL, lSkillActive); SetPoint(POINT_SUB_SKILL, lSkillSub); SetPoint(POINT_HORSE_SKILL, lSkillHorse); SetPoint(POINT_LEVEL_STEP, lLevelStep); SetPoint(POINT_STAT_RESET_COUNT, lStatResetCount); SetPoint(POINT_ST, GetRealPoint(POINT_ST)); SetPoint(POINT_HT, GetRealPoint(POINT_HT)); SetPoint(POINT_DX, GetRealPoint(POINT_DX)); SetPoint(POINT_IQ, GetRealPoint(POINT_IQ)); SetPart(PART_MAIN, GetOriginalPart(PART_MAIN)); SetPart(PART_WEAPON, GetOriginalPart(PART_WEAPON)); SetPart(PART_HEAD, GetOriginalPart(PART_HEAD)); SetPart(PART_HAIR, GetOriginalPart(PART_HAIR)); SetPoint(POINT_PARTY_ATTACKER_BONUS, lAttackerBonus); SetPoint(POINT_PARTY_TANKER_BONUS, lTankerBonus); SetPoint(POINT_PARTY_BUFFER_BONUS, lBufferBonus); SetPoint(POINT_PARTY_SKILL_MASTER_BONUS, lSkillMasterBonus); SetPoint(POINT_PARTY_HASTE_BONUS, lHasteBonus); SetPoint(POINT_PARTY_DEFENDER_BONUS, lDefenderBonus); SetPoint(POINT_HP_RECOVERY, lHPRecovery); SetPoint(POINT_SP_RECOVERY, lSPRecovery); SetPoint(POINT_PC_BANG_EXP_BONUS, 0); SetPoint(POINT_PC_BANG_DROP_BONUS, 0); int iMaxHP, iMaxSP; int iMaxStamina; if(IsPC()) { iMaxHP = JobInitialPoints[GetJob()].max_hp + m_points.iRandomHP + GetPoint(POINT_HT) * JobInitialPoints[GetJob()].hp_per_ht; iMaxSP = JobInitialPoints[GetJob()].max_sp + m_points.iRandomSP + GetPoint(POINT_IQ) * JobInitialPoints[GetJob()].sp_per_iq; iMaxStamina = JobInitialPoints[GetJob()].max_stamina + GetPoint(POINT_HT) * JobInitialPoints[GetJob()].stamina_per_con; { CSkillProto* pkSk = CSkillManager::instance().Get(SKILL_ADD_HP); if(NULL != pkSk) { pkSk->SetPointVar("k", 1.0f * GetSkillPower(SKILL_ADD_HP) / 100.0f); iMaxHP += static_cast<int>(pkSk->kPointPoly.Eval()); } } // default value SetPoint(POINT_MOV_SPEED, 100); SetPoint(POINT_ATT_SPEED, 100); PointChange(POINT_ATT_SPEED, GetPoint(POINT_PARTY_HASTE_BONUS)); SetPoint(POINT_CASTING_SPEED, 100); } else { iMaxHP = m_pkMobData->m_table.dwMaxHP; iMaxSP = 0; iMaxStamina = 0; SetPoint(POINT_ATT_SPEED, m_pkMobData->m_table.sAttackSpeed); SetPoint(POINT_MOV_SPEED, m_pkMobData->m_table.sMovingSpeed); SetPoint(POINT_CASTING_SPEED, m_pkMobData->m_table.sAttackSpeed); } if(IsPC()) { if(GetMountVnum()) { if(GetHorseST() > GetPoint(POINT_ST)) PointChange(POINT_ST, GetHorseST() - GetPoint(POINT_ST)); if(GetHorseDX() > GetPoint(POINT_DX)) PointChange(POINT_DX, GetHorseDX() - GetPoint(POINT_DX)); if(GetHorseHT() > GetPoint(POINT_HT)) PointChange(POINT_HT, GetHorseHT() - GetPoint(POINT_HT)); if(GetHorseIQ() > GetPoint(POINT_IQ)) PointChange(POINT_IQ, GetHorseIQ() - GetPoint(POINT_IQ)); } } ComputeBattlePoints(); if(iMaxHP != GetMaxHP()) { SetRealPoint(POINT_MAX_HP, iMaxHP); } PointChange(POINT_MAX_HP, 0); if(iMaxSP != GetMaxSP()) { SetRealPoint(POINT_MAX_SP, iMaxSP); } PointChange(POINT_MAX_SP, 0); SetMaxStamina(iMaxStamina); m_pointsInstant.dwImmuneFlag = 0; for(int i = 0; i < WEAR_MAX_NUM; i++) { LPITEM pItem = GetWear(i); if(pItem) { pItem->ModifyPoints(true); SET_BIT(m_pointsInstant.dwImmuneFlag, GetWear(i)->GetImmuneFlag()); } } if(DragonSoul_IsDeckActivated()) { for(int i = WEAR_MAX_NUM + DS_SLOT_MAX * DragonSoul_GetActiveDeck(); i < WEAR_MAX_NUM + DS_SLOT_MAX * (DragonSoul_GetActiveDeck() + 1); i++) { LPITEM pItem = GetWear(i); if(pItem) { if(DSManager::instance().IsTimeLeftDragonSoul(pItem)) pItem->ModifyPoints(true); } } } UpdatePacket(); ComputeSkillPoints(); RefreshAffect(); CPetSystem* pPetSystem = GetPetSystem(); if(NULL != pPetSystem) { pPetSystem->RefreshBuff(); } for(TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin(); it != m_map_buff_on_attrs.end(); it++) { it->second->GiveAllAttributes(); } if(GetHP() > GetMaxHP()) PointChange(POINT_HP, GetMaxHP() - GetHP()); if(GetSP() > GetMaxSP()) PointChange(POINT_SP, GetMaxSP() - GetSP()); UpdatePacket(); }
  25. Pode ser útil para alguém quest_lua.cpp ALUA(pc_go_city) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); ch->GoCity(); return 1; } void RegisterPCFunctionTable() { luaL_reg pc_functions[] = { { "go_city", pc_go_city }, char.h public : void GoCity(); char.cpp void CHARACTER::GoCity() { WarpSet(EMPIRE_START_X(GetEmpire()), EMPIRE_START_Y(GetEmpire())); } quest_list pc.go_city Exemplo uso em quest quest asd begin state start begin when 101.kill begin pc.go_city() end end end Teleporta personagem para a cidade inicial do seu reino.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
You will be able to see content when you disable your adblocker and enable javascript.