Postado Julho 5, 2018 6 anos OTX 0.4 8.60 Existe alguma função ou action que coloque o nome do player no começo do summon dele? Tipo o Wolf ai ficaria assim [Darcio] Wolf Pra poder saber de quem é o summon, eu particularmente acho veadagem da mais pura mas os player tão pedindo então vai saber né. A script / Spell que criei é essa aqui. local config = { storage = 223554, maxSummons = 1, --Limite de summons. summons = { [1] = "[PET] Tronic I", --Level / Summon. [30] = "[PET] Tronic II", [60] = "[PET] Tronic III", }, } local storageTimeSummon = 66995501 local time = 120 function onCastSpell(cid) if (getPlayerStorageValue(cid, storageTimeSummon) > os.time()) then doPlayerSendTextMessage(cid, 19, "Você só poderá invocar novamente depois de "..getPlayerStorageValue(cid, storageTimeSummon) - os.time().." segundos") else if not (getPlayerStorageValue(cid,config.storage) == 2) then doPlayerSendTextMessage(cid, 19, "Você não tem esse PET!") doSendMagicEffect(getCreaturePosition(cid), 3) return false end if #getCreatureSummons(cid) < config.maxSummons then local summon for level, summonName in pairs(config.summons) do if getPlayerLevel(cid) >= level then summon = summonName break end end if summon then if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 29 then setPlayerStorageValue(cid, storageTimeSummon, os.time() + time) doConvinceCreature(cid, doSummonCreature("[PET] Tronic I", getThingPos(cid))) doSendMagicEffect(getCreaturePosition(cid), 30) doCreatureSay(getCreatureSummons(cid)[#getCreatureSummons(cid)], "Cheguei", TALKTYPE_ORANGE_1) elseif getPlayerLevel(cid) >= 30 and getPlayerLevel(cid) <= 59 then setPlayerStorageValue(cid, storageTimeSummon, os.time() + time) doConvinceCreature(cid, doSummonCreature("[PET] Tronic II", getThingPos(cid))) doSendMagicEffect(getCreaturePosition(cid), 30) doCreatureSay(getCreatureSummons(cid)[#getCreatureSummons(cid)], "Cheguei", TALKTYPE_ORANGE_1) elseif getPlayerLevel(cid) >= 60 then setPlayerStorageValue(cid, storageTimeSummon, os.time() + time) doConvinceCreature(cid, doSummonCreature("[PET] Tronic III", getThingPos(cid))) doSendMagicEffect(getCreaturePosition(cid), 30) doCreatureSay(getCreatureSummons(cid)[#getCreatureSummons(cid)], "Cheguei", TALKTYPE_ORANGE_1)Z end end else for _, pid in ipairs(getCreatureSummons(cid)) do doRemoveCreature(pid) end doSendMagicEffect(getCreaturePosition(cid), 3) doPlayerSendTextMessage(cid, 19, "Summon removido") end end return true end
Postado Julho 5, 2018 6 anos @Darcio Antonio, tem a função setCreatureName, caso não tenha na sua source, será necessário modificar: https://tibiaking.com/forums/topic/38559-função-setcreaturenamecid-name-description/ No final do link tem um exemplo de uso que se encaixa no seu pedido também. ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 5, 2018 6 anos Autor Bom só duplica o summon não quero isso saca só Quero somente que ele crie o meu summon com um nome do jogador na frente. Olha o video
Postado Julho 5, 2018 6 anos @Darcio Antonio, certo. O que eu reparei no vídeo foi o seguinte, primeiro faltou a função doConvinceCreature: local monster = doCreateMonster(monster, pos) doConvinceCreature(cid, monster) setCreatureName(monster, name, desc) Segundo, você salvou as alterações antes de testar? No vídeo, as últimas alterações não foram salvas no notepad. Pq se for pensar bem, com os hifens adicionados na função de summon, era pra apenas criar o monstro da função doCreateMonster, e no vídeo ele usa as 2 funções(a doCreateMonster e a função que você alterou para comentário.) ➥ Regras | Seções OTServ | Seções BOT
Postado Julho 6, 2018 6 anos testa assim: local config = {storage = 223554, maxSummons = 1, storageTimeSummon = 66995501, time = 120} function onCastSpell(cid) if getPlayerStorageValue(cid, config.storageTimeSummon) > os.time() then doPlayerSendTextMessage(cid, 19, "Você só poderá invocar novamente depois de "..getPlayerStorageValue(cid, config.storageTimeSummon) - os.time().." segundos") return true elseif not (getPlayerStorageValue(cid,config.storage) == 2) then doPlayerSendTextMessage(cid, 19, "Você não tem esse PET!") return true elseif #getCreatureSummons(cid) >= config.maxSummons then for _, pid in ipairs(getCreatureSummons(cid)) do doRemoveCreature(pid) end doSendMagicEffect(getCreaturePosition(cid), 3) doPlayerSendTextMessage(cid, 19, "Summon removido") return true end local ret, summons = "",{ [{1, 29}] = "[PET] Tronic I", [{30, 59}] = "[PET] Tronic II", [{60, math.huge}] = "[PET] Tronic III" } for v , r in pairs(summons) do if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) <= v[2] then ret = r end end if ret == "" then doPlayerSendTextMessage(cid, 19, "Você não pode summonar nenhum PET!") return true end setPlayerStorageValue(cid, config.storageTimeSummon, os.time() + config.time) local var = doSummonCreature(ret, getThingPos(cid)) setCreatureName(var, getCreatureName(cid), "a "..getCreatureName(cid)) doConvinceCreature(cid, var) doSendMagicEffect(getCreaturePosition(cid), 30) doCreatureSay(getCreatureSummons(cid)[#getCreatureSummons(cid)], "Cheguei", TALKTYPE_ORANGE_1) return true end caso não funcionar, troca essa linha: local var = doSummonCreature(ret, getThingPos(cid)) por local var = doCreateMonster(ret, getThingPos(cid)) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.