Solutions
-
xWhiteWolf's post in (Resolvido)Ao usar item adicionar log was marked as the answersó adicionar essas duas linhas no script. daí vc cria o arquivo stamina refuel.txt na pasta data e toda vez que usar vai aparecer o dia, horario, nome do player usou STAMINA REFUEL
local file = "data/stamina refuel.txt" doWriteLogFile(file, ""..getPlayerName(cid).." usou STAMINA REFUEL.") -
xWhiteWolf's post in (Resolvido)Outfit com storage was marked as the answertenta <outfit id="5" storageId="1415" storageValue="1">
se não der tenta
<outfit id="4" quest="40853">
(isso varia com a versão)
-
xWhiteWolf's post in (Resolvido)[Itens Donates] absorb,skill,magic was marked as the answertodo item que vc editar no items.xml pra dar atributos vc tem que adicioná-lo no movements.xml (caso não esteja declarado)
<movevent type="Equip" itemid="6531" slot="head" level="10" event="function" value="onEquipItem"> </movevent> <movevent type="DeEquip" itemid="6531" slot="head" event="function" value="onDeEquipItem"/> itemid é o id do item, slot é o tipo de slot que o item deve ocupar pra ativar os bonus.. nesse caso ele ativa qnd vc colocar o item 6531 no slot de head (cabeça); O level pra usar o item é 10
-
xWhiteWolf's post in (Resolvido)Efeito apenas para God was marked as the answerif isKnight(cid) then
local tempo = 0.3 --- de quanto em quanto segundos ele solta o efeito
function loop (cid)
local pos = getCreaturePosition(cid)
local effects = math.random (28,30)
local effectPositions = {
{x = pos.x, y = pos.y - 1, z = pos.z},
{x = pos.x, y = pos.y + 1, z = pos.z},
{x = pos.x - 1, y = pos.y, z = pos.z},
{x = pos.x + 1, y = pos.y, z = pos.z},
{x = pos.x - 1, y = pos.y + 1, z = pos.z},
{x = pos.x - 1, y = pos.y - 1, z = pos.z},
{x = pos.x + 1, y = pos.y - 1, z = pos.z},
{x = pos.x + 1, y = pos.y + 1, z = pos.z}
}
doSendMagicEffect(effectPositions[math.random(1, #effectPositions)], effects)
addEvent(function()
if isCreature(cid) then
loop(cid)
end
end, 1000 * tempo)
return true
end
loop(cid)
end
ou
if getPlayerStorageValue(cid, 19399) >= 1 then
local tempo = 0.3 --- de quanto em quanto segundos ele solta o efeito
function loop (cid)
local pos = getCreaturePosition(cid)
local effects = math.random (28,30)
local effectPositions = {
{x = pos.x, y = pos.y - 1, z = pos.z},
{x = pos.x, y = pos.y + 1, z = pos.z},
{x = pos.x - 1, y = pos.y, z = pos.z},
{x = pos.x + 1, y = pos.y, z = pos.z},
{x = pos.x - 1, y = pos.y + 1, z = pos.z},
{x = pos.x - 1, y = pos.y - 1, z = pos.z},
{x = pos.x + 1, y = pos.y - 1, z = pos.z},
{x = pos.x + 1, y = pos.y + 1, z = pos.z}
}
doSendMagicEffect(effectPositions[math.random(1, #effectPositions)], effects)
addEvent(function()
if isCreature(cid) then
loop(cid)
end
end, 1000 * tempo)
return true
end
loop(cid)
end
-
xWhiteWolf's post in (Resolvido){Pedido} Lança-Chamas was marked as the answerlocal up = { {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } local area1 = createCombatArea(up) local down = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0} } local area2 = createCombatArea(down) local left = { {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {1, 1, 2, 0, 0}, {1, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } local area3 = createCombatArea(left) local right = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 2, 1, 1}, {0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} } local area4 = createCombatArea(right) local tempo = 1 local storage = 19481 function onUse(cid, item, frompos, item2, topos) if getPlayerSlotItem(cid, 5).itemid == item.itemid or getPlayerSlotItem(cid, 6).itemid == item.itemid then if not exhaustion.get(cid, storage) then exhaustion.set(cid, storage, tempo) if getPlayerLookDirection(cid) == 0 then doAreaCombatHealth(cid, 1, getThingPos(cid), area2, -(getPlayerLevel(cid) * 2 / 3), -(getPlayerLevel(cid) * 4 / 3), 15) elseif getPlayerLookDirection(cid) == 1 then doAreaCombatHealth(cid, 1, getThingPos(cid), area3, -(getPlayerLevel(cid) * 2 / 3), -(getPlayerLevel(cid) * 4 / 3), 15) elseif getPlayerLookDirection(cid) == 2 then doAreaCombatHealth(cid, 1, getThingPos(cid), area1, -(getPlayerLevel(cid) * 2 / 3), -(getPlayerLevel(cid) * 4 / 3), 15) elseif getPlayerLookDirection(cid) == 3 then doAreaCombatHealth(cid, 1, getThingPos(cid), area4, -(getPlayerLevel(cid) * 2 / 3), -(getPlayerLevel(cid) * 4 / 3), 15) end else doPlayerSendCancel(cid, "You are exhausted.") end end return true end a unica coisa ruim do meu trabalho é que as pessoas pedem uma coisa pensando em outra e depois reclamam que oque eu fiz tá errado --'. Nos próximos pedidos seja extremamente detalista noque vc quer se não eu não vou ajudar.
-
xWhiteWolf's post in (Resolvido){Pedido} Arma de fogo was marked as the answereu tenho esse script aqui que o @Adriano SwaTT fez a mil anos atrás, vê se é oque tu tá procurando
local bullets = 6529 local ammo = 2299 local glock, g_qtdd = 2406, 14 local tglock, tg_qtdd = 2407, 16 local sglock, sg_qtdd = 2408, 18 local spglock, spg_qtdd = 2431, 20 local tempo = 3 -- em segundos local condition_infight = createConditionObject(CONDITION_INFIGHT) setConditionParam(condition_infight, CONDITION_PARAM_TICKS, -1) function onUse(cid, item, frompos, itemEx, topos) local n = getPlayerSlotItem(cid, 10).type local m = getPlayerSlotItem(cid, 6).itemid local b = getPlayerItemCount(cid, ammo) if n >= 1 then doPlayerSendCancel(cid, "Deixe o slot de municao vazio para recarregar sua arma.") end if itemEx.itemid == glock and n == 0 and m == glock and b >= g_qtdd then doAddCondition(cid, condition_infight) doPlayerSendTextMessage(cid, 22, "Recarregando...") doPlayerRemoveItem(cid, ammo, g_qtdd) addEvent(reload_glock, tempo * 1000, cid) elseif itemEx.itemid == glock and m == glock and n == 0 and b < g_qtdd then doAddCondition(cid, condition_infight) doPlayerSendTextMessage(cid, 22, "Recarregando...") doPlayerRemoveItem(cid, ammo, b) addEvent(reload_glock2, tempo * 1000, cid) elseif itemEx.itemid == sglock and n == 0 and m == sglock and b >= sg_qtdd then doAddCondition(cid, condition_infight) doPlayerSendTextMessage(cid, 22, "Recarregando...") doPlayerRemoveItem(cid, ammo, sg_qtdd) addEvent(reload_sglock, tempo * 1000, cid) elseif itemEx.itemid == spglock and n == 0 and m == spglock and b >= spg_qtdd then doAddCondition(cid, condition_infight) doPlayerSendTextMessage(cid, 22, "Recarregando...") doPlayerRemoveItem(cid, ammo, spg_qtdd) addEvent(reload_spglock, tempo * 1000, cid) end return true end function reload_glock(cid) local n2 = getPlayerSlotItem(cid, 10).itemid local m = getPlayerSlotItem(cid, 6).itemid if n2 == 0 and m == glock then doPlayerAddItem(cid, bullets, g_qtdd) doPlayerSendTextMessage(cid, 21, "Glock recarregada com sucesso.") doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid, 21, "Deixe o slot de municao vazio e sua Glock empunhada para recarregar.") addEvent(reload_glock, 4000, cid) end return true end function reload_glock2(cid) local n2 = getPlayerSlotItem(cid, 10).itemid local m = getPlayerSlotItem(cid, 6).itemid if n2 == 0 and m == glock then doPlayerAddItem(cid, bullets, b) doPlayerSendTextMessage(cid, 21, "Glock recarregada com sucesso.") doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid, 21, "Deixe o slot de municao vazio e sua Glock empunhada para recarregar.") addEvent(reload_glock2, 4000, cid) end return true end function reload_tglock(cid) local n2 = getPlayerSlotItem(cid, 10).itemid local m = getPlayerSlotItem(cid, 6).itemid if n2 == 0 and m == tglock then doPlayerAddItem(cid, bullets, tg_qtdd) doPlayerSendTextMessage(cid, 21, "Tactical Glock recarregada com sucesso.") doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid, 21, "Deixe o slot de municao vazio e sua Tactical Glock empunhada para recarregar.") addEvent(reload_tglock, 4000, cid) end return true end function reload_sglock(cid) local n2 = getPlayerSlotItem(cid, 10).itemid local m = getPlayerSlotItem(cid, 6).itemid if n2 == 0 and m == sglock then doPlayerAddItem(cid, bullets, sg_qtdd) doPlayerSendTextMessage(cid, 21, "Super Glock recarregada com sucesso.") doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid, 21, "Deixe o slot de municao vazio e sua Super Glock empunhada para recarregar.") addEvent(reload_sglock, 4000, cid) end return true end function reload_spglock(cid) local n2 = getPlayerSlotItem(cid, 10).itemid local m = getPlayerSlotItem(cid, 6).itemid if n2 == 0 and m == spglock then doPlayerAddItem(cid, bullets, spg_qtdd) doPlayerSendTextMessage(cid, 21, "Special Glock recarregada com sucesso.") doRemoveCondition(cid, CONDITION_INFIGHT) else doPlayerSendTextMessage(cid, 21, "Deixe o slot de municao vazio e sua Special Glock empunhada para recarregar.") addEvent(reload_spglock, 4000, cid) end return true end -
xWhiteWolf's post in (Resolvido)[PEDIDO] Recompensa Ao Pega Level was marked as the answeré só ir em creaturescripts.xml e procurar algum script que seja onAdvanced e colocar isso nele:
local level = 100 if skill == 8 and newlevel == level then local pointsForPlayer = 5 -- quantos pontos vai ganhar db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+" .. pointsForPlayer .. " WHERE `id` IN (" .. table.concat(accounts, ',') .. ");") doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA) -
xWhiteWolf's post in (Resolvido)[pedido Spells] auto-explosao was marked as the answerlocal cooldown = 24*60*60 function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 19329) >= cooldown then doPlayerSetStorageValue(cid, 19329, os.time()) local target = getCreatureTarget(cid) doCreatureAddHealth(cid, -getCreatureHealth(cid)) doCreatureAddHealth(target, -getCreatureHealth(target)) doCreatureSay(cid, "SUICIDE!!", 20) doSendMagicEffect(getPlayerPosition (cid), 0) doSendMagicEffect(getPlayerPosition (target), 0) else doPlayerSendCancel(cid, "Your skill is in cooldown, you can use it again after "..math.floor((cooldown - (os.time() - getPlayerStorageValue(cid, 19329)))/60).." minute(s).") end return true end <instant name="Suicide" words="suicide" lvl="50" mana="20" prem="1" range="4" needtarget="1" blockwalls="1" exhaustion="2000" groups="1,2000" icon="88" needlearn="0" event="script" value="especiais/assistedsuicide.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant>
-
xWhiteWolf's post in (Resolvido)Spells para remover os summons was marked as the answergetCreatureSummons(cid) Info This functions checks for creature summons list. Returns false if creature not found, otherwise table with creatures list (NOTE: Can be empty!) Example local summons = getCreatureSummons(cid) if(table.maxn(summons) <= 0) then -- no summons doPlayerSendCancel(cid, "You don't have any summons..") return false end -- remove all summons for _, pid in ipairs(summons) do doRemoveCreature(pid) end
-
xWhiteWolf's post in (Resolvido)Ajuda com creaturescript em sistema de pet was marked as the answermudei aquele fimzinho, troca por isso daqui:
elseif item.itemid == 7633 then if #getCreatureSummons(cid) >= 1 then local hp, maxhp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1]) doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 67) doRemoveCreature(getCreatureSummons(cid)[1]) doTransformItem(item.uid, 7632) doItemSetAttribute(item.uid, "lifepet", hp) doItemSetAttribute(item.uid, "maxlifepet", maxhp) doCreatureSay(cid, "Volta, " .. pet_name .. ".", TALKTYPE_SAY) end end return true end -
xWhiteWolf's post in (Resolvido)[PEDIDO] Refine System, Dúvida como Editar was marked as the answernão dá.. não existe nenhuma funções que adicione ml então a unica forma de fazer seria por condition.. oque não é viável. Pode fechar o tópico que não vai ser possível fazer isso que vc quer
-
xWhiteWolf's post in (Resolvido)Talkaction redutora de exp por tempo was marked as the answermods\scripts\expstagescroll.lua:
local config = { storage = 99000, expstorage = 99001, register = 99002, savexp = 99003 } function onSay(cid, words, param) if getPlayerAccess(cid) >= 3 then local t = string.explode(param, ",") if not t[2] and not t[3] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end local pid = getPlayerByName(t[1]) if(not pid or (isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if isNumber(t[2]) and isNumber (t[3]) then local tempo = tonumber(t[2])*60 local constant = tonumber(t[3]) local rate = constant/8 setPlayerStorageValue(pid, config.savexp, rate) if getPlayerStorageValue(pid, config.storage) <= 0 then local rates = getPlayerRates(pid) setPlayerStorageValue(pid, config.expstorage, rates[SKILL__LEVEL]) setPlayerStorageValue(pid, config.register, 1) doCreatureSay(pid, "Your experience rate has been changed! It now is: " .. rate .. "x ("..constant.."/8) of your former experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(pid, config.storage, os.time()+tempo) doPlayerSetExperienceRate(pid, rates[SKILL__LEVEL]*rate) registerCreatureEvent(pid, "ExpStage") else doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Param must be a number.") end end return true end function onThink(cid, interval) if getPlayerStorageValue(cid, config.register) == 1 then if getPlayerStorageValue(cid, config.storage) <= os.time() then doCreatureSay(cid, "Your experience rate has finished! It is now normaly experience rate.", TALKTYPE_ORANGE_1, true, cid) setPlayerStorageValue(cid, config.storage, 0) setPlayerStorageValue(cid, config.register, 0) local oldexp = getPlayerStorageValue(cid, config.expstorage) doPlayerSetExperienceRate(cid, oldexp) end end return true end function onLogin(cid) if getPlayerStorageValue(cid, config.register) == 1 then registerCreatureEvent(cid, "ExpStage") local rates = getPlayerRates(cid) if getPlayerStorageValue(cid, config.storage) > os.time() then doCreatureSay(cid, "Your experience rate is still here!.", TALKTYPE_ORANGE_1, true, cid) local oldexp = getPlayerStorageValue(cid, config.expstorage) local newrate = getPlayerStorageValue(cid, config.savexp) doPlayerSetExperienceRate(cid, oldexp*newrate) end end return true end mods\expscroll.xml:
<?xml version="1.0" encoding="UTF-8"?> <mod name="Experience Stages Scroll" version="1.0" author="TomCrusher" contact="otland.net" enabled="yes"> <talkaction log="yes" words="/expreduce" event="script" value="expstagescroll.lua"/> <creatureevent type="think" name="ExpStage" event="script" value="expstagescroll.lua"/> <creatureevent type="login" name="ExpStageLogin" event="script" value="expstagescroll.lua"/> </mod> funcionou 200% no meu TFS 0.3.6.. além de diminuir a exp ele tb aumenta a exp se o numero for maior que 8.
Pra testar use /expreduce nome do seu char, 1 (significa 1 minuto), 4 (metade de 8)
-
xWhiteWolf's post in (Resolvido)Spell kamui was marked as the answerlocal config = { pos = {x=42, y=234, z=7}, -- posição da aegis dimension tempo = 15, -- tempo pra voltar effect1 = 66, -- efeito ao ser teleportado effect2 = 10 -- efeito ao voltar } function onCastSpell(cid, var) if isPlayer(getCreatureTarget(cid)) then target = getCreatureTarget(cid) addEvent(doTeleportThing, 1000*config.tempo, target, getThingPos(target), true) addEvent(doSendMagicEffect, 1000*config.tempo, getThingPos(target), config.effect2) doSendMagicEffect(getThingPos(target), config.effect1) doTeleportThing(target, config.pos) if isCreature(cid) then doPlayerSendTextMessage(target, 27, "You were teleported by ".. getCreatureName(cid) ..".") end if isPlayer(cid) and isCreature(target) then doPlayerSendTextMessage(cid, 27, "You teleported ".. getCreatureName(target) .."!") end for i = 1,config.tempo do addEvent(function() if isCreature(target) then doPlayerSendTextMessage(target,25,"You'll be back in " .. config.tempo -i +1 .. " second(s)") end end, 1000*i) end else doPlayerSendCancel(cid, "You can only use this spell in players") end return true end
-
xWhiteWolf's post in (Resolvido)ajuda mostro para healar was marked as the answersubstitui isso: <defenses armor="1" defense="2"/> por isso:
<defenses armor="1" defense="2"> <defense name="healing" interval="10000" chance="100" min="24000" max="24000"/> </defenses> aqui é a chance de ele recuperar 24000 de vida a cada 10 segundos.
-
xWhiteWolf's post in (Resolvido)script de item que teleporta was marked as the answernao faz sentido o player mirar no lugar que quer ir porque a função onUse não é ativada a distância, logo o player teria que ir do lado do item para se teleportar (e nós dois sabemos que não é isso que vc quer) Fiz uma spell aqui que vc fala uma palavra e ela adiciona um item no chão, ao ser falada dnv vc se teleporta pra onde o item está:
crie um arquivo em spells\scripts\especiais\itemport.lua
local config = { storage = 49607, --- storage que será salvo o tempo e o lugar na table que a posição do player pertence tempo = 10, --- tempo que o player poderá utilizar aquele item para se teleportar (após esse tempo será necessário colocar outro item) itemid = 6217 --- id do item que será criado } local positions = {} function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) <= 0 then table.insert(positions, getThingPos(cid)) doPlayerSetStorageValue(cid, config.storage, #positions) doCreateItem(config.itemid, getThingPos(cid)) doSendMagicEffect(getThingPos(cid), 3) addEvent(function() if isCreature(cid) then doPlayerSetStorageValue(cid, config.storage, 0) table.remove(positions, getPlayerStorageValue(cid, config.storage)) end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doTeleportThing(cid, positions[getPlayerStorageValue(cid, config.storage)]) doSendMagicEffect(getThingPos(cid), 10) end return true end e em spells.xml é só adicionar uma linha qualquer (como essa por exemplo:)
<instant name="TESTE TK" words="itemport" lvl="50" mana="100" prem="1" exhaustion="1000" needlearn="0" event="script" value="especiais/itemport.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> -
xWhiteWolf's post in (Resolvido)[PEDIDO] Critical System was marked as the answercreaturescripts.xml
<!-- CRITICAL SYSTEM --> <event type="statschange" name="critical" event="script" value="critical.lua"/> creaturescripts\scripts\login.lua
--- CRITICAL SYSTEM ---- registerCreatureEvent(cid, "critical") if getPlayerStorageValue(cid, 48903) == -1 then setPlayerStorageValue(cid, 48903, 0) end creaturescripts\scripts\critical.lua:
-----[[Critical System by Night Wolf]] local lvlcrit = 48903 local multiplier = 1.5 function onStatsChange(cid, attacker, type, combat, value) if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(attacker) and isCreature(cid) then if (getPlayerStorageValue(attacker, lvlcrit)*3) >= math.random (0,1000) then value = math.ceil(value*(multiplier)) doTargetCombatHealth(attacker, cid, combat, -value, -value, 255) doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144) return false end end return true end actions.xml:
<action itemid="1294" script="criticalrock.lua"/> obs: muda o ID da pedra que vc for usar... aqui eu usei a small stone pra teste
e em actions\scripts\criticalrock.lua:
--- CRITICAL System by Night Wolf local config = { effectonuse = 14, -- efeito que sai levelscrit = 100, --- leveis que terão storagecrit = 48903 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doSendMagicEffect(topos,config.effectonuse) doPlayerSendTextMessage(cid,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/100].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!") return 0 end return 1 end OBS: Só funciona em ataques de players em players. Se vc ficar atacando monstro pra testar não vai dar certo (isso é porque o creaturescript só tá registrado no login.lua então o cid tem que necessariamente ser um player)
-
xWhiteWolf's post in (Resolvido)[PEDIDO] Item que da HP was marked as the answerja sei como resolver seu problema!
local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 50) function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Now that you're using this item you'll receive a special bonus...") doAddCondition(cid, condition) doSendMagicEffect(getCreaturePos(cid), 10) return true end function onDeEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") doRemoveCondition(cid, CONDITION_ATTRIBUTES) return true end só criar uma condition que adicione pontos de vida.. nesse caso aí vai adicionar 50 pontos de vida.. o -1 no tempo é pra garantir que esse buff seja eterno. Daí ao remover o item do slot ele vai remover a condition.
Obs: isso é um movements
-
xWhiteWolf's post in (Resolvido)[AJUDA] Checar o slotType do item was marked as the answernão existe essa função (que eu saiba) mas dependendo do script que vc tiver em mente dá pra fazer umas gambiarras
-
xWhiteWolf's post in (Resolvido)Fishing Monster Script was marked as the answerlocal maxChance2 = 400 - fishSkill local maxChance = 200 - fishSkill
a maxchance é 200 - o skill. Se o skill for 200 então dá 0 e vai bugar o math.random.
Coloca uns numeros maiores tipo 300 e 500 que deve resolver.. mas qnd uparem 300 de fishing vai precisar aumentar dnv -
xWhiteWolf's post in (Resolvido)Pedido - Sistema de Broadcast para players (pago) was marked as the answer<talkaction log="yes" words="/anuncio" event="script" value="broadcast.lua"/> local config = { storage = 19400, -- storage em que será salvo o tempo cor = "green", -- de acordo com o constant.lua da lib tempo = 2, -- em minutos price = 200000, -- quantidade de dinheiro que irá custar level = 100 -- level pra poder utilizar o broadcast } function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if getPlayerLevel(cid) >= config.level then if getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then if doPlayerRemoveMoney(cid, config.price) then setPlayerStorageValue(cid, config.storage, os.time() + (config.tempo*60)) doBroadcastMessage(""..getCreatureName(cid).." [ANUNCIO]: "..param.."", config.cor) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have successfully sent a broadcast, now you'll have to wait " ..config.tempo.. " minute(s) until you broadcast again.") else doPlayerSendCancel(cid, "You don't have " ..config.price.. " gp's for broadcasting.") return true end else doPlayerSendCancel(cid, "You have to wait " ..(getPlayerStorageValue(cid, config.storage) - os.time()).. " seconds until you can broadcast again.") return true end else doPlayerSendCancel(cid, "You have to be level " ..config.level.. " or more in order to use broadcast.") end end ps: editei com doRemoveMoney
-
xWhiteWolf's post in (Resolvido)On Interval Caste Spell was marked as the answerjust change at global.lua
emoteSpells = true (something like that).
If you want for just a specific spells then change "return true" at the end of the script for "return false".
But keep in mind that will make the spells being exhaustless and without mana cost. But you can add those functions at the script to solve the problem. If you need help any further in this, feel free to PM me.
-
xWhiteWolf's post in (Resolvido)O ultimo que ficar no trono ganha o evento! was marked as the answerlocal config = { tempo = 5*60, -- segundos pos = {x=139, y=56, z=7, stackpos = 253}, -- posição do trono tp = {x=160, y=54, z=7}, -- posição que será criado o teleporte togo = {x=139, y=55, z=7}, --- posição que irá levar o teleporte premio = 2160, --- premio q vai dar count = 1, -- quantidade que vai dar effect = 27 -- efeito que vai sair } function onSay(cid, words, param, channel) doBroadcastMessage("The fight for the throne has begun, the last man standing there after "..config.tempo/60 .." minute(s) will be the winner.", 21) doCreateTeleport(1387, config.togo, config.tp) for j= 0,(config.tempo -1) do addEvent(function() doBroadcastMessage("Time left: ".. config.tempo - j .." second(s)", 25) end, (50+(j*1000))) end addEvent(function() if isPlayer(getThingFromPos(config.pos).uid) then doBroadcastMessage("The winner is "..getCreatureName(getThingFromPos(config.pos).uid)..".", 21) doPlayerAddItem(getThingFromPos(config.pos).uid, config.premio, config.count) doSendMagicEffect(config.pos, config.effect) else doBroadcastMessage("We didn't had a winner.. so sad!", 21) end end, 1000*config.tempo) end
-
xWhiteWolf's post in (Resolvido)Bônus no Conjunto de itens was marked as the answersegue essa lógica:
movements\scripts\set.lua:
-- NW SET SYSTEM local config = { slot1 = 4, slot2 = 8, item1 = 8889, item2 = 11234 } local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 50) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 50) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, 50) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 50) function onEquip(cid, item, slot) if getPlayerSlotItem(cid, config.slot2).itemid == config.item2 and getPlayerSlotItem(cid, config.slot1).itemid == config.item1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Now that you're using the full set you'll receive a special bonus...") doAddCondition(cid, condition) doSendMagicEffect(getCreaturePos(cid), 10) end return true end function onDeEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") doRemoveCondition(cid, CONDITION_ATTRIBUTES) return true end movements.xml
<!-- Set Items --> <movevent type="Equip" itemid="11234" slot="feet" event="script" value="set.lua"/> <movevent type="Equip" itemid="8889" slot="armor" event="script" value="set.lua"/> <movevent type="DeEquip" itemid="11234" slot="feet" event="script" value="set.lua"/> <movevent type="DeEquip" itemid="8889" slot="armor" event="script" value="set.lua"/> -
xWhiteWolf's post in (Resolvido)[PEDIDO] /b pra player com exausth de 2 minutos pf was marked as the answer@llucas75 tem uma lógica bem simples pra fazer isso que vc quer. Pensa comigo:
if getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then
setPlayerStorageValue(cid, config.storage, os.time() + config.tempo)
Se o storage - o tempo atual for menor ou igual a 0 então
Setar o storage como sendo o tempo atual + o tempo.
O tempo pra usar novamente será o storage (tempo atual no momento que usou + tempo) - tempo atual (desse momento)
@topic Testei no meu server e funcionou perfeitamente. Uso TFS 0.36. Se o seu server for diferente do meu procure as funções variantes e faça as modificações necessárias:
local config = { storage = 19400, -- storage em que será salvo o tempo cor = "white", -- de acordo com o constant.lua da lib tempo = 2, -- em minutos price = 1000, -- preço pra usar o broadcast level = 100 -- level pra poder utilizar o broadcast } function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if getPlayerLevel(cid) >= config.level then if getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then if doPlayerRemoveMoney(cid, config.price) then setPlayerStorageValue(cid, config.storage, os.time() + (config.tempo*60)) doBroadcastMessage(""..getCreatureName(cid)..": "..param.."", config.cor) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have successfully sent a broadcast, now you'll have to wait " ..config.tempo.. " minute(s) until you broadcast again.") else doPlayerSendCancel(cid, "You don't have " ..config.price.. " gp's for broadcasting.") return true end else doPlayerSendCancel(cid, "You have to wait " ..(getPlayerStorageValue(cid, config.storage) - os.time()).. " seconds until you can broadcast again.") return true end else doPlayerSendCancel(cid, "You have to be level " ..config.level.. " or more in order to use broadcast.") end end -
xWhiteWolf's post in (Resolvido)[PEDIDO]/addskill was marked as the answerse é nas sources, a forma de adicionar seria pegar uma source nova da sua versão, fazer as modificações e compilar ela dnv. (O executável que abre o server não passa das sources compiladas) então é muito mais fácil pegar algo já pronto q funcione e trocar.