Ir para conteúdo

Anderson Sacani

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Anderson Sacani recebeu reputação de Wakon em [Revscripts][Spell] Sword Attack - Metin2   
    Boa tarde, eu estava de bobeira e criei uma magia com base em uma skill do Metin2. A magia se chama Sword Attack.
    Essa magia dá dano físico em uma pequena área à sua frente e também aplica o efeito de paralyze em seus inimigos.
    Essa magia possui um sistema de nível, então quanto maior o nível da magia, maior será o dano, maior será a probabilidade de paralizar o inimigo e maior será o gasto de mana.
    Testado hoje 17/11/2023 na versão mais atual do Canary
     
    Esse é o script:
     
    local config = { --[[ * addManaSpentSystem: In Metin2, there is no magic level system based on spent mana points, commonly known as addManaSpent. If you want the magic to increase the player's magic level, leave this option as true. * limitSkillCombatLevel: In Metin2, the maximum combat level with swords that a player can reach is 90; however, in Tibia, there is no such limit. This option is used to restrict the maximum damage that the magic will deal. * damageBasedOnSkillOnly: In Metin2, the damage of spells is solely based on the player's sword skill. In Tibia, however, the damage may also include the weapon's attack. * isDamageBasedOnSwords: In Metin2, only swords exist. In Tibia, there are swords, axes, and clubs. ]] addManaSpentSystem = false, limitSkillCombatLevel = true, damageBasedOnSkillOnly = true, isDamageBasedOnSwords = true, } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) combat:setArea(createCombatArea(AREA_WAVE6, AREADIAGONAL_WAVE6)) function onGetFormulaValues(player, skill, attack, factor) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local formula = spellLevel >= 4 and 25.333 or spellLevel >= 3 and 19.6 or spellLevel >= 2 and 15.333 or 9.333 if config.isDamageBasedOnSwords then skill = player:getSkillLevel(SKILL_SWORD) or 1 end if config.limitSkillCombatLevel then if skill > 90 then skill = 90 end end local damage = formula * skill * attack * 0.0175 if config.damageBasedOnSkillOnly then damage = formula * skill end return -damage, -damage end combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") local spell = Spell("instant") function spell.onCastSpell(creature, var) local player = Player(creature) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local mana = spellLevel >= 4 and 190 or spellLevel >= 3 and 138 or spellLevel >= 2 and 100 or 46 if player:getMana() < mana then player:sendCancelMessage("Not enough mana.") return false end player:addMana(-mana) if config.addManaSpentSystem then player:addManaSpent(mana) end local paralyzeChance = spellLevel >= 4 and 30 or spellLevel >= 3 and 23 or spellLevel >= 2 and 18 or 10 local targets = combat:getTargets(creature, var) for _, target in ipairs(targets) do if target:isCreature() then local condition = Condition(CONDITION_PARALYZE) condition:setParameter(CONDITION_PARAM_TICKS, 20000) condition:setFormula(-0.9, 0, -0.9, 0) if math.random(1, 100) <= paralyzeChance then target:addCondition(condition) target:say("OH, I'M SLOW!", TALKTYPE_MONSTER_SAY) end end end return true end spell:group("attack") spell:name("Sword Attack") spell:words("exori ico immo") spell:needDirection(true) spell:cooldown(20 * 1000) spell:groupCooldown(1 * 1000) spell:needWeapon(true) spell:needLearn(true) spell:vocation("knight;true", "elite knight;true") spell:register()  

    E aqui estão dois novos métodos que deverão adicionar à biblioteca para funcionar:
     
    SPELL_SWORD_ATTACK = 599961 function Player.getSpellLevelById(self, spellId) if self:isPlayer() then local storage = self:getStorageValue(spellId) local minValue, maxValue = 1, 4 if storage then storage = math.min(math.max(storage, minValue), maxValue) return storage else error("Invalid spellId in Player.getSpellLevelById.") end end error("Invalid player in Player.getSpellLevelById.") end function Player.setSpellLevelById(self, spellId, value) if self:isPlayer() then local minValue, maxValue = 1, 4 if value <= minValue then value = minValue elseif value >= maxValue then value = maxValue end self:setStorageValue(spellId, value) else error("Invalid player in Player.setSpellLevelById.") end end  
  2. Gostei
    Anderson Sacani recebeu reputação de Mateus Robeerto em [Revscripts][Spell] Sword Attack - Metin2   
    Boa tarde, eu estava de bobeira e criei uma magia com base em uma skill do Metin2. A magia se chama Sword Attack.
    Essa magia dá dano físico em uma pequena área à sua frente e também aplica o efeito de paralyze em seus inimigos.
    Essa magia possui um sistema de nível, então quanto maior o nível da magia, maior será o dano, maior será a probabilidade de paralizar o inimigo e maior será o gasto de mana.
    Testado hoje 17/11/2023 na versão mais atual do Canary
     
    Esse é o script:
     
    local config = { --[[ * addManaSpentSystem: In Metin2, there is no magic level system based on spent mana points, commonly known as addManaSpent. If you want the magic to increase the player's magic level, leave this option as true. * limitSkillCombatLevel: In Metin2, the maximum combat level with swords that a player can reach is 90; however, in Tibia, there is no such limit. This option is used to restrict the maximum damage that the magic will deal. * damageBasedOnSkillOnly: In Metin2, the damage of spells is solely based on the player's sword skill. In Tibia, however, the damage may also include the weapon's attack. * isDamageBasedOnSwords: In Metin2, only swords exist. In Tibia, there are swords, axes, and clubs. ]] addManaSpentSystem = false, limitSkillCombatLevel = true, damageBasedOnSkillOnly = true, isDamageBasedOnSwords = true, } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) combat:setArea(createCombatArea(AREA_WAVE6, AREADIAGONAL_WAVE6)) function onGetFormulaValues(player, skill, attack, factor) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local formula = spellLevel >= 4 and 25.333 or spellLevel >= 3 and 19.6 or spellLevel >= 2 and 15.333 or 9.333 if config.isDamageBasedOnSwords then skill = player:getSkillLevel(SKILL_SWORD) or 1 end if config.limitSkillCombatLevel then if skill > 90 then skill = 90 end end local damage = formula * skill * attack * 0.0175 if config.damageBasedOnSkillOnly then damage = formula * skill end return -damage, -damage end combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") local spell = Spell("instant") function spell.onCastSpell(creature, var) local player = Player(creature) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local mana = spellLevel >= 4 and 190 or spellLevel >= 3 and 138 or spellLevel >= 2 and 100 or 46 if player:getMana() < mana then player:sendCancelMessage("Not enough mana.") return false end player:addMana(-mana) if config.addManaSpentSystem then player:addManaSpent(mana) end local paralyzeChance = spellLevel >= 4 and 30 or spellLevel >= 3 and 23 or spellLevel >= 2 and 18 or 10 local targets = combat:getTargets(creature, var) for _, target in ipairs(targets) do if target:isCreature() then local condition = Condition(CONDITION_PARALYZE) condition:setParameter(CONDITION_PARAM_TICKS, 20000) condition:setFormula(-0.9, 0, -0.9, 0) if math.random(1, 100) <= paralyzeChance then target:addCondition(condition) target:say("OH, I'M SLOW!", TALKTYPE_MONSTER_SAY) end end end return true end spell:group("attack") spell:name("Sword Attack") spell:words("exori ico immo") spell:needDirection(true) spell:cooldown(20 * 1000) spell:groupCooldown(1 * 1000) spell:needWeapon(true) spell:needLearn(true) spell:vocation("knight;true", "elite knight;true") spell:register()  

    E aqui estão dois novos métodos que deverão adicionar à biblioteca para funcionar:
     
    SPELL_SWORD_ATTACK = 599961 function Player.getSpellLevelById(self, spellId) if self:isPlayer() then local storage = self:getStorageValue(spellId) local minValue, maxValue = 1, 4 if storage then storage = math.min(math.max(storage, minValue), maxValue) return storage else error("Invalid spellId in Player.getSpellLevelById.") end end error("Invalid player in Player.getSpellLevelById.") end function Player.setSpellLevelById(self, spellId, value) if self:isPlayer() then local minValue, maxValue = 1, 4 if value <= minValue then value = minValue elseif value >= maxValue then value = maxValue end self:setStorageValue(spellId, value) else error("Invalid player in Player.setSpellLevelById.") end end  
  3. Gostei
    Anderson Sacani recebeu reputação de Under em [Revscripts][Spell] Sword Attack - Metin2   
    Boa tarde, eu estava de bobeira e criei uma magia com base em uma skill do Metin2. A magia se chama Sword Attack.
    Essa magia dá dano físico em uma pequena área à sua frente e também aplica o efeito de paralyze em seus inimigos.
    Essa magia possui um sistema de nível, então quanto maior o nível da magia, maior será o dano, maior será a probabilidade de paralizar o inimigo e maior será o gasto de mana.
    Testado hoje 17/11/2023 na versão mais atual do Canary
     
    Esse é o script:
     
    local config = { --[[ * addManaSpentSystem: In Metin2, there is no magic level system based on spent mana points, commonly known as addManaSpent. If you want the magic to increase the player's magic level, leave this option as true. * limitSkillCombatLevel: In Metin2, the maximum combat level with swords that a player can reach is 90; however, in Tibia, there is no such limit. This option is used to restrict the maximum damage that the magic will deal. * damageBasedOnSkillOnly: In Metin2, the damage of spells is solely based on the player's sword skill. In Tibia, however, the damage may also include the weapon's attack. * isDamageBasedOnSwords: In Metin2, only swords exist. In Tibia, there are swords, axes, and clubs. ]] addManaSpentSystem = false, limitSkillCombatLevel = true, damageBasedOnSkillOnly = true, isDamageBasedOnSwords = true, } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) combat:setArea(createCombatArea(AREA_WAVE6, AREADIAGONAL_WAVE6)) function onGetFormulaValues(player, skill, attack, factor) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local formula = spellLevel >= 4 and 25.333 or spellLevel >= 3 and 19.6 or spellLevel >= 2 and 15.333 or 9.333 if config.isDamageBasedOnSwords then skill = player:getSkillLevel(SKILL_SWORD) or 1 end if config.limitSkillCombatLevel then if skill > 90 then skill = 90 end end local damage = formula * skill * attack * 0.0175 if config.damageBasedOnSkillOnly then damage = formula * skill end return -damage, -damage end combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") local spell = Spell("instant") function spell.onCastSpell(creature, var) local player = Player(creature) local spellLevel = player:getSpellLevelById(SPELL_SWORD_ATTACK) local mana = spellLevel >= 4 and 190 or spellLevel >= 3 and 138 or spellLevel >= 2 and 100 or 46 if player:getMana() < mana then player:sendCancelMessage("Not enough mana.") return false end player:addMana(-mana) if config.addManaSpentSystem then player:addManaSpent(mana) end local paralyzeChance = spellLevel >= 4 and 30 or spellLevel >= 3 and 23 or spellLevel >= 2 and 18 or 10 local targets = combat:getTargets(creature, var) for _, target in ipairs(targets) do if target:isCreature() then local condition = Condition(CONDITION_PARALYZE) condition:setParameter(CONDITION_PARAM_TICKS, 20000) condition:setFormula(-0.9, 0, -0.9, 0) if math.random(1, 100) <= paralyzeChance then target:addCondition(condition) target:say("OH, I'M SLOW!", TALKTYPE_MONSTER_SAY) end end end return true end spell:group("attack") spell:name("Sword Attack") spell:words("exori ico immo") spell:needDirection(true) spell:cooldown(20 * 1000) spell:groupCooldown(1 * 1000) spell:needWeapon(true) spell:needLearn(true) spell:vocation("knight;true", "elite knight;true") spell:register()  

    E aqui estão dois novos métodos que deverão adicionar à biblioteca para funcionar:
     
    SPELL_SWORD_ATTACK = 599961 function Player.getSpellLevelById(self, spellId) if self:isPlayer() then local storage = self:getStorageValue(spellId) local minValue, maxValue = 1, 4 if storage then storage = math.min(math.max(storage, minValue), maxValue) return storage else error("Invalid spellId in Player.getSpellLevelById.") end end error("Invalid player in Player.getSpellLevelById.") end function Player.setSpellLevelById(self, spellId, value) if self:isPlayer() then local minValue, maxValue = 1, 4 if value <= minValue then value = minValue elseif value >= maxValue then value = maxValue end self:setStorageValue(spellId, value) else error("Invalid player in Player.setSpellLevelById.") end end  
  4. Você Tentou
    Anderson Sacani recebeu reputação de Doidodepeda em Botar EXP no codigo da source antes do numeros   
    std::stringstream ss; ss << (uint64_t)gainExp; std::string expText = "EXP: " + ss.str(); g_game.addAnimatedText(getPosition(), (uint8_t)color, expText); }  
  5. Obrigado
    Anderson Sacani recebeu reputação de Doidodepeda em Botar EXP no codigo da source antes do numeros   
    Já leu o nome do método? onGainSharedExperience;
    Tente fazer modificações também em onGainExperience;
     
    void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied) { if(gainExp <= 0) return; if(master) { gainExp = gainExp / 2; master->onGainExperience(gainExp, fromMonster, multiplied); } else if(!multiplied) gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE); int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR); if(color < 0) color = random_range(0, 255); std::stringstream ss; ss << "Exp: " << (uint64_t)gainExp; g_game.addAnimatedText(getPosition(), (uint8_t)color, ss.str()); }  
  6. Curtir
    Anderson Sacani recebeu reputação de Pedro. em [AJUDA] Summon que explode   
    Quer tirar a prova real se irá funcionar ou não?

    Ta aqui:

     
    function onDeath(creature, corpse, killer) local creatureName = getCreatureName(creature) print(creatureName .. " died.") if isSummon(creature) then print(creatureName .. " is a summon.") else print(creatureName .. " is not a summon.") end return true end  
    Sempre faça depuração de um código quando há dúvidas. Registra esse script no summon e vai perceber que nenhum print aparecerá, porque ele não morre.
  7. Gostei
    Refiz teu script:

     
    function onUse(cid, item, frompos, item2, topos) local dexsoftCoinId = 6535 if getPlayerItemCount(cid, dexsoftCoinId) < 1 then doPlayerSendCancel(cid, "Voce precisa de 1 DexSoft Coin para comprar!") return true end doPlayerRemoveItem(cid, dexsoftCoinId, 1) doPlayerAddItem(cid, 7881, 1) doSendMagicEffect(topos, 14) doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " comprou donate axe", MESSAGE_STATUS_CONSOLE_BLUE) return true end  
  8. Curtir
    Eu só usaria o stopEvent caso não estivesse verificando a storage do player, nesse caso não há necessidade.
    E agora um detalhe muito importante: Sempre que usar addEvent com player, é bom criar condição para verificar se ele está online, caso contrário o servidor poderá crashar.

     
    local MAX_HEAL_LEVEL = 717217 local STORAGE_VALUE = 98910 local HEAL_INTERVAL = 4 * 1000 local HEAL_AMOUNT = 1000000000 local HEAL_TEXT = "|ROX|..." function doHealPlayer(cid) if not cid or not isPlayer(cid) then return true end if getPlayerStorageValue(cid, STORAGE_VALUE) == 1 then doCreatureAddHealth(cid, HEAL_AMOUNT) doPlayerAddMana(cid, HEAL_AMOUNT) doSendAnimatedText(getCreaturePos(cid), HEAL_TEXT, 138) doSendMagicEffect(getCreaturePosition(cid), 53) addEvent(doHealPlayer, HEAL_INTERVAL, cid) end return true end function onStepIn(cid, item, position, lastPosition, fromPosition) if getPlayerLevel(cid) >= MAX_HEAL_LEVEL then doPlayerSendCancel(cid, "Você já está acima do nível " .. MAX_HEAL_LEVEL .. ", portanto não será curado.") return true end setPlayerStorageValue(cid, STORAGE_VALUE, 1) doHealPlayer(getPlayerGUID(cid)) return true end function onStepOut(cid, item, position, lastPosition, fromPosition) setPlayerStorageValue(cid, STORAGE_VALUE, 0) return true end  
  9. Curtir
    Anderson Sacani recebeu reputação de Aragllov em [AJUDA] ADICIONAR MAGIC EFFECT EM SCRIPT   
    O problema provavelmente é porque não está passando o local em que será reproduzido o efeito mágico.
    No caso tem que ser assim: doSendMagicEffect(positions[i].pos, CONST_ME_POFF)
     
    O parâmetro que coloquei "positions[i].pos" retorna a posição criada dentro da variável positions, e como o efeito foi colocado dentro de uma estrutura de repetição, servirá para qualquer outra posição que adicionar após o primeiro índice.
     
    -- EditeD by: Yuri -- Passagem Secreta BOSS: Sunfyre the Golden local positions = { [1] = { pos = { x = 33295, y = 32779, z = 7 }, id = 419, toid = 411 } } local tempo = 15 function onUse(cid, item, frompos, item2, topos) if getTileItemById(positions[1].pos, positions[1].id).uid < 100 then doPlayerSendTextMessage(cid, 19, "Is already open.") return true end doPlayerSendTextMessage(cid, 19, "The passage will close in " .. tempo .. " seconds.") function criar_paredes(buff) for i = 1, #positions do if i <= (#positions / 2) then doCreateItem(positions[i].id, 1, positions[i].pos) doRemoveItem(obst, 1) elseif i > (#positions / 2) then local obst = getTileItemById(positions[i].pos, positions[i].toid).uid doTransformItem(obst, positions[i].id) end end return true end for i = 1, #positions do local obst = getTileItemById(positions[i].pos, positions[i].id).uid if i <= (#positions / 2) and obst ~= 0 then doRemoveItem(obst, 1) doSendMagicEffect(positions[i].pos, CONST_ME_POFF) elseif i > (#positions / 2) and obst ~= 0 then doTransformItem(obst, positions[i].toid) end end addEvent(criar_paredes, tempo * 1000) return true end  
    Eu alterei o script que o @Aragllov passou, por tanto, o efeito só vai aparecer quando a pedra for removida.
    Eu deixei o script um pouco menor, porque vi muitas coisas desnecessárias:
     
    local position = { x = 33295, y = 32779, z = 7 } local ladder_id = 419 function onUse(cid, item, fromPosition, itemEx, toPosition) local ladderItem = getTileItemById(position, ladder_id) if ladderItem then doRemoveItem(ladderItem.uid, 1) doSendMagicEffect(position, CONST_ME_POFF) else doCreateItem(ladder_id, 1, position) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) addEvent(function() local ladderItem = getTileItemById(position, ladder_id) if ladderItem then doRemoveItem(ladderItem.uid, 1) doSendMagicEffect(position, CONST_ME_POFF) end end, 15000) end return true end  
  10. Curtir
    Anderson Sacani recebeu reputação de L3K0T em Revscripts | SD que bate mais durante a noite   
    Bom dia!
    Estava de bobeira agora pela manhã e resolvi brincar um pouco.
    Criei um script de SD no qual se for noite, ela retornará um valor X de dano, e, se for dia, ela retornará um valor Y de dano.
    Estou compartilhando esse script para vocês terem como base e usarem até mesmo em outros:
     
    local config = { damageDay = { min = 0.70, max = 0.75 }, damageNight = { min = 0.95, max = 1 }, hourStartDay = 6, hourEndDay = 18 } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function onGetFormulaValues(player, level, maglevel) local min, max = ((level / 5) + (maglevel * 4.605)), ((level / 5) + (maglevel * 7.395)) local hour = tonumber(os.date("%H", os.time())) -- Obtém a hora atual -- Define o valor do dano com base na hora do dia if hour >= config.hourStartDay and hour < config.hourEndDay then -- Dia min = min * config.damageDay.min max = max * config.damageDay.max else -- Noite min = min * config.damageNight.min max = max * config.damageNight.max end return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local rune = Spell("rune") function rune.onCastSpell(creature, var, isHotkey) return combat:execute(creature, var) end rune:group("attack") rune:name("sudden death rune") rune:runeId(3155) rune:allowFarUse(true) rune:charges(3) rune:level(45) rune:magicLevel(15) rune:cooldown(2 * 1000) rune:groupCooldown(2 * 1000) rune:needTarget(true) rune:isBlocking(true) -- True = Solid / False = Creature rune:register()  
  11. Curtir
    Anderson Sacani recebeu reputação de Bruxo Ots em Revscripts | SD que bate mais durante a noite   
    Bom dia!
    Estava de bobeira agora pela manhã e resolvi brincar um pouco.
    Criei um script de SD no qual se for noite, ela retornará um valor X de dano, e, se for dia, ela retornará um valor Y de dano.
    Estou compartilhando esse script para vocês terem como base e usarem até mesmo em outros:
     
    local config = { damageDay = { min = 0.70, max = 0.75 }, damageNight = { min = 0.95, max = 1 }, hourStartDay = 6, hourEndDay = 18 } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function onGetFormulaValues(player, level, maglevel) local min, max = ((level / 5) + (maglevel * 4.605)), ((level / 5) + (maglevel * 7.395)) local hour = tonumber(os.date("%H", os.time())) -- Obtém a hora atual -- Define o valor do dano com base na hora do dia if hour >= config.hourStartDay and hour < config.hourEndDay then -- Dia min = min * config.damageDay.min max = max * config.damageDay.max else -- Noite min = min * config.damageNight.min max = max * config.damageNight.max end return -min, -max end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local rune = Spell("rune") function rune.onCastSpell(creature, var, isHotkey) return combat:execute(creature, var) end rune:group("attack") rune:name("sudden death rune") rune:runeId(3155) rune:allowFarUse(true) rune:charges(3) rune:level(45) rune:magicLevel(15) rune:cooldown(2 * 1000) rune:groupCooldown(2 * 1000) rune:needTarget(true) rune:isBlocking(true) -- True = Solid / False = Creature rune:register()  
  12. Curtir
    Tem certeza que o 
    CONST_ME_MAGIC_YALAHARIGHOST Existe no teu servidor?
  13. Gostei
    Anderson Sacani recebeu reputação de Aksz em Estatua que nasce Monstro   
    --[[ Observação: No mapa colocar o uid 5032 na estátua que dará recompensa No mapa colocar o uid 5033 na estátua que teleportará o jogador para dentro da sala ]] local config = { reward = { id = 2152, amount = 50 }, playerLevel = 100, playerTeleportTo = { x = 100, y = 100, z = 7 }, checkArea = { fromPosition = { x = 100, y = 100, z = 7 }, toPosition = { x = 100, y = 100, z = 7 } }, monsterName = "Papao", monsterSpawnPosition = { x = 100, y = 100, z = 7 }, exitPosition = { x = 100, y = 100, z = 7 }, time = 5, } function onUse(cid, item, frompos, item2, topos) if item.uid == 5032 then local storage = 1164372809 if getPlayerStorageValue(cid, storage) < 1 then setPlayerStorageValue(cid, storage, 1) doPlayerAddItem(cid, config.reward.id, config.reward.amount) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce foi recompensado com 5000 gold coins.") end doTeleportThing(cid, config.exitPosition, false) end if item.uid == 5033 then local storage, fromPos, toPos = 6431953401, config.checkArea.fromPosition, config.checkArea.toPosition local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) local monster_, player_ = 0, 0 for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do local pid = getTopCreature({ x = x, y = y, z = z }).uid if ((isMonster(pid)) and (getCreatureName(pid) == config.monsterName)) then monster_ = monster_ + 1 end if isPlayer(pid) then player_ = player_ + 1 end end end end if ((getPlayerLevel(cid) < config.playerLevel) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Precisa ter pelo menos nivel " .. config.playerLevel) return true end if ((check < 0) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Faz menos de " .. config.time .. " minutos que voce enfrentou o monstro.") return true end if ((player_ > 0) and (getPlayerAccess(cid) < 3)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Alguem esta na sala!") return true end if monster_ < 1 then doSummonCreature(config.monsterName, config.monsterSpawnPosition) end doTeleportThing(cid, config.playerTeleportTo, false) setPlayerStorageValue(cid, storage, (now + (60 * config.time))) end return true end  
  14. Curtir
    Anderson Sacani deu reputação a yuriowns em Script para Pesca Simples   
    funcionou certinho, obrigado! rep+
  15. Curtir
    Anderson Sacani recebeu reputação de yuriowns em Script para Pesca Simples   
    local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doSendMagicEffect(topos, CONST_ME_LOSEENERGY) doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end  
  16. Obrigado
    Anderson Sacani recebeu reputação de Straikar em Estatua que nasce Monstro   
    Atualizei o script a cima, agora removi todos os bugs. está 100% funcional!
  17. Obrigado
    Só alterar o script da gema para este:
    local config = { itemId = 2154, vocationId_1 = 2, -- Sorcerer vocationId_2 = 6, -- Master sorcerer vocationName = "Mage", } function onUse(cid, item, fromPosition, itemEx, toPosition) local itemId, amount = config.itemId, 1 local storage, getItemName = 6318964231, getItemNameById(itemId) if not ((getPlayerVocation(cid) == config.vocationId_1) or (getPlayerVocation(cid) == config.vocationId_2)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Para usar a gema voce precisa ser um " .. config.vocationName) return true end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce ja usou uma " .. getItemName) return true end doRemoveItem(item.uid, amount) setPlayerStorageValue(cid, storage, 1) return true end  
    E criar um novo creaturescript para login, com esse algorítmo:
    local text = "´ . ,", ". ´ ,", "` . ,", ", ` ." local function effect(cid) local storage = 6318964231 if isPlayer(cid) then if getPlayerStorageValue(cid, storage) > 0 then doCreatureSay(cid, text, TALKTYPE_ORANGE_1) end addEvent(effect, 1000, cid) end end function onLogin(cid) effect(cid) return true end  
  18. Curtir
    Anderson Sacani recebeu reputação de kkaneki13 em [AJUDA] Bomberman   
    Eu achei algo do tipo, mas não tenho certeza se é o que precisa.
    Talkactions.xml:
    <talkaction words="z;Z" event="script" value="bomb.lua"/> bomb.lua:
    function getPlayersInRange(position, radiusx, radiusy) local creaturesList = {} for x = -radiusx, radiusx do for y = -radiusy, radiusy do if not (x == 0 and y == 0) then local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z}) if creature.type == 1 then table.insert(creaturesList, creature.uid) end end end end local creature = getTopCreature(position) if creature.type == 1 then if not(table.find(creaturesList, creature.uid)) then table.insert(creaturesList, creature.uid) end end return creaturesList end function isPositionInArray(haystack, needle) for i = 1, #haystack do if haystack[i].x == needle.x and haystack[i].y == needle.y and haystack[i].z == needle.z then return true end end return false end local t = { from = {x=490, y=495, z=9}, to = {x=504, y=505, z=9}, storage = { placed = 10001, max = 10002, radius = 10003 }, delay = 3000, bombID = 10570, effect = CONST_ME_FIREAREA, blockID = 9468, text = "BOOM!", temple = {x=498, y=541, z=9}, exceptions = { {x=490, y=495, z=9}, {x=491, y=495, z=9}, {x=490, y=496, z=9}, {x=503, y=495, z=9}, {x=504, y=495, z=9}, {x=504, y=496, z=9}, {x=490, y=505, z=9}, {x=491, y=505, z=9}, {x=490, y=504, z=9}, {x=503, y=505, z=9}, {x=504, y=505, z=9}, {x=504, y=504, z=9} } } function reset() local dummy = doCreateItem(10570, 1, {x=486,y=498,z=9}) for x = t.from.x, t.to.x do for y = t.from.y, t.to.y do local pos = {x=x,y=y,z=t.from.z} local i1, i2, i3 = getTileItemById(pos, 8304).uid, getTileItemById(pos, 8306).uid, getTileItemById(pos, 8310).uid if i1 > 0 then doRemoveItem(i1) end if i2 > 0 then doRemoveItem(i2) end if i3 > 0 then doRemoveItem(i3) end if queryTileAddThing(dummy, pos, 4) == RETURNVALUE_NOERROR and not isPositionInArray(t.exceptions, pos) then doCreateItem(t.blockID, 1, pos) end end end doRemoveItem(dummy) end local function boom(pos, cid) local v = getTileItemById(pos, t.bombID).uid if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1) doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos) doSendMagicEffect(pos, t.effect) local c = getTopCreature(pos).uid if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS) doTeleportThing(c, t.temple) doSendMagicEffect(t.temple, CONST_ME_MORTAREA) local n1, n2 = getPlayerName(c), getPlayerName(cid) doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING) local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5) if #a < 2 then doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING) doPlayerAddLevel(a[1], 1) doTeleportThing(a[1], t.temple) doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED) reset() reset() end else local b = getTileItemById(pos, t.blockID).uid if b > 0 then doSendMagicEffect(pos, CONST_ME_BLOCKHIT) doRemoveItem(b) local r = math.random(10) if r < 4 then doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos) end end end local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius) function loopDir(dir) local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z} if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then doSendMagicEffect(_pos, t.effect) local c = getTopCreature(_pos).uid if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS) doTeleportThing(c, t.temple) doSendMagicEffect(t.temple, CONST_ME_MORTAREA) local n1, n2 = getPlayerName(c), getPlayerName(cid) doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING) local a = getPlayersInRange({x=497, y=500, z=9}, 7, 5) if #a < 2 then doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING) doPlayerAddLevel(a[1], 1) doTeleportThing(a[1], t.temple) doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED) reset() reset() return "endgame" end else local b = getTileItemById(_pos, t.blockID).uid if b > 0 then doSendMagicEffect(_pos, CONST_ME_BLOCKHIT) doRemoveItem(b) local r = math.random(10) if r < 4 then doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos) end return false end end elseif queryTileAddThing(v, _pos, 4) == 3 then return false end return true end while N <= l do local q = loopDir("N") if q == "endgame" then return doRemoveItem(v, 1) elseif not q then break else N = N + 1 end end while E <= l do local q = loopDir("E") if q == "endgame" then return doRemoveItem(v, 1) elseif not q then break else E = E + 1 end end while W <= l do local q = loopDir("W") if q == "endgame" then return doRemoveItem(v, 1) elseif not q then break else W = W + 1 end end while S <= l do local q = loopDir("S") if q == "endgame" then return doRemoveItem(v, 1) elseif not q then break else S = S + 1 end end end doRemoveItem(v, 1) end function onSay(cid, words, param, channel) if isInRange(getThingPos(cid), t.from, t.to) then setPlayerStorageValue(cid, t.storage.placed, math.max(getPlayerStorageValue(cid, t.storage.placed), 0)) setPlayerStorageValue(cid, t.storage.max, math.max(getPlayerStorageValue(cid, t.storage.max), 1)) setPlayerStorageValue(cid, t.storage.radius, math.max(getPlayerStorageValue(cid, t.storage.radius), 1)) if getPlayerStorageValue(cid, t.storage.placed) < getPlayerStorageValue(cid, t.storage.max) then doCreateItem(t.bombID, 1, getThingPos(cid)) addEvent(boom, t.delay, getThingPos(cid), cid) setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) + 1) end return true end end lever.lua:
    function getPlayersInRange(position, radiusx, radiusy) local creaturesList = {} for x = -radiusx, radiusx do for y = -radiusy, radiusy do if not (x == 0 and y == 0) then local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z}) if creature.type == 1 then table.insert(creaturesList, creature.uid) end end end end local creature = getTopCreature(position) if creature.type == 1 then if not(table.find(creaturesList, creature.uid)) then table.insert(creaturesList, creature.uid) end end return creaturesList end local t, n, storage = { {x=496, y=537, z=9}, {x=497, y=537, z=9}, {x=498, y=537, z=9}, {x=499, y=537, z=9} }, { {x=490, y=495, z=9}, {x=504, y=505, z=9}, {x=504, y=495, z=9}, {x=490, y=505, z=9} }, { placed = 10001, max = 10002, radius = 10003 } function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1946 then return doTransformItem(item.uid, item.itemid - 1) end local v = getPlayersInRange({x=497, y=500, z=9}, 7, 5) if #v > 0 then return doPlayerSendCancel(cid, "Please wait for the current match to end.") end local players = {} for i = 1, #t do local v = getTopCreature(t[i]).uid players[i] = isPlayer(v) and v or nil end if #players < 2 then return doPlayerSendCancel(cid, "You need at least 2 players to enter.") end local first = players[1] and 1 or players[2] and 2 or players[3] and 3 or players[4] and 4 for i = 1, 4 do if players[i] then setPlayerStorageValue(players[i], storage.placed, 0) setPlayerStorageValue(players[i], storage.max, 1) setPlayerStorageValue(players[i], storage.radius, 1) doSendMagicEffect(t[i], CONST_ME_TELEPORT) doTeleportThing(players[i], n[i]) doSendMagicEffect(n[i], CONST_ME_TELEPORT) end end doTransformItem(item.uid, item.itemid + 1) return true end items.xml:
    <item id="2195" name="boots of haste"> <attribute key="weight" value="750" /> <attribute key="slotType" value="feet" /> <attribute key="speed" value="40" /> <attribute key="showattributes" value="1" /> <attribute key="showduration" value="1" /> <attribute key="decayTo" value="0" /> <attribute key="duration" value="30" /> </item> ... <item id="8304" name="eternal flames"> <attribute key="moveable" value="0" /> </item> ... <item id="8306" name="pure energy"> <attribute key="moveable" value="0" /> </item> ... <item id="8310" name="neutral matter"> <attribute key="moveable" value="0" /> </item> ... <item id="10570" article="a" name="war crystal"> <attribute key="moveable" value="0" /> </item> powerups.lua
    local t = { from = {x=490, y=495, z=9}, to = {x=504, y=505, z=9}, storage = { max = 10002, radius = 10003 } } function onStepIn(cid, item, pos, fromPos) if isInRange(pos, t.from, t.to) then if item.itemid == 8304 then local n = getPlayerStorageValue(cid, t.storage.max) if n < 3 then setPlayerStorageValue(cid, t.storage.max, n + 1) doRemoveItem(item.uid) doSendMagicEffect(pos, CONST_ME_FIREATTACK) end elseif item.itemid == 8306 then local n = getPlayerSlotItem(cid, CONST_SLOT_FEET) if n.itemid ~= 2195 then doPlayerAddItem(cid, 2050, 1) doPlayerAddItem(cid, 2050, 1) doPlayerAddItem(cid, 2050, 1) doDecayItem(doPlayerAddItem(cid, 2195, 1)) doPlayerRemoveItem(cid, 2050, 1) doPlayerRemoveItem(cid, 2050, 1) doPlayerRemoveItem(cid, 2050, 1) doRemoveItem(item.uid) doSendMagicEffect(pos, CONST_ME_ENERGYHIT) end elseif item.itemid == 8310 then local n = getPlayerStorageValue(cid, t.storage.radius) if n < 4 then setPlayerStorageValue(cid, t.storage.radius, n + 1) doRemoveItem(item.uid) doSendMagicEffect(pos, CONST_ME_GROUNDSHAKER) end end end end bombtiles.lua:
    function onStepIn(cid, item, pos, fromPos) if math.abs(pos.x - fromPos.x) == math.abs(pos.y - fromPos.y) then if item.actionid == 100 then doItemSetAttribute(item.uid, "aid", 0) else doItemSetAttribute(getTileItemById(fromPos, 10764).uid, "aid", 100) doTeleportThing(cid, fromPos, false) end end end function onAddItem(moveItem, tileItem, position, cid) if not isInArray({8304, 8306, 8310, 9468, 10570}, moveItem.itemid) then doRemoveItem(moveItem.uid) end end movements.xml:
    <movevent type="StepIn" itemid="10764" event="script" value="bombtiles.lua"/> <movevent type="AddItem" itemid="10764" tileitem="1" event="script" value="bombtiles.lua"/> <movevent type="StepIn" itemid="8304" event="script" value="powerups.lua"/> <movevent type="StepIn" itemid="8306" event="script" value="powerups.lua"/> <movevent type="StepIn" itemid="8310" event="script" value="powerups.lua"/>  
    Apenas pesquisei e postei aqui para ajudar.
    Não testei e os créditos dos scripts vão para Ancores.
  19. Curtir
    Anderson Sacani recebeu reputação de yuriowns em (Resolvido)Change Name Scroll   
    local scrollId = 1234 function onSay(cid, words, param) if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'To use the command: !changename "NEW_NAME') return false end if getPlayerItemCount(cid, scrollId) < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need a ' .. getItemNameById(scrollId)) return false end if getTilePzInfo(getPlayerPosition(cid)) ~= true then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can only use this command in a protected area.') return false end doPlayerRemoveItem(cid, scrollId, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '" .. param .. "' WHERE `id` = " .. guid .. ";") doRemoveCreature(guid) return true end  
    Achei um script bem mais completo do que esse que criei:
    local config = { item = {Id = 1111, count = 0}, paramBlacklist = {"account manager", "god", "tutor", "tester"}, kick = {enabled = true, delay = 2 * 1000}, forceLogout = false, namelockCheck = true, vowelsCheck = true, maxTextLenght = 29, minWordLenght = 2, maxWordLenght = 14, maxWords = 3 } config.kick.enabled = getBooleanFromString(config.kick.enabled) config.forceLogout = getBooleanFromString(config.forceLogout) config.namelockCheck = getBooleanFromString(config.namelockCheck) config.vowelsCheck = getBooleanFromString(config.vowelsCheck) function onSay(cid, words, param, channel) local t = string.explode(param, ",") local len, firstWord, wordCount, textCancel, limit = string.len(tostring(t[1])), true, 0, '', ";" if(getConfigValue('sqlType') == 'mysql') then limit = db.updateLimiter() end if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") elseif(getPlayerGUIDByName(t[1], true) ~= nil) then textCancel = "That name is already in use." elseif(getPlayerItemCount(cid, config.item.Id) < config.item.count) then textCancel = "You do not fulfill the requirements." elseif(not getTilePzInfo(getCreaturePosition(cid))) then textCancel = "You must be inside a protection zone to use this command." elseif(len > config.maxTextLenght) then textCancel = "A name must have at least " .. config.minWordLenght .. " but no more than " .. config.maxTextLenght .. " letters!" elseif(config.namelockCheck and db.getResult("SELECT * FROM `player_namelocks` WHERE `name` = " .. db.escapeString(t[1]) .. "" .. limit .. ""):getID() ~= 1) then textCancel = "That name is namelocked." elseif(string.find(t[1]:lower(), "[^%l%s]") ~= nil) then textCancel = "This name contains invalid letters. Please use only A-Z, a-z and space!" else paramTemp = '' for word in string.gmatch(t[1], "%a+") do len, wordCount = string.len(word), wordCount + 1 if(isInArray(config.paramBlacklist, paramTemp:lower())) then textCancel = "Invalid name entry." break elseif(len < config.minWordLenght) then textCancel = "This name contains a word with only " .. len .. " letter" .. (len > 1 and "s" or '') .. ". Please use more than " .. len .. " letter" .. (len > 2 and "s" or '') .. " for each word!" break elseif(len > config.maxWordLenght) then textCancel = "This name contains a word that is too long. Please use no more than " .. config.maxWordLenght .. " letters for each word!" break elseif(wordCount > config.maxWords) then textCancel = "This name contains more than 3 words. Please choose another name!" break elseif(config.vowelsCheck and string.find(word:lower(), "[aeiouy]") == nil) then textCancel = "This name contains a word without vowels. Please choose another name!" break else wordTemp = '' for i = 1, len do letter = string.sub(word, i, i) if(i == 1) then if(getBooleanFromString(firstWord) and string.find(letter, "%l")) then letter = string.upper(letter) end else if(string.find(letter, "%u")) then letter = string.lower(letter) end end firstWord = false wordTemp = "" .. wordTemp .. "" .. letter .. "" end end paramTemp = "" .. paramTemp .. "" .. (paramTemp ~= '' and " " or '') .. "" .. wordTemp .. "" end end if(textCancel ~= '') then doPlayerSendCancel(cid, textCancel) return true end local oldName, guid = getCreatureName(cid), getPlayerGUID(cid) t[1] = paramTemp doPlayerRemoveItem(cid, config.item.Id, config.item.count) if(pcall(doPlayerChangeName, guid, oldName, t[1]) ~= true) then db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. db.escapeString(t[1]) .. ", " .. os.time() .. ");") db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(t[1]) .. " WHERE `id` = " .. guid .. "" .. limit .. "") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your name has been changed successfully." .. (config.kick.enabled and " You will be kicked in " .. config.kick.delay / 1000 .. " seconds." or " Re-enter the game to see the changes.") .. "") if(config.kick.enabled) then addEvent(function(cid, forceLogout) if(isPlayer(cid)) then doRemoveCreature(cid, forceLogout) end end, config.kick.delay, cid, config.forceLogout) end return true end  
    A parte do .xml fica assim:
    <talkaction log="yes" words="!changename;/changename;!namechange;/namechange" access="0" event="script" value="changename.lua"/>  
     
  20. Gostei
    No config.lua, como está a parte do SQL? Mostra aqui pra nós
  21. Curtir
    local config = { fromPosition = { x = 100, y = 100, z = 6 }, toPosition = { x = 1000, y = 1000, z = 8 }, } local players = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), config.fromPosition, config.toPosition) then table.insert(players, cid) end end print(#players)  
    Explicando:
    Imprimirá no console do teu otserv, a quantidade de pessoas presentes em determinada área, fromPosition, toPosition.
  22. Gostei
    Anderson Sacani recebeu reputação de carloos em storage que dura 48h   
    Ao invés de usar function onDeath, eu usaria o function onKill, e desta maneira:
    local monster = { [1] = { name = "Energy Soul", storage = 6640 }, [2] = { name = "Mazoran", storage = 6641 }, [3] = { name = "Brother Freeze", storage = 6642 }, [4] = { name = "Fleshcrawler", storage = 6643 }, } function onKill(cid, target, lastHit) local time = os.time() if not isPlayer(target) then for i = 1, #monster, 1 do local name, storage = monster[i].name, monster[i].storage if getCreatureName(target) == name then if getPlayerStorageValue(cid, storage) <= time then setPlayerStorageValue(cid, storage, time + (48 * 60 * 60)) doCreatureSay(cid, "I killed the " .. name .. "!", TALKTYPE_ORANGE_1) end end end end return true end  
  23. Obrigado
    Anderson Sacani recebeu reputação de koyotestark em Adicionar uma nova categoria no spells.xml   
    Já testou? Caso não tenha testado, por favor teste.
    Existe 2 outras possibilidades. Uma é em C++ e a outra é em Lua, porém a opção em Lua é mais trabalhosa já que precisará de uma tabela
    No caso da solução em lua, terá que completar a tabela:
    local list = { [1] = { spellName = "Berserk", spellType = "AREA" }, [2] = { spellName = "Heal Friend", spellType = "HEAL" }, } function onUse(cid, item, fromPosition, itemEx, toPosition) local t, spelltype = {}, "" for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if (spell.level ~= 0) then if (spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if (prevLevel ~= spell.level) then if (i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end for i = 1, #list do if spell.name == list[i].spellName then spelltype = list[i].spellType end end text = text .. line .. " " .. spell.words .. " - " .. spell.name .. "(" .. spelltype .. ") : " .. spell.mana .. "\n" end doShowTextDialog(cid, item.itemid, text) return true end  
  24. Curtir
    Anderson Sacani recebeu reputação de Maahzeera em Spell Cura   
    Este funcionará perfeitamente:
    local config = { heal = 500, -- Quanto irá curar? Obs.: Valor fixo. } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(cid, level, maglevel) local max = config.heal local min = max return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end  
  25. Obrigado
    Anderson Sacani recebeu reputação de raphadoidera em Puxar alavanca e abrir um teleport.   
    local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) local leverId = 10030 if item.itemid == leverId then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) doTransformItem(item.uid, leverId) end, 5 * 60 * 1000) doTransformItem(item.uid, leverId - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end  

Informação Importante

Confirmação de Termo