Ir para conteúdo

Nazo

Banido
  • Registro em

  • Última visita

Tudo que Nazo postou

  1. Tente ser mais claro na sua dúvida, não podemos adivinhar como você quer...
  2. Esse código tá uma bagunça desgraçada, mas tenta aí: ----------------------------------- ---------SCRIPT por PC98------------ NAO REMOVA OS CREDITOS ----------------------------------- function onUse(cid, item, frompos, item2, topos) ------------------ Inicio das Config ------------ local castle_one_name = "Castle" -- Nome do castelo 1 local storages = {154154,54321,123123} -- Storages ( se vc eh iniciante, deixe como está...) -------PREMIOs I N D I V I D U A L --------- local premio_por_vezes = 1 -- Premio por vezes de conquista de castelo. (1) = Ativo (0) = Desativa. local premio_vezes = 1 -- Caso ativo, a quantidade de conquista que o player tem, para ganhar PREMIO. local premio = 5956 -- ID do Premio local premio_cont = 1 -- Quantidade do Premio local premio_reset = 1 -- Resetar o contador do premio depois que atingir a meta?? (1) = SIM (0) = NAO -------FIM PREMIOs I N D I V I D U A L --------- ----------------- FIM DAS CONFIG ----------------- local hours = os.date("%X"):sub(1, 2) local h = tonumber(hours) if h < 16 or h > 17 then -- arrume a hora aqui doPlayerSendTextMessage(cid,18,"O castelo só pode ser invadida entre as 16 e 17 horas.") return true end local sto_ativ = getGlobalStorageValue(storages[2]) position = getCreaturePosition(cid) if item.itemid == 9826 then doTransformItem(item.uid,item.itemid-1) doPlayerSendCancel(cid,"O castelo ja foi invadida hoje.") return false end if item.itemid == 9825 then for posx = 1254,1256 do -- checar posição X, começo e final da sala for posy = 690,690 do -- checar posicao Y, começo e final da sala local pos = {x=posx, y=posy, z=6, stackpos=253} -- posição que ira verificar se existe creatures (stackpos = 253) local creature = getThingfromPos(pos) -- pega informações da creature da posição if isMonster(creature.uid) then -- verifica se é um monster doTransformItem(item.uid,item.itemid+1) doPlayerSendTextMessage(cid,18,"Para dominar o castelo é necessario matar os guardas.") return false end end end end if isPlayerGuild(cid) == TRUE then if sto_ativ == 1 or sto_ativ == -1 then guildname = getPlayerGuildName(cid) guild = getPlayerGuildId(cid) guild_sto = getGlobalStorageValue(storages[3]) if guild ~= guild_sto then setPlayerStorageValue(cid,guild_sto,guild) if getPlayerStorageValue(cid,storages[1]) == -1 then setPlayerStorageValue(cid,storages[1],0) end sto_vezes = getPlayerStorageValue(cid,storages[1]) setGlobalStorageValue(storages[3],getPlayerGuildId(cid)) setPlayerStorageValue(cid,storages[1], sto_vezes + 1) sto_vezes_total = getPlayerStorageValue(cid,storages[1]) doBroadcastMessage("A guild "..getPlayerGuildName(cid).." acaba de dominar o castelo!") doTransformItem(item.uid,9826) if premio_por_vezes == 1 then if getPlayerStorageValue(cid,storages[1]) == premio_vezes then if getItemWeightById(premio,1) <= getPlayerFreeCap(cid) then doPlayerAddItem(cid, premio,premio_cont) ----------------------------------------------- -- if premio_reset == 1 then -- setPlayerStorageValue(cid,storages[1],0) -- Resetar a contagem end -- ----------------------------------------------- -- else doPlayerSendTextMessage(cid, 18, "Voce nao tem capacidade para ganhar o item. Vamos verificar novamente em 10 segundos!") addEvent(additem,10000,cid,premio,premio_cont,premio_reset) end end end else doPlayerSendCancel(cid,"Sua guild já está dominando o castelo.") doTransformItem(item.uid,item.itemid+1) end else doPlayerSendCancel(cid,"O sistema está desativado") end else doPlayerSendCancel(cid,"É nescessario ter guild para dominar o castelo.") doTransformItem(item.uid,item.itemid+1) end end ------------------------- por pc98 ------------------------- por pc98 function isPlayerGuild(cid) if getPlayerGuildName(cid) ~= "" then return TRUE else return FALSE end end
  3. Vê agora: -- by Nazo (tibiaking.com) local function getStaffPlayers() local query = db.storeQuery("SELECT `name` FROM `players` WHERE `group_id` >= 2;") return query end function onSay(cid, words, param, channel) local staff = getStaffPlayers() if staff ~= false then text = "Equipe:\n" repeat text = text .. "Nome: " .. result.getDataInt(staff, "name") .. " | Status: " .. isPlayer(getCreatureByName(result.getDataInt(staff, "name"))) and "Online" or "Offline" until not result.next(staff) result.free(staff) else text = "Não há staffs cadastrados no banco de dados." end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text) return true end
  4. Eu havia errado no group_id mesmo, perdão. Testa agora: -- by Nazo (tibiaking.com) local function getStaffPlayers() query = db.getResult("SELECT `name` FROM `players` WHERE `group_id` >= 2;") return query:getDataString("name") end function onSay(cid, words, param, channel) staff = getStaffPlayers() text = "Equipe:\n" for _, name in ipairs(staff) do text = text .. "Nome: " .. name .. " | Status: " if (isPlayer(getCreatureByName(name))) then text = text .. "Online\n" else text = text .. "Offline\n" end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text) return true end
  5. Cria a talkaction no xml e referencia pra um arquivo lua com o seguinte código: -- by Nazo (tibiaking.com) local function getStaffPlayers() return db.getResult("SELECT name FROM `players` WHERE `access` >= 2;") end function onSay(cid, words, param, channel) staff = getStaffPlayers() text = "Equipe:\n" for _, name in ipairs(staff) do text = text .. "Nome: " .. name .. " | Status: " if (isPlayer(getCreatureByName(name))) then text = text .. "Online\n" else text = text .. "Offline\n" end end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text) return true end Escrevi sem testar, caso algo dê errado, me informe.
  6. Dentro da função "function onLogin(cid)" no creaturescripts\scripts\login.lua. (Lembrando, não ponha dentro de nenhum "if/else")
  7. As sources do seu servidor são os códigos-fonte do arquivo executável que você inicia para rodar o servidor, então, primeiramente, você precisa ter acesso a estes códigos-fonte (que uma vez compilados no .exe, não podem ser obtidos novamente, portanto, trate de checar se o servidor que você utiliza tem estes arquivos disponibilizados em algum local); recomendo que dê uma estudada sobre, e refaça o post pedindo ajuda, para que possam melhor te ajudar. Minhas especialidades dentro dos otservers não incluem alterações nas sources, então, alguém pode te ajudar melhor que eu, xD. edit: esqueci-me de incluir na explicação, no código das sources, teoricamente, são definidas coisas que normalmente não seriam alteradas nos otservers, são os pilares do jogo (como o ato de andar, conexões de entrada, saída, skills existentes in-game, itens relacionados a estas skills, etc).
  8. Não tenho certeza se vai funcionar baseado na versão do seu TFS, mas tenta: function onCastSpell(cid, var) local jogadorpos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local monsterpos = getCreaturePosition(target) if (isPlayer(target)) then doTeleportThing(cid,monsterpos) doTeleportThing(target,jogadorpos) doSendMagicEffect(jogadorpos, 7) doSendMagicEffect(monsterpos, 7) else doPlayerSendTextMessage(cid,20,'You can only use it on players.') end end
  9. Não possuo se vai funcionar, pois o erro pode ser em diversos uso da mesma função, mas coloquei as mesmas alterações em todas, testa aí: local combats = { [PSYCHICDAMAGE] = {cor = COLOR_PSYCHIC}, [GRASSDAMAGE] = {cor = COLOR_GRASS}, [POISONEDDAMAGE] = {cor = COLOR_GRASS}, [FIREDAMAGE] = {cor = COLOR_FIRE2}, [BURNEDDAMAGE] = {cor = COLOR_BURN}, [WATERDAMAGE] = {cor = COLOR_WATER}, [ICEDAMAGE] = {cor = COLOR_ICE}, [NORMALDAMAGE] = {cor = COLOR_NORMAL}, [FLYDAMAGE] = {cor = COLOR_FLYING}, [GHOSTDAMAGE] = {cor = COLOR_GHOST}, [GROUNDDAMAGE] = {cor = COLOR_GROUND}, [ELECTRICDAMAGE] = {cor = COLOR_ELECTRIC}, [ROCKDAMAGE] = {cor = COLOR_ROCK}, [BUGDAMAGE] = {cor = COLOR_BUG}, [FIGHTDAMAGE] = {cor = COLOR_FIGHTING}, [DRAGONDAMAGE] = {cor = COLOR_DRAGON}, [POISONDAMAGE] = {cor = COLOR_POISON}, [DARKDAMAGE] = {cor = COLOR_DARK}, [STEELDAMAGE] = {cor = COLOR_STEEL}, [MIRACLEDAMAGE] = {cor = COLOR_PSYCHIC}, [DARK_EYEDAMAGE] = {cor = COLOR_GHOST}, [SEED_BOMBDAMAGE] = {cor = COLOR_GRASS}, [SACREDDAMAGE] = {cor = COLOR_FIRE2}, [MUDBOMBDAMAGE] = {cor = COLOR_GROUND}, --alterado v1.9 } local function sendPlayerDmgMsg(cid, text) if not isCreature(cid) then return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, text) end local races = { [4] = {cor = COLOR_FIRE2}, [6] = {cor = COLOR_WATER}, [7] = {cor = COLOR_NORMAL}, [8] = {cor = COLOR_FIRE2}, [9] = {cor = COLOR_FIGHTING}, [10] = {cor = COLOR_FLYING}, [11] = {cor = COLOR_GRASS}, [12] = {cor = COLOR_POISON}, [13] = {cor = COLOR_ELECTRIC}, [14] = {cor = COLOR_GROUND}, [15] = {cor = COLOR_PSYCHIC}, [16] = {cor = COLOR_ROCK}, [17] = {cor = COLOR_ICE}, [18] = {cor = COLOR_BUG}, [19] = {cor = COLOR_DRAGON}, [20] = {cor = COLOR_GHOST}, [21] = {cor = COLOR_STEEL}, [22] = {cor = COLOR_DARK}, [1] = {cor = 180}, [2] = {cor = 180}, [3] = {cor = 180}, [5] = {cor = 180}, } local damages = {GROUNDDAMAGE, ELECTRICDAMAGE, ROCKDAMAGE, FLYDAMAGE, BUGDAMAGE, FIGHTINGDAMAGE, DRAGONDAMAGE, POISONDAMAGE, DARKDAMAGE, STEELDAMAGE} local fixdmgs = {PSYCHICDAMAGE, COMBAT_PHYSICALDAMAGE, GRASSDAMAGE, FIREDAMAGE, WATERDAMAGE, ICEDAMAGE, NORMALDAMAGE, GHOSTDAMAGE} local ignored = {POISONEDDAMAGE, BURNEDDAMAGE} local cannotkill = {BURNEDDAMAGE, POISONEDDAMAGE} local centropokemon = {x=1050, y=1053, z=7} -- Coordenadas para onde o player irá ser teleportado. function onStatsChange(cid, attacker, type, combat, value) if combat == FLYSYSTEMDAMAGE then return false end if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end -- TV if not isCreature(attacker) then if not isInArray(fixdamages, combat) and combats[combat] then doSendAnimatedText(getThingPos(cid), value, combats[combat].cor) end return true end local damageCombat = combat -------------------------------------------------- if type == STATSCHANGE_HEALTHGAIN then if cid == attacker then return true end if isSummon(cid) and isSummon(attacker) and canAttackOther(cid, attacker) == "Cant" then return false end return true end -------------------------------------------------- if isMonster(cid) then local valor = value if not pokes[getCreatureName(cid)] and damageCombat == COMBAT_PHYSICALDAMAGE then valor = getOffense(attacker) * playerDamageReduction doCreatureAddHealth(cid, -math.abs(valor), 3, races[7].cor) return false elseif not pokes[getCreatureName(cid)] and damageCombat ~= COMBAT_PHYSICALDAMAGE then doCreatureAddHealth(cid, -math.abs(valor), 3, combats[damageCombat].cor) return false end end -------------------------------------------------- if isPlayer(attacker) then local valor = value if valor >= getCreatureHealth(cid) then valor = getCreatureHealth(cid) end if combat == COMBAT_PHYSICALDAMAGE then return false end if combat == PHYSICALDAMAGE then doSendMagicEffect(getThingPos(cid), 3) doSendAnimatedText(getThingPos(cid), valor, races[getMonsterInfo(getCreatureName(cid)).race].cor) end if combats[damageCombat] and not isInArray(fixdmgs, damageCombat) then doSendAnimatedText(getThingPos(cid), valor, combats[damageCombat].cor) end if #getCreatureSummons(attacker) >= 1 and not isInArray({POISONEDDAMAGE, BURNEDDAMAGE}, combat) then doPlayerSendTextMessage(attacker, MESSAGE_STATUS_DEFAULT, "Your "..getPokeName(getCreatureSummons(attacker)[1]).." dealt "..valor.." damage to "..getSomeoneDescription(cid)..".") end return true end -------------------------------------------------- if isPlayer(cid) and #getCreatureSummons(cid) >= 1 and type == STATSCHANGE_HEALTHLOSS then return false end -------------------------------------------------- if isPlayer(cid) and #getCreatureSummons(cid) <= 0 and type == STATSCHANGE_HEALTHLOSS then if isSummon(attacker) or isPlayer(attacker) then if canAttackOther(cid, attacker) == "Cant" then return false end end local valor = 0 if combat == COMBAT_PHYSICALDAMAGE then valor = getOffense(attacker) else valor = getSpecialAttack(attacker) end valor = valor * playerDamageReduction valor = valor * math.random(83, 117) / 100 if valor >= getCreatureHealth(cid) then valor = getCreatureHealth(cid) end valor = math.floor(valor) if valor >= getCreatureHealth(cid) then if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then setPlayerStorageValue(cid, 6598754, -1) setPlayerStorageValue(cid, 6598755, -1) doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, posBackPVP, false) if isCreature(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) end return false --alterado v1.8 end if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then doRemoveCondition(cid, CONDITION_OUTFIT) setPlayerStorageValue(cid, 17000, 0) setPlayerStorageValue(cid, 17001, 0) setPlayerStorageValue(cid, 63215, -1) doChangeSpeed(cid, PlayerSpeed) local item = getPlayerSlotItem(cid, ? local btype = getPokeballType(item.itemid) if #getCreatureSummons(cid) <= 0 then if isInArray(pokeballs[btype].all, item.itemid) then doTransformItem(item.uid, pokeballs[btype].off) doItemSetAttribute(item.uid, "hp", 0) end end end if getPlayerStorageValue(cid, 22545) == 1 then if getGlobalStorageValue(22550) == 1 then doPlayerSendTextMessage(cid, 20, "You are the last survivor of the golden arena! Take your reward!") doPlayerAddItem(cid, 2152, getPlayerStorageValue(cid, 22551)*2) setPlayerStorageValue(cid, 22545, -1) doTeleportThing(cid, getClosestFreeTile(cid, getClosestFreeTile(cid, posBackGolden)), false) if isCreature(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid)) end setPlayerRecordWaves(cid) endGoldenArena() return false --alterado v1.8 else setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1) setPlayerStorageValue(cid, 22545, -1) doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false) if isCreature(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid)) end setPlayerRecordWaves(cid) return true end end if getPlayerStorageValue(cid, 98796) >= 1 then setPlayerStorageValue(cid, 98796, -1) setPlayerStorageValue(cid, 98797, -1) --alterado v1.8 doTeleportThing(cid, SafariOut, false) doSendMagicEffect(getThingPos(cid), 21) doPlayerSendTextMessage(cid, 27, "You die in the saffari... Best luck in the next time!") return false --alterado v1.8 end local corpse = doCreateItem(3058, 1, getThingPos(cid)) doDecayItem(corpse) doItemSetAttribute(corpse, "pName", getCreatureName(cid)) --alterado v1.7 coloca corpse quando o player morre! doItemSetAttribute(corpse, "attacker", getCreatureName(attacker)) doItemSetAttribute(corpse, "article", getPlayerSex(cid) == 0 and "She" or "He") if getCreatureName(attacker) ~= "" and getPlayerStorageValue(cid, 7598767) <= 0 and getPlayerStorageValue(cid, 6598754) <= 0 and getPlayerStorageValue(cid, 6598755) <= 0 then setPlayerStorageValue(cid, 7598767, 1) db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `date`, `level`, `nick`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(getCreatureName(attacker)) .. ");") end if getPlayerStorageValue(cid, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) <= 10 then setPlayerStorageValue(cid, Agatha.stoIni, -1) setPlayerStorageValue(cid, Agatha.stoRec, -1) setPlayerStorageValue(cid, Agatha.stoPer, -1) setPlayerStorageValue(cid, Agatha.stoEni, -1) --alterado v1.9 agatha quest setPlayerStorageValue(cid, Agatha.stoRes, -1) end if isCreature(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 3, 180) end if getTileZoneInfo(getCreaturePosition(cid)) == 2 then updateLevel(cid, math.ceil(getPlayerLevel(cid) / 100 * 9), "nao") else updateLevel(cid, math.ceil(getPlayerLevel(cid) / 100 * 9), "sim") end end if isCreature(cid) then doCreatureAddHealth(cid, -valor, 3, 180) end if not isPlayer(cid) then addEvent(sendPlayerDmgMsg, 5, cid, "You lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".") end return false end -------------------------------------------------- if isMonster(attacker) and getPlayerStorageValue(attacker, 201) ~= -1 then if isPlayer(cid) then return false end if getPlayerStorageValue(getCreatureMaster(cid), ginasios[getPlayerStorageValue(attacker, 201)].storage) ~= 1 then return false end end -------------------------------------------------- if isMonster(cid) and getPlayerStorageValue(cid, 201) ~= -1 then if getPlayerStorageValue(getCreatureMaster(attacker), ginasios[getPlayerStorageValue(cid, 201)].storage) ~= 1 then return false end end -------------------------------------------------- if ehMonstro(cid) and ehMonstro(attacker) and not isSummon(cid) and not isSummon(attacker) then return false --alterado v1.9 /\ end -------------------------------------------------- --------------------REFLECT----------------------- if getPlayerStorageValue(cid, 21099) >= 1 and combat ~= COMBAT_PHYSICALDAMAGE then if not isInArray({"Team Claw", "Team Slice"}, getPlayerStorageValue(attacker, 21102)) then doSendMagicEffect(getThingPosWithDebug(cid), 135) doSendAnimatedText(getThingPosWithDebug(cid), "REFLECT", COLOR_GRASS) addEvent(docastspell, 100, cid, getPlayerStorageValue(attacker, 21102)) if getCreatureName(cid) == "Wobbuffet" then doRemoveCondition(cid, CONDITION_OUTFIT) end setPlayerStorageValue(cid, 21099, -1) setPlayerStorageValue(cid, 21100, 1) setPlayerStorageValue(cid, 21101, attacker) setPlayerStorageValue(cid, 21103, getTableMove(attacker, getPlayerStorageValue(attacker, 21102)).f) setPlayerStorageValue(cid, 21104, getCreatureOutfit(attacker).lookType) return false end end ------------------------------------------------- local multiplier = 1 if isCreature(cid) then poketype1 = pokes[getCreatureName(cid)].type poketype2 = pokes[getCreatureName(cid)].type2 end if not poketype1 or not poketype2 then return false end if getCreatureCondition(cid, CONDITION_INVISIBLE) then return false end if combat == COMBAT_PHYSICALDAMAGE then if isGhostPokemon(cid) then if not isInArray(specialabilities["foresight"], getCreatureName(attacker)) then --passiva Foresight!! doSendMagicEffect(getThingPos(cid), 3) return false end end local cd = getPlayerStorageValue(attacker, conds["Miss"]) local cd2 = getPlayerStorageValue(attacker, conds["Confusion"]) local cd3 = getPlayerStorageValue(attacker, conds["Stun"]) if cd >= 0 or cd2 >= 0 or cd3 >= 0 then if math.random(1, 100) > 50 then doSendMagicEffect(getThingPos(cid), 211) doSendAnimatedText(getThingPos(attacker), "MISS", 215) return false end end end -------------------------------------------------- local valor = value if multiplier < 1.5 and poketype2 == "no type" then multiplier = 2 elseif multiplier == 1.5 and poketype2 ~= "no type" then multiplier = 1.75 elseif multiplier == 2.20 then multiplier = 3 end -------------------------------------------------- if isSummon(cid) and isSummon(attacker) then if getCreatureMaster(cid) == getCreatureMaster(attacker) then return false end if canAttackOther(cid, attacker) == "Cant" then return false end end valor = valor * multiplier if isSummon(attacker) then valor = valor * getHappinessRate(attacker) else valor = valor * summonReduction end valor = math.floor(valor) if combat == COMBAT_PHYSICALDAMAGE then local value = getOffense(attacker) > 1000 and 3 or 2 block = 1 - (getDefense(cid) / (getOffense(attacker) + getDefense(cid))) --alterado v1.9 testem essa nova formula plzzz '--' valor = (getOffense(attacker)/value) * block if valor <= 0 then valor = math.random(5, 10) --alterado v1.9 end if isInArray(specialabilities["counter"], getCreatureName(cid)) then if math.random(1, 100) <= 10 then if isCreature(attacker) then doCreatureAddHealth(attacker, -valor, 3, 180) end valor = 0 doSendAnimatedText(getThingPosWithDebug(cid), "COUNTER", 215) end end else if valor <= 0 then valor = math.random(5, 10) --alterado v1.9 end valor = valor / getDefense(cid) end -------------------------Edited CLAN SYSTEM----------------------------------- if isSummon(attacker) and getPlayerStorageValue(getCreatureMaster(attacker), 86228) >= 1 then valor = valor*getClanPorcent(getCreatureMaster(attacker), combat, "atk") elseif isSummon(cid) and getPlayerStorageValue(getCreatureMaster(cid), 86228) >= 1 then valor = valor - (valor*getClanPorcent(getCreatureMaster(cid), combat, "def", pokes[getCreatureName(cid)].type, pokes[getCreatureName(cid)].type2)) end ----------------------------------------------------------------------- ---------------------- FEAR / ROAR ------------------------------------ if getPlayerStorageValue(attacker, conds["Fear"]) >= 1 then return true end -------------------------------------------------------------------------- if damageCombat == GROUNDDAMAGE then if isInArray(specialabilities["levitate"], getCreatureName(cid)) then valor = 0 end end ----------------------------------------------------------------------------- local p = getThingPos(cid) if p.x == 1 and p.y == 1 and p.z == 10 then return false end if getPlayerStorageValue(cid, 9658783) == 1 then return false --imune end ----------------------------------------------------------------------------- --------------- FIGHT MODE ----------------------- if useOTClient then if isSummon(cid) then local master = getCreatureMaster(cid) if getPlayerStorageValue(master, 248759) == 1 then valor = valor * 1.1 elseif getPlayerStorageValue(master, 248759) == 3 then valor = valor * 0.9 end end if isSummon(attacker) then local master = getCreatureMaster(attacker) if getPlayerStorageValue(master, 248759) == 1 then valor = valor * 1.1 elseif getPlayerStorageValue(master, 248759) == 3 then valor = valor * 0.9 end end end ----------------------------------------------------------------------------- ------------------ SKILLs Q CURAM O ATTACKER --------------------------------- local function doHeal(cid, amount) if (getCreatureHealth(cid) + amount) >= getCreatureMaxHealth(cid) then amount = math.abs(getCreatureHealth(cid)-getCreatureMaxHealth(cid)) end if getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) then if isCreature(cid) then doCreatureAddHealth(cid, amount) end doSendAnimatedText(getThingPosWithDebug(cid), "+"..amount.."", 65) end end if damageCombat == PSYCHICDAMAGE or damageCombat == MIRACLEDAMAGE then if getPlayerStorageValue(attacker, 95487) >= 1 then doHeal(attacker, valor) setPlayerStorageValue(attacker, 95487, -1) end elseif damageCombat == SEED_BOMBDAMAGE then doHeal(attacker, valor) end -------------------------------------------- ----------SACRED FIRE----------------------- if combat == SACREDDAMAGE and not ehNPC(cid) then local ret = {} ret.id = cid ret.cd = 9 ret.check = getPlayerStorageValue(cid, conds["Silence"]) ret.eff = 39 ret.cond = "Silence" doCondition2(ret) elseif combat == MUDBOMBDAMAGE and not ehNPC(cid) then local ret = {} ret.id = cid ret.cd = 9 ret.eff = 34 ret.check = getPlayerStorageValue(cid, conds["Miss"]) ret.spell = "Mud Bomb" --alterado v1.9 ret.cond = "Miss" doCondition2(ret) end --------------------------------------------- --------------Passiva Lifesteal Clobat------------ if combat == COMBAT_PHYSICALDAMAGE then if getCreatureName(attacker) == "Crobat" then if isCreature(attacker) then doCreatureAddHealth(attacker, math.floor(valor)) end doSendAnimatedText(getThingPos(attacker), "+ "..math.floor(valor), 30) end end -------------------------------------------- valor = math.abs(valor) --alterado v1.9 if isSummon(attacker) then if combat == COMBAT_PHYSICALDAMAGE then doTargetCombatHealth(getCreatureMaster(attacker), cid, PHYSICALDAMAGE, -valor, -valor, 255) addEvent(doDoubleHit, 1000, attacker, cid, valor, races) else doTargetCombatHealth(getCreatureMaster(attacker), cid, damageCombat, -valor, -valor, 255) end else if combat ~= COMBAT_PHYSICALDAMAGE then if isCreature(cid) then doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor) end else if isCreature(cid) then doCreatureAddHealth(cid, -valor, 3, races[getMonsterInfo(getCreatureName(cid)).race].cor) end addEvent(doDoubleHit, 1000, attacker, cid, valor, races) end if isSummon(cid) and valor ~= 0 then addEvent(sendPlayerDmgMsg, 5, getCreatureMaster(cid), "Your "..getCreatureName(cid).." lost "..valor.." hitpoints due to an attack from "..getSomeoneDescription(attacker)..".") end end if damageCombat == FIREDAMAGE and not isBurning(cid) then local ret = {} ret.id = cid ret.cd = math.random(5, 12) ret.check = getPlayerStorageValue(cid, conds["Burn"]) ret.damage = isSummon(attacker) and getPokemonBoost(attacker) or getPokemonLevel(attacker) ret.cond = "Burn" doCondition2(ret) elseif damageCombat == POISONDAMAGE and not isPoisoned(cid) then local ret = {} ret.id = cid ret.cd = math.random(6, 15) ret.check = getPlayerStorageValue(cid, conds["Poison"]) local lvl = isSummon(attacker) and getPokemonBoost(attacker) or getPokemonLevel(attacker) ret.damage = math.floor((getPokemonLevel(attacker)+lvl)/2) ret.cond = "Poison" doCondition2(ret) end --[[---------------CD BAR----------------------- if isSummon(cid) then doCreatureExecuteTalkAction(getCreatureMaster(cid), "/pokeread") end ]] ------------------------------------POTIONS------------------------------------------- if isSummon(cid) and type == STATSCHANGE_HEALTHLOSS then if getPlayerStorageValue(cid, 173) >= 1 then if damageCombat ~= BURNEDDAMAGE and damageCombat ~= POISONEDDAMAGE then setPlayerStorageValue(cid, 173, -1) doSendAnimatedText(getThingPos(cid), "Lost Heal", 144) end end end ----------------------------------------PASSIVAS------------------------------------- -------------------------------------------Counter Helix------------------------------------ if passivesChances["Helix"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Helix"][getCreatureName(cid)] then docastspell(cid, "Counter Helix") end -------------------------------------------Lava Counter/Electricity---------------------------- if passivesChances["Fire_Thunder"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Fire_Thunder"][getCreatureName(cid)] then docastspell(cid, "Lava-Electricity") end ---------------------------------------Stunning Confusion----------------------------------------- if passivesChances["Stunning"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Stunning"][getCreatureName(cid)] then docastspell(cid, "Stunning Confusion") end -----------------------------------------Groundshock----------------------------------- ---------------------------------------Stunning Confusion----------------------------------------- if passivesChances["Invisible Passive"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Invisible Passive"][getCreatureName(cid)] then docastspell(cid, "Invisible Passive") end -----------------------------------------Groundshock----------------------------------- if passivesChances["Groundshock"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Groundshock"][getCreatureName(cid)] then docastspell(cid, "Groundshock") end --------------------------------------Electric Charge--------------------------------------------- if passivesChances["Electric Charge"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Electric Charge"][getCreatureName(cid)] then docastspell(cid, "Electric Charge", 0, 0) end -------------------------------------Melody------------------------------------ if passivesChances["Melody"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Melody"][getCreatureName(cid)] then docastspell(cid, "Melody") end ------------------------------------- Dragon Fury / Fury --------------------------------------- if passivesChances["Dragon Fury"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Dragon Fury"][getCreatureName(cid)] then docastspell(cid, "Dragon Fury", 0, 0) end ------------------------------------- Mega Drain --------------------------------------- if passivesChances["Mega Drain"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mega Drain"][getCreatureName(cid)] then docastspell(cid, "Mega Drain") end ------------------------------------- Spores Reaction --------------------------------------- if passivesChances["Spores Reaction"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Spores Reaction"][getCreatureName(cid)] then docastspell(cid, "Spores Reaction") end ------------------------------------ Amnesia ---------------------------------------- if passivesChances["Amnesia"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Amnesia"][getCreatureName(cid)] then docastspell(cid, "Amnesia", 0, 0) end ----------------------------------- Zen Mind ----------------------------------------- if passivesChances["Zen Mind"][getCreatureName(cid)] and isWithCondition(cid) and math.random(1, 100) <= passivesChances["Zen Mind"][getCreatureName(cid)] then docastspell(cid, "Zen Mind", 0, 0) end ---------------------------------- Mirror Coat --------------------------------------- if passivesChances["Mirror Coat"][getCreatureName(cid)] and math.random(1, 100) <= passivesChances["Mirror Coat"][getCreatureName(cid)] then docastspell(cid, "Mirror Coat", 0, 0) end --------------------------------- Illusion ----------------------------------------- return false end
  10. Isso acontece devido ao fato de não existir estrutura para criação de armas do tipo "fist" nas sources do game, se você deseja que isso funcione, precisa adicionar lá. A skill existe e é utilizada apenas pro dano quando não há armas na sua mão, não existe configuração para armas serem criadas dando dano embasando-se na skill Fist Fighting.
  11. Faz assim, em cada spell que necessita de um item específico equipado para ser utilizada, coloque a seguinte linha no começo do código: wand = 3074 -- id da wand Abaixo de: function onCastSpell(cid, var) Coloque: if (not ((getPlayerSlotItem(cid,CONST_SLOT_LEFT).itemid == wand) or (getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == wand))) then -- by Nazo (tibiaking.com) doPlayerSendCancel(cid, "Sorry, you need the wand.") return false end
  12. Testa aqui: -- edited by Nazo (tibiaking.com) local outfit = {lookType = 154} -- outfit local tempo = 120 -- tempo em segundos. local effect = {191} -- effect no player, caso queira apenas 1, basta remover os outros numeros. local cooldown = 300 -- cooldown em segundos. local ml = 45 -- quantos ira aumentar o skill de ML local skillfist = 40 -- quantos ira aumentar o skill de Fist local skillsword = 40 -- quantos ira aumentar o skill de Sword local skillaxe = 40 -- quantos ira aumentar o skill de Axe local skillclub = 45 -- quantos ira aumentar o skill de Club local skilldistance = 40 -- quantos ira aumentar o skill de Distance local skillshield = 40 -- quantos ira aumentar o skill de Shield local health = 150 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield) setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_SPEED, 250) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) local sys = createConditionObject(CONDITION_OUTFIT) setConditionParam(sys, CONDITION_PARAM_TICKS, tempo) addOutfitCondition(sys, outfit) setCombatCondition(combat, sys) function magicEffect2076(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then for i=1, #effect do local position = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} doSendMagicEffect(position, effect[i]) end end end end local sys = createConditionObject(CONDITION_OUTFIT) setConditionParam(sys, CONDITION_PARAM_TICKS, tempo*1000) addOutfitCondition(sys, outfit) setCombatCondition(combat, sys) function onCastSpell(cid, var) local position129 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if (getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false) and (getPlayerStorageValue(cid, 102054) <= os.time()) then doCombat(cid, combat, var) tempo2 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect2076, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 end setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado. setPlayerStorageValue(cid, 102054,os.time()+cooldown+tempo) -- adiciona o cooldown a partir do primeiro uso doCreatureSay(cid, "AAAAAAAAAAA QUE DELICIA CARA!", TALKTYPE_MONSTER) doSendMagicEffect(position129, 275) else doPlayerSendCancel(cid, "Sorry, you are transformed or the spell are in cooldown.") end end Deixei o cooldown de modo que ele comece após o término do tempo total do buff, ou seja, se eu usei a spell ao 00:00, e durar 5 minutos o buff, e o cooldown for de 5 minutos, 00:05 acaba o buff, 00:10 posso utilizar novamente.
  13. Nazo postou uma resposta no tópico em Eventos de Spriting (pixel art)
    @Nogard (tá bom demais, carai) 2 x 0 @Wingardium
  14. Nazo postou uma resposta no tópico em Suporte Websites
    Testa isso aqui, não uso muito o modern por preferir outros frameworks, mas modifique essas duas linhas no config.php: $config['website'] = $config['website'] = 'http://localhost/'; $config['server_name'] = "%SERVER_NAME%"; // nome do servidor igual no config.lua Se não der certo, joga esse modern no lixo (dica)
  15. Nazo postou uma resposta no tópico em Suporte Websites
    mostra o config.php, um print do seu phpmyadmin e o config.lua ae xupinga
  16. Imagine os players como estantes com gavetas, as storages são como gavetas que são representadas por um número de até 65535 se não me engano, cada uma tem um conteúdo que é um número, imagine que você tem a gaveta de número 31223, e bota o valor 5 dentro dela, o player terá na storage 31223 o valor 5, entendeu? o valor padrão em todas storages é -1 se não houver sido setada
  17. muda o ipv4 e dns (numérico e de letras) do servidor e crie outra conta.
  18. Nazo postou uma resposta no tópico em Suporte Tibia OTServer
    Tipo, dá pra tentar fazer isso sem mexer nas sources, só não entendi o que você quer. você está no floor 4, dá look no item do floor 7 mas tem um item no floor 6 que fica na frente e te impossibilita?
  19. Perdão, mas não é permitido falar sobre comércio em áreas que não são sobre tal assunto, só no privado ou nas áreas específicas para tal. Daqui a pouco coloco aqui tudo direitinho sobre o que foi pedido inicialmente.
  20. Mas por que você mudou isso meu jovem, deixa do modo que tá, não tem motivo pra mudar essas linhas, a parte do onkill é do modo que te mandei meu chapa.
  21. Use o código que mandei com o seu npc, porém quando você pega sua missão com o npc o npc te dá a storage que vc quer ali com o valor 0, o código que você acabou de mandar não tem nexo, ele só seta a storage, mas não incrementa.
  22. O seu NPC precisa dar valor "0" na storage 12312 pro script funcionar.
  23. local config = { monster = "Ferumbras", -- nome do monstro storage = 12312, -- storage em que ficam salvos monstersToKill = 1700 -- monstros a matar } function onKill(cid, target, lastHit) if(isMonster(target) and getCreatureName(target) == config.monster and getPlayerStorageValue(cid,config.storage) >= 0 and getPlayerStorageValue(cid,config.storage) < config.monstersToKill) then setPlayerStorageValue(cid,config.storage,getPlayerStorageValue(cid,config.storage)+1) if(getPlayerStorageValue(cid,config.storage) == 1700) then doPlayerPopupFYI(cid, "finish task") end end return true end
  24. Cara, é só adicionar depois da linha que incrementa a storage no seu onKill do creaturescripts, isso: if(getPlayerStorageValue(cid,suastorage) == 1000) then doPlayerPopupFYI(cid,"lalalala") end

Informação Importante

Confirmação de Termo