-
-
King Baiak 8.6 - Reestruturando o projeto!
Olá, meu nome é Jefferson, trabalho até as 18h, entretanto tenho tempo livre à noite quase todos os dias. Tenho interesse na vaga de mapper, espero que apreciem um pouquinho do meu trabalho. Caso tenham algum interesse ou queiram ver outros mapas, procurem-me no inbox. Só deixarei contato wpp por lá também. Obrigado.
-
-
Teleport não fecha
Tenta trocar a função onTimer() por onThink() e ve se em globalevents.xml a tag de registro do evento esta com o nome do evento e o arquivo certinhos.
-
Aura system (MODIFICAR)
-- CONFIGURAÇÕES porcentagem = 100 -- chance de curar em cada volta da aura, em porcentagem quantheal = 10 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 10% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) EfeitosSorc = 10 EfeitosPaladin = 34 EfeitosDruid = 37 EfeitosKnight = 24 efeitocura = 49 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura(i,tm,cid) if(isCreature(cid)) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)-1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8 and getCreatureHealth(cid)<getCreatureMaxHealth(cid)) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal) if(i<=8 and i>1) then doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, atual, tipoaura) else doSendDistanceShoot({x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, atual, tipoaura) end doSendMagicEffect(atual, efeitocura) end if(i==8) then if isSorc(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, EfeitosSorc) elseif isDruid(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, EfeitosDruid) elseif isPaladin(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, EfeitosPaladin) elseif isKnight(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[1].x, y=posaura[1].y, z=posaura[1].z}, EfeitosKnight) end elseif(i<8) then if isSorc(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, EfeitosSorc) elseif isDruid(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, EfeitosDruid) elseif isPaladin(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, EfeitosPaladin) elseif isKnight(cid) doSendDistanceShoot({x=posaura.x, y=posaura.y, z=posaura.z}, {x=posaura[i+1].x, y=posaura[i+1].y, z=posaura[i+1].z}, EfeitosKnight) end if(i<=8) then i = i+1 tm = tempo/8 return addEvent(efeitosAura,tm,i,tm,cid) else return efeitosAura(1,0,cid) end else return TRUE end end --Função principal function onLogin(cid) if(getPlayerLevel(cid)>500) then return efeitosAura(1,tempo/8,cid) end return TRUE end
-
-
[PEDIDO] NPC Vocation 2
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 local c = { price = 50000, vocations = {5,6,7,8}, pos = {x=723, y=599, z=7}, -- Pos do templo tmp = 3 -- apos esses segundos ele desloga automaticamente. } local xp = 4200 -- exp para do lvl 8 local hp = 185 local mp = 35 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local playerid = getPlayerGUID(cid) local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'valan') or msgcontains(msg, 'semi deus')) then selfSay('Você quer virar valan por '..c.price..' gps? {yes} ', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if isInArray(c.vocations, getPlayerVocation(cid)) then if doPlayerRemoveMoney(cid,c.price) == TRUE then doPlayerSetPromotionLevel(cid, 2) local CheckExp = getPlayerExperience(cid) doPlayerAddExperience(cid, -CheckExp) doPlayerAddExp(cid, xp) setCreatureMaxHealth(cid, hp) setCreatureMaxMana(cid, mp) doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doPlayerAddMana(cid, mp) doPlayerSave(cid, true) addEvent(doRemoveCreature, 3000, cid) doTeleportThing(cid, c.pos) else selfSay('Voce nao tem o dinheiro necessario', cid) end else selfSay('Voce ja foi promovido ou nao tem a vocação necessaria.', cid) end elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay('Que assim seja.', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Tente agora. Acho que nao vai mais dar erro algum
-
-
[PEDIDO] NPC Vocation 2
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 local c = { price = 50000, vocations = {5,6,7,8}, newlevel = 8, -- novo level. pos = {x=723, y=599, z=7}, -- Pos do templo tmp = 3 -- apos esses segundos ele desloga automaticamente. } local xp = 8400 -- exp para do lvl 8 local hp = 185 local mp = 35 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local playerid = getPlayerGUID(cid) local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'valan') or msgcontains(msg, 'semi deus')) then selfSay('Você quer virar valan por '..c.price..' gps? {yes} ', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if isInArray(c.vocations, getPlayerVocation(cid)) then if doPlayerRemoveMoney(cid,c.price) == TRUE then db.query("UPDATE `players` SET `level` = "..c.newlevel..",`experience` = "..xp..",`mana` = "..mp..",`manamax` = "..mp..", `health` = "..hp..", `healthmax` = "..hp.." WHERE `players`.`id` = ".. playerid) doPlayerSetPromotionLevel(cid, 2) doTeleportThing(cid, c.pos) doRemoveCreature(cid) else selfSay('You do not have the required vocation', cid) end else selfSay('You have already been promoted or doesnt have the necessary experience', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Fiz alterações do query da db, forçando as alterações por ela. Veja se da algum erro
-
-
(Resolvido)[Pedido] Npc que para quest
Hahahahah sou nada Bem, espero ter ajudado. Precisando, manda inbox, ou marca no post
-
[PEDIDO] NPC Vocation 2
tem como mostrar o erro na distro?
-
-
-
-
-
-
-
[PEDIDO] NPC Vocation 2
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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local x = {1,2} -- Ids das vocaçoes necessarias pra promote. para adicionar mais, basta por uma virgula dps do ultimo numero e adicionar a id da voc local sto = 4642 -- storage praq ele n faça a promotion novamente local lvl = 8 -- lvl ao resetar local lvlmin = 500 --lvl para resetar local health = 185 -- hp ao resetar local mana = 35 -- mana ao resetar local v = getVocationInfo(getPlayerVocation(cid)) if (msgcontains(msg, 'promotion')) then if getPlayerStorageValue(cid, sto) == -1 and getPlayerLevel(cid) >= lvlmin then if isInArray(x, getPlayerVocation(cid)) then local playerid = getPlayerGUID(cid) selfSay('Congratulations! You were promoted', cid) setPlayerStorageValue(cid, sto, 1) setPlayerPromotionLevel(cid, v.id + 4) -- aqui o sistema pega a vocação atual e adicona a proxima (v.id + 4). assim, basta adicionar a voc base na variavel x. setCreatureMaxHealth(cid, health) setCreatureMaxMana(cid, mana) db.executeQuery("UPDATE `players` SET `level`="..lvl..",`experience`= 4200 WHERE `players`.`id`= ".. playerid .."") else selfSay('You do not have the required vocation', cid) end else selfSay('You have already been promoted or doesnt have the necessary experience', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) pronto só dar aquele rep, se possivel, pra mim e pro sttorm, por ter criado a base do script hahaha
-
[PEDIDO] NPC Vocation 2
voce pode fazer dessa forma: 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local x = {1,2} -- Ids das vocaçoes necessarias pra promote. para adicionar mais, basta por uma virgula dps do ultimo numero e adicionar a id da voc local sto = 4642 -- storage praq ele n faça a promotion novamente local lvl = 8 -- lvl ao resetar local health = 185 -- hp ao resetar local mana = 35 -- mana ao resetar local v = getVocationInfo(getPlayerVocation(cid)) if (msgcontains(msg, 'promotion')) then if getPlayerStorageValue(cid, sto) == -1 then if isInArray(x, getPlayerVocation(cid)) then local playerid = getPlayerGUID(cid) selfSay('Congratulations! You were promoted', cid) setPlayerStorageValue(cid, sto, 1) setPlayerPromotionLevel(cid, v.id + 4) -- aqui o sistema pega a vocação atual e adicona a proxima (v.id + 4). assim, basta adicionar a voc base na variavel x. setCreatureMaxHealth(cid, health) setCreatureMaxMana(cid, mana) db.executeQuery("UPDATE `players` SET `level`="..lvl..",`experience`= 4200 WHERE `players`.`id`= ".. playerid .."") else selfSay('You do not have the required vocation', cid) end else selfSay('You have already been promoted', cid) end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) no outro codigo, nao havia a função para promover o jogador e seriam necessarios npcs diferentes pra cada voc. com esse, um unico npc pode promover qlqr personagem desde que a vocação dele seja guardada na variavel x.
-
IP OTservlist
segue esse tutorial do matheus. Pra por na otserverlist, vc tem que se cadastrar la. mas para por o ip la, vc precisa criar seu ip fixo, no site no-ip, por exemplo. segue o tutorial do matk e tenta de novo na otserverlist que vai dar bom.
-
(Resolvido)[Pedido] Npc que para quest
@Kyllini segue o script do npc. Espero que esteja funcional! Abraços! 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 talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { destino = {x=1553, y=1825, z=4}, -- para onde o player vai ser teleportado storage = 1111, -- storage da quest. lembre-se de por o mesmo storage da quest que voce fez permitir = {1,2,3,4}, --id das vocações que podem ir money = 100000000 -- dinheiro (aqui está custando 100kk) } playerVocInfo = getVocationInfo(getPlayerVocation(cid)) if msgcontains(msg, 'quest') or msgcontains(msg, 'promotion') then if(getPlayerStorageValue(cid, config.storage) ~= 1) and (isInArray(config.permitir, playerVocInfo.id)) then npcHandler:say("Eu posso te levar para a Quest Promotion. Eu cobrarei 100kk para a sua morte chegar! Diga {sim} caso queira desafiar seu destino, ou {nao}, se voce for um covarde!", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, config.storage) >= 1 then -- caso ja tenha a quest feita npcHandler:say("Desculpe voce ja fez a Quest Promotion. Nao posso permitir que voce pise naquelas terras novamente.", cid) return true elseif not isInArray(config.permitir, playerVocInfo.id) then -- caso nao tenha a vocação permitida npcHandler:say("Desculpe, nao posso permitir que players com a sua voca\çao pisem nessas terras.", cid) return true end elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 then if doPlayerRemoveMoney(cid, config.money) then npcHandler:say("HAHAHA Ja vou preparando o seu caixao, entao!", cid) doTeleportThing(cid, config.destino) talkState[talkUser] = 0 else npcHandler:say("HAHAHAH! Quer enfrentar desafios mas nao tem nem um centavo no bolso? Saia daqui, charlatao!", cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] > 0 then npcHandler:say("La nao \é lugar para covardes, mesmo! HAHAH", cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
[SCRIPT] Adicionar item no chão por x tempo
Magina!
-
-
(Resolvido)[Pedido] Script de bau com mensagem Global
Hehe marca la como melhor resposta e da aquele repzin maroto. Jaja vou trabalhar no script do npc. é rapido, mas eu to trabalhando nos meus projetos ao msm tempo, entao pode demorar um tiquin. mas sai ainda hoje hahaha
-
(Resolvido)[Pedido] Script de bau com mensagem Global
UAHEUAHEUAHEUHA foi mal, eu corrigi o teleport mas eu usei uma versao antiga do script, onde eu n tinha modificado os items. onde tem o for i = 1, #config.items do doPlayerAddItem(cid, config.items[1], config.items[2]) end substitua por for i = 1, #config.items do doPlayerAddItem(cid, config.items[i][1], config.items[i][2]) end
-
(Resolvido)[Pedido] Script de bau com mensagem Global
tenta assim (sono ta me atrapalhando.. aushausha) local config = { items = {{12714,1}}, -- aqui vc configura quais items vc quer dar de recompensa. caso for mais de 1, adicione uma virgula e ponha a id e qtd dentro de colchetes --{{2160,3},{2134,1}}, voc = {1}, -- aqui vc poe os ids das vocações que podem abrir o bau. caso sejam mais de 1, basta adicionar uma virgula dps do ultimo numero e por o outro. voc = {5,6}, storage = 5000, -- altere para o storage que você desejar gmessage = true, -- vai mandar mensagem global quando o jogar finalizar a quest? true = sim | false = nao unique = 1000, --uniqueid do bau. caso nao tenha, deixe 0, caso tenha, ponha o valor. teleport = {true, {x = 157, y = 51, z = 7}}, --vai teletransportar o jogar ao finalizar a quest? se sim, mude para true e dps da virgula mude o {} para a posição desejada, ex: --teleport = {true, {x = 2438, y = 2400, z = 9}} nome = "Hellraiser" -- aqui vc poe o nome da sua quest, se tiver. Na mensagem global, aparecerá da seguinte maneira: -- "O player (nomedochar) completou a quest Hellraiser!." Deixe em branco o nome para nao mostrar qual foi a quest feita (isso ainda vai gerar uma mensagem global!) } function onUse(cid, item, frompos, item2, topos) if item.uid == config.unique then if getPlayerStorageValue(cid, config.storage) ~= 1 and isInArray(config.voc, getPlayerVocation(cid)) then if config.gmessage and config.nome ~= "" then doBroadcastMessage("O player "..getCreatureName(cid).." completou a quest ".. config.nome .. "!",MESSAGE_STATUS_WARNING) elseif config.gmessage and config.nome == "" then doBroadcastMessage("O player "..getCreatureName(cid).." completou uma quest!",MESSAGE_STATUS_WARNING) end setPlayerStorageValue(cid, config.storage, 1) for i = 1, #config.items do doPlayerAddItem(cid, config.items[1], config.items[2]) end if config.teleport[1] then tp = config.teleport[2] doTeleportThing(cid, tp) end elseif getPlayerStorageValue(cid, config.storage) == 1 then -- caso ja tenha feito a quest doPlayerSendCancel(cid, "Você já fez essa quest!") elseif not isInArray(config.voc, getPlayerVocation(cid)) then -- caso nao seja da vocação apropriada doPlayerSendCancel(cid, "Você não pode receber a recompensa porque não tem a vocação apropriada!") end end return true end