-
Total de itens
70 -
Registro em
-
Última visita
-
Dias Ganhos
1
Tipo de Conteúdo
Perfis
Fóruns
Calendário
Publique
Posts postados por Kyle Bellini
-
-
Como funciona o script? Qual é a intenção com ele? Daí eu vejo de criar algo um pouco mais elaborado, ou uma forma melhor/mais fácil de configurar
-
envia o script do comando em questão, as vezes é configurado através dele mesmo
-
mas no primeiro pedido foi exatamente isso que pediu, jogador só conseguiria utilizar se tivesse X item na bag kkkk
tanto que não tem verificação se o item está equipado ou não, apenas se o jogador possui o item
sobre o segundo pedido, o que acontece exatamente quando você tenta usar a spell? consegue fazer um gif? eu havia testado e tava ok
-
não entendi, o primeiro script você pediu de uma forma, o segundo você pediu de outra (só utilizar se estiver no slot)
como você realmente quer o script?
-
a spell já funcionava anteriormente? não alterei nada na funcionalidade dela (buffs, e afins)
vou testar depois
-
opa, não havia notado que era pra 1.x hahaha
bom que já fica aí pra quem usa 0.x
valeu Luan o/
-
para fazer com que seja necessário o jogador possuir uma storage pra utilizar o comando, basta adicionar uma verificação no código:
if getPlayerStorageValue(cid, storageNecessaria) ~= valorDaStorage then return doPlayerSendCancel(cid, "Você não possui tal tal tal") end
- luanluciano93 reagiu a isso
- 1
-
fiz esse código aqui, pra ficar mais fácil de adicionar mais cidades posteriormente, sem ter que mexer no "código", só adicionar na tabela mesmo
local config = { cities = { ["thais"] = { name = "Thais City", pos = {x = 141, y = 379, z = 7} }, ["carlin"] = { name = "Carlin City", pos = {x = 142, y = 379, z = 7} }, ["venore"] = { name = "Venore City", pos = {x = 143, y = 379, z = 7} }, ["kazordoon"] = { name = "Kazordoon City", pos = {x = 144, y = 379, z = 7} }, ["yalahar"] = { name = "Yalahar City", pos = {x = 145, y = 379, z = 7} }, }, effect = 39 } function onSay(cid, words, param, channel) if (param == "") then return doPlayerSendCancel(cid, string.format("No parameters. Try this instead: %s cityname.", words)) end local cities = "" for city, values in pairs (config.cities) do cities = city .. ", " .. cities cities = cities:gsub(", $", ".") end if not config.cities[param] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("Available cities: %s", cities)) return doPlayerSendCancel(cid, "Invalid city. A list of available cities has been sent to you. Check your Default Channel.") end doTeleportThing(cid, config.cities[param].pos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("You have been teleported to %s.", config.cities[param].name)) doSendMagicEffect(getPlayerPosition(cid), config.effect) return true end
-
vou dar uma olhada, e envio aqui
--------
testa aí
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 30000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, 10) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, 25) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, 25) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) local config = { exhaustionStorage = 13101, exhaustionTime = 30.0, ringId = 7116, effect = 112 } function onCastSpell(cid, var) if exhaustion.check(cid, config.exhaustionStorage) == TRUE then doPlayerSendCancel(cid, "Podera usar novamente dentro de 30 segundos.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end local ringName = getItemNameById(config.ringId) if getPlayerSlotItem(cid, CONST_SLOT_RING).itemid ~= config.ringId then return doPlayerSendCancel(cid, string.format("You do not have a %s equipped.", ringName)) end for k = 1, 100 do addEvent(function() if isCreature(cid) then local pos1 = {x = getPlayerPosition(cid).x + 0, y = getPlayerPosition(cid).y + 0, z = getPlayerPosition(cid).z} doSendMagicEffect(pos1, config.effect) end end, 1 + ((k-1) * 300)) end exhaustion.set(cid, config.exhaustionStorage, config.exhaustionTime) return doCombat(cid, combat, var) end
- What Member reagiu a isso
- 1
-
me informa o id do item, e a quantidade, pra eu arrumar tudo
- What Member reagiu a isso
- 1
-
agora o seu primeiro if tem dois "end", só precisa de um
- What Member reagiu a isso
- 1
-
você colocou duas onCastSpell(cid, var), e uma delas não está fechada (que é a primeira), pode deletar ela, e manter apenas a de baixo
daí só copiar o que tem dentro da primeira onCastSpell e jogar pra baixo, onde está a segunda
- What Member reagiu a isso
- 1
-
Envia aqui quais foram as alterações que você fez, que fica melhor de explicar/ver o que errou no script
-
Precisa fazer a verificação se o jogador possui tal item, para isso, basta utilizar a função getPlayerItemCount(cid, itemid)
function onGetFormulaValues(cid, level, maglevel) local levelTotal = level local min = (levelTotal * 4) / 5 + (maglevel * 25) / 2 local max = (levelTotal * 5) / 5 + (maglevel * 27) / 2 return -min, -max end local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 33) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 46) setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local function onCastSpell1(parameters) if not isPlayer(parameters.cid) then return true end doCombat(parameters.cid, parameters.combat1, parameters.var) end local config = { requiredItem = {itemid = 2675, count = 1} -- Coloque o id do item necessário em: 'itemid = aqui', e a quantidade necessária do item em: 'count = aqui' } function onCastSpell(cid, var) local parameters = {cid = cid, var = var, combat1 = combat1} local itemName = getItemNameById(config.requiredItem.itemid) if getPlayerItemCount(cid, config.requiredItem.itemid) < config.requiredItem.count then if config.requiredItem.count == 1 then doPlayerSendCancel(cid, string.format("You need %d %s to use this spell.", config.requiredItem.count, itemName)) else doPlayerSendCancel(cid, string.format("You need %d %ss to use this spell.", config.requiredItem.count, itemName)) end return end for k = 1, 10 do addEvent(function() if isCreature(cid) then addEvent(onCastSpell1, 1, parameters) end end, 1 + ((k-1) * 300)) end return true end
- What Member reagiu a isso
- 1
-
A linha comentada que falei ali acima, é de permitir colocar as armas nos outros slots (por isso falei que talvez n seja a melhor forma, visualmente é feio kkk)
Quanto a poder colocar armas de outras vocações ali, não foi alterado nada disso, salvo engano é permitido por padrão, no entanto, elas não deveriam funcionar se for de outra vocação (remove as alterações que citei, e faz o teste)
-
Não sei se é a melhor forma, mas depois testo com calma, e vejo se dá pra fazer algo melhorzinho
Comenta essa linha:
else if((item->getSlotPosition() & SLOTP_RIGHT) || (item->getSlotPosition() & SLOTP_LEFT)) ret = RET_PUTTHISOBJECTINYOURHAND;
Ficando assim:
/*else if((item->getSlotPosition() & SLOTP_RIGHT) || (item->getSlotPosition() & SLOTP_LEFT)) ret = RET_PUTTHISOBJECTINYOURHAND;*/
- Doidodepeda reagiu a isso
- 1
-
Vá até o arquivo thing.h, e busque por:
RET_TILEISFULL = 64
Adicione uma vírgula após o 64, e logo abaixo adicione:
RET_CANNOTUSESAMEWEAPON = 65
Agora vá até o arquivo player.cpp, e busque por:
case RET_TILEISFULL: sendCancel("You cannot add more items on this tile."); break;
Pule uma linha, e na seguinte adicione:
case RET_CANNOTUSESAMEWEAPON: sendCancel("You cannot use the same weapon."); break;
Ainda no arquivo player.cpp, busque por:
else if(!leftItem->isWeapon() || !item->isWeapon() || leftType == WEAPON_SHIELD || leftType == WEAPON_AMMO || type == WEAPON_SHIELD || type == WEAPON_AMMO) ret = RET_NOERROR;
Logo abaixo, adicione:
else if(item->isWeapon() && leftItem->isWeapon()) { if(item->getID() == leftItem->getID()) ret = RET_CANNOTUSESAMEWEAPON; }
Busque por:
else if(!rightItem->isWeapon() || !item->isWeapon() || rightType == WEAPON_SHIELD || rightType == WEAPON_AMMO || type == WEAPON_SHIELD || type == WEAPON_AMMO) ret = RET_NOERROR;
Logo abaixo, adicione:
else if(item->isWeapon() && rightItem->isWeapon()) { if(item->getID() == rightItem->getID()) ret = RET_CANNOTUSESAMEWEAPON; }
-
posta o código, para que possam ajudar
-
Mas você já verificou se o problema não é o código?
-
Vi que tinha deixado uma letra minúscula em uma das funções, editei o meu post ali acima.. Mas tem certeza que foi o script que causou esse erro?
-
-
Envia o código, pra gente poder ver o problema
-
E aí,
Testa assim:
Spoiler<?xml version="1.0" encoding="UTF-8"?> <!-- ULTIMATE SURVIVAL - Codigo feito por Omega / Pedido por vinnevinne --> <mod name="Ultimate Survival" version="1.0" author="Omega" enabled="yes"> <config name="ultimatelib"><![CDATA[ USurvival = { posi = {x=110, y=151, z=11}, posf = {x=121, y=162, z=11}, posc = {x=116, y=159, z=11}, waves = { [1] = {monsters = {"wolf","wolf beast"}, count = 30, reward = {exp = 0, item = 3956, amount = 5, money = 100}}, [2] = {monsters = {"shadow beast","shadow lion","shadow skeleton","shadow prisioner","shadow tombler"}, count = 40, reward = {exp = 0, item = 3956, amount = 10, money = 1000}}, [3] = {monsters = {"raditz","nappa","turles","bardock","broly","gotenks","vegeta","king vegeta","goku","gogeta","vegetto"}, count = 50, reward = {exp = 0, item = 3956, amount = 15, money = 10000}}, }, exhaust = 1 * 24 * 60 * 60, -- Tempo em segundos ate poder entrar novamente na arena (1 * 24 * 60 * 60 = 1 dia) final_reward = {item = 2160, amount = 100, exp = 300000, money = 500000}, storage_ex = 607069, storage_wave = 607089, } function isWalkable(pos)-- by Nord / editado por Omega if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false elseif isCreature(getTopCreature(pos).uid) then return false elseif getTileInfo(pos).protection then return false elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then return false end return true end function doSpawnMonsters(monsters, pos, radius, limit) if not pos.x or not pos.y or not pos.z or not type(monsters) == 'table' then return false end local radius = tonumber(radius) if radius > 5 then radius = 5 elseif radius < 2 then radius = 2 end if not limit or limit < 1 then limit = 1 elseif limit > radius ^ 2 then limit = math.floor((radius*1.5) ^ 2) end local k = 0 local tries = 0 repeat for x = pos.x - radius, pos.x + radius do for y = pos.y - radius, pos.y + radius do if isWalkable({x=x, y=y, z=pos.z}) then local monster = monsters[math.random(1, #monsters)] local chance = math.random(1, 30) if k == limit then break elseif chance <= 8 and doCreateMonster(monster, {x=x, y=y, z=pos.z}) then k = k + 1 end end end end tries = tries + 1 until k >= limit or tries >= 500 return k >= limit and true or false end function getPlayersInArea(pos1,pos2) local players = {} if pos1.x and pos1.y and pos2.x and pos2.y and pos1.z == pos2.z then for a = pos1.x, pos2.x do for b = pos1.y,pos2.y do local pos = {x=a,y=b,z=pos1.z} if isPlayer(getTopCreature(pos).uid) then table.insert(players,getTopCreature(pos).uid) end end end return players else return false end end function getMonstersInArea(pos1,pos2) local players = {} if pos1.x and pos1.y and pos2.x and pos2.y and pos1.z == pos2.z then for a = pos1.x, pos2.x do for b = pos1.y,pos2.y do local pos = {x=a,y=b,z=pos1.z} if isMonster(getTopCreature(pos).uid) then table.insert(players,getTopCreature(pos).uid) end end end return players else return false end end function doCleanArena() local monsters = getMonstersInArea(USurvival.posi, USurvival.posf) for _, cid in pairs(monsters) do doRemoveCreature(cid) end end function doStartWave(waveID, cid) if not isCreature(cid) then return false end if USurvival.waves[waveID] then wave = USurvival.waves[waveID] doSpawnMonsters(wave.monsters, USurvival.posc, 5, wave.count) doPlayerSendTextMessage(cid, 21, 'Wave '..waveID..' has started! FIGHT!') end end ]]></config> <action actionid="4599" event="script" override="yes"><![CDATA[ domodlib('ultimatelib') function onUse(cid, item) local taskItem = { checkItem = 1547, countItem = 1 } if getPlayerItemCount(cid, taskItem.checkItem) >= taskItem.countItem then if getPlayerStorageValue(cid, USurvival.storage_ex) <= os.time() then if #getPlayersInArea(USurvival.posi, USurvival.posf) == 0 then doCleanArena() doPlayerRemoveItem(cid, taskItem.checkItem, taskItem.countItem) doTeleportThing(cid, USurvival.posc) doPlayerSendTextMessage(cid, 21, 'The Survival will Start in 60 seconds! Be ready to face your destiny!') addEvent(doStartWave, 60000, 1, cid) setPlayerStorageValue(cid, USurvival.storage_wave, 1) setPlayerStorageValue(cid, USurvival.storage_ex, os.time() + USurvival.exhaust) if item.itemid % 2 == 1 then doTransformItem(item.uid, item.itemid+1) else doTransformItem(item.uid, item.itemid-1) end else doPlayerSendCancel(cid, 'Someone is already in the arena.') doSendMagicEffect(getThingPos(cid), 2) end else local left = getPlayerStorageValue(cid, USurvival.storage_ex) - os.time() left = {hour = math.floor(left/3600), minutes = math.ceil((left % 3600)/60)} doPlayerSendCancel(cid, 'You have to wait '.. left.hour ..'h and '..left.minutes..'min.') doSendMagicEffect(getThingPos(cid), 2) end end return true end ]]></action> <event type="login" name="US Login" event="script"><![CDATA[ domodlib('ultimatelib') function onLogin(cid) registerCreatureEvent(cid,'UltimateSurvival1') registerCreatureEvent(cid,'UltimateSurvival2') if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 10) end return true end ]]></event> <event type="kill" name="UltimateSurvival1" event="script"><![CDATA[ domodlib('ultimatelib') function onKill(cid, target) if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then if #getMonstersInArea(USurvival.posi, USurvival.posf) == 1 then local wave = getPlayerStorageValue(cid, USurvival.storage_wave) if USurvival.waves[wave+1] then setPlayerStorageValue(cid, USurvival.storage_wave, wave + 1) addEvent(doStartWave, 30000, wave + 1, cid) doPlayerSendTextMessage(cid, 22, 'Congratulations! Next wave will start in 30 seconds!') else doPlayerSendTextMessage(cid, 22, 'CONGRATULATIONS! YOU HAVE BEATEN THE SURVIVAL!') local reward = USurvival.final_reward if reward.item then doPlayerAddItem(cid, reward.item, (reward.amount or 1), false) end if reward.exp then doPlayerAddExp(cid, reward.exp) end if reward.money then doPlayerAddMoney(cid, reward.money) end local medal = doPlayerAddItem(cid, 5785, 1, false) if medal then doItemSetAttribute(medal, 'description', 'This was awarded to '..getCreatureName(cid)..' for completing the Ultimate Survival.') doItemSetAttribute(medal,'name', 'Ultimate Survival Medal') end doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end end end return true end ]]></event> <event type="preparedeath" name="UltimateSurvival2" event="script"><![CDATA[ domodlib('ultimatelib') function onPrepareDeath(cid, killers) if isInArea(getThingPos(cid), USurvival.posi, USurvival.posf) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doRemoveConditions(cid, false) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, 21, 'Too bad, you couldn\'t defeat the Ultimate Survival... Better luck next time.') local reward = USurvival.waves[getPlayerStorageValue(cid, USurvival.storage_wave)].reward if reward.item then doPlayerAddItem(cid, reward.item, reward.amount or 1) end if reward.exp then doPlayerAddExp(cid, reward.exp) end if reward.money then doPlayerAddMoney(cid, reward.money) end return false end return true end ]]></event> </mod>
-
É bem simples, fiz um aqui pra ti:
local config = { bossPos = {x = 1091, y = 920, z = 7}, -- Position que o monstro será criado bossName = "Boss Monster" -- Nome do monstro } function onStartup() doCreateMonster(config.bossName, config.bossPos) return true end
No seu globalevents.xml você adiciona essa tag:
<globalevent name="CreateBoss" type = "start" event="script" value="createboss.lua"/>
Adicionar mais posicoes
em Suporte Tibia Otserv
Postado
Basta seguir o modelo da tabela; adicionar o nome do monstro, junto da posição onde quer que ele de spawn: