Esse Mod faz com que seja possível criar novos char na sua acc usando apenas o client.
OBS: Ele usa Opcode, e com isso só é possível criar char com um personagem online, Porem o sistema é foi totalmente feito para funcionar com um personagem off, então a menos que você consiga editar as source do server, só será possível criar novos personagens na conta com um char logado, Pois os opcodes só funcionam com um char logado.
Nome: Char MakerDescrição: Criado de charAutor: Eduardo Vicente (Banana Fight)Website: www.xtibia.com
Client Side
Client_Entergame/Entergame.lua
Procure por:
if modules.game_things.isLoaded() thenprotocolLogin:login(G.host, G.port, G.account, G.password)
e embaixo adicione:
accountName = G.account
Client_Entergame/Characterlist.lua
procure por :
-- public functions[function CharacterList.init()connect(g_game, { onLoginError = onGameLoginError })connect(g_game, { onUpdateNeeded = onGameUpdateNeeded })connect(g_game, { onConnectionError = onGameConnectionError })connect(g_game, { onGameStart = CharacterList.destroyLoadBox })connect(g_game, { onLoginWait = onLoginWait })connect(g_game, { onGameEnd = CharacterList.showAgain })if G.characters thenCharacterList.create(G.characters, G.characterAccount)endend
E substitua por :
-- public functions[function CharacterList.init()connect(g_game, { onLoginError = onGameLoginError })connect(g_game, { onUpdateNeeded = onGameUpdateNeeded })connect(g_game, { onConnectionError = onGameConnectionError })connect(g_game, { onGameStart = CharacterList.destroyLoadBox })connect(g_game, { onLoginWait = onLoginWait })connect(g_game, { onGameEnd = CharacterList.showAgain })if G.characters thenCharacterList.create(G.characters, G.characterAccount)endnewChar = g_ui.displayUI('newchar')newChar:hide()endfunction sendAll()local msg = newChar:getChildById('msg')local name = newChar:getChildById('name'):getText()local sex = newChar:getChildById('sex'):getText()local voc = newChar:getChildById('vocation'):getText()local protocol = g_game.getProtocolGame()local sendSexlocal sendVocif sex == "male" thensendSex = 0elsesendSex = 1endif voc == "Sorcerer" thensendVoc = 1elseif voc == "Druid" thensendVoc = 2elseif voc == "Paladin" thensendVoc = 3elsesendVoc = 4endprotocol:sendExtendedOpcode(152, string.format("%s,%s,%d,%d", accountName, name, sendVoc, sendSex))msg:setColor("green")msg:setText("Character "..name.." Created")end
Agora Crie um arquivo com o nome newchar.lua, e adiciona isso dentro :
MainWindowid: characterCreator!text: tr('New Char')size: 210 250@onEnter: sendAll()Labelid: labelNametext: Choose your name:color: whitetext-auto-resize: trueanchors.top: parent.topanchors.left: parent.leftmargin-top: 2TextEditid: nameanchors.left: parent.leftanchors.right: parent.rightanchors.top: prev.bottommargin-top: 5Labelid: labelSextext: Chose your sextext-auto-resize: truecolor: whiteanchors.left: parent.leftanchors.top: name.bottommargin-top: 10ComboBoxid: sexanchors.left: parent.leftanchors.top: labelSex.bottommargin-top: 5width: 75options:- Male- FemaleLabelid: labelVocationtext: Chose your vocationtext-auto-resize: truecolor: whiteanchors.left: parent.leftanchors.top: sex.bottommargin-top: 10ComboBoxid: vocationanchors.left: parent.leftanchors.top: labelVocation.bottommargin-top: 5width: 100options:- Knight- Paladin- Sorcerer- DruidLabelid: msgtext-auto-resize: trueanchors.left: parent.leftanchors.top: vocation.bottommargin-top: 20Buttonid: creatChartext: Creat Charactercolor: whiteanchors.left: parent.leftanchors.bottom: parent.bottom@onClick: sendAll()Buttonid: canceltext: Cancelcolor: whiteanchors.left: creatChar.rightanchors.right: parent.rightanchors.bottom: parent.bottommargin-left: 10@onClick: newChar:hide()
E no chartacterlist.otui, lá no final você apaga os 2 botões de "cancel" e "ok" e substituto por estes :
Buttonid: newChartext: New Charwidth: 64anchors.left: parent.leftanchors.bottom: parent.bottom@onClick: newChar:show()Buttonid: buttonOk!text: tr('Ok')width: 64anchors.left: newChar.rightanchors.right: buttonCancel.leftanchors.bottom: parent.bottommargin-right: 10margin-left: 10@onClick: CharacterList.doLogin()Buttonid: buttonCancel!text: tr('Cancel')width: 64anchors.right: parent.rightanchors.bottom: parent.bottom@onClick: CharacterList.hide(true)
Server Side
Data/Creaturescritps/scripts
crie um arquivo chamado exetendedopcode.lua, e adicione isso dentro :
local QUERY = "INSERT INTO `players` VALUES (NULL, '%s', 0, 1, %d, 1, %d, 150, 150, 0, 0, 0, 0, 0, 221, 0, 0, 50, 50, 0, 0, 1, 95, 127, 7, 0, 400, %d, 0, 0, 1, 0, 0, 0, '', 0, 0, 0, 151200000, 2, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '');"NEW_ACCOUNT_CHAR = 152function onExtendedOpcode(cid, opcode, buffer)if opcode == NEW_ACCOUNT_CHAR thenlocal info = string.explode(buffer, ",")for a = 1, #info doif tonumber(info[a]) theninfo[a] = tonumber(info[a])endenddb.executeQuery(string.format(QUERY, info[2], getAccountIdByAccount(info[1]), info[3], info[4]))endreturn trueend
E dentro do creaturescripts.xml adicione :
<event type="extendedopcode" name="ExtendedOpcode" event="script" value="extendedopcode.lua"/>
O sistema ainda não esta 100% completo, falta a parte que envia uma mensagem de erro quando o char não é criado, Porem eu não irei atualizar esse sistema pelo fato de só funcionar com char online.