-
Total de itens
311 -
Registro em
-
Última visita
-
Dias Ganhos
8
Posts postados por meubk
-
-
Faço tudo o q for preciso em servidor de Tibia, tenho conhecimento em todas linguagens.
Quero ajudar alguém que esteja desenvolvendo um servidor TFS 1.0+
E que seja um servidor diferente, quanto mais criativo melhor.
Nada de pokemon.
-
local spells = {
[1] = { --sorcerer
level = {
[1] = {"utevo lux", "exura", "adori"},
[40] = {"exevo gran mas vis"}
}
},
[2] = { --druid
level = {
[1] = {"utevo lux", "exura", "adori"},
[28] = {"exevo gran mas pox"}
}
},
[3] = { --paladin
level = {
[1] = {"utevo lux", "exura", "exevo con"},
[14] = {"exevo con vis"}
}
},
[4] = { --knight
level = {
[1] = {"utevo lux", "exura"},
[5] = {"exori"}
}
}
}
local vocs = {
{1,4,8},
{2,5,9},
{3,6,10},
{4,7,11}
}
local vocationSpells = {}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == 7 then
for i, class in ipairs(vocs) do
if isInArray(class, getPlayerVocation(cid)) then
vocationSpells = spells
end
end
if vocationSpells == nil then
return false
end
local lvl = getPlayerMagLevel(cid)
local playerSpells = vocationSpells.level[lvl]
if #playerSpells == nil or #playerSpells == 0 then
return false
end
for x = 1, #playerSpells do
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "New spells for level["..lvl.."]: "..playerSpells[x]..".")
end
end
return true
end
-
-
Oi pessoal, estou planejando montar um ATS, o maior diferencial serias as classes. Como todo RPG deve conter um Mago, Arqueiro e Guerreiro, o que é obvio que terá no servidor, qual seria a quarta vocação mais desejadas por vocês ?
Eae, qual vocação você gostaria de ver no servidor ? Ou se tem alguma idéia por favor comente.
-
getPlayerMana()
esqueceu que os server de pokemon usam a mana para mostrar na barra quantos pokemons tem, logo usando a função getPlayerMana, vai retornar o numero de pokemons q tem.
E é possivel usar sim a função getPlayerFreeCap(), só que ela retorna o tanto que você tem LIVRE(FREE) de cap, não o tanto que você esta utilizando, e muito menos o tanto que você tem no total.
-
como se posta o script desta forma cara ? use o "código", que talvez eu possa ajudar
-
-- Script por Killua, antigo Amoeba13 -- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if amoebaTask[msg] then if getPlayerStorageValue(cid, amoebaTask[msg].storagecount) == amoebaTask[msg].count then local esperiencia = amoebaTask[msg].exp > 0 and "" ..amoebaTask[msg].exp.. " exp e " or "" local dineiro = amoebaTask[msg].money > 0 and "" .. amoebaTask[msg].money .. " gold coins e " or "" selfSay("Voce conseguiu completar a task de ".. msg .. ", parabens! Eu vou te dar " .. esperiencia .. "" .. dineiro .."alguns itens como recompensa.", cid) doPlayerAddExperience(cid, amoebaTask[msg].exp) doPlayerAddMoney(cid, amoebaTask[msg].money) doPlayerSetStorageValue(cid, amoebaTask[msg].storage, -1) doPlayerSetStorageValue(cid, amoebaTask[msg].storagecount, 0) for juba, prize in pairs(amoebaTask[msg].premios) do doPlayerAddItem(cid, prize[1], prize[2]) end else selfSay("Desculpe, mas voce ainda nao matou todos os " .. msg .. "s. Voce so matou " .. taskKills(cid, amoebaTask[msg].storagecount) .. " de " .. amoebaTask[msg].count .. " " .. msg .. "s.", cid) end else selfSay("O que?", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
somente vai mudar o script do npc
-
pelo script tbem da certo ... criei uma função q faria isso:
function doSendUpMagicEffect(pos, effect) return doSendMagicEffect({x = pos.x-1, y = pos.y+1, z = pos.z}, effect) end
-
qual a função que coloca o follow ? talvez colocando 0 no lugar ele perca o follow
-
desculpe, me esqueci, atualizado.
-
local item = {2323, 1} -- id do item, quantidade local vocations = {77} function onKill(cid, target, lastHit) if isPlayer(target) and isInArray(vocations, getPlayerVocation(cid)) then doPlayerAddItem(cid, item[1], item[2]) end return true end
Cria um arquivo .lua coloca na pasta creaturescripts coloca a tag no creaturescripts.xml do tipo "kill" e adiciona no login.lua de acordo com o nome
-
amigo desculpe a demora, tive q baixar o tfs 8.54 e fazer testes, mas agora esta 100%, segue abaixo o mod:
<?xml version="1.0" encoding="UTF-8"?> <mod name="SpellLife" enabled="yes" author="Miiller" forum="XTibia.com"> <!-- Configs and Functions --> <config name="SpellLifeConfig"><![CDATA[ config = { vocationIds = {76}, -- quais vocação pode usar level = 100, -- que level é preciso para usar cooldownSeconds = 60, -- quantos segundos é preciso esperar para usar novamente emptyStorage = 54154, -- uma storage que não esteja sendo usada no seu servidor otherEmptyStorage = 54155, -- outra storage que não esteja sendo usada no seu servidor durationSeconds = 10, -- quanto tempo durara a spell effect = 10 -- qual efeito mostrara conforme esta sobre o efeito da spell } function startSpellLife(cid, seconds) if not isCreature(cid) then return true end if seconds == config.durationSeconds then doPlayerSetStorageValue(cid, config.emptyStorage, 1) end if getPlayerStorageValue(cid, config.emptyStorage) == -1 then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end if seconds == 0 then doPlayerSetStorageValue(cid, config.emptyStorage, -1) return true end doSendMagicEffect(getThingPos(cid), config.effect) addEvent(startSpellLife, 1000, cid, seconds-1) end ]]></config> <!-- configure abaixo o id do item --> <action itemid="2525" event="script"><![CDATA[ domodlib('SpellLifeConfig') function onUse(cid, item, fromPosition, itemEx, toPosition) if not isInArray(config.vocationIds, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Sua vocação não pode usar esta spell.") end if getPlayerLevel(cid) < config.level then return doPlayerSendCancel(cid, "É necessário level " .. config.level .. " para usar esta spell.") end if exhaustion.check(cid, config.otherEmptyStorage) then return doPlayerSendCancel(cid, "É necessário esperar " .. config.cooldownSeconds .. " segundos para usar esta spell novamente.") end exhaustion.set(cid, config.otherEmptyStorage, config.cooldownSeconds) startSpellLife(cid, config.durationSeconds) doRemoveItem(item.uid, 1) return true end ]]></action> <creaturescript type="statschange" name="SpellLife" event="script"><![CDATA[ domodlib('SpellLifeConfig') function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if getCreatureHealth(cid) - value <= 0 then if getPlayerStorageValue(cid, config.emptyStorage) == 1 then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doPlayerSetStorageValue(cid, config.emptyStorage, -1) return false end end end return true end ]]></creaturescript> <creaturescript type="login" name="SpellLifeLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "SpellLife") return true end ]]></creaturescript> </mod>
-
ve se mudou algo
-
fiz por mod por precisar usar actionscripts e creaturescripts, então crie um xml com o nome qualquer na pasta mods e cole o código, todas as configurações estão no inicio, e o ID do item pode ser configurada na tag da action.
<?xml version="1.0" encoding="UTF-8"?> <mod name="SpellLife" enabled="yes" author="Miiller" forum="XTibia.com"> <!-- Configs and Functions --> <config name="SpellLifeConfig"><![CDATA[ config = { vocationIds = {76}, -- quais vocação pode usar level = 100, -- que level é preciso para usar cooldownSeconds = 60, -- quantos segundos é preciso esperar para usar novamente emptyStorage = 54154, -- uma storage que não esteja sendo usada no seu servidor otherEmptyStorage = 54155, -- outra storage que não esteja sendo usada no seu servidor durationSeconds = 10, -- quanto tempo durara a spell effect = 10 -- qual efeito mostrara conforme esta sobre o efeito da spell } function startSpellLife(cid, seconds) if not isCreature(cid) then return true end if seconds == config.durationSeconds then doPlayerSetStorageValue(cid, config.emptyStorage, 1) end if getPlayerStorageValue(cid, config.emptyStorage) == -1 then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) return true end if seconds == 0 then doPlayerSetStorageValue(cid, config.emptyStorage, -1) return true end doSendMagicEffect(getThingPos(cid), config.effect) addEvent(startSpellLife, 1000, cid, seconds-1) end ]]></config> <!-- configure abaixo o id do item --> <action itemid="2525" event="script"><![CDATA[ domodlib('SpellLifeConfig') function onUse(cid, item, fromPosition, itemEx, toPosition) if not isInArray(config.vocationIds, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, "Sua vocação não pode usar esta spell.") end if getPlayerLevel(cid) < config.level then return doPlayerSendCancel(cid, "É necessário level " .. config.level .. " para usar esta spell.") end if exhaustion.check(cid, config.otherEmptyStorage) then return doPlayerSendCancel(cid, "É necessário esperar " .. config.cooldownSeconds .. " segundos para usar esta spell novamente.") end exhaustion.set(cid, config.otherEmptyStorage, config.cooldownSeconds) startSpellLife(cid, config.durationSeconds) doRemoveItem(item.uid, 1) return true end ]]></action> <creaturescript type="statschange" name="SpellLife" event="script"><![CDATA[ domodlib('SpellLifeConfig') function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if getCreatureHealth(cid) - value <= 0 then if getPlayerStorageValue(cid, config.emptyStorage) == 1 then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) doPlayerSetStorageValue(cid, config.emptyStorage, -1) return false end end end return true end ]]></creaturescript> <creaturescript type="login" name="SpellLifeLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "SpellLife") return true end ]]></creaturescript> </mod>
Fico no aguardo caso estiver algum bug
-
versão do servidor
-
Eu acho q o certo seria fazer a verificação junto com a verificação que só pode carregar 6 pokebolas. Não sei como funciona os servidores de pokemon de hoje, não sei se esta verificação é por script ou algum código nas sources.
-
posta o script do evento, ou o link onde você achou o mesmo
-
Esta função serve para repetir outras funções por um certo tempo.
function repeatFunction(_times, _delay, _function, ...) if _times == 0 then return true end _function(...) addEvent(repeatFunction, _delay, _times - 1, _delay, _function, ...) end
exemplo de uso:
repeatFunction(20, 1000, doSendMagicEffect, getThingPos(cid), 23)
ira repetir a função doSendMagicEffect, 20 vezes, com intervalos de 1000ms (1 segundo).
-
EFEITO COM TODOS ITEMS NO UPGRADE MAXIMO
Existe varios servidores que estão adaptanto o upgrade system, ou seja poder deixar os items +1, +2, +3 até o maximo configurado, então eu fiz esse script baseando no MU Online, aonde quando se tem todos os items por exemplo no +13, fica saindo efeitinhos no jogador, bom segue o script:
creaturescripts/scripts/upgradeEffect.lua
-- CONFIGURAÇÕES -- MAXUPGRADE = 9 -- nivel que os items precisarão estar para sair o efeito ANIMATIONEFFECT = 1 -- numero do efeito DELAYEFFECT = 1000 -- de quanto em quanto tempo saira o efeito (1000 = 1s) NEEDBOOTS = true -- as botas tbem precisam estar no nivel maximo ? (existe sistema de upgrade que não é possivel usar nas botas, caso o seu for deixe "false") ------------------- function thinkEffect(cid, mU, aE, dE, nB) if not isCreature(cid) then return true end local slots = nB and {1, 4, 7, 8} or {1, 4, 7} local result = true for _, slot in pairs(slots) do if getPlayerSlotItem(cid, slot).uid > 0 then local itemName = getItemAttribute(getPlayerSlotItem(cid, slot).uid, "name") if itemName:find("+" .. mU) or itemName:find("+ " .. mU) then result = true else result = false break end end end if result then doSendMagicEffect(getThingPos(cid), aE) end addEvent(thinkEffect, dE, cid, mU, aE, dE, nB) end function onLogin(cid) return thinkEffect(cid, MAXUPGRADE, ANIMATIONEFFECT, DELAYEFFECT, NEEDBOOTS) end
toda configuração esta no script, creio q funcione com todos sistemas de upgrade, pois a maioria usa a msm função para editar o nome do item, oque pode mudar é q uns upgrade system não aceitam aprimorar as botas, mais isto esta configuravel no script tbem.
creaturescripts/creaturescripts.xml
<event type="login" name="UpgradeEffect" event="script" value="upgradeEffect.lua"/>
flw
-
function onStepIn(cid, item, position, fromPosition)
local reset = 6 ---Quantidade de reset necessaria--------
function getPlayerReset(cid)
local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)..";")
rss = qr:getDataInt("reset", getPlayerGUID(cid))
if rss <= 0 then
rss = 0
end
return tonumber(rss)
end
if getPlayerReset(cid) < reset then
doTeleportThing(cid, fromPosition, true)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Voce precisa de pelo menos "..reset.." reset")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seja bem vindo")
return TRUE
end
-
pronto script atualizado, la em cima /\
-
e é pra remover só ql ?
-
-
local items = { [2381] = {7365, 6}, [2411] = {7365, 8}, [2385] = {7365, 12}, } function onUse(cid, item, frompos, item2, topos) if items[item2.itemid] then doPlayerAddItem(cid, items[item2.itemid][1], items[item2.itemid][2]) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "É necessario o item correto para usar.") end return true end
xml:
<action itemid="2263" event="script" value="arquivo.lua"/>
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
Erro em script de invasão
em Scripts
Postado
estava faltando uma chave