Líderes
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 05/27/17 em %
-
Launcher para OTCliente/Classico com AutoUpdate sem Host
joaquin2455 reagiu a saviomu por um tópico no fórum
=> Bom,o titulo diz tudo né? Esse é um launcher com autoupdate para OTCliente ou para cliente Clássico(CIPSOFT), com o seguinte detalhe, ele utiliza arquivos upados no GitHub, ou seja,não é necessário uma hospedagem e muito menos que seja o cliente postado em seu WebSite. => Foi codado em C# usando o WPF. O vídeo abaixo ensina a configurar tudo passo a passo, bonitinho para que não ocorra erros. Para configurar a execução do cliente, fique atento as seguintes condições: Para Cliente Padrão, o nome do mesmo deve ser -> padrao.exePara OTCliente DX, o nome deve ser -> dx.exePara OTCliente OpenGL, o nome deve ser -> opengl.exe CASO SEU TIBIA.SPR FOR MAIOR QUE 100MB SIGA O TUTO ABAIXO, CASO CONTRARIO APENAS PULE: 1 => Selecione seu arquivo tibia.spr e comprima-o em zip separando ele em partes (Deixe o arquivo comprimido dentro da pasta original onde fica o tibia.spr ein!!!!), como a imagem abaixo. Configurações Extras (Que não estão no vídeo): <!-- LAYOUT -->Background -> Nome da imagem Background do LauncherBtnFechar -> Nome da imagem do Botão FecharBtnMinimizar -> Nome da imagem do Botão MinimizarEsquemaCores -> Muda o esquema de cores do Launcher (Código em Hexadecimal de Cores)<!-- MUSICAS -->->Apenas mude o arquivo dentro de musicas/principal.mp3.->Caso não deseje musica apenas delete a pasta.<!-- CASO SPR MAIOR QUE 100MB -->DirSprite -> Coloque o caminho onde se encontra sua pasta.->Caso esteja na raiz do cliente, deixe em branco.->Caso esteja dentro de alguma pasta coloque da seguinte forma: pasta1/pasta2/pasta3/ => A ultima pasta precisa ter uma / ein. Changelog: -------------01/12/2016------------------*Correção de Erros; e*Adicionada Música na execução do launcher.-------------05/11/2016------------------*Otimização dos Codes (Muito Menos Gambs );*Melhor Gerenciamento do Esquema de Cores;*Arquivo de Configurações mais Clean;*Suporte para o spr maior que 100MB.-------------04/11/2016------------------*Adicionada personalização no arquivo de configurações para o esquema de cores do launcher;*Melhorias de códigos inuteis(gambiarras) que haviam dentro do mesmo.-------------20/10/2016------------------*Adicionado personalização no arquivo de configurações para imagens de background e botões de minimizar e fechar. Créditos: ME -> Por ter feito :SDalvo rsrsrsrnrnrsnrnrnnrnn -> Por ter me ensinado a usar o github bash,serio eu não sabia usar só usava o desktop. Ah e também por mostrar essa api maravilhosa. Senha: www.xtibia.com Link para repositório do launcher. https://github.com/f1nal1ty/LauncherWPFOTC launcher2.zip launcher2.zip1 ponto -
[TFS 1.2] Flying Mount System
StyloMaldoso reagiu a DarkWore por um tópico no fórum
Para dar uma força na sessão de programação vo lotar de código isso aqui, bom la vamos nós hoje é um fly system para tfs 1.2, sem gambiarras. Vá no arquivo creaturevent.cpp procure por: } else if (tmpStr == "extendedopcode") { type = CREATURE_EVENT_EXTENDED_OPCODE; Coloque isso abaixo: } else if (tmpStr == "move") { type = CREATURE_EVENT_MOVE; Depois procure por: case CREATURE_EVENT_EXTENDED_OPCODE: return "onExtendedOpcode"; Coloque isso abaixo: case CREATURE_EVENT_MOVE: return "onMove"; Depois procure por: void CreatureEvent::executeExtendedOpcode(Player* player, uint8_t opcode, const std::string& buffer) No Final dessa função coloque isso abaixo: bool CreatureEvent::executeOnMove(Player* player, const Position& fromPosition, const Position& toPosition) { //onMove(player, frompos, topos) if (!scriptInterface->reserveScriptEnv()) { std::cout << "[Error - CreatureEvent::executeOnMove] Call stack overflow" << std::endl; return false; } ScriptEnvironment* env = scriptInterface->getScriptEnv(); env->setScriptId(scriptId, scriptInterface); lua_State* L = scriptInterface->getLuaState(); scriptInterface->pushFunction(scriptId); LuaScriptInterface::pushUserdata(L, player); LuaScriptInterface::setMetatable(L, -1, "Player"); LuaScriptInterface::pushPosition(L, fromPosition); LuaScriptInterface::pushPosition(L, toPosition); return scriptInterface->callFunction(3); } Vá no arquivo creatureevent.h procure por: CREATURE_EVENT_EXTENDED_OPCODE, // otclient additional network opcodes Coloque isso abaixo: CREATURE_EVENT_MOVE, Ainda no arquivo creatureevent.h procure por: void executeExtendedOpcode(Player* player, uint8_t opcode, const std::string& buffer); Coloque isso abaixo: bool executeOnMove(Player* player, const Position& fromPosition, const Position& toPosition); Vá no arquivo events.cpp procure por: playerOnGainSkillTries = -1; Coloque isso abaixo: playerOnToggleMount = -1; Ainda no arquivo events.cpp procure por: } else if (methodName == "onGainSkillTries") { playerOnGainSkillTries = event; Coloque isso abaixo: } else if (methodName == "onToggleMount") { playerOnToggleMount = event; Ainda no arquivo events.cpp procure por: void Events::eventPlayerOnGainSkillTries(Player* player, skills_t skill, uint64_t& tries) No Final dessa função coloque isso abaixo: bool Events::eventPlayerOnToggleMount(Player* player, uint8_t mountid, bool mounting) { // Player:onToggleMount(mountid, mounting) if (playerOnToggleMount == -1) { return true; } if (!scriptInterface.reserveScriptEnv()) { std::cout << "[Error - Events::eventPlayerOnToggleMount] Call stack overflow" << std::endl; return false; } ScriptEnvironment* env = scriptInterface.getScriptEnv(); env->setScriptId(playerOnToggleMount, &scriptInterface); lua_State* L = scriptInterface.getLuaState(); scriptInterface.pushFunction(playerOnToggleMount); LuaScriptInterface::pushUserdata<Player>(L, player); LuaScriptInterface::setMetatable(L, -1, "Player"); lua_pushnumber(L, mountid); LuaScriptInterface::pushBoolean(L, mounting); return scriptInterface.callFunction(3); } Vá no arquivo events.h procure por: void eventPlayerOnGainSkillTries(Player* player, skills_t skill, uint64_t& tries); Coloque isso abaixo: bool eventPlayerOnToggleMount(Player* player, uint8_t mountid, bool mounting); Ainda no arquivo events.h procure por: int32_t playerOnGainSkillTries; Coloque isso abaixo: int32_t playerOnToggleMount; Vá no arquivo game.cpp procure por: player->resetIdleTime(); Embaixo de uma quebra de linha e coloque isso abaixo: const Position& currentPos = player->getPosition(); Position destPos = getNextPosition(direction, currentPos); const CreatureEventList& moveEvents = player->getCreatureEvents(CREATURE_EVENT_MOVE); for (CreatureEvent* moveEvent : moveEvents) { if (!moveEvent->executeOnMove(player, currentPos, destPos)) { player->sendCancelWalk(); return; } } Vá no arquivo player.cpp procure por: bool Player::toggleMount(bool mount) return false; } Coloque isso abaixo: if (!g_events->eventPlayerOnToggleMount(this, currentMountId, mount)) { return false; } Ainda no arquivo player.cpp procure por: bool Player::toggleMount(bool mount) return false; } Coloque isso abaixo: uint8_t currentMountId = getCurrentMount(); if (!g_events->eventPlayerOnToggleMount(this, currentMountId, mount)) { return false; } Bom aqui acabamos o sistema na source vamos para á parte de programação lua no datapack. Instale essa Lib no seu servidor: FlyingMounts = {65} -- Mounts in this table are going to force fly when mounting/dismounting. PvpRestrictions = "high" -- You can set 3 different types of pvp restrictions -- None: ---- Nothing will be done, the players can attack each other anytime while flying. -- Medium: -- The players can attack each other while flying, but they cant start flying if they already have pz and they will have a huge interval (configurable) to go up and down. The interval is only applied to the people with PZ locked. -- High: ---- Players can't attack each other while flying at all and they cant start flying as in medium. This could be abused to escape from pks as you can't be attacked by them while flying. ChangeFloorInterval = 2 -- seconds ChangeFloorIntervalPZ = 10 -- seconds, only in medium restriction. function Position:createFlyFloor() local toTile = Tile(self) if not toTile or not toTile:getItems() or not toTile:getGround() then doAreaCombatHealth(0, 0, self, 0, 0, 0, CONST_ME_NONE) Game.createItem(460, 1, self) end end function Tile:hasValidGround() local ground = self:getGround() local nilitem = self:getItemById(460) if ground and not nilitem then return true end return false end function Player:activateFly() self:setStorageValue(16400, 1) self:registerEvent("FlyEvent") return true end function Player:deactivateFly() local can, floor = self:canDeactivateFly() local pos = self:getPosition() if can then local curtile = Tile(pos) local itemfloor = curtile:getItemById(460) if itemfloor then itemfloor:remove() end self:setStorageValue(16400, -1) self:unregisterEvent("FlyEvent") if pos.z ~= floor then pos.z = floor self:teleportTo(pos) pos:sendMagicEffect(CONST_ME_TELEPORT) end end return can end function Player:isFlying() return self:getStorageValue(16400) == 1 end function Player:canDeactivateFly() local pos = self:getPosition() for z = pos.z, 15 do local tmp = Tile(pos.x, pos.y, z) if tmp and tmp:hasValidGround() then if self:canFlyDown(z) then return true, z else return false end end end return false end function Player:canFlyUp() local pos = self:getPosition() local tmp = Tile(pos.x, pos.y, pos.z-1) if tmp and tmp:hasValidGround() then return false end return true end function Player:canFlyDown(floor) local pos = self:getPosition() local tmp = Tile(pos) if floor and floor == pos.z then return true end if tmp:hasValidGround() then return false end tmp = Tile(pos.x, pos.y, floor or pos.z+1) if tmp and (tmp:getHouse() or tmp:hasFlag(TILESTATE_PROTECTIONZONE) or tmp:hasFlag(TILESTATE_FLOORCHANGE) or tmp:hasFlag(TILESTATE_BLOCKSOLID)) then return false end return true end function Player:flyUp() if self:isFlying() then if self:canFlyUp() then local pos = self:getPosition() local tile = Tile(pos) local itemfloor = tile:getItemById(460) if itemfloor then itemfloor:remove() end pos.z = pos.z-1 pos:createFlyFloor() self:teleportTo(pos) pos:sendMagicEffect(CONST_ME_TELEPORT) return true end return false else self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not flying.") end end function Player:flyDown() if self:isFlying() then if self:canFlyDown() then local pos = self:getPosition() local tile = Tile(pos) local itemfloor = tile:getItemById(460) if itemfloor then itemfloor:remove() end pos.z = pos.z+1 pos:createFlyFloor() self:teleportTo(pos) pos:sendMagicEffect(CONST_ME_TELEPORT) return true end return false else self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not flying.") end end Agora em creaturescripts instale: -- <event type="move" name="FlyEvent" script="flyevent.lua" /> function onMove(player, fromPosition, toPosition) if PvpRestrictions:lower() == "high" and player:isPzLocked() then return true end if player:isFlying() then local fromTile = Tile(fromPosition) local fromItem = fromTile:getItemById(460) if fromItem then fromItem:remove() end toPosition:createFlyFloor() end return true end Agora em talkactions instale: -- <talkaction words="!down" script="fly.lua" /> -- <talkaction words="!up" script="fly.lua" /> local exhauststorage = 16500 function onSay(player, words) if not player:isFlying() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not flying.") return false end if player:isPzLocked() and PvpRestrictions:lower() == "high" then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You cannot use this command in fight.") return false end local last = player:getStorageValue(exhauststorage) local interval = ChangeFloorInterval if PvpRestrictions:lower() == "medium" and player:isPzLocked() then interval = ChangeFloorIntervalPZ end if last+interval > os.time() then player:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED) return false end if words == "!up" then local ret = player:flyUp() if ret == false then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You cannot fly up.") else player:setStorageValue(exhauststorage, os.time()) end elseif words == "!down" then local ret = player:flyDown() if ret == false then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You cannot fly down.") else player:setStorageValue(exhauststorage, os.time()) end end return false end Agora em data/events/events.xml troque: <event class="Creature" method="onTargetCombat" enabled="0" /> Por: <event class="Player" method="onToggleMount" enabled="1" /> Agora em events/scripts/creature.lua troque á função onTargetCombat por: function Creature:onTargetCombat(target) if self and target then if PvpRestrictions:lower() == "high" then if self:isPlayer() and self:isFlying() then local pos = self:getPosition() local tile = Tile(pos) if tile:getItemById(460) then return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER end end if target:isPlayer() and target:isFlying() then local pos = target:getPosition() local tile = Tile(pos) if tile:getItemById(460) then return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER end end end end return true end Agora em events/scripts/player.lua adicione á função: function Player:onToggleMount(mountid, mount) if mount then if isInArray(FlyingMounts, mountid) then if isInArray({"high", "medium"}, PvpRestrictions:lower()) and self:isPzLocked() then self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You cannot start flying now.") return false end self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are now flying.") self:activateFly() end elseif self:isFlying() then local ret = self:deactivateFly() if ret then self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are no longer flying.") else self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You can't deactivate fly now.") end return ret end return true end Agora coloque em logout.lua encima da função onLogout(player) : if player:isFlying() then player:sendCancelMessage("You cannot logout while flying.") return false end Pronto só Compilar á source e utilizar o sistema. Créditos DarkWore (5% Por trazer ao Xtibia) Mkalo (95% Por Desenvolver)1 ponto -
kkkk eu vou fazer essa sessão transbordar até o @Frenvius pedir pra parar, huehuehuehue, abraço benny.1 ponto
-
Hoje venho postar o Race System para TFS 1.2 que desenvolvi um tempo atrás para um amigo e hoje venho postar ele aqui talvez possa ajudar os que estão começando. Vá no arquivo const.h procure por: enum TextColor_t : uint8_t { Logo abaixo procure por: TEXTCOLOR_FAIRY = 190, Coloque isso abaixo: TEXTCOLOR_WATER = 11, TEXTCOLOR_NORMAL = 128, TEXTCOLOR_FIRE2 = 180, TEXTCOLOR_FIGHTING = 114, TEXTCOLOR_FLYING = 131, TEXTCOLOR_GRASS = 66, TEXTCOLOR_POISON = 147, TEXTCOLOR_ELECTRIC = 210, TEXTCOLOR_GROUND = 126, TEXTCOLOR_PSYCHIC = 149, TEXTCOLOR_ROCK = 120, TEXTCOLOR_STEEL = 120, TEXTCOLOR_ICE = 35, TEXTCOLOR_BUG = 18, TEXTCOLOR_DRAGON = 220, TEXTCOLOR_GHOST = 219, TEXTCOLOR_DARK = 219, Agora vá no arquivo enums.h procure por: enum RaceType_t : uint8_t { Logo abaixo procure por: RACE_ENERGY, Coloque isso abaixo: RACE_WATER = 6, RACE_NORMAL = 7, RACE_FIRE2 = 8, RACE_FIGHTING = 9, RACE_FLYING = 10, RACE_GRASS = 11, RACE_POISON = 12, RACE_ELECTRIC = 13, RACE_GROUND = 14, RACE_PSYCHIC = 15, RACE_ROCK = 16, RACE_ICE = 17, RACE_BUG = 18, RACE_DRAGON = 19, RACE_GHOST = 20, RACE_STEEL = 21, RACE_FAIRY = 22, RACE_DARK = 23, Agora em monsters.cpp procure por: if ((attr = monsterNode.attribute("race"))) { stdstring tmpStrValue = asLowerCaseString(attr.as_string()); uint16_t tmpInt = pugicast<uint16_t>(attr.value()); Logo abaixo procure por: } else if (tmpStrValue == "energy" || tmpInt == 5) { mType->info.race = RACE_ENERGY; Coloque isso abaixo: } else if (tmpStrValue == "water" || tmpInt == 6) { mType->info.race = RACE_WATER; } else if (tmpStrValue == "normal" || tmpInt == 7) { mType->info.race = RACE_NORMAL; } else if (tmpStrValue == "fire2" || tmpInt == 8) { mType->info.race = RACE_FIRE2; } else if (tmpStrValue == "fighting" || tmpInt == 9) { mType->info.race = RACE_FIGHTING; } else if (tmpStrValue == "flying" || tmpInt == 10) { mType->info.race = RACE_FLYING; } else if (tmpStrValue == "grass" || tmpInt == 11) { mType->info.race = RACE_GRASS; } else if (tmpStrValue == "poison" || tmpInt == 12) { mType->info.race = RACE_POISON; } else if (tmpStrValue == "electric" || tmpInt == 13) { mType->info.race = RACE_ELECTRIC; } else if (tmpStrValue == "ground" || tmpInt == 14) { mType->info.race = RACE_GROUND; } else if (tmpStrValue == "psychic" || tmpInt == 15) { mType->info.race = RACE_PSYCHIC; } else if (tmpStrValue == "rock" || tmpInt == 16) { mType->info.race = RACE_ROCK; } else if (tmpStrValue == "ice" || tmpInt == 17) { mType->info.race = RACE_ICE; } else if (tmpStrValue == "bug" || tmpInt == 18) { mType->info.race = RACE_BUG; } else if (tmpStrValue == "dragon" || tmpInt == 19) { mType->info.race = RACE_DRAGON; } else if (tmpStrValue == "ghost" || tmpInt == 20) { mType->info.race = RACE_GHOST; } else if (tmpStrValue == "fairy" || tmpInt == 21) { mType->info.race = RACE_FAIRY; } else if (tmpStrValue == "steel" || tmpInt == 22) { mType->info.race = RACE_STEEL; } else if (tmpStrValue == "dark" || tmpInt == 23) { mType->info.race = RACE_DARK; Por Fim vá em game.cpp procure por: void GamecombatGetTypeInfo(CombatType_t combatType, Creature* target, TextColor_t& color, uint8_t& effect){ switch (combatType) { case COMBAT_PHYSICALDAMAGE: { Item* splash = nullptr; switch (target->getRace()) { Logo abaixo procure por: case RACE_ENERGY: color = TEXTCOLOR_PURPLE; effect = CONST_ME_ENERGYHIT; break; Coloque isso abaixo: case RACE_WATER: color = TEXTCOLOR_WATER; effect = CONST_ME_DRAWBLOOD; break; case RACE_NORMAL: color = TEXTCOLOR_NORMAL; effect = CONST_ME_DRAWBLOOD; break; case RACE_FIRE2: color = TEXTCOLOR_FIRE2; effect = CONST_ME_DRAWBLOOD; break; case RACE_FIGHTING: color = TEXTCOLOR_FIGHTING; effect = CONST_ME_DRAWBLOOD; break; case RACE_FLYING: color = TEXTCOLOR_FLYING; effect = CONST_ME_DRAWBLOOD; break; case RACE_GRASS: color = TEXTCOLOR_GRASS; effect = CONST_ME_DRAWBLOOD; break; case RACE_POISON: color = TEXTCOLOR_POISON; effect = CONST_ME_DRAWBLOOD; break; case RACE_ELECTRIC: color = TEXTCOLOR_ELECTRIC; effect = CONST_ME_DRAWBLOOD; break; case RACE_GROUND: color = TEXTCOLOR_GROUND; effect = CONST_ME_DRAWBLOOD; break; case RACE_PSYCHIC: color = TEXTCOLOR_PSYCHIC; effect = CONST_ME_DRAWBLOOD; break; case RACE_ROCK: color = TEXTCOLOR_ROCK; effect = CONST_ME_DRAWBLOOD; break; case RACE_ICE: color = TEXTCOLOR_ICE; effect = CONST_ME_DRAWBLOOD; break; case RACE_BUG: color = TEXTCOLOR_BUG; effect = CONST_ME_DRAWBLOOD; break; case RACE_DRAGON: color = TEXTCOLOR_DRAGON; effect = CONST_ME_DRAWBLOOD; break; case RACE_GHOST: color = TEXTCOLOR_GHOST; effect = CONST_ME_DRAWBLOOD; break; case RACE_DARK: color = TEXTCOLOR_DARK; effect = CONST_ME_DRAWBLOOD; break; case RACE_FAIRY: color = TEXTCOLOR_FAIRY; effect = CONST_ME_DRAWBLOOD; break; case RACE_STEEL: color = TEXTCOLOR_STEEL; effect = CONST_ME_DRAWBLOOD; break; Pronto agora só compilar com Visual Studio e Pronto. PS: Não Autorizo postar em outro fórum, conteúdo exclusivo do xtibia se postar pedirei para o Administrador do fórum remover.1 ponto
-
Que isso Benny eu tinha falado com o @Frenvius que ia dar uma força na sessão de programação do fórum. Abraço do Padrinho ^^1 ponto
-
Criei um poketibia e estou precisando de equipe. Iniciei o projeto hoje , mas já irei comprar vps e o que for preciso caso o server vá para frente. Preciso de tudo , mapper, scripter , tudo. Se você quiser pode entrar em contato comigo pelo WhatsApp : 18996423022 Ou comenta aqui para mim entrar em contato. Deixa seu up para ajudar ! Obrigado pela atenção1 ponto
Líderes está configurado para São Paulo/GMT-03:00