Postado Junho 28, 2014 10 anos fala ai Molecada ! seguinte eu tenho um NPC de reset.. e queria que ele desse alguns atributos ao player, dependendo da vocação.. por exemplo Kina - 15 skills (axe, club, fist, sword, shield) // mage 10 magic level e 10 shield // pally 10 dist e 10 shield --[[Script made 100% by Nogard and Night Wolf. You can feel free to edit anything you want, but don't remove the credits]] local config = { minlevel = 510, --- level inical para resetar price = 1000000, --- preço inicial para resetar newlevel = 25, --- level após reset priceByReset = 1000000, --- preço acrescentado por reset mlnew = 10, --- quanto de ml vai adicionar ao resetar skillnew = 15--- quanto de skill vai dar (axe, club, sword, shield, distance) } --- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ------------------------------------ MUDE AQUI A % DE VIDA QUE GANHA AO RESETAR --------------------- local hp = getCreatureMaxHealth(cid) local resethp = hp*0.10 setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*0.10 setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) ------------------------------------ FIM ---------------------------- ------------------------------ EDIÇÃO DAS SKILLS -------------------- local skills = { magic = getPlayerSkillLevel(cid, SKILL__MAGLEVEL), club = getPlayerSkillLevel(cid, SKILL_CLUB), axe = getPlayerSkillLevel(cid, SKILL_AXE), sword = getPlayerSkillLevel(cid, SKILL_SWORD), shield = getPlayerSkillLevel(cid, SKILL_SHIELD), distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) } if isInArray({13,14}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skills.magic + config.mlnew) .. ", `count` = 0 WHERE `skillid` = 7 and `player_id` = " .. playerid .. ";") end if isInArray({16}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.axe + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.sword + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.club + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. playerid .. ";") end if isInArray({15}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (skill.distance + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. playerid .. ";") end ------------------------FIM ---------------------------------- doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id`= ".. playerid .."") db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid .."") return TRUE end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) if resets < 0 then resets = 0 end return resets end 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 creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local newPrice = config.price + (getResets(cid) * config.priceByReset) if msgcontains(msg, 'reset') then if getResets(cid) == resets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('I couldnt acess your bank of acess!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for reseting is '..config.minlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(addReset, (5*1000), cid) local msg ="---[Reset: "..getResets(cid).."]-- You have reseted! You'll be disconnected in 5 seconds." if doPlayerPopupFYI(cid, msg) then end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) a versao do meu Server é 8.54! Rep++
Postado Junho 28, 2014 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Scripting → Monsters e NPCs" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Junho 29, 2014 10 anos Autor acho que nao, porque o nome ja diz NPC! então foi na area certa uai -.-'
Postado Junho 29, 2014 10 anos No lugar que você criou o tópico é para scripts de Monster e NPC's prontos e não para suporte,qualquer suporte relacionado a script deve ser criado na área de Suporte Scripts,mesma coisa para as outras áreas de suporte.Espero que tenha entendido,abraço ! Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Junho 29, 2014 10 anos Autor Ok, Entendido Senhor! pode me ajudar ? alguem pode me ajudar? ;x
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.