Ir para conteúdo

Skydrowz

Membro
  • Registro em

  • Última visita

  1. Você pode usar todos os comandos juntos... cd usr/tfs && ./tfs Nisso ele já abre o servidor.
  2. Você pode adicionar as storages necessárias nos personagens ao irem pra main, por exemplo, no NPC Oracle. Exemplo: local missions = { WotE = { [1] = {stg = Storage.WrathoftheEmperor.Questline, value = 29}, [2] = {stg = Storage.WrathoftheEmperor.Mission01, value = 3}, [3] = {stg = Storage.WrathoftheEmperor.Mission02, value = 3}, [4] = {stg = Storage.WrathoftheEmperor.Mission03, value = 3}, [5] = {stg = Storage.WrathoftheEmperor.Mission04, value = 3}, [6] = {stg = Storage.WrathoftheEmperor.Mission05, value = 3}, [7] = {stg = Storage.WrathoftheEmperor.Mission06, value = 4}, [8] = {stg = Storage.WrathoftheEmperor.Mission07, value = 6}, [9] = {stg = Storage.WrathoftheEmperor.Mission08, value = 2}, [10] = {stg = Storage.WrathoftheEmperor.Mission09, value = 2}, }, } for _, wrath in pairs(missions.WotE) do local storage = wrath.stg local valor = wrath.value player:setStorageValue(storage, valor) end
  3. Não seria melhor criar a função em player.lua? Assim, quando o player puxar os gold coins para a backpack, a função seria usada.
  4. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) local reviveId = -- Id do revive local potionId = -- Id da potion local nextPosition = Position(-- Position pra onde ele vai ser teleportar) if npcHandler.topic[cid] == 0 then if msgcontains(msg, 'yes') then if player:getItemCount(reviveId) < 1 and player:getItemCount(potionId) < 1 then player:teleportTo(nextPosition) player:getPosition():sendMagicEffet(CONST_ME_TELEPORT) else npcHandler:say("Desculpe, não posso o teleportar se houver potions dentro de sua backpack." , cid) end end end return true end npcHandler:setMessage(MESSAGE_GREET, 'Olá posso lhe levar para o torneio PVP semanal. Deseja ir?') npcHandler:setMessage(MESSAGE_FAREWELL, 'See you later, |PLAYERNAME|.') npcHandler:setMessage(MESSAGE_WALKAWAY, 'See you later, |PLAYERNAME|.') npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Nem sei se funciona pra pokémon, só sei que tava sem ter o que fazer. Se for mais de uma potion, tem que fazer uma tabela.
  5. Em tfs/src/protocolgame.cpp, procurar por: void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) E substituir essa linha por este código: void ProtocolGame::AddPlayerStats(NetworkMessage_ptr msg) { msg->put<char>(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { float f_h_percent = (float) player->getHealth() / player->getPlayerInfo(PLAYERINFO_MAXHEALTH); uint16_t h_percent = f_h_percent * 100; msg->put<uint16_t>(h_percent); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) // client debugs after 2,147,483,647 exp msg->put<uint32_t>(0x7FFFFFFF); else msg->put<uint32_t>(experience); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { float f_m_percent = (float) player->getPlayerInfo(PLAYERINFO_MANA) / (float) player->getPlayerInfo(PLAYERINFO_MAXMANA); uint16_t m_percent = f_m_percent * 100; msg->put<uint16_t>(m_percent); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->put<char>(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->put<uint16_t>(player->getStaminaMinutes()); } Depois é só compilar. Só copiei do tópico do cara aí.
  6. Esse é o seu yellow.lua? function onUseWeapon(creature, var) min, max = 360, 420 target = getCreatureTarget(creature) if target ~= 0 then doSendDistanceShoot(getThingPos(creature), getThingPos(target), sh) addEvent(doAreaCombatHealth, 100, creature, dmg, getThingPos(target), 0, -min, -max, ef) end return 1 end Tenta assim.
  7. <item fromid="16103" toid="16104" article="a" name="mathmaster shield"> <attribute key="weight" value="314" /> <attribute key="description" value="It's an Emblem of Wisdom." /> <attribute key="weaponType" value="shield" /> <attribute key="defense" value="39" /> <attribute key="magiclevelpoints" value="3" /> <attribute key="showattributes" value="1" /> </item>
  8. <movevent type="Equip" itemid="16103" slot="shield" event="function" value="onEquipItem"> <vocation id="3"/> <vocation id="2"/> </movevent> <movevent type="DeEquip" itemid="16104" slot="shield" event="function" value="onDeEquipItem"/>
  9. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkState = {} local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 6527 -- id da sua moeda vip local t = { [12396] = {price = 400}, [12575] = {price = 400}, [7440] = {price = 200}, [7443] = {price = 400}, [8981] = {price = 1000}, [5468] = {price = 250}, [2156] = {price = 200}, [2153] = {price = 400}, [2154] = {price = 600}, [2155] = {price = 800}, [2346] = {price = 200} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("Here are you.", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE')) then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe')) then doSetGameState(GAMESTATE_SHUTDOWN) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você não pode fechar um elseif com end, e sim o if ao qual o elseif pertence. Abraços.
  10. É sim. Criando uma talkaction que subtraia da tabela saldo do primeiro jogador e adicione a quantidade ao saldo do segundo jogador.
  11. Adaptado para a 1.X e funcionando perfeitamente(depois de algumas correções). Ótimo evento!
  12. Acabei de ver a versão do TFS, hahaha. Usa o do Vodkart.
  13. Maste reagiu a uma resposta no tópico: (Resolvido)[Statues] Morar na cidade.
  14. Por nada. Se precisar de ajuda com a tabela, só dar um toque!
  15. Maste reagiu a uma resposta no tópico: (Resolvido)[Statues] Morar na cidade.
  16. function onUse(player, item) local townId = 4 local townName = Town(townId):getName() if player:getTown():getId() == townId then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você já é morador desta cidade.") return false else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Parabéns! Você agora é morador de " .. townName .. ".") player:setTown(townId) player:getPosition():sendMagicEffect(CONST_ME_YELLOW_RINGS) end return true end Agora vai. Desculpa, é que não tô testando. Tô fazendo de cabeça. xD São só erros de função mesmo. Sempre esqueço algumas...
  17. Havia atualizado o código. Dá uma olhada de novo lá. Mudei em: local townName = Town(townId):getName() Acho que você pegou o código antes da edição ?

Informação Importante

Confirmação de Termo