
Solutions
-
Snowsz's post in (Resolvido)Talkaction Deathlist [TFS1.X] was marked as the answerlocal deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and not isInArray(KillersArray, CreatureMT:getName()) then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Isso deve resolver ↑.
Sobre o site eu não entendo muito bem, mas posso até tentar.
-
Snowsz's post in (Resolvido)TRADUZIR ACCOUNT MANAGER was marked as the answerPra traduzi-lo vai precisar alterar as sources, só procurar por lá.
-
Snowsz's post in (Resolvido)Alguém ajuda a ajeitar essa script :( was marked as the answerlocal config = { affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for? killStorageValue = 3943, deathStorageValue = 3944, -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME rewardItem = { use = true, itemid = 5953, minLevel = false, -- false if you don't want any level req minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed). }, killMessage = { use = true, text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!", messageClass = MESSAGE_STATUS_CONSOLE_BLUE }, killerAnimation = { use = false, text = "Frag!", -- Only 9 letters! No "commands" here. color = 1 }, targetAnimation = { use = false, text = "OWNED!!", -- Only 9 letters! No "commands" here. color = 180 } } function onDeath(cid, corpse, deathList) local killer = deathList[1] if isPlayer(killer) then for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do if getPlayerIp(cid) == getPlayerIp(killer) then return true end local targetKills = (getPlayerStorageValue(cid, config.killStorageValue) > 0 and getPlayerStorageValue(cid, config.killStorageValue) or 0) + 1 local targetDeaths = (getPlayerStorageValue(cid, config.deathStorageValue) > 0 and getPlayerStorageValue(cid, config.deathStorageValue) or 0) + 1 local killerKills = (getPlayerStorageValue(killer, config.killStorageValue) > 0 and getPlayerStorageValue(killer, config.killStorageValue) or 0) + 1 local killerDeaths = (getPlayerStorageValue(killer, config.deathStorageValue) > 0 and getPlayerStorageValue(killer, config.deathStorageValue) or 0) + 1 setPlayerStorageValue(killer, config.killStorageValue, targetKills) setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths) local killerLevel = getPlayerLevel(killer) local targetLevel = getPlayerLevel(cid) local levelDiff = targetLevel - killerLevel local values = { ["KILLERKILLS"] = killerKills, ["KILLERDEATHS"] = killerDeaths, ["KILLERNAME"] = getCreatureName(killer), ["KILLERLEVEL"] = killerLevel, ["TARGETKILLS"] = targetKills, ["TARGETDEATHS"] = targetDeaths, ["TARGETNAME"] = getCreatureName(cid), ["TARGETLEVEL"] = targetLevel } local function formateString(str) return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end))) end if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1) end if(config.killMessage.use) then doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text)) end if(config.killerAnimation.use) then doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color) end if(config.targetAnimation.use) then doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color) end end end return true end
-
Snowsz's post in (Resolvido)Tile que até X level consegue passar was marked as the answerEsta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.
local c = { level = 601, msg = "Você não pode passar, apenas pessoas de level 1 a 600 podem passar." } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getPlayerLevel(cid) >= c.level then doPlayerSendCancel(cid, c.msg) doTeleportThing(cid, fromPosition) return false end return true end
-
Snowsz's post in (Resolvido)Mensagem no [OTC] was marked as the answerNão, não resta o OTC, simplesmente, NÃO É NO OTC! É algum arquivo do creaturescript, pode procurar que tá lá.
-
Snowsz's post in (Resolvido)[AJUDA] Troca de looktype de um NPC was marked as the answerlocal 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 interval = 2 -- in seconds function onThink() local npc = getNpcCid() addEvent(function() if isCreature(npc) then doCreatureChangeOutfit(npc, {lookType = (getCreatureOutfit(npc).lookType == 80 and 51 or 80)}) end end, interval*1000) npcHandler:onThink() end npcHandler:addModule(FocusModule:new()) O intervalo está em dois segundos, altere em interval.
-
Snowsz's post in (Resolvido)Skill Bugada was marked as the answerNa tag no spells.xml da sua magia, adicione o seguinte parâmetro:
direction="1" Exemplo com a magia "exevo frigo hur":
<instant group="attack" spellid="121" name="Ice Wave" words="exevo frigo hur" lvl="18" mana="25" direction="1" exhaustion="4000" groupcooldown="2000" needlearn="0" script="attack/ice wave.lua"> <vocation name="Druid"/> <vocation name="Elder Druid"/> </instant> -
Snowsz's post in (Resolvido)como reverter um distance effect? was marked as the answerfunction onThink(interval, lastExecution) for _, name in ipairs(getOnlinePlayers()) do local cid = getPlayerByName(name) if getPlayerStorageValue(cid, 9899) >= 1 then doSendAnimatedText(getPlayerPosition(cid), "[VIP]", 29) local spot = getThingPosition(cid) doSendDistanceShoot({x = spot.x + 1, y = spot.x + 1, z = spot.z}, spot, 37) doSendDistanceShoot({x = spot.x - 1, y = spot.y - 1, z = spot.z}, spot, 37) doSendDistanceShoot({x = spot.x + 1, y = spot.y - 1, z = spot.z}, spot, 37) doSendDistanceShoot({x = spot.x - 1, y = spot.y + 1, z = spot.z}, spot, 37) end end return true end
-
Snowsz's post in (Resolvido)Me ajudem , Não conssigo colocar a senha no Putty (VPS LINUS) was marked as the answerCara, o putty é assim mesmo, quando você vai botar a senha, ele não coloca os asteriscos(*****) ele deixa em branco, sem mostrar, você tem que por a senha e apertar enter, ele não vai mostrar nada na hora de por a senha mesmo.
-
Snowsz's post in (Resolvido)Colocando cooldown na magia was marked as the answerLogo após:
function onCastSpell(cid, var) Adicione:
if getPlayerStorageValue(cid, cooldownStorage) > os.time() then doPlayerSendCancel(cid, "You are exhausted.") return true else setPlayerStorageValue(cid, cooldownStorage, (os.time()+cooldownSeconds)) end E no começo to arquivo, no começo mesmo, de dois enter, e atrás dos dois enter, adicione isso:
local cooldownSeconds = 5 local cooldownStorage = 6541 Nisso /\, você configura o tempo de cooldown que a spell irá dar: 5 segundos que está configurado. E a storage do cooldown, caso queira um cooldown diferente para cada magia, mude o cooldownStorage para outro valor sempre para cada magia.
Não testei:
local cooldownSeconds = 5 local cooldownStorage = 6541 local tempo = 30 local effect = {175} local health = 1000 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) 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) function magicEffect10(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 function onCastSpell(cid, var) if getPlayerStorageValue(cid, cooldownStorage) > os.time() then doPlayerSendCancel(cid, "You are exhausted.") return true else setPlayerStorageValue(cid, cooldownStorage, (os.time()+cooldownSeconds)) end if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doCombat(cid, combat, var) tempo2 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect10, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 end setPlayerStorageValue(cid, 102053,1) else doPlayerSendCancel(cid, "A magia está sendo usada!") end end -
Snowsz's post in (Resolvido)[pedido] talkaction muda outfit de todos q estao usando citizen was marked as the answerCara, seu script não tem nada a ver, por favor, poderia estudar mais?
Não testei:
local antigaOutfit = 128 local novaOutfit = 300 function onSay(cid, words, param) for k,v in pairs(getPlayersOnline()) do if getCreatureOutfit(v).lookType == antigaOutfit then local look = getCreatureOutfit(v) look.lookType = novaOutfit doCreatureChangeOutfit(cid, look) end end return true end -
Snowsz's post in (Resolvido)Compilar arquivos OTC was marked as the answerEntão, como eu disse, não testei, pode testar e dizer o resultado
-
Snowsz's post in (Resolvido)Equipar item conflito was marked as the answerEstou rindo aqui agora kkk, existe um atributo para isso ;] que você adiciona no items.xml, no movements, você só vai precisar registrar o equip e deequip sem script algum.
maxHealthPoints Se não for essa:
maxHitPoints Ou, pode querer usar com porcentagem.
maxHealthPercent Se não for essa:
maxHitpointsPercent -
Snowsz's post in (Resolvido)How to create a new module? [OTC] was marked as the answerhttp://www.tibiaking.com/forum/topic/57670-criando-um-mod-simples/
-
Snowsz's post in (Resolvido)Como editar item TFS 1.2 was marked as the answerDeveria ter dito antes kk, é como no tfs 0.4 ou menor, precisa registrar no movements.xml, usa essas tags, use a que corresponde ao seu item, no caso, esse ai é uma arma, mude o XXXX para o id do item:
Tag para armas:
<movevent event="Equip" itemid="XXXX" slot="hand" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="hand" function="onDeEquipItem"/> Tag para armor:
<movevent event="Equip" itemid="XXXX" slot="armor" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="armor" function="onDeEquipItem"/> Tag para legs:
<movevent event="Equip" itemid="XXXX" slot="legs" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="legs" function="onDeEquipItem"/> Tag para boots:
<movevent event="Equip" itemid="XXXX" slot="feet" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="feet" function="onDeEquipItem"/> Tag para Helmet:
<movevent event="Equip" itemid="XXXX" slot="head" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="head" function="onDeEquipItem"/> Tag para Ring:
<movevent event="Equip" itemid="XXXX" slot="ring" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="ring" function="onDeEquipItem"/> Tag para Shield:
<movevent event="Equip" itemid="XXXX" slot="shield" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="shield" function="onDeEquipItem"/> Tag para Amuletos:
<movevent event="Equip" itemid="XXXX" slot="necklace" function="onEquipItem"/> <movevent event="DeEquip" itemid="XXXX" slot="necklace" function="onDeEquipItem"/> -
Snowsz's post in (Resolvido)4youstart was marked as the answerSobre ripping, não pude lhe responder antes, minha internet caiu, atualmente minha opinião é que isso não acontece nem acontecerá, nunca sofri com isso na 4youstart e nem conheço nenhum caso que tenham sofrido isso.
Já sobre a formatação eu não sei, pois nunca pedi para formatarem a máquina.
-
Snowsz's post in (Resolvido)Ganhar todos os addons ao logar was marked as the answerlocal storage = 5465 function onLogin(cid) if getPlayerStorageValue(cid, storage) <= 0 then doPlayerAddAddons(cid, 1) doPlayerAddAddons(cid, 2) setPlayerStorageValue(cid, storage, 1) end return true end
-
Snowsz's post in (Resolvido)Pz was marked as the answerlocal medalId = 5785 --ID da Medal of Honour. local toPosition = {x = 238, y = 256, z = 7} --Para onde o jogador será teleportado. function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function onUse(cid) if getPlayerSkullType(cid) == SKULL_WHITE or isPlayerPzLocked(cid) then doPlayerSendCancel(cid, "Você não pode passar aqui com PZ Locked ou com PK.") else if #getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, medalId) < 1 then local medalCheck for i = 1, 10 do if getPlayerSlotItem(cid, i).itemid == medalId then medalCheck = true break end end if not medalCheck then return doPlayerSendCancel(cid, "Você não pode passar aqui sem um "..getItemNameById(medalId)..".") end end doTeleportThing(cid, toPosition) end return true end
-
Snowsz's post in (Resolvido)[PEDIDO] Adicionar chances was marked as the answerfunction onUse(cid, item, fromPosition, itemEx, toPosition) local rand = math.random(1, 120) if rand <= 10 then doCreatureSay(cid, "Abriu e ganhou 15x HANDGUN AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11389,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 20 then doCreatureSay(cid, "Abriu e ganhou 15x MAGNUM AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11390,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 30 then doCreatureSay(cid, "Abriu e ganhou 15x SHOTGUN AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11391,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 40 then doCreatureSay(cid, "Abriu e ganhou 15x RIFLE AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11392,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 50 then doCreatureSay(cid, "Abriu e ganhou 15x MACHINEGUN AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11394,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 60 then doCreatureSay(cid, "Abriu e ganhou 15x ACID AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11395,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 70 then doCreatureSay(cid, "Abriu e ganhou 15x EXPLOSIVE AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11396,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 80 then doCreatureSay(cid, "Abriu e ganhou 15x NITROGEN AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11397,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 90 then doCreatureSay(cid, "Abriu e ganhou 15x FLASH AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11398,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 100 then doCreatureSay(cid, "Abriu e ganhou 15x ELETRIC AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11399,15) doRemoveItem(cid, item.uid, 1) elseif rand <= 110 then doCreatureSay(cid, "Abriu e ganhou 15x FLAME AMMO!", TALKTYPE_ORANGE_1) doPlayerAddItem(cid, 11400,15) doRemoveItem(cid, item.uid, 1) elseif rand >= 110 then doCreatureSay(cid, "BROKE!", TALKTYPE_ORANGE_1) doRemoveItem(cid, item.uid, 1) end return true end Sua explicação ficou confusa, então, use isso e teste, pois não são 7 items, são mais que isso, coloquei chances de 10% até 100% de pegar tal item, bom, veja se está bom para você.
E você está errado.
-
Snowsz's post in (Resolvido)[DÚVIDA] OTC/OLD - Fonts Client was marked as the answerFaça o seguinte, use o notepad++ e abra o arquivo.lua desse tal broadcast, nele, clique em formatação e dai, formatar para UTF-8(sem bom) e salve, se não funcionar, formate para ANSI, tenta isso.
-
Snowsz's post in (Resolvido)[Pedido] Movement que envia mensagem após player entrar no Teleport was marked as the answerfunction onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabéns, você tem acesso a Yalahar.") end return true end
-
Snowsz's post in (Resolvido)Erro ao usar item (PC) was marked as the answerTenta assim:
function onJoinChannel(cid, channelId, users, isTv) if channelId == 10 then doShowPokemonStatistics(cid) return false end if channelId == 11 then doPlayerPopupFYI(cid, getHighscoreString(8)) return false end if channelId == 12 then doPlayerPopupFYI(cid, getHighscoreString(6)) return false end --////////////////////////////////////////////////////////////////////////////////////////-- if channelId >= 13 and channelId <= 18 then doSendAnimatedText(getThingPos(cid), (channelId-12).." Poke"..(channelId > 13 and "s" or ""), COLOR_BURN) setPlayerStorageValue(cid, 52481, (channelId-12)) if isInParty(cid) then local party = getPartyMembers(cid) if #party >= 2 then for i = 1, #party do if getPlayerStorageValue(party[i], 52481) <= -1 then --alterado v2.6 duel system setPlayerStorageValue(party[i], 52481, (channelId-12)) end end end elseif not isInParty(cid) then for _, sid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(sid, 52482) == getCreatureName(cid) then if getPlayerStorageValue(sid, 52481) == -1 then setPlayerStorageValue(sid, 52481, (channelId-12)) end end end end addEvent(doSendAnimatedText, 1000, getThingPos(cid), "BATTLE", COLOR_ELECTRIC) doPlayerSetVocation(cid, 1) return false end --////////////////////////////////////////////////////////////////////////////////////////-- if channelId >= 100 and channelId <= 10000 then local owner = getPlayerByGUID(getChannelOwner(channelId)) if isChannelTv(channelId) then if isCreature(owner) then if owner ~= cid then doPlayerWatchOther(cid, owner) local plural = #users == 1 and "" or "s" doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).', 15, channelId) else setPlayerStorageValue(cid, 99284, 1) end end elseif owner == cid then setPlayerStorageValue(cid, 99284, 2) end return true end return true end function onLeaveChannel(cid, channelId, users) if channelId >= 100 and channelId <= 10000 then local owner = getPlayerByGUID(getChannelOwner(channelId)) if isChannelTv(channelId) then if owner ~= cid and getCreatureOutfit(cid).lookType == 814 then doPlayerStopWatching(cid) local plural = #users == 2 and "" or "s" doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users - (1)..' player'..plural..' watching this channel).', 15, channelId) elseif owner == cid then setPlayerStorageValue(cid, 99284, -1) doSendAnimatedText(getThingPos(cid), "CAM OFF", 180) for stops = 1, #users do if users[stops] ~= owner then doPlayerStopWatching(users[stops]) end end end elseif owner == cid then setPlayerStorageValue(cid, 99284, -1) end return true end return true end function onMove(cid, fromPosition, toPosition) -- Código não é mais necessário, feito em c++ -- Code deprecated, made in c++ --if not canWalkOnPos(toPosition, false, false, false, true, false) and getPlayerStorageValue(cid, 17000) >= 1 then -- doTeleportThing(cid, fromPosition, false) -- doPlayerSendCancel(cid, "Sorry, not possible.") --end if getPlayerStorageValue(cid, 99284) <= 0 then return true end local speed = getCreatureSpeed(cid) local a = getWatchingPlayersFromPos(cid, fromPosition) for b = 1, #a do if getCreatureSpeed(a[b]) ~= speed then doChangeSpeed(a[b], - getCreatureSpeed(a[b])) doChangeSpeed(a[b], speed) end doTeleportThing(a[b], toPosition, true) end return true end local permited = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "w", ",", "'", '"', "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "!", "@", "#", "$", "%", "&", "*", "(", ")", "-", "_", "+", "/", ";", ":", "?", "^", "~", "{", "[", "}", "]", ">", "<", "£", "¢", "¬"} function onTextEdit(cid, item, newText) if item.itemid == 12330 then if getPlayerStorageValue(cid, 99284) >= 1 then doPlayerSendCancel(cid, "You are already on air!") return false end local channelName = getCreatureName(cid).."'s TV Channel" if string.len(newText) <= 0 then doPlayerSendCancel(cid, "Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".") elseif string.len(newText) > 25 then doPlayerSendCancel(cid, "Your channel name can't have more than 25 characters.") return false else channelName = newText end setPlayerStorageValue(cid, 99284, 1) setPlayerStorageValue(cid, 99285, "") setPlayerStorageValue(cid, 99285, channelName) doPlayerCreatePrivateChannel(cid, channelName) doSendAnimatedText(getThingPos(cid), "ON AIR!", COLOR_GRASS) return false end return true end -
Snowsz's post in (Resolvido)[AJUDA]Magias was marked as the answerfunction onUse(cid, item, frompos, item2, topos) local level = getPlayerLevel(cid) local mlevel = getPlayerMagLevel(cid) local exhausted_seconds = 1 local exhausted_storagevalue = 7480 local mana_minimum = 100000 local mana_maximum = 100000 local mana_add = math.random(mana_minimum, mana_maximum) if(item.type >= 1) then if os.time() > getPlayerStorageValue(cid, exhausted_storagevalue) then if isPlayer(cid) then doSendMagicEffect(topos,12) doPlayerAddMana(cid, mana_add) setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) doChangeTypeItem(item.uid, item.type - 1) else setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds) doRemoveItem(item.uid, 1) doSendMagicEffect(frompos, 18) doCreatureAddHealth(cid, mana_add) doChangeTypeItem(item.uid,item.type-1) doPlayerAddMana(cid, mana_add) doCreatureSay(cid, "Senzu!", TALKTYPE_ORANGE_1) end else doSendMagicEffect(frompos, CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted.") end else if os.time() < getPlayerStorageValue(cid, exhausted_storagevalue) then doSendMagicEffect(frompos, CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted.") else if isPlayer(cid) then doSendMagicEffect(topos,12) doPlayerAddMana(cid, mana_add) doPlayerAddHealth(cid, mana_add*1.5) doCreatureSay(cid, "Senzu!", TALKTYPE_ORANGE_1) else doSendMagicEffect(frompos, CONST_ME_POFF) doPlayerSendCancel(cid, "You are exchausted.") end end end return true end
-
Snowsz's post in (Resolvido)[AJUDA] Codigo de add addon was marked as the answerCara, re-vê seus códigos, tem bastante coisa errada...
@Topic
Tenta assim:
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 item = 'I\'m sorry, but you do not have the required items for this trade.' local done = 'Here you are, thank you for your business.' function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return true end if msgcontains(msg, 'items') then npcHandler:say('I sell items for bar of golds, i have: {boots of waterwalking}, {furious} {frock}, {umbral master spellbook}, {umbral master crossbow}, {umbral} {master} {slayer}, {umbral master} {chopper}, {umbral master hammer}, {umbral master bow}, {umbral master} {mace}, {umbral master axe}, {umbral} {masterblade}, {change sex}, {remover} {skull}, {sweet mangonaise elixir}.', cid) elseif msgcontains(msg, 'addons') then npcHandler:say('I sell addons for bar of golds, i have: {assassin}, {warrior}, {barbarian}, {druid}, {brotherhood}, {entrepreneur}, {dream warden}, {glooth engineer}, {conjurer}, {death herald}, {ceremonial} {garb}, {chaos acolyte}, {beastmaster}, {ranger}, {puppeteer}, {spirit caller} and {champion}.', cid) elseif msgcontains(msg, 'mounts') then npcHandler:say('I sell mounts for bar of golds, i have: {ursagrodon}, {walker}, {armoured war} {horse}, {shadow draptor}, {azudocus}, {blazebringer}, {carpacosaurus}, {crimson ray}, {death crawler}, {desert} {king}, {flamesteed}, {winter} { king}, {jade pincer}, {platesaurian}, {tempest}, {tombstinger}, {nethersteed}, {jade lion}, {steelbreak}, {floating kashmir}, {magic carpet}, {flying divian}, {night} {waccoon}, {ringtail waccoon}, {emerald} {waccoon}, {blackpelt}, {siegebreaker}, {poisonbane}, {doombringer}, {woodland prince}, {hailtorm fury}.', cid) elseif msgcontains(msg, 'assassin') then if getPlayerItemCount(cid,15515) >= 25 then npcHandler:say('Did you bring me the 25 bar of golds?', cid) npcHandler.topic[cid] = 45 else npcHandler:say('I need a {25 bar of golds}, to give you addon assassin. Please come back when you have them.', cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 46 then npcHandler.topic[cid] = 0 if getPlayerItemCount(cid,15515) >= 25 then if doPlayerRemoveItem(cid,15515, 25) then npcHandler:say(done, cid) local player = Player(cid) player:addOutfitAddon(152, 3) end else npcHandler:say(item, cid) end elseif msgcontains(msg, 'no') and npcHandler.topic[cid] >= 1 and npcHandler.topic[cid] <= 90 then npcHandler:say('Well, then leave.') npcHandler.topic[cid] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
Snowsz's post in (Resolvido)[Monstros] Loot com porcentagem em 100% was marked as the answerNas sources do tfs, 100000 é 100%, enquanto 0 é 0%, ou seja, ajuste no xml do monstro de 0 a 100000 a porcentagem dele, e deixe o rate loot em 0 no config.lua, por exemplo:
45000 = 45%