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
    • Anúncios
    • Apresentacoes
    • F.A.Q's & Guias
    • Arquivos
  • Hospedagem de imagens
  • Member special
  • Hardware
    • Tutoriais
    • Duvidas
  • Software
    • Programas
    • Guias & Tutoriais
    • Problemas & Duvidas
    • Segurança e Desempenho
  • Sistemas Operativos
    • FreeBSD
    • Windows
    • Linux
    • Android
  • Programação
    • PHP
    • C & C++
    • SQL
    • C# & .NET & VisualBasic
    • Python
    • Outros
  • Metin2
    • Geral
    • Servidores Privado
    • Tutoriais
    • Serverfiles
    • Quests
    • Cliente
    • Ferramentas/Software
    • 3D & 2D
    • Download
    • Duvidas & Problemas & Pedidos
  • Websites
    • Design
    • Codificado
  • Other Games
    • Dota2
    • League Of Legends
    • Payday 2
  • Design
    • Galeria
    • Tutoriais
    • Pedidos
    • Ferramentas/Diversos
  • Espaço web
    • Webmaster
    • Duvidas
    • Servidores
  • Classificados
    • Trocas e Vendas
    • Outros
  • Tema Livre
    • Filmes & Series
    • Anime
    • Mundo Livre
    • Outros
    • Youtube

