Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''TFS 1.0''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 8 registros

  1. Em talkactions/scripts crie um arquivo chamado set_actionid.lua com o seguinte código: function onSay(cid, words, param) local player = Player(cid) if not player then return false end if not player:getGroup():getAccess() then return true end if not tonumber(param) then player:sendCancelMessage("Need a number param.") return false end local position = player:getPosition() position:getNextPosition(player:getDirection()) local tile = Tile(position) if not tile then player:sendCancelMessage("Object not found.") return false end local thing = tile:getTopVisibleThing(player) if not thing then player:sendCancelMessage("Thing not found.") return false end if thing:isCreature() then player:sendCancelMessage("You can't give an action id to a creature.") elseif thing:isItem() then local actionid = tonumber(param) if actionid <= 0 then thing:removeAttribute(ITEM_ATTRIBUTE_ACTIONID) else thing:setActionId(actionid) end end position:sendMagicEffect(CONST_ME_MAGIC_RED) return false end E em talkactions.xml ponha a seguinte tag: <talkaction words="/aid" separator=" " script="set_actionid.lua" /> Para utilizar, ponha o item no chão na sua frente e escreva /aid action_id, sendo action_id um umero
  2. Bem, venho trazer para vocês hoje um sistema de train funcionando 100% em TFS 1.0. Direto ao assunto postei um video para verem o funcionamento Instalação Primeiramente pessoal, deverão abrir a pasta data/movements/scripts/ . Copie qualquer arquivo renomeando-o como 'train.lua' sem as aspas. Abra esse arquivo e cole o seguinte codigo. Feito isso pessoal, vão em data/movements/movements.xml e cole isso logo apos o primeiro <movements> do arquivo Obrigado Creditos pelo script LEOLEO
  3. Habilitando onEquip e onDeEquip para actionId

    Atualmente o TFS 1.0, em moveevents, não reconhece items com actionId para as funções onEquip e onDeEquip. Para adicionar é simples. Em movement.cpp procure por: if (it != m_itemIdMap.end()) { std::list<MoveEvent*>& moveEventList = it->second.moveEvent[eventType]; for (MoveEvent* moveEvent : moveEventList) { if ((moveEvent->getSlot() & slotp) != 0) { return moveEvent; } } } Isso deve estar na função MoveEvents::getEvent. Depois de achar essa parte, abaixo dela cole o seguinte: uint16_t actionId = item->getActionId(); if (actionId != 0) { it = m_actionIdMap.find(actionId); if (it != m_actionIdMap.end()) { std::list<MoveEvent*>& moveEventList = it->second.moveEvent[eventType]; if (!moveEventList.empty()) { return *moveEventList.begin(); } } } Agora onEquip e onDeEquip aceita itens com actionId. Tenha em mente que onEquip e onDeEquip definidos com o id do item toma preferencia em relação aos com action id. Se você colar de forma invertida, ou seja, colar acima daquele trecho que eu falei para procurar, a ordem também vai inverter e action id vai ter agora preferencia sobre item id.
  4. Crie um arquivo em talkactions/scripts chamado storage.lua e ponha o seguinte código: function onSay(cid, words, param, type) local player = Player(cid) if not player or not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then return false end -- Extract the specified parameters. local parameters = param:split(",") if words == "/getstorage" and parameters[2] == nil then player:sendCancelMessage("Insufficient parameters, usage: !getstorage playerName, key") return false end if words == "/setstorage" and parameters[3] == nil then player:sendCancelMessage("Insufficient parameters, usage: !setstorage playerName, key, value") return false end -- Remove trailing/leading white spaces from parameters. local playerName = (parameters[1] or ""):trim() local storageKey = tonumber(parameters[2]) or 0 -- Get meta player. local checkedPlayer = Player(playerName) if not checkedPlayer then player:sendCancelMessage(string.format("Could not find player '%s'.", playerName)) player:getPosition():sendMagicEffect(CONST_ME_BUBBLES) return false end local storageValue = tonumber(parameters[3]) or checkedPlayer:getStorageValue(storageKey) local msg = string.format("Storage key '%s' %s set to '%d' for player '%s'.", storageKey, "%s", storageValue, checkedPlayer:getName()) if words == "/setstorage" then -- Set specified storage value on player. checkedPlayer:setStorageValue(storageKey, storageValue) msg = string.format(msg, "is now") else -- Get specified storage value from player. msg = string.format(msg, "is currently") end -- Print the message in Local Chat in orange (only self can see). player:sendTextMessage(MESSAGE_EVENT_ORANGE, msg) player:getPosition():sendMagicEffect(CONST_ME_BUBBLES) end Em talkactions.xml ponha as seguintes tags: <talkaction words="/getstorage" separator=" " script="storage.lua"/> <talkaction words="/setstorage" separator=" " script="storage.lua"/>
  5. TFS 1.0 Skill Point System

    Opa galera, eu vi esse script em outro fórum e trouxe aqui para compartilhar com vocês porque achei a ideia bacana. O script é uma forma de customizar seu personagem à medida que ele vai avançando de level. O avanço de level dá ao jogador "pontos", os quais podem ser utilizados para comprar HP, MP e niveis de skills. O grande benefício desse sistema é que jogadores de um mesmo level podem ser radicalmente diferentes e podem se especializar, como no caso de uma equipe/time (um druida com pontos pode se especializar em HP e MP e virar o healer do time, enquanto um knight pode se especializar somente skills para ser o atacante e outro em HP para ser o tank e bloquer) Algumas imagens do funcionamento (retiradas do outro tópico original): Agora que já se interessou pelo sistema, vamos aplicá-lo em nosso servidor! Em /creaturescripts/scripts/skillpoints.lua local SkillPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 1, [8] = 1, } function onAdvance(cid, skill, oldlevel, newlevel) if not (SkillPoints[getPlayerVocation(cid)]) then return true end if (skill == 8) then if (getPlayerStorageValue(cid, 14573) < newlevel) then if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) setPlayerStorageValue(cid, 14573, 0) end setPlayerStorageValue(cid, 14573, newlevel) setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) + (newlevel - oldlevel) * (SkillPoints[getPlayerVocation(cid)])) doCreatureSay(cid, '+1 Skill Point!', TALKTYPE_ORANGE_1) end end return true endEm /creaturescripts/scripts/login.lua, adicione player:registerEvent("SkillPointSystem")Em /creaturescripts/creaturescripts.xml, adicione <event type="advance" name="SkillPointSystem" script="skillpoints.lua"/>Em /talkactions/scripts/skillpoints.lua local SkillPoints = { [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1, [6] = 1, [7] = 1, [8] = 1, } function onSay(cid, words, param) local player = Player(cid) local vocation = Player(cid) if not (SkillPoints[getPlayerVocation(cid)]) then return false end local param = param:lower() local p2 = param:split(",") if (getPlayerStorageValue(cid, 14574) < 0) then setPlayerStorageValue(cid, 14574, 0) end local skillids = { ["shielding"] = 5, ["sword"] = 2, ["axe"] = 3, ["club"] = 1, ["fist"] = 0, ["distance"] = 4 } local attributes = { ["health"] = {np = 1, vl = 2, skn = "Hit Points"}, ["energy"] = {np = 1, vl = 2, skn = "Mana Points"}, ["magic"] = {np = 15, vl = 1, skn = "Magic Level"}, ["shielding"] = {np = 15, vl = 1, skn = "Shielding Skill"}, ["sword"] = {np = 15, vl = 1, skn = "Sword Skill"}, ["axe"] = {np = 15, vl = 1, skn = "Axe Skill"}, ["club"] = {np = 15, vl = 1, skn = "Club Skill"}, ["fist"] = {np = 15, vl = 1, skn = "Fist Skill"}, ["distance"] = {np = 15, vl = 1, skn = "Distance Skill"}, } if (param == "check") then doPlayerPopupFYI(cid, "<<<<< Skill Points >>>>> \n\nPoints Available: ".. getPlayerStorageValue(cid, 14574) .."\nPoints Per Level: ".. SkillPoints[getPlayerVocation(cid)]) elseif (p2[1] and p2[1] == "add") and (attributes[p2[2]]) and (tonumber(p2[3])) then local creature = Creature(cid) local cpos = creature:getPosition() if (getPlayerStorageValue(cid, 14574) < tonumber(p2[3]) * attributes[p2[2]].np) then doPlayerSendCancel(cid, "you need more skill points go hunt!") return cpos:sendMagicEffect(CONST_ME_POFF) end if (p2[2] == "health") then player:setMaxHealth(player:getMaxHealth() + attributes[p2[2]].vl * tonumber(p2[3])) player:addHealth(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Hit Points") elseif (p2[2] == "energy") then player:setMaxMana(player:getMaxMana() + attributes[p2[2]].vl * tonumber(p2[3])) player:addMana(attributes[p2[2]].vl * tonumber(p2[3])) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been rewarded with ".. tonumber(p2[3]) * attributes[p2[2]].vl .. "Mana Points") elseif (p2[2] == "magic") then player:addManaSpent(math.ceil((Vocation(getPlayerVocation(cid)):getRequiredManaSpent(player:getBaseMagicLevel() + 1) - player:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC))) ---Player receives message on Skill Advance elseif(skillids[p2[2]]) then for a = 1, tonumber(p2[3]) do player:addSkillTries(skillids[p2[2]], player:getVocation():getRequiredSkillTries(skillids[p2[2]], player:getSkillLevel(skillids[p2[2]]) + 1) - player:getSkillTries(skillids[p2[2]])) --Player receives message on Level Advance end end setPlayerStorageValue(cid, 14574, getPlayerStorageValue(cid, 14574) - tonumber(p2[3]) * attributes[p2[2]].np) else local msgx = "" for i, v in pairs(attributes) do local add = (v.np > 1) and "s" or "" msgx = msgx .. string.upper(i:sub(1,1)) .. i:sub(2, #i) .. " - ".. v.np .. " points".. add .. " = " .. v.vl .. " ".. v.skn .. "\n" end doPlayerPopupFYI(cid, " <<<<<<<< Add Skill Points >>>>>>>> \n\n Skill Points are used to customize your character\n\n".. msgx .. "\nExample of Use: ".. words .." add,health, 1\n\nPoints available: ".. getPlayerStorageValue(cid, 14574)) end return true endEm /talkactions/talkactions.xml, adicione <talkaction words="!points" separator=" " script="skillpoints.lua"/>Se gostou, poste!<Não testei o script, embora tenham garantido no outro fórum que está funcionando... se não funcionar, poste no próprio tópico os erros relacionados a esse script ou então em nossa seção de dúvidas de scripting (http://forums.otserv.com.br/index.php/forum/170-dúvidas/)>
  6. Recentemente em um dos servidores que eu trabalho surgiu um inconveniente para criar um sistema que envolve todos os equipamentos do server, e isso era o fato de que se registrássemos um script para um item que tem uma tag function, por exemplo energy ring ou life ring, esse item passa a não exercer mais sua função de energy ring ou life ring, sendo assim o script teria que substituir isso. Como o sistema envolvia todos os itens do servidor, não era possível refazer todos esses itens em LUA então eu alterei a source de modo que move events passam a aceitar function tag e script tag. Para fazer essa mesma alteração, você vai ter que ir em baseevents.cpp, na função BaseEvents::loadFromXml() procure por: pugi::xml_attribute scriptAttribute = node.attribute("script"); if (scriptAttribute) { std::string scriptFile = "scripts/" + std::string(scriptAttribute.as_string()); success = event->checkScript(basePath, scriptsName, scriptFile) && event->loadScript(basePath + scriptFile); } else { pugi::xml_attribute functionAttribute = node.attribute("function"); if (functionAttribute) { success = event->loadFunction(functionAttribute.as_string()); } else { success = false; } } e substitua por: pugi::xml_attribute scriptAttribute = node.attribute("script"); if (scriptAttribute) { std::string scriptFile = "scripts/" + std::string(scriptAttribute.as_string()); success = event->checkScript(basePath, scriptsName, scriptFile) && event->loadScript(basePath + scriptFile); pugi::xml_attribute functionAttribute = node.attribute("function"); if (functionAttribute) { event->loadFunction(functionAttribute.as_string()); } } else { pugi::xml_attribute functionAttribute = node.attribute("function"); if (functionAttribute) { success = event->loadFunction(functionAttribute.as_string()); } else { success = false; } } Agora em movement.cpp, na função MoveEvent::EquipItem procure por: if (isCheck) { return 1; } E logo abaixo adicione: if (moveEvent->m_scriptId) { moveEvent->executeEquip(player, item, slot); } Ainda em movement.cpp, na função MoveEvent::DeEquipItem procure por: player->setItemAbility(slot, false); const ItemType& it = Item::items[item->getID()]; E adicione logo abaixo isso if (moveEvent->m_scriptId) { moveEvent->executeEquip(player, item, slot); }
  7. Habilitando PvP 10.10

    Edit: Essas alterações apenas ajudam a implementar o novo sistema, ela não cobre todos aspectos do mesmo. No TFS 1.0 o novo sistema de pvp do Tibia 10.10 não foi totalmente implementado. Esse tópico vai te mostrar uma pequena alteração que pode te ajudar a implementar totalmente o novo sistema pvp do Tibia global. Essas alterações são feitas na source. Em player.h, depois de: fightMode_t fightMode; adicione: pvpMode_t pvpMode; Depois de: secureMode_t getSecureMode() const { return secureMode; } adicione: pvpMode_t getPvpMode() const { return pvpMode; } Se você não tiver a função setPvpMode em player.h também: Depois de: void setFightMode(fightMode_t mode); adicione: void setPvpMode(pvpMode_t mode) { pvpMode = mode; }
  8. Walkthrough magic wall e wildgrowth

    Importante: Antes de tentar implementar isso, implemente isso http://forums.otserv.com.br/index.php/topic/166000-habilitando-pvp-1010/ EDIT: Estou trabalhando numa solução melhor. Por favor evitem usar essa abaixo. Eu estou atualizando o TFS 1.0 para a versão mais nova do Tibia e recentemente atualizei a parte de poder passar por magic wall e wildgrowth se você estiver em Dove mode. Vá em tile.cpp e procure por essa parte: if (items) { if (!hasBitSet(FLAG_IGNOREBLOCKITEM, flags)) { //If the FLAG_IGNOREBLOCKITEM bit isn't set we dont have to iterate every single item if (hasFlag(TILESTATE_BLOCKSOLID)) { return RET_NOTENOUGHROOM; } logo abaixo dela adicione if (hasFlag(TILESTATE_MAGICFIELD)) { MagicField* field = getFieldItem(); if (field->getID() == ITEM_MAGICWALL_SAFE || field->getID() == ITEM_WILDGROWTH_SAFE) { if (const Player* player = creature->getPlayer()) { Creature* itemOwner = g_game.getCreatureByID(field->getOwner()); if (itemOwner && itemOwner->getPlayer()){ if (!(player->getGuild() == itemOwner->getPlayer()->getGuild() && player->getGuild()) && !(player->getParty() == itemOwner->getPlayer()->getParty() && player->getParty())) { if (!(player->getPvpMode() == PVP_MODE_DOVE) || itemOwner->getPlayer() == player) { return RET_NOTENOUGHROOM; } } } } } }
×