Ir para conteúdo

Lyu

Membro
  • Registro em

  • Última visita

Solutions

  1. Lyu's post in (Resolvido)Guild Bonus was marked as the answer   
    Tente isso, fiz aqui rapidinho mas não testei (acredito que funcione como você espera)
     
    data/movements/scripts/guildexp.lua
    if not guildExperienceBonus then guildExperienceBonus = 0 -- default value; no guild end function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end local guild = player:getGuild() if guild then guildExperienceBonus = guild:getId() player:sendTextMessage(MESSAGE_INFO_DESCR, 'Sua guild agora possui o bônus em experiência.') player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end return true end data/movements/movements.xml
    <movevent event="StepIn" actionid="33462" script="guildexp.lua" /> data/events/scripts/player.lua
    --[[ Atenção, procure a função Player:onGainExperience(source, exp, rawExp) Adicione o código abaixo antes do último return exp ]] local guild = self:getGuild() if guild and guild:getId() == guildExperienceBonus then exp = exp * 1.2 -- 20% bonus end  
  2. Lyu's post in (Resolvido)como aumento a barra de skills (LEVEL) na source? was marked as the answer   
    no tibia.exe, mas não tem source do client da cipsoft. Nesse caso, só otclient.
  3. Lyu's post in (Resolvido)Ao invés de Curar, Danificar. was marked as the answer   
    basicamente inverta os valores, negative-os.
  4. Lyu's post in (Resolvido)SCRIPT BLESS ATÉ 3 RESET was marked as the answer   
    Substitui seu código e ver se soluciona..
    function onCombat(cid, target) if not isPlayer(target) then return true end if getPlayerResets(cid) < 3 or getPlayerResets(target) < 3 then return false end return true end  
  5. Lyu's post in (Resolvido)anti mc was marked as the answer   
    Provavelmente o erro ocorre se o player deslogar imediatamente após o login. Repita esse processo de deslogamento imediato e veja se realmente ocorre erros, depois, você pode testar se minha modificação resolveu :
    local config = { max = 4, -- Número de players permitido com o mesmo IP. group_id = 1 -- Kikar apenas player com o group id 1. } local accepted_ip_list = {} -- Lista dos players permitidos a usar MC, exemplo: {"200.85.3.60", "201.36.5.222"} local function antiMC(p) if isCreature(p.pid) then if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then doRemoveCreature(p.pid) end end return true end function onLogin(cid) if not isPlayer(cid) then return true end if getPlayerGroupId(cid) <= config.group_id then if isInArray(accepted_ip_list,doConvertIntegerToIp(getPlayerIp(cid))) == false then addEvent(antiMC, 1000, {pid = cid, max = config.max+1}) end end return true end  
  6. Lyu's post in (Resolvido)Domar Creature was marked as the answer   
    local monsters = { ['Dragon'] = {chance = 25, rewarditem = {2352, 1}}, ['Dragon Lord'] = {chance = 14, rewarditem = {8858, 1}} } function onUse(cid, item, fromPosition, itemEx, toPosition) if not isMonster(itemEx.uid) then return false end local monster = monsters[getCreatureName(itemEx.uid)] if not monster then return doPlayerSendCancel(cid, 'Esse monstro não é capturável.') end if monster.chance < math.random(100) then doCreatureSay(cid, 'Ops, a criatura conseguiu escapar.', TALKTYPE_MONSTER_SAY) else doCreatureSay(cid, 'Criatura capturada com sucesso.', TALKTYPE_MONSTER_SAY) doSendMagicEffect(getCreaturePosition(itemEx.uid), 14) doPlayerAddItem(cid, monster.rewarditem[1], monster.rewarditem[2]) end doRemoveCreature(itemEx.uid) doRemoveItem(item.uid, 1) return true end  
    <action itemid="7253" event="script" value="domar.lua"/>  
  7. Lyu's post in (Resolvido)Raid-Channel was marked as the answer   
    Opa eai @Jobs, beleza? Fiz aqui rapidinho, testa ai meu bom!
     
    raids.cpp
    Procure :
    extern ConfigManager g_config; Adicione isso abaixo :
     extern Chat* g_chat;  
    Agora no mesmo arquivo, procure :
    g_game.broadcastMessage(message, messageType); Remova e adicione isso no lugar :
    ChatChannel* channel = g_chat->getChannelById(0x14/*CHANNEL_RAID*/); channel->sendToAll(message, TALKTYPE_CHANNEL_W);  
     
    data/chatchannels/chatchannels.xml
    <channel id="20" name="Raid Channel" script="raid.lua" />  
    data/chatchannels/scripts/raid.lua
    function onSpeak(player, type, message) return false end  
    Isso deve enviar mensagens de Raid diretamente para o Channel 20 ao invés de um broadcastMessage, não sei se era isso que você queria mas espero que sim haha. Abraços!
  8. Lyu's post in (Resolvido)SQL Error! was marked as the answer   
    Execute isso em sua database!
    CREATE TABLE IF NOT EXISTS `players_online` ( `player_id` int(11) NOT NULL, PRIMARY KEY (`player_id`) ) ENGINE=MEMORY;  
  9. Lyu's post in (Resolvido)[pedido] Invasion boss was marked as the answer   
    Utilize a Interface Raid, é exatamente o que você precisa.
    Talvez você encontre exemplos de como fazer em data/raids.
  10. Lyu's post in (Resolvido)Ajudinha ae globalevents was marked as the answer   
    Clique aqui e veja se isso lhe ajuda!
  11. Lyu's post in (Resolvido)[NPC] Vende itens por pontos depositado was marked as the answer   
    @KotZletY Ele já conseguiu o conteúdo pelo Discord, @VitorSubhi ajudou ele, acho que já podes considerar o tópico como resolvido. Para os que veio aqui atrás do mesmo conteúdo, irei deixar uma versão minha abaixo para TFS 0.3.7/0.4.
     
    data/npc/Neil.xml
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Neil" script="neil.lua" walkinterval="2000" skull="green" floorchange="0"> <health now="100" max="100"/> <look type="128" head="0" body="105" legs="105" feet="0" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Eu vendo itens por pontos de doação, diga {trade}."/> </parameters> </npc>  
    data/npc/scripts/neil.lua
    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 items = { {id = 2352, subType = 0, buy = 50, sell = 0, name = 'crystal arrow'}, {id = 8858, subType = 0, buy = 35, sell = 0, name = 'crossbow'} } local onBuy = function(cid, item, subType, amount) local price = 0 for _, v in ipairs(items) do if item == v.id then price = v.buy end end if not doPlayerRemoveMoney(cid, price) then selfSay(('Você não possui {%d pontos}.'):format(price), cid) else doPlayerAddItem(cid, item, amount) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, ('Você recebeu %d %s.'):format(amount, getItemInfo(item).name)) closeShopWindow(cid) end return npcHandler:releaseFocus(cid) end function creatureSayCallback(cid, type, msg) if msg:lower() == 'trade' then openShopWindow(cid, items, onBuy, onSell) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
    para configurar os itens a serem negociados por pontos, é em neil.lua na tabela items :
    local items = {     {id = 2352, subType = 0, buy = 50, sell = 0, name = 'crystal arroww'},     {id = 8858, subType = 0, buy = 35, sell = 0, name = 'ice crossbow'} }  
    Para trocar o tipo de moeda (pontos), edite a linha 21 em :
    if not doPlayerRemoveMoney(cid, price) then  
    Troque pela função de remover pontos. Abraços.
  12. Lyu's post in (Resolvido)Skull System was marked as the answer   
    Procurei a função aqui, não testei, mas adicione-a em data/lib/050-function.lua e veja se resolve o seu problema.
    function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end  
  13. Lyu's post in (Resolvido)Ganhar mais exp com cast aberto. was marked as the answer   
    @Jobs que estranho! Coloquei o código sem os bugs no pastebin talvez funcione dessa vez, copie e cole la no seu arquivo :
    https://pastebin.com/gVn7BtzV 
  14. Lyu's post in (Resolvido)perde item ao usá-lo. was marked as the answer   
    Opa, olha eu aqui de novo xD
    testa ai:
    local walls = {1058, 9119, 10180, 1039} function onUse(cid, item, _, itemEx) local tmp = {} for _, v in ipairs(walls) do tmp[v] = #walls == _ and '_last' or walls[_ + 1] end local wall = tmp[itemEx.itemid] if not wall then return false end if wall == '_last' then doRemoveItem(itemEx.uid, 1) else doTransformItem(itemEx.uid, tmp[itemEx.itemid]) end return doRemoveItem(item.uid, 1) end  
  15. Lyu's post in (Resolvido)Mudar outfit de 1 em 1 segundo was marked as the answer   
    Fiz aqui rapidinho, utilizei onThink por ser um método mais seguro e permitir reLogin sem interferir na troca de outfits.
     
    data/creaturescripts/scripts/outfitring.lua
    local config = {          ring = 2205,          outfits = {         {lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 3},         {lookType = 129, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 3}     } } function onThink(cid, interval)         if getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == config.ring then         doSetCreatureOutfit(cid, config.outfits[os.time() % 2 == 0 and 1 or 2])     end          return true end  
    data/creaturescripts/creaturescripts.xml
    <event type="think" name="OutfitRing" event="script" value="outfitring.lua"/>  
    adicionar no final de data/creaturescripts/scripts/login.lua
    registerCreatureEvent(cid, "OutfitRing")  
    a configuração é na tabela config, onde você pode configurar o id do ring e as duas outfits. Abraços.
  16. Lyu's post in (Resolvido)[ERRO] was marked as the answer   
    é um bug no código. Altera a encoding do arquivo para ANSI que irá aparecer na linha 1 uma caractere especial. Delete-a.
  17. Lyu's post in (Resolvido)ao dar use no bau o player morre ! was marked as the answer   
    function onUse(cid) return doCreatureAddHealth(cid, -getCreatureMaxHealth(cid)) end  
    <action actionid="5543" event="script" value="onehit.lua"/>  
  18. O XML do monstro não foi encontrado na pasta monsters.
  19. Lyu's post in (Resolvido)como eu fasso para criar um iten portal? was marked as the answer   
    data/actions/actions.xml
    <action itemid="2352" event="script" value="itemteleport.lua"/> data/actions/scripts/itemteleport.lua
    local position = {x = 1000, y = 1000, z = 7} function onUse(cid, item)     if(doTeleportThing(cid, position)) then         doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)         doRemoveItem(item.uid, 1)     end          return true end Agora só basta você configurar o item que quer e a posição pra onde você vai.
  20. Lyu's post in (Resolvido)[PEDIDO] Porta com requisitos was marked as the answer   
    Testa ai, qualquer coisa me diz..
     
    Abre teu remeres e na porta que desejas editar, dê um duplo click e adicione a unique id 2500;
     
    agora em actions.xml adicione isso :
    <action uniqueid="2500" event="script" value="sworddoor.lua"/> crie um arquivo sworddoor.lua e adicione isso dentro :
    function onUse(cid, item, fromPosition, itemEx, toPosition)     if(item.uid == 2500 and getPlayerSkillLevel(cid, SKILL_SWORD) < 20) then         return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 20 sword fighting to open this door.")     end end
  21. Lyu's post in (Resolvido)[Error - CreatureScript Interface] was marked as the answer   
    ta faltando uma variável 'getTeamSpawn'
  22. Lyu's post in (Resolvido)[Pedido] Ajuste em Script was marked as the answer   
    Fala parceiro, tente assim :
     



  23. Lyu's post in (Resolvido)Help! Pokémon, talvez bugado?! was marked as the answer   
    no caso você não está conseguindo criar o monstro através do comando /m? já verificou se no arquivo monsters.xml, o nome do monstro realmente é Salamence? porque se for diferente, terá que escrever o que está lá por exemplo :
     
    Lá está Salamenc, você vai ter que escrever /m Salamenc.
  24. Lyu's post in (Resolvido)Tão simples, mas tá complicado? was marked as the answer   
    tente assim : level = 200 function onStepIn(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) < level then doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED) doPlayerSendCancel(cid,"Somente level " .. level .. " ou mais podem passar aqui.") else return doSendMagicEffect(getThingPos(cid), 14) end return TRUE end
  25. Lyu's post in (Resolvido)[Script] Ser teleportado apos matar um numero "x" de monstros ? was marked as the answer   
    Eu fiz um aqui rapidão, testa aê e qualquer error, me avisa..

    vá na pasta data/creaturescripts e abra o creaturescripts.xml, em seguida adicione esta tag :
    <event type="kill" name="monster" event="script" value="monster.lua"/> agora vá em data/creaturescripts/scripts e abra o arquivo login.lua, em seguida digite CRTL+F e procure por RegisterCreatureEvent, abaixo adicione :
    registerCreatureEvent(cid, "monster") no mesmo arquivo, desça até o final e antes do return true, adicione isto :
        if getPlayerStorageValue(cid, 50000) == -1 then         setPlayerStorageValue(cid, 50000, 0)     end agora vá em data/creaturescripts/scripts e crie um arquivo monster.lua e adicione este código :
    local config = { monster = 'Dragon', -- nome do monstro. count = 9, -- quantidade que deverá matar, configure sempre 1 a menos. position = {x = 1086, y = 1062, z = 7} -- posição que o player irá após matar todos os monstros. } function onKill(cid, target) if isPlayer(target) then return true end if getPlayerStorageValue(cid, 50000) < config.count and getCreatureName(target) == config.monster then setPlayerStorageValue(cid, 50000, getPlayerStorageValue(cid, 50000)+1) doPlayerSendTextMessage(cid, 19, ""..config.monster.."'s : ["..getPlayerStorageValue(cid, 50000).."/"..((config.count)+1).."]") elseif getPlayerStorageValue(cid, 50000) >= config.count and getCreatureName(target) == config.monster then doTeleportThing(cid, config.position, true) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, 22, 'Todos os monstros foram derrotados.') doPlayerSendTextMessage(cid, 19, ""..config.monster.."'s : [Finish]") setPlayerStorageValue(cid, 50000, 0) return true end return true end pronto, simples de configurar e se você gostou, se eu te ajudei realmente, rep+ haha!

Informação Importante

Confirmação de Termo