Ir para conteúdo

Sacani

Campones
  • Total de itens

    12
  • Registro em

  • Última visita

Sobre Sacani

Informações

  • Forma que conheci o xTibia
    Otservs
  • Sou
    Programador

Últimos Visitantes

270 visualizações

Sacani's Achievements

  1. Criei um script do 0 para as poções: local potions = { [266] = { -- Health Potion minHeal = 50, maxHeal = 100, emptyVial = 2874 }, [268] = { -- Mana Potion minMana = 25, maxMana = 75, emptyVial = 2874 } } function onUse(cid, item, fromPosition, itemEx, toPosition) local target = itemEx.uid local potion = potions[item.itemid] if not isPlayer(target) or isMonster(target) or isNpc(target) then return false end if potion then if potion.minHeal then local healAmount = math.random(potion.minHeal, potion.maxHeal) doCreatureAddHealth(target, healAmount) elseif potion.minMana then local manaAmount = math.random(potion.minMana, potion.maxMana) doCreatureAddMana(target, manaAmount) end doCreatureSay(target, "Ahhhh!", TALKTYPE_MONSTER_SAY) local exhaustStorage = 6499135761 local exhaustTime = os.time() + 1 if getPlayerStorageValue(cid, exhaustStorage) <= exhaustTime then setPlayerStorageValue(cid, exhaustStorage, exhaustTime) doSendMagicEffect(getPlayerPosition(target), CONST_ME_MAGIC_BLUE) doPlayerRemoveItem(cid, item.uid, 1) doPlayerAddItem(cid, potion.emptyVial, 1) else doPlayerSendCancel(cid, "You are exhausted and cannot use this potion yet.") end end return true end Está bem fácil de configurar, é só adicionar mais poções na tabela "potions"
  2. Já tentou colocar a blank rune na mão? Não sei qual versão do teu otserv, mas antigamente precisava.
  3. Melhor não fazer da forma que você pediu, porque alguém pode colocar uma knife e bater em full def pra dar apenas 1 de dano e dropar gold ou platinum. A maneira mais segura, é fazer com que a quantidade de gold dropada, seja equivalente à quantidade de vida perdida: local mType = Game.createMonsterType("Treasure Bandit") local monster = {} monster.description = "a treasure bandit" monster.experience = 600 monster.outfit = { lookType = 129, lookHead = 58, lookBody = 40, lookLegs = 24, lookFeet = 95, lookAddons = 0, lookMount = 0 } monster.raceId = 223 monster.Bestiary = { class = "Human", race = BESTY_RACE_HUMAN, toKill = 500, FirstUnlock = 25, SecondUnlock = 250, CharmsPoints = 5, Stars = 2, Occurrence = 0, Locations = "Pode ser encontrado nas redondezas de Mortland." } monster.health = 1200 monster.maxHealth = 1200 monster.race = "blood" monster.corpse = 18050 monster.speed = 180 monster.manaCost = 450 monster.changeTarget = { interval = 5000, chance = 0 } monster.strategiesTarget = { nearest = 30, health = 10, damage = 10, random = 50, } monster.flags = { summonable = false, attackable = true, hostile = true, convinceable = false, pushable = false, rewardBoss = false, illusionable = true, canPushItems = true, canPushCreatures = true, staticAttackChance = 90, targetDistance = 4, runHealth = 240, healthHidden = false, isBlockable = false, canWalkOnEnergy = true, canWalkOnFire = true, canWalkOnPoison = true } monster.light = { level = 0, color = 0 } monster.voices = { interval = 6000, chance = 10, { text = "Não fui eu!", yell = false }, { text = "Tente me pegar!", yell = false } } monster.loot = { { name = "gold coin", chance = 83940, maxCount = 40 }, -- { name = "platinum coin", chance = 29900, maxCount = 2 }, -- { name = "meat", chance = 12350 }, -- { name = "rope belt", chance = 4110 } } monster.attacks = { { name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -68 }, { name = "combat", interval = 3000, chance = 30, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -80, range = 7, shootEffect = CONST_ANI_SPEAR, target = false } } monster.defenses = { defense = 25, armor = 20 } monster.elements = { { type = COMBAT_PHYSICALDAMAGE, percent = 5 }, { type = COMBAT_ENERGYDAMAGE, percent = 10 }, { type = COMBAT_EARTHDAMAGE, percent = 10 }, { type = COMBAT_FIREDAMAGE, percent = 0 }, { type = COMBAT_LIFEDRAIN, percent = 0 }, { type = COMBAT_MANADRAIN, percent = 0 }, { type = COMBAT_DROWNDAMAGE, percent = 0 }, { type = COMBAT_ICEDAMAGE, percent = -10 }, { type = COMBAT_HOLYDAMAGE, percent = 0 }, { type = COMBAT_DEATHDAMAGE, percent = -5 } } monster.immunities = { { type = "paralyze", condition = false }, { type = "outfit", condition = false }, { type = "invisible", condition = false }, { type = "bleed", condition = false } } local maxHealth = monster.maxHealth local aux = maxHealth mType.onThink = function(monster, interval) local health = monster:getHealth() if aux > health then Game.createItem(2448, (maxHealth - health), monster:getPosition()) aux = health end end mType:register(monster)
  4. Criei um revscript em forma de login, ou seja, a cada 24h que o player logar, receberá uma recompensa. Fiz de forma configurável e fácil de entender para modificar os leveis e os rewards: local config = { storage = 1674353, reward = { [1] = { fromLevel = 1, toLevel = 50, itemId = 5890, amount = 80 }, -- 80 chicken feather [2] = { fromLevel = 51, toLevel = 100, itemId = 5878, amount = 60 }, -- 60 minotaur leather [3] = { fromLevel = 101, toLevel = 150, itemId = 5880, amount = 20 }, -- 20 iron ore [4] = { fromLevel = 151, toLevel = 999999, itemId = 9058, amount = 4 }, -- 4 gold ingot }, } local loginReward = CreatureEvent("LoginReward") function loginReward.onLogin(player) local osTime, level = os.time(), player:getLevel() if player:getStorageValue(config.storage) <= osTime then player:setStorageValue(config.storage, osTime + (24 * 60 * 60)) for i = 1, #config.reward, 1 do local reward = config.reward[i] if ((level >= reward.fromLevel) and (level <= reward.toLevel)) then player:addItem(reward.itemId, reward.amount) end end end end loginReward:register()
  5. local message = { [1] = { actionId = 56001, text = "Set saga nivel 1.\nO set pode ser conquistado em quest.\nLocal: Proximo a saida sul de Konohra.\nRequer: Level 10.", storage = 556655001 }, [2] = { actionId = 56002, text = "Set saga nivel 2.\nO set pode ser conquistado em quest.\nLocal: Proximo a saida norte de Konohra.\nRequer: Level 15.", storage = 556655002 }, } function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end for i = 1, #message, 1 do if item.actionid == message[i].actionId then if getPlayerStorageValue(cid, message[i].storage) <= 0 then doPlayerPopupFYI(cid, message[i].text) setPlayerStorageValue(cid, message[i].storage, 1) end end end end Para funcionar tu precisa colocar um actionid pelo mapa diretamente no tile(sqm) que deseja. Por exemplo o actionid: 56001
  6. Para definir o level, os itens e o local, tem que modificar os personagens com nome de Sample, por exemplo Sorcerer Sample. Pode modificar diretmente pelo banco de dados, ou dentro do jogo com a ajuda do GOD
  7. Dentro do arquivo de cada monstro existem essas opções.
  8. Problema está no arquivo nomeado como Seller Super Rox, tu tem ele na pasta do ot?
  9. local dailyWand = TalkAction("!wand") function dailyWand.onSay(player, words, param) local storage = 556655001 local getStor, osTime = player:getStorageValue(storage), os.time() if ((osTime <= getStor) or (getStor == -1)) then player:addItem(28557, 1) player:setStorageValue(storage, osTime + (60 * 60 * 24)) else player:sendCancel("You can only use this command once every 24 hours.") end return false end dailyWand:register()
  10. Sim, você está na área errada. Aqui é para pedir ajuda, ou seja, suporte. De qualquer forma, tomei a liberdade de organizar o script:
  11. Se tu não entendeu, não conseguiremos explicar neste caso, pois o script trabalha com estrutura de repetição, e isso não é algo que se explica rapidamente. Aconselho fazer um curso de algorítmos, caso queira realmente entender... ...e além da estrutura de repetição, existe a presença do addEvent, que basicamente executa uma função após um tempo pré-determinado.
  12. Sacani

    Donate doTeleportThing

    Tu não atribuiu um valor para a função doTeleportThing, então: local config = { -- Sem VIP kickMsg = "Voce nao e Donate para acessar essa area.", kickPos = { x = 100, y = 200, z = 7 }, kickEffect = CONST_ME_POFF, -- Com VIP enterMsg = "Bem vindo a area Donate", enterEffect = CONST_ME_MAGIC_RED, } function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end if not vip.hasVip(cid) then doTeleportThing(cid, config.kickPos) doSendMagicEffect(config.kickPos, config.kickEffect) doPlayerSendCancel(cid, config.kickMsg) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.enterMsg) doSendMagicEffect(position, config.enterEffect) return true end
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...