Postado Setembro 1, 2017 7 anos Funciona assim Ao Usar com 15% de HP o player teleporta e naonde ele teleportou aparece um corpse ("Checa a vocaçao dele e manda um corpo") - "Aparece assim na tela dele" (Obs: ele só fica 3 segundos e volta Full Life) "Coraçoes 5/6" quando aparecer "Coraçoes 3/6" Fica Red a palavra ele pode usar 6 vezes isso Coldown de 5 Segundos/se ele usar as 6 Vezes no dia,ele tem um Coldown de 3 Horas para usar novamente. 2 Script Mostrar conteúdo oculto AO USAR X SUMMON ELE GANHA 15+ DE BUFF POR 7 SEGUNDOS SE ELE RETIRAR OS SUMMONS O BUFF AINDA CONTINUA O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Postado Setembro 1, 2017 7 anos 1º - Em actions/scripts: tpcoracao.lua Mostrar conteúdo oculto local t = { hp_pc = 15, -- % de hp para usar timetoback = {3, "sec"}, -- tempo para voltar cooldown_used = {5, "sec"}, -- cooldown ao usar o item cooldown_maxused = {3, "hour"}, -- quando usar max_coracoes vezes o cooldown aumenta para esse timetocooldown_maxused = {1, "day"}, -- tempo que ficará o cooldown aumentado max_coracoes = 6, new_pos = {x=1,y=1,z=1}, -- posição para onde será teleportado corpses = { [1] = 1111, -- id do corpo [2] = 2222, [3] = 3333, [4] = 4444} } -- só modifique se necessário local stors = {hearts = 16772, cooldown = 16773, daily_cooldown = 16774} function onUse(cid, item, fromPosition, itemEx, toPosition) local p, v = getPlayerPosition(cid), t.corpses[getPlayerVocation(cid)] local current_hp, max = getCreatureHealth(cid), getCreatureMaxHealth(cid) if not v then return true end if getPlayerStorageValue(cid, stors.cooldown) - os.time() > 0 then daily = getPlayerStorageValue(cid, stors.daily_cooldown) - os.time() rest_time = getPlayerStorageValue(cid, stors.cooldown) - os.time() cooldown = daily > 0 and math.ceil(rest_time/3600) .. " hours" or rest_time .. " seconds" doPlayerSendCancel(cid, "You must wait " .. cooldown .. " to use again.") doSendMagicEffect(p, CONST_ME_POFF) return true end if current_hp >= (t.hp_pc/100)*max then doPlayerSendCancel(cid, "Your health must be " .. t.hp_pc .. "% or less to use.") doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerStorageValue(cid, stors.hearts) == -1 then setPlayerStorageValue(cid, stors.hearts, 6) end local current_hearts = getPlayerStorageValue(cid, stors.hearts) setPlayerStorageValue(cid, stors.hearts, current_hearts - 1) current_hearts = getPlayerStorageValue(cid, stors.hearts) local type = (current_hearts > 0.5*(t.max_coracoes) and MESSAGE_INFO_DESCR or MESSAGE_STATUS_WARNING) doPlayerSendTextMessage(cid, type, "Corações: [" ..current_hearts .. "/" .. t.max_coracoes .. "]") doTeleportThing(cid, t.new_pos) doSendMagicEffect(t.new_pos, CONST_ME_TELEPORT) if current_hearts == 0 then setPlayerStorageValue(cid, stors.daily_cooldown, mathtime(t.timetocooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.hearts, 6) else setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_used) + os.time()) if getPlayerStorageValue(cid, stors.daily_cooldown) ~= -1 then setPlayerStorageValue(cid, stors.daily_cooldown, -1) end end doCreateItem(v, 1, t.new_pos) addEvent(function() if isPlayer(cid) then doCleanTile(t.new_pos) doCreatureAddHealth(cid, max-current_hp) doTeleportThing(cid, p) doSendMagicEffect(p, CONST_ME_TELEPORT) end end, mathtime(t.timetoback)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." end Em actions.xml: <action itemid="ID_DO_ITEM" script="tpcoracao.lua" /> 2º - É um BUFF para aumentar o que? Skill? ML? Edite para o que você quiser. Você poderia fazer algo assim. Em talkactions/scripts: Mostrar conteúdo oculto local t = { skills = {club = 25, sword = 25, axe = 25, distance = 25, shield = 25, ml = 50, duration = 7}} -- duration do BUFF em segundos local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, t.skills.duration*1000) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, t.skills.club) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, t.skills.sword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, t.skills.axe) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, t.skills.distance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, t.skills.shield) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, t.skills.ml) setConditionParam(condition, CONDITION_PARAM_BUFF, true) local name = "Rat" function onSay(cid, words, param, channel) local summons = getCreatureSummons(cid) if #summons ~= 2 then if param:lower() == "\""..name:lower() then doAddCondition(cid, condition) end doSummonMonster(cid, name) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return true end Em talkactions.xml: <talkaction words="utevo res" filter="word-spaced" event="script" value="NOMEDOSEUARQUIVO.lua"/> Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
Postado Setembro 1, 2017 7 anos Autor Em 01/09/2017 em 15:40, Dwarfer disse: 1º - Em actions/scripts: tpcoracao.lua Mostrar conteúdo oculto Mostrar conteúdo oculto local t = { hp_pc = 15, -- % de hp para usar timetoback = {3, "sec"}, -- tempo para voltar cooldown_used = {5, "sec"}, -- cooldown ao usar o item cooldown_maxused = {3, "hour"}, -- quando usar max_coracoes vezes o cooldown aumenta para esse timetocooldown_maxused = {1, "day"}, -- tempo que ficará o cooldown aumentado max_coracoes = 6, new_pos = {x=1,y=1,z=1}, -- posição para onde será teleportado corpses = { [1] = 1111, -- id do corpo [2] = 2222, [3] = 3333, [4] = 4444} } -- só modifique se necessário local stors = {hearts = 16772, cooldown = 16773, daily_cooldown = 16774} function onUse(cid, item, fromPosition, itemEx, toPosition) local p, v = getPlayerPosition(cid), t.corpses[getPlayerVocation(cid)] local current_hp, max = getCreatureHealth(cid), getCreatureMaxHealth(cid) if not v then return true end if getPlayerStorageValue(cid, stors.cooldown) - os.time() > 0 then daily = getPlayerStorageValue(cid, stors.daily_cooldown) - os.time() rest_time = getPlayerStorageValue(cid, stors.cooldown) - os.time() cooldown = daily > 0 and math.ceil(rest_time/3600) .. " hours" or rest_time .. " seconds" doPlayerSendCancel(cid, "You must wait " .. cooldown .. " to use again.") doSendMagicEffect(p, CONST_ME_POFF) return true end if current_hp >= (t.hp_pc/100)*max then doPlayerSendCancel(cid, "Your health must be " .. t.hp_pc .. "% or less to use.") doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerStorageValue(cid, stors.hearts) == -1 then setPlayerStorageValue(cid, stors.hearts, 6) end local current_hearts = getPlayerStorageValue(cid, stors.hearts) setPlayerStorageValue(cid, stors.hearts, current_hearts - 1) current_hearts = getPlayerStorageValue(cid, stors.hearts) local type = (current_hearts > 0.5*(t.max_coracoes) and MESSAGE_INFO_DESCR or MESSAGE_STATUS_WARNING) doPlayerSendTextMessage(cid, type, "Corações: [" ..current_hearts .. "/" .. t.max_coracoes .. "]") doTeleportThing(cid, t.new_pos) doSendMagicEffect(t.new_pos, CONST_ME_TELEPORT) if current_hearts == 0 then setPlayerStorageValue(cid, stors.daily_cooldown, mathtime(t.timetocooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.hearts, 6) else setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_used) + os.time()) if getPlayerStorageValue(cid, stors.daily_cooldown) ~= -1 then setPlayerStorageValue(cid, stors.daily_cooldown, -1) end end doCreateItem(v, 1, t.new_pos) addEvent(function() if isPlayer(cid) then doCleanTile(t.new_pos) doCreatureAddHealth(cid, max-current_hp) doTeleportThing(cid, p) doSendMagicEffect(p, CONST_ME_TELEPORT) end end, mathtime(t.timetoback)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." end Em actions.xml: <action itemid="ID_DO_ITEM" script="tpcoracao.lua" /> 2º - É um BUFF para aumentar o que? Skill? ML? Edite para o que você quiser. Você poderia fazer algo assim. Em talkactions/scripts: Mostrar conteúdo oculto Mostrar conteúdo oculto local t = { skills = {club = 25, sword = 25, axe = 25, distance = 25, shield = 25, ml = 50, duration = 7}} -- duration do BUFF em segundos local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, t.skills.duration*1000) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, t.skills.club) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, t.skills.sword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, t.skills.axe) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, t.skills.distance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, t.skills.shield) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, t.skills.ml) setConditionParam(condition, CONDITION_PARAM_BUFF, true) local name = "Rat" function onSay(cid, words, param, channel) local summons = getCreatureSummons(cid) if #summons ~= 2 then if param:lower() == "\""..name:lower() then doAddCondition(cid, condition) end doSummonMonster(cid, name) else doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return true end Em talkactions.xml: <talkaction words="utevo res" filter="word-spaced" event="script" value="NOMEDOSEUARQUIVO.lua"/> o primeiro é uma Spell nao uma Action Id ou seja o Player vai falar exemplo "Bilada" e sim acontece as coisas O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Postado Setembro 1, 2017 7 anos Em 01/09/2017 em 12:26, ZikaLord disse: Funciona assim Ao Usar com 15% de HP o player teleporta e naonde ele teleportou aparece um corpse "AO USAR" deixa subtendido action. Mostrar conteúdo oculto local t = { hp_pc = 15, -- % de hp para usar timetoback = {3, "sec"}, -- tempo para voltar cooldown_used = {5, "sec"}, -- cooldown ao usar o item cooldown_maxused = {3, "hour"}, -- quando usar max_coracoes vezes o cooldown aumenta para esse timetocooldown_maxused = {1, "day"}, -- tempo que ficará o cooldown aumentado max_coracoes = 6, new_pos = {x=1,y=1,z=1}, -- posição para onde será teleportado corpses = { [1] = 1111, -- id do corpo [2] = 2222, [3] = 3333, [4] = 4444} } -- só modifique se necessário local stors = {hearts = 16772, cooldown = 16773, daily_cooldown = 16774} function onCastSpell(cid, var) local p, v = getPlayerPosition(cid), t.corpses[getPlayerVocation(cid)] local current_hp, max = getCreatureHealth(cid), getCreatureMaxHealth(cid) if not v then return true end if getPlayerStorageValue(cid, stors.cooldown) - os.time() > 0 then daily = getPlayerStorageValue(cid, stors.daily_cooldown) - os.time() rest_time = getPlayerStorageValue(cid, stors.cooldown) - os.time() cooldown = daily > 0 and math.ceil(rest_time/3600) .. " hours" or rest_time .. " seconds" doPlayerSendCancel(cid, "You must wait " .. cooldown .. " to use again.") doSendMagicEffect(p, CONST_ME_POFF) return true end if current_hp >= (t.hp_pc/100)*max then doPlayerSendCancel(cid, "Your health must be " .. t.hp_pc .. "% or less to use.") doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerStorageValue(cid, stors.hearts) == -1 then setPlayerStorageValue(cid, stors.hearts, 6) end local current_hearts = getPlayerStorageValue(cid, stors.hearts) setPlayerStorageValue(cid, stors.hearts, current_hearts - 1) current_hearts = getPlayerStorageValue(cid, stors.hearts) local type = (current_hearts > 0.5*(t.max_coracoes) and MESSAGE_INFO_DESCR or MESSAGE_STATUS_WARNING) doPlayerSendTextMessage(cid, type, "Corações: [" ..current_hearts .. "/" .. t.max_coracoes .. "]") doTeleportThing(cid, t.new_pos) doSendMagicEffect(t.new_pos, CONST_ME_TELEPORT) if current_hearts == 0 then setPlayerStorageValue(cid, stors.daily_cooldown, mathtime(t.timetocooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.hearts, 6) else setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_used) + os.time()) if getPlayerStorageValue(cid, stors.daily_cooldown) ~= -1 then setPlayerStorageValue(cid, stors.daily_cooldown, -1) end end doCreateItem(v, 1, t.new_pos) addEvent(function() if isPlayer(cid) then doCleanTile(t.new_pos) doCreatureAddHealth(cid, max-current_hp) doTeleportThing(cid, p) doSendMagicEffect(p, CONST_ME_TELEPORT) end end, mathtime(t.timetoback)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." end Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
Postado Setembro 1, 2017 7 anos Autor Em 01/09/2017 em 17:25, Dwarfer disse: "AO USAR" deixa subtendido action. Mostrar conteúdo oculto Mostrar conteúdo oculto local t = { hp_pc = 15, -- % de hp para usar timetoback = {3, "sec"}, -- tempo para voltar cooldown_used = {5, "sec"}, -- cooldown ao usar o item cooldown_maxused = {3, "hour"}, -- quando usar max_coracoes vezes o cooldown aumenta para esse timetocooldown_maxused = {1, "day"}, -- tempo que ficará o cooldown aumentado max_coracoes = 6, new_pos = {x=1,y=1,z=1}, -- posição para onde será teleportado corpses = { [1] = 1111, -- id do corpo [2] = 2222, [3] = 3333, [4] = 4444} } -- só modifique se necessário local stors = {hearts = 16772, cooldown = 16773, daily_cooldown = 16774} function onCastSpell(cid, var) local p, v = getPlayerPosition(cid), t.corpses[getPlayerVocation(cid)] local current_hp, max = getCreatureHealth(cid), getCreatureMaxHealth(cid) if not v then return true end if getPlayerStorageValue(cid, stors.cooldown) - os.time() > 0 then daily = getPlayerStorageValue(cid, stors.daily_cooldown) - os.time() rest_time = getPlayerStorageValue(cid, stors.cooldown) - os.time() cooldown = daily > 0 and math.ceil(rest_time/3600) .. " hours" or rest_time .. " seconds" doPlayerSendCancel(cid, "You must wait " .. cooldown .. " to use again.") doSendMagicEffect(p, CONST_ME_POFF) return true end if current_hp >= (t.hp_pc/100)*max then doPlayerSendCancel(cid, "Your health must be " .. t.hp_pc .. "% or less to use.") doSendMagicEffect(p, CONST_ME_POFF) return true end if getPlayerStorageValue(cid, stors.hearts) == -1 then setPlayerStorageValue(cid, stors.hearts, 6) end local current_hearts = getPlayerStorageValue(cid, stors.hearts) setPlayerStorageValue(cid, stors.hearts, current_hearts - 1) current_hearts = getPlayerStorageValue(cid, stors.hearts) local type = (current_hearts > 0.5*(t.max_coracoes) and MESSAGE_INFO_DESCR or MESSAGE_STATUS_WARNING) doPlayerSendTextMessage(cid, type, "Corações: [" ..current_hearts .. "/" .. t.max_coracoes .. "]") doTeleportThing(cid, t.new_pos) doSendMagicEffect(t.new_pos, CONST_ME_TELEPORT) if current_hearts == 0 then setPlayerStorageValue(cid, stors.daily_cooldown, mathtime(t.timetocooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_maxused) + os.time()) setPlayerStorageValue(cid, stors.hearts, 6) else setPlayerStorageValue(cid, stors.cooldown, mathtime(t.cooldown_used) + os.time()) if getPlayerStorageValue(cid, stors.daily_cooldown) ~= -1 then setPlayerStorageValue(cid, stors.daily_cooldown, -1) end end doCreateItem(v, 1, t.new_pos) addEvent(function() if isPlayer(cid) then doCleanTile(t.new_pos) doCreatureAddHealth(cid, max-current_hp) doTeleportThing(cid, p) doSendMagicEffect(p, CONST_ME_TELEPORT) end end, mathtime(t.timetoback)*1000) return true end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1]*(60^(v == "day" and 2 or i-1))*(v == "day" and 24 or 1) end end return "Error: Bad declaration in mathtime function." end eu ultilizei mas nao funciona,nao aparece nem erro no console O rei de seu proprio destino é aquele que luta pela gloria do amanhã! Discord : ZoR#9373
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.