Categories

  • Metin2
    • Quests
    • Clientes
    • Serverfiles
    • Tools
    • Other Downloads
    • Weapons & Armors
    • NPC & MOB
  • Software
  • Operating Systems
    • Windows
  • Member special
  • 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 20 results

  1. 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!
  2. Guest

    Lennt's latest Mount System.

    Im using this, kinda easy to understand. Have fun with it. [C++]System Mount V2.rar
  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. Boas venho aqui fazer um tutorial visto que hoje em dia não se vé tutoriais com a seguinte partilha Abrir o char_battle.cpp no game/src procurar por : Titemdroppenalty aitemdroppenalty_k é [9] = { {0, 0, 0, 0}, IAA // IAA ?? ???? * ¢ ¢ â ?? {0, 0, 0, 0}, // IEE ???? IAA ºâ ?? ?? | {0, 0, 0, 0}, // IAA ± ì ???? ???? {0, 0, 0, 0}, // ì§â ¬ì ?? ?? ¸ {0, 0, 0, 0}, IAA // â ???? ???? 민 {25, 1, 5, 1}, // AUC ???? i ?? * ¸ {50, 2, 10, 1}, IAA // ¢ â ?? ?? ?? | eu ¸ {75, 4, 15, 1}, // ë§ë AUC ?? ?????? {100, 8, 20, 1}, IAA // IAA ?? ?? ?? ¢ â ¢ }; substituir por o de baixo Titemdroppenalty aitemdroppenalty_k é [9] = { {0, 0, 0, 0}, IAA // IAA ?? ???? * ¢ ¢ â ?? {0, 0, 0, 0}, // IEE ???? IAA ºâ ?? ?? | {0, 0, 0, 0}, // IAA ± ì ???? ???? {0, 0, 0, 0}, // ì§â ¬ì ?? ?? ¸ {0, 0, 0, 0}, IAA // â ???? ???? 민 {0, 0, 0, 0}, // AUC ???? i ?? * ¸ {0, 0, 0, 0}, // IAA ¢ â ?? ?? ?? | ì ¸ {0, 0, 0, 0}, // ë§ë AUC ?? ?????? {0, 0, 0, 0}, IAA // IAA ?? ?? ?? ¢ â ¢ }; créditos: forum.turkmmo.com tópico criado por : ZacqooLeaven
  5. 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
  6. Guest

    Bravery cape effect [gf style]

    Never tested it but should work since the code is pretty simple and easy to understand, have fun with it. Bravery cape effect.rar
  7. 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...
  8. Guest

    Lennt's latest Title System.

    Never tested it by myself only heard from a friend that it's working. Have fun with it. [C++]Title System.rar
  9. 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; }
  10. 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();
  11. Mudar as cordeadas do mapa de inicio Como o titulo indica server para quem quiser alterar as cordeadas de onde o char aprece quando morremos e clicamos em recomeçar. Vamos lá Via FTP: ir a seguinte localização / Usr / game / share / local / xxxxx / map Vamos entrar no: "Index" Vamos baixar o (os) arquivo(s): vamos abrir depois: Veremos na imagem a cima localizado a esquerda: 1: Bandeira vermelha 1º index da aldeia, 3: Bandeira vermelha 2º index da aldeia, 21: Bandeira amarela 1º index da aldeia, 23: Bandeira amarela 2º index da aldeia, 41: Bandeira azul é o primeiro index da aldeia, 43: a bandeira azul é o segundo index da aldeia. Agora abrimos start_position.cpp in /// game / src /. Procuramos: long g_start_map [4] = Substituímos pelo número de índex do mapa inicial que deseja alterar. Procuramos: DWORD g_start_position [4] [2] = Quando está morto, você pode clicar no botão "Iniciar na cidade" e você poderá escrever as coordenadas de acordo com o mapa que você usa para determinar quais coordenadas nascerá, Na imagem a cima mostra onde editar as coordenadas Procuramos DWORD arena_return_position [4] [2] = Coordenadas do mapa onde você pode definir onde ir após um evento tipo war: Procuramos: DWORD g_create_position [4] [2] = Depois de criar o personagem, você pode alterar as coordenadas de ressurreição do personagem de acordo com o mapa que você está usando. Fonte: freackgamers Tradução e organização eu mesmo
  12. Boas Hoje encontrei um sistema de veras interessante e vim partilhar. Pelo que parece o sistema cria uma replica tipo pet do nosso personagem. Não testei nem sei como implementar só vim fazer a partilha pode ser util para quem quiser testar. Imagens Vamos começar Para a pasta root add Abrir o Ficheiro game.py Procurar por: from switchbot import Bot Adicionar: import uiChild Procurar: processpreservedservercommand self .__ () Adicionar: self.uiChild = uiChild.ChildWindowKevin () Procurar: def Close (self): In self.hi () Adicionar self.uichild.clos A () Procurar: def BINARY_NEW_RemoveAffect (self, type, pointIdx): self.affectShower.BINARY_NEW_RemoveAffect (type, pointIdx) if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type: self.interface.dragonsouldeactivat A () Adicionar: def BINARY_NEW_OpenPet (self, name): self.uichild.openwindow (name) def BINARY_NEW_UpdatePet (self, level, hp, maxhp, dmg, dmgmax, exp, expmax, boni1, boni2, pickup, hitting, emo, antiexp): self.uiChild.Update (level, hp, maxhp, dmg, dmgmax, exp, expmax, boni1, boni2, pickup, hitting, emo, antiexp) def BINARY_NEW_ClosePet (self): self.uichild.clos A () self.uiChild = uiChild.ChildWindowKevin () Procurar: def OnUpdate (self): app.updateg tool () Adicionar if self.uiChild! = None: self.uichild.onupdat A () uiinventory.py def ClickDSSButton (self): Adicionar: # Bebeksystem def ClickDSSButton (self): print "click_dss_button" net.sendchatpacket ( "/ babyspawn") locale inventorywindow.py : ## Dragon Soul Button ## Bebeksystem { "name": "DSSButton", "type": "button", "x": 77, "y": 109, "tooltip_text": uiScriptLocale.KIND_TITLE, "default_image": "locale / tr / ui / button / babybtn.tga" "over_image": "locale / tr / ui / button / babybtn_h.tga" "down_image": "locale / tr / ui / button / babybtn_h.tga" }, Adicionar ao locale_interface.txt KIND_TITLE Baby Botão sistema Exemplos para a surce. EterGrnLib / ThingInstance.cpp EterLib / GrpObjectInstance.cpp EterLib / GrpObjectInstance.h Fonte FreakGames
  13. 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
  14. Boas Este tutorial irá explicar-lhe como reduzir o atraso antes do respawn, então veja: Vamos seguir em frente sem mais detalhes. cmd_general.cpp procurar por: int iTimeToDead = (event_time(ch->m_pkDeadEvent) / passes_per_sec); Desta linha, para a linha: //END_PREVENT_HACK Substitua tudo pelo meu código: int iTimeToDead = (event_time(ch->m_pkDeadEvent) / passes_per_sec); int iTown = iTimeToDead - 2; // Retire 2 secondes au temps de rez en ville (default = 6) int iHere = iTimeToDead - 5; // Retire 5 secondes au temps de rez sur place (default = 9) if (subcmd != SCMD_RESTART_TOWN && (!ch->GetWarMap() || ch->GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG)) { if (!test_server) { if (ch->IsHack()) { //성지 맵일경우에는 체크 하지 않는다. if (false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex())) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아직 재시작 할 수 없습니다. (%d초 남음)"), iTimeToDead - (180 - g_nPortalLimitTime)); return; } } if (iHere > 170) // RESPAWN_HERE { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아직 재시작 할 수 없습니다. (%d초 남음)"), iHere - 170); return; } } } //PREVENT_HACK //DESC : 창고, 교환 창 후 포탈을 사용하는 버그에 이용될수 있어서 // 쿨타임을 추가 if (subcmd == SCMD_RESTART_TOWN) { if (ch->IsHack()) { //길드맵, 성지맵에서는 체크 하지 않는다. if ((!ch->GetWarMap() || ch->GetWarMap()->GetType() == GUILD_WAR_TYPE_FLAG) || false == CThreeWayWar::instance().IsSungZiMapIndex(ch->GetMapIndex())) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아직 재시작 할 수 없습니다. (%d초 남음)"), iTimeToDead - (180 - g_nPortalLimitTime)); return; } } if (iTown > 173) // RESPAWN_TOWN { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아직 마을에서 재시작 할 수 없습니다. (%d 초 남음)"), iTown - 173); return; } } //END_PREVENT_HACK Em seguida, modifique os dados desses valores para o que deseja: int iTown = iTimeToDead - 2; // Retire 2 secondes au temps de rez en ville int iHere = iTimeToDead - 5; // Retire 5 secondes au temps de rez sur place Preste atenção às guias no início da linha! Compile, divirta-se. AVISO: você pode reduzir o tempo de espera para 0, mas não se surpreenda se o seu cliente falhar após várias ressurreições. Além disso, definir um valor muito baixo traria a PK, então verifique os valores que você colocou;). Fonte:funky-emu
  15. Boas Toturial de como acelerar o texto das quests Não testei Vamos lá. Abra UserInterface \ PythonEventManager.cpp; Nas primeiras linhas você terá isso: const long c_lNormal_Waiting_Time = 10; Basta alterar o valor para de 10 para 0 Depois compilar e testar xD Tenho também um pequeno fix Para aqueles que não conseguem compilar ou não tem 40k basta adicionar um "setdelay (0)" logo acima do "say_title". Tipo isto say_title = function(name, width, height) setdelay(0); [...] end fonte: funky-emu
  16. 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(); }
  17. Boas maltinha Trago aqui algo que pode ser util Sistema de críticos ou dds em tempo real Imagem A pasta contem todos os tutoriais de como implementar nas surce e fix Fonte Vegas
  18. Boas pessoal irei apenas "ensinar" quem não saiba aumentar o número de letras no nome dos items ... Ficheiro necessários: Source server -> common/item_length.h Source cliente -> gameLib/ItemData.h Procurar: ITEM_NAME_MAX_LEN = 24 ( 24 ) é o número máximo, alterem para o que quiserem... Compilam tudo e está feito. Cumprimentos, Créditos não irei dar meus pois não fui que "criei", foi me dito via skype, passa palavra* Se alguém souber créditos eu edito.
  19. Não encontrei nada por aqui, então deixo um pequeno tutorial. Isto é para o caso de terem algum NPC com uma diferença de tamanho, que a bandeira por cima, fique desproporcional. Ou mesmo como eu, que apenas ache feio os NPC's o terem apenas. Vamos apenas precisar do InstanceBaseEffect, na pasta UserInterface. ( Source Client ) Procurem por - void CInstanceBase::__AttachEmpireEffect(DWORD eEmpire) e por baixo de - if (IsResource()) return; adicionam: DWORD vnum_my_npc = 20406; if (GetRace() == vnum_my_npc) return; Sendo que em "20406" é o NPC que querem que a bandeira não apareça. No meu caso ( que eu uso nos servidores ), retiro por completo tudo, ou seja, em vez de adicionar o que referi acima, faço o seguinte: Aqui - if (IsResource()) return; adicionam abaixo: if (IsNPC()) return;
  20. Olá Aqui algo para alterar a velocidade das montadas ou diminuir consoante o caso. Abrir questlua_pc.cpp e procurar por pc_mount function. Substitua toda a função por isto: Então você pode usá-la em quests como: Nao testado por min: Fonte FreakGames
×
×
  • Create New...

Important Information

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

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.