Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''tfs 1.1''.



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 5 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. 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"/>
  3. Tornar walkthrough (ghosting) opcional

    Nem todo mundo gosta dessa função. Eu particularmente acho que cagou o PVP o fato de você poder sair atravessando os outros. Então fiz um patch para o TFS que permite habilitar ou desabilitar essa função. Patch: https://gist.github.com/ranisalt/33f83fc76485403cd1f2 (visualização no fim do post) Como aplicar? Leia este tutorial! Para alterar, basta mudar a flag allowWalkthrough no config.lua. Opcionalmente acompanhe o merge request que fiz no repositório oficial. https://gist.github.com/ranisalt/33f83fc76485403cd1f2
  4. onMove creature event

    Atenção, a tag em creaturescripts.xml tem que ter o type="move" Criando a callback onMove, que é chamada, quando registrada, a todo momento que o player se mover. Em creatureevent.h Após: CREATURE_EVENT_EXTENDED_OPCODE, // otclient additional network opcodes Adicionar: CREATURE_EVENT_MOVE Após: bool executeOnDeath(Creature* creature, Item* corpse, Creature* killer, Creature* mostDamageKiller, bool lastHitUnjustified, bool mostDamageUnjustified); Adicionar: bool executeOnMove(Creature* creature, const Position& newPos, const Position& oldPos); Em creatureevent.cpp Após: } else if (tmpStr == "extendedopcode") { m_type = CREATURE_EVENT_EXTENDED_OPCODE; } Adicionar: } else if (tmpStr == "move") { m_type = CREATURE_EVENT_MOVE; } Após: case CREATURE_EVENT_EXTENDED_OPCODE: return "onExtendedOpcode"; Adicionar: case CREATURE_EVENT_MOVE: return "onMove"; Após: Adicionar: Em game.cpp Dentro do método Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags /*= 0*/), e depois de: const Position& currentPos = creature->getPosition(); Position destPos = getNextPosition(direction, currentPos); Adicionar for (CreatureEvent* moveEvent : creature->getCreatureEvents(CREATURE_EVENT_MOVE)) { if (!moveEvent->executeOnMove(creature, destPos, currentPos)) { return RETURNVALUE_NOTPOSSIBLE; } }
  5. Monster Damage Multiplier

    A pedido do usuário Vyctor17 neste tópico fiz uma função para multiplicar o dano dos monstros: Primeiro, em luascripts.cpp deverá ser adicionado, logo após: registerMethod("Monster", "isMonster", LuaScriptInterface::luaMonsterIsMonster); Isso: registerMethod("Monster", "multiplyDamage", LuaScriptInterface::luaMonsterMultiplyDamage); Logo abaixo de: int32_t LuaScriptInterface::luaMonsterIsMonster(lua_State* L) { // monster:isMonster() const Monster* monster = getUserdata<const Monster>(L, 1); pushBoolean(L, monster != nullptr); return 1; } Isso: int32_t LuaScriptInterface::luaMonsterMultiplyDamage(lua_State* L) { // monster:multiplyDamage(multiplier) Monster* monster = getUserdata<Monster>(L, 1); if (monster) { monster->multiplier = getNumber<uint32_t>(L, 2); pushBoolean(L, true); } else { lua_pushnil(L); } return 1; } Em luascripts.h: Logo após: static int32_t luaMonsterIsMonster(lua_State* L); Isso: static int32_t luaMonsterMultiplyDamage(lua_State* L); Em monster.h: Logo após: static uint32_t monsterAutoID; Isso: int32_t multiplier; Em monster.cpp: Logo após: Monster::Monster(MonsterType* _mtype) : Creature() { Isso: multiplier = 1; No método Monster::doAttacking, procure por: ATENÇÃO, TEM QUE SER NO MÉTODO Monster::doAttacking! minCombatValue = spellBlock.minCombatValue; maxCombatValue = spellBlock.maxCombatValue; Substitua por: minCombatValue = spellBlock.minCombatValue * multiplier; maxCombatValue = spellBlock.maxCombatValue * multiplier; E está feito. Se quiser fazer o monstro não dar dano, só por um multiplier abaixo de zero. É possível fazer algo mais específico com a variável isMelee, multiplicando apenas spell ou apenas melee. Se preferirem dessa forma posso editar novamente para atender esse caso.
×