Ir para conteúdo
  • Cadastre-se

(Resolvido)Movement a partir de um MOD


Ir para solução Resolvido por zipter98,

Posts Recomendados

Então, eu uso esse mod do Vodkart de Guild Frag System, que da acesso aos jogadores vencedores que atingir X quantia de kills, porém não tem a parte do movement onde verifica se o jogador é da guild vencedora e se tem acesso e tals.... no script tem um action id no qual não funciono aqui, sempre muda pra outro numero na hora de por

 

http://www.tibiaking.com/forum/topic/12235-gfs-guild-frag-system/

<?xml version="1.0" encoding="UTF-8"?>  
<mod name="Guild Frag System" version="1.0" author="Vodkart" contact="none" enabled="yes">  
<config name="guild_func"><![CDATA[

frag_guild = {
start_frags = 120155,
FragsToWinAcess = 500,
FragsPerKill = 1,
AcessTimeDays = 2,
MoreExpToGuild = false,
Exp_Rate = 1.1, -- 10%
Honor_Storage = 215548,
Honor_Point = 10
}

function getFragsByGuild(GuildName)
local check = db.getResult("SELECT `frags` FROM `guilds` WHERE `id` = " ..getGuildId(GuildName))
return check:getDataInt("frags") <= 0 and 0 or check:getDataInt("frags")
end
function addFragsByGuild(GuildName,amount)
db.executeQuery("UPDATE `guilds` SET `frags` = "..getFragsByGuild(GuildName).."+"..amount.." WHERE `guilds`.`id` = "..getGuildId(GuildName))
end
function removeFragsByGuild(GuildName,amount)
db.executeQuery("UPDATE `guilds` SET `frags` = "..getFragsByGuild(GuildName).."-"..amount.." WHERE `guilds`.`id` = "..getGuildId(GuildName))
end
function setFragsByGuild(GuildName,value)
db.executeQuery("UPDATE `guilds` SET `frags` = "..value.." WHERE `guilds`.`id` = "..getGuildId(GuildName))
end
function cleanGuildFrags()
db.executeQuery("UPDATE guilds SET frags = 0;")
end
function removeAcessGuildServer()
return db.executeQuery("UPDATE guilds SET acesstime = 0;")
end
function getAcessTime(GuildName)
				local query = db.getResult("SELECT `acesstime` FROM `guilds` WHERE `id` = " ..getGuildId(GuildName))
				if query:getID() ~= -1 then return query:getDataInt("acesstime") end
end
function HaveGuild(cid)
return getPlayerGuildId(cid) > 0 and TRUE or FALSE
end
function doBroadCastGuild(GuildName,type,msg)
local players = {}
for _, cid in pairs(getPlayersOnline()) do
if getPlayerGuildName(cid) == GuildName then
table.insert(players, cid) end end
for i = 1, #players do doPlayerSendTextMessage(players[i],type,msg) end
return true end
function setAcessTime(GuildName, time)
return db.executeQuery("UPDATE `guilds` SET `acesstime` = "..time.." WHERE `guilds`.`id` = "..getGuildId(GuildName))
end
function getDaysAcess(GuildName)
local acess = math.ceil((getAcessTime(GuildName) - os.time())/(86400))
return acess <= 0 and 0 or acess
end
function HaveAcess(GuildName)
				return getDaysAcess(GuildName) > 0 and TRUE or FALSE
end
function getGuildWinnerName()
local guildname = ''
local query = db.getResult("SELECT `name` FROM `guilds`;")  
if(query:getID() ~= -1) then  
repeat  
if HaveAcess(query:getDataString("name")) then
guildname = query:getDataString("name")
end
until not query:next()  
query:free()
end
return guildname
end
function addAcess(GuildName, days)
if days > 0 then
local add = days*86400
local time = getDaysAcess(GuildName) == 0 and (os.time() + add) or (getAcessTime(GuildName) + add)
return setAcessTime(GuildName, time) end
return nil end
function doRemoveAcess(GuildName, days)
if days > 0 then
local remove = days*86400
local time = getAcessTime(GuildName) - remove
return setAcessTime(GuildName, (time <= 0 and 1 or time)) end
return nil end
function getAcessDate(GuildName)
if HaveAcess(GuildName) then return os.date("%d/%m/%y %X", getAcessTime(GuildName)) end
return FALSE
end
function getHonorPoints(cid)
local Honor = getPlayerStorageValue(cid, frag_guild.Honor_Storage)
return Honor < 0 and 0 or Honor
end
function addHonorPoints(GuildName, amount)
local PlayersGuild = db.getResult("SELECT `name` FROM `players` WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = " .. getGuildId(GuildName) .. ");")  
if (PlayersGuild:getID() ~= -1) then
repeat
local pid,Guid = getPlayerByNameWildcard(PlayersGuild:getDataString("name")),getPlayerGUIDByName(PlayersGuild:getDataString("name"))
if(not pid or isPlayerGhost(pid)) then
local getHonor = db.getResult("SELECT `value` FROM `player_storage` WHERE `player_id` = ".. Guid .." AND `key` = ".. frag_guild.Honor_Storage)
if (getHonor:getID() ~= -1) then
repeat
db.executeQuery("UPDATE `player_storage` SET `value` = ".. (getHonor:getDataInt("value")+amount) .." WHERE `player_id` = ".. Guid .." AND `key` = ".. frag_guild.Honor_Storage)
until not(getHonor:next())
getHonor:free()
end
else
setPlayerStorageValue(getPlayerByName(PlayersGuild:getDataString("name")), frag_guild.Honor_Storage, getHonorPoints(getPlayerByName(PlayersGuild:getDataString("name")))+amount)
end
until not PlayersGuild:next()
PlayersGuild:free()
end
return true
end
]]></config>
<talkaction words="!guildfrags;!myhonor" event="buffer"><![CDATA[
domodlib('guild_func')
if words == "!myhonor" or  words == "/myhonor" then
return doPlayerPopupFYI(cid,"Honor Points can be exchanged for special items in npc\nAnd each domain, every guild players receive "..frag_guild.Honor_Point.." Honor Points!\n\n\nMy Honor Points: "..getHonorPoints(cid))
elseif words == "!guildfrags" or words == "/guildfrags" then
if param == "rank" then
local max_guild,str = 10,""
str = "--[ Rank Guild Frags ]--\n\n"
				query = db.getResult("SELECT `name`, `frags` FROM `guilds` WHERE `frags` ORDER BY `frags` DESC, `name` ASC;")
				if (query:getID() ~= -1) then k = 1 while true do
				str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("frags") .. "]"
				k = k + 1
				if not(query:next()) or k > max_guild then break end end query:free()end
				if str ~= "" then doPlayerPopupFYI(cid, str) end
return true
end
doPlayerPopupFYI(cid,"".. (getGuildWinnerName() == "" and "The server does not have any dominant guild\n\nTo show the rank of frags enter !guildfrags rank" or "Currently guild dominant is ["..getGuildWinnerName().."]\n\nYour domain ends in "..getAcessDate(getGuildWinnerName()).."") .."")
end
return true
]]></talkaction>
<event type="login" name="FragsGuildLogin" event="script"><![CDATA[  
domodlib('guild_func')
function onLogin(cid)
registerCreatureEvent(cid, "FragsGuildLogin")
registerCreatureEvent(cid, "FragsGuildKill")
if getPlayerStorageValue(cid,frag_guild.Honor_Storage) == -1 then
setPlayerStorageValue(cid, frag_guild.Honor_Storage, 0)
end
local MyGuild,StorCheck = getPlayerGuildName(cid),17595
if HaveGuild(cid) then
if HaveAcess(MyGuild) then
setPlayerStorageValue(cid, StorCheck, 1)
if frag_guild.MoreExpToGuild == true then doPlayerSetExperienceRate(cid, frag_guild.Exp_Rate) end
elseif getPlayerStorageValue(cid, StorCheck) == 1 and not HaveAcess(MyGuild) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerPopupFYI(cid, "[Guild Frag System]\nThe domain of your guild is over and you've been teleported to the temple.")
setPlayerStorageValue(cid, StorCheck, -1)
if getGlobalStorageValue(frag_guild.start_frags) >= 1 then
setGlobalStorageValue(frag_guild.start_frags, 0)
end
end
end
return TRUE
end
]]></event>
<action actionid="84005" event="script"><![CDATA[
domodlib('guild_func')
function onUse(cid, item, frompos, item2, topos)
local MyGuild = getPlayerGuildName(cid)
if not HaveGuild(cid) then
return doPlayerSendTextMessage(cid,22,"Sorry, you're not in a guild.")
elseif not HaveAcess(MyGuild) then
return doPlayerSendTextMessage(cid,22,"Your guild no has access to this area.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome,The access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
return true
end]]></action>
<event type="kill" name="FragsGuildKill" event="script"><![CDATA[
domodlib('guild_func')
function onKill(cid, target, lastHit)
config = {
MaxDifLevel = 50,
MyGuild = getPlayerGuildName(cid)
}
if isPlayer(cid) and isPlayer(target) and HaveGuild(cid) and HaveGuild(target) and getPlayerGuildId(cid) ~= getPlayerGuildId(target) and getPlayerIp(target) ~= getPlayerIp(cid) and math.abs(getPlayerLevel(cid) - getPlayerLevel(target)) <= config.MaxDifLevel and getGlobalStorageValue(frag_guild.start_frags) <= 0 then
addFragsByGuild(config.MyGuild,frag_guild.FragsPerKill)
doBroadCastGuild(config.MyGuild,20,'[Guild Frag System] Your guild received '..frag_guild.FragsPerKill..' frag because have killed a player another guild, now your guild have '..getFragsByGuild(config.MyGuild)..' frags')
if getFragsByGuild(config.MyGuild) >= frag_guild.FragsToWinAcess then
addAcess(config.MyGuild, frag_guild.AcessTimeDays)
addHonorPoints(config.MyGuild, frag_guild.Honor_Point)
doBroadcastMessage("[Guild Frag System]\nThe guild ["..config.MyGuild.."] is dominant for having achieved "..frag_guild.FragsToWinAcess.." Frags!\nYour domain ends in "..getAcessDate(config.MyGuild))
cleanGuildFrags()
setGlobalStorageValue(frag_guild.start_frags, 1)
if frag_guild.MoreExpToGuild == true then
		   local players = {}
				for _, cid in pairs(getPlayersOnline()) do
								if getPlayerGuildName(cid) == config.MyGuild then
												table.insert(players, cid)
								end
		   end
		   for i = 1, #players do
		   doPlayerSetExperienceRate(players[i], frag_guild.Exp_Rate)
		   end
end
end
end
return TRUE
end]]></event>
<globalevent name="GuildFrags" interval="3600000" event="script"><![CDATA[
domodlib('guild_func')
function onThink(interval, lastExecution)
if getGuildWinnerName() == "" and getGlobalStorageValue(frag_guild.start_frags) >= 1 then
setGlobalStorageValue(frag_guild.start_frags, 0)
end
return doBroadcastMessage("".. (getGuildWinnerName() == "" and "[Guild Frag System]\nThe first guild to reach "..frag_guild.FragsToWinAcess.." frags will gain "..frag_guild.AcessTimeDays.." days of access to exclusive areas, for more information enter !guildfrags" or "[Guild Frag System]\nCurrently guild dominant is ["..getGuildWinnerName().."] and your domain ends in "..getAcessDate(getGuildWinnerName()).."") .."", 22)
end]]></globalevent>
</mod>

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites

Tenta esse movement:

function onStepIn(cid, item, position, fromPosition)
    local guild = getPlayerGuildName(cid)
    if not isPlayer(cid) then
        return true
    elseif not HaveGuild(cid) then
        return doPlayerSendCancel(cid, "Sorry, you're not in a guild.") and doTeleportThing(cid, fromPosition)
    elseif not HaveAcess(guild) then
        return doPlayerSendCancel(cid, "Your guild no has access to this area.") and doTeleportThing(cid, fromPosition)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome, the access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
    return true
end

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

 

Tenta esse movement:

function onStepIn(cid, item, position, fromPosition)
    local guild = getPlayerGuildName(cid)
    if not isPlayer(cid) then
        return true
    elseif not HaveGuild(cid) then
        return doPlayerSendCancel(cid, "Sorry, you're not in a guild.") and doTeleportThing(cid, fromPosition)
    elseif not HaveAcess(guild) then
        return doPlayerSendCancel(cid, "Your guild no has access to this area.") and doTeleportThing(cid, fromPosition)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome, the access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
    return true
end

10872194_779368655476014_348874712_n.jpg

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites
  • Solução

Coloquei fora do mod, my bad.

Troca:

<action actionid="84005" event="script"><![CDATA[
domodlib('guild_func')
function onUse(cid, item, frompos, item2, topos)
local MyGuild = getPlayerGuildName(cid)
if not HaveGuild(cid) then
return doPlayerSendTextMessage(cid,22,"Sorry, you're not in a guild.")
elseif not HaveAcess(MyGuild) then
return doPlayerSendTextMessage(cid,22,"Your guild no has access to this area.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome,The access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
return true
end]]></action>
por:
<movevent type="StepIn" actionid="9089" event="script"><![CDATA[
domodlib("guild_func")
function onStepIn(cid, item, position, fromPosition)
    local guild = getPlayerGuildName(cid)
    if not isPlayer(cid) then
        return true
    elseif not HaveGuild(cid) then
        return doPlayerSendCancel(cid, "Sorry, you're not in a guild.") and doTeleportThing(cid, fromPosition)
    elseif not HaveAcess(guild) then
        return doPlayerSendCancel(cid, "Your guild no has access to this area.") and doTeleportThing(cid, fromPosition)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome, the access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
    return true
end]]></movement>
PS: Não mexo com MODs, então não é certeza que vai funcionar. Mas não custa tentar.

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

 

Coloquei fora do mod, my bad.

Troca:

<action actionid="84005" event="script"><![CDATA[
domodlib('guild_func')
function onUse(cid, item, frompos, item2, topos)
local MyGuild = getPlayerGuildName(cid)
if not HaveGuild(cid) then
return doPlayerSendTextMessage(cid,22,"Sorry, you're not in a guild.")
elseif not HaveAcess(MyGuild) then
return doPlayerSendTextMessage(cid,22,"Your guild no has access to this area.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Welcome,The access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
return true
end]]></action>
por:
<movevent type="StepIn" actionid="9089" event="script"><![CDATA[
domodlib("guild_func")
function onStepIn(cid, item, position, fromPosition)
    local guild = getPlayerGuildName(cid)
    if not isPlayer(cid) then
        return true
    elseif not HaveGuild(cid) then
        return doPlayerSendCancel(cid, "Sorry, you're not in a guild.") and doTeleportThing(cid, fromPosition)
    elseif not HaveAcess(guild) then
        return doPlayerSendCancel(cid, "Your guild no has access to this area.") and doTeleportThing(cid, fromPosition)
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Welcome, the access of your guild in this area ends in "..getAcessDate(getGuildWinnerName()))
    return true
end]]></movement>
PS: Não mexo com MODs, então não é certeza que vai funcionar. Mas não custa tentar.

 

 

Cara.......

Cara.......

Cara.......

Cara.......

 

Fala o que de um fera desse, deu certo sim, só esqueceu de fechar a tag certinho </movement> troquei por </movevent>.

Muito obrigado, um cara desse tem que me ajudar com esse ultimo bug aqui hasudhaidas

 

http://www.tibiaking.com/forum/topic/49927-vip-name-fail/

Editado por jNo (veja o histórico de edições)

(1º) | [8.60] - Galaxy Server - Download

(2º) | [8.60] - Glorious Server - Download

(3º) | [8.60] - Epic Server - Download

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por tataboy67
      Opa galerinha beleza?
       
      Andei pesquisando 1 pouco sobre script e vi que ainda não existe nada do tipo,
      então resolvi trazer aqui pra vocês  !

      Meu intuito em fazer esses tipos de scripts: 
      Na verdade eu andei pensando bastante em fazer Quest's em meu servidor no estilo HARDCORE... Imagine que você consiga entrar em uma Areá e ter consciência de que ao morrer, perderá tudo ! Seria meio tenso não? É... Eu achei interessante essa ideia, e como é simples resolvi trazer pra vocês.

      Como o script funciona?
      O script funciona a partir de 2 Actions.
      A de entrada, dará ao jogador uma Skull Red (Colocar ActionID: 5901) 

      Saída removerá a Skull (Colocar ActionID: 5902)


      Sem mais delongas, vamos ao Script:

      Adicione a linha em:
      (data/movements/movements.xml)
      <movevent event="StepIn" fromaid="5901" toaid="5902" script="TP_Red_Skull.lua"/>
      Crie um arquivo em:
      (data/movements/scripts/TP_Red_Skull.lua)
      local config = { storage = 39202, -- Storage usada pos_room = {x = 1231, y = 1066, z = 7}, -- Posição da sala pos_back = {x = 1132, y = 1074, z = 7} -- Posição para sair da sala } function onStepIn(player, item, position, fromPosition) if item.actionid == 5901 then if player:getSkull() >= 1 then player:sendCancelMessage("Remova seu Skull para poder entrar.") player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) else player:teleportTo(config.pos_room) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:setSkull(4) player:setSkullTime(1000*999999999999999999) player:setStorageValue(config.storage, 1) end end if item.actionid == 5902 then if player:getSkull() == 4 then if player:getStorageValue(config.storage) then player:setSkull(0) player:teleportTo(config.pos_back) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end end return true end Por favor, se puderem dar dicas para eu melhorar o script ou adicionar algo a mais, ficarei grato e terei o prazer em fazer.
      Rep+ para me motivar a postar cada vez mais coisas
    • Por tataboy67
      Opa galera beleza? Como prometido eu tentei fazer 1 script e vim posta-lo no TibiaKing...

      O script é simples e com uma boa configuração:
      Numero de membros da Party Nível necessário Se precisa de PZ para entrarem Se precisa que todos estejam perto Se só o Leader poderá entrar Teleporte que os jogadores irão Items necessários
      Como o script funciona?
                    O script ele serve como uma forma de o jogador poder entrar em 1 Sala com a necessidade de uma Party, nível necessário e alguns Items.

      Meu intuito em fazer esses tipos de scripts: 
                     Estou cada vez mais tentando aprender um pouco mais em relação a scripts Lua... Sou um pouco leigo nessa parte, mas vou continuar treinando e estudando para alimentar meu conhecimento na linguagem e o conteúdo no Fórum. Espero que vocês me apoiem no que estou tentando fazer, e agradeço a todos que estão me ajudando a entender um pouco do assunto.

      Sem mais delongas, vamos ao Script:

      Adicione a linha em:
      (data/movements/movements.xml)
      <movevent event="StepIn" actionid="5900" script="Tile_Party.lua"/>
      Crie um arquivo em:
      (data/movements/scripts/Tile_Party.lua)
      local config = { members = 2, -- membros ou +. level = 300, -- nivel que todos os membros devem ter para entrar. leader = false, -- somente o leader pode entrar no teleport. pz = true, -- só irá funcionar se todos os membros tiverem em PZ area. pos_to = {x = 1143, y = 1064, z = 7}, -- posição que os jogadores serão teleportados. other = { pert = true, -- só poderá entrar se os membros tiverem na quant_sqm de distancia. quant_sqm = 7 -- jogadores tem que estar a 7 sqm de distancia do jogador que entrou no TP. }, items = { -- itens necessários para que os players entrem. [1] = {item = 2160, count = 1}, [2] = {item = 2159, count = 1} -- [3] = {item = ItemID, count = Quantidade} }, } function onStepIn(player, item, position, fromPosition) local party = player:getParty() if not party then player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) position:sendMagicEffect(CONST_ME_MAGIC_RED) return player:sendCancelMessage("You don't have a party.") end local leader = party:getLeader() local member = party:getMembers() if config.leader and player ~= leader then player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) position:sendMagicEffect(CONST_ME_MAGIC_RED) player:sendCancelMessage("Somente o leader pode entrar por aqui.") return false end table.insert(member, leader) local ready = {} if #member >= config.members-1 then for _, var in pairs(member) do if var:getLevel() > config.level then if config.other.pert then if player:getPosition():getDistance(var:getPosition()) >= config.other.quant_sqm then player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendCancelMessage("Seu time tem que esta proximo de voce.") return end end if config.pz then if not getTileInfo(getThingPos(var)).protection then player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return player:sendCancelMessage("Seu time tem que estar em protection zone.") end end for k, v in pairs(config.items) do if var:getItemCount(v.item) < v.count then player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(22,string.format("O membro (corno) %s não possui %sx %s.", var:getName(), v.count, ItemType(v.item):getName())) return false end end table.insert(ready, var) else player:sendTextMessage(22,"Um dos membros da party não possui nivel superior a "..config.level..".") player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return false end end if rawequal(#ready, #member) then for _, var in pairs(member) do for k, v in pairs(config.items) do var:removeItem(v.item, v.count) end var:sendTextMessage(22,"Your team join the room.") var:teleportTo(config.pos_to) var:getPosition():sendMagicEffect(CONST_ME_TELEPORT) end end else player:teleportTo(fromPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) position:sendMagicEffect(CONST_ME_MAGIC_RED) player:sendTextMessage(20,"Somente party's com " .. config.members-1 .. " ou mais jogadores, poderão passar.") end return true end Deixe seu REP+ Para me motivar ainda mais a postar novos scripts para vocês.

      Créditos:
      @Snowsz
      @KotZletY
      @Vodkart
      @Lyu

      Está atualizado o script...
      Algumas configurações foram adicionadas !
      local config = { members = 2, -- membros ou +. level = 300, -- nivel que todos os membros devem ter para entrar. leader = false, -- somente o leader pode entrar no teleport. pz = true, -- só irá funcionar se todos os membros tiverem em PZ area. pos_to = {x = 1143, y = 1064, z = 7}, -- posição que os jogadores serão teleportados. other = { pert = true, -- só poderá entrar se os membros tiverem na quant_sqm de distancia. quant_sqm = 7 -- jogadores tem que estar a 7 sqm de distancia do jogador que entrou no TP. }, items = { -- itens necessários para que os players entrem. [1] = {item = 2160, count = 1}, [2] = {item = 2159, count = 1} -- [3] = {item = ItemID, count = Quantidade} }, }  
    • Por HSinhori
      eu consegui esse script mas ele não está funcionando, ele deveria fazer aparecer o addon quando eu coloco um item no inventário, e fazer desaparecer o addon quando eu removo o item, alguém poderia me ajudar?
      local outfitvip = { lookType = 128 } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) function onEquip(cid, item, slot) local param = {cid = cid, item = item, slot = slot} doPlayerAddOutfit(cid, outfitvip.lookType, 2) end function onDeEquip(cid, item, slot) doPlayerRemoveOutfit(cid,outfitvip.lookType,0) doRemoveCondition(cid, CONDITION_OUTFIT) end <movevent type="Equip" itemid="2195" slot="feet" event="script" value="addon.lua"/> <movevent type="DeEquip" itemid="2195" slot="feet" event="script" value="addon.lua"/>
    • Por xWhiteWolf
      Fala galera do TK, criei esse anelzinho pra servers que procuram inovar.. 
      bom, oque ele faz??
      Simples, ele torna o usuário invisível.
      aff, mas já existe o stealth ring que faz isso!
      Sim mas dessa vez eu digo invisível mesmo, nenhum monstro ou players conseguirá te ver.
      que lixo, assim qualquer player vai poder ficar invisível e passar no meio dos monstros e players.. vai estragar o server
      Aí é que vc se engana porque o anel vem uma maldição, quem usar ele vai perdendo 3% de vida por segundo (ajustável) e só vai estragar o server se vc sair distribuindo o anel pra todos os players haha

      O anel em si possui duas versões, na primeira ele retira 3% de vida por segundo, na segunda ele adiciona uma condição que te deixa perdendo uma quantidade fixa de vida, CONTUDO, na segunda versão aparece uma poça de sangue cada vez que toma o dano então dá pros players te pegarem caso vc coloque o anel e resolva fugir kkkkk
      Vou chamar aqui de versão 1 e 2 respectivamente.
      OBS: ISSO É EM MOVEMENTS!

       
       
      1ª versão (sem sangue mas que tira 3% de vida por segundo):
      local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) local percent = 3 local tempo = 1 -- em segundos function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "By using this ring you will become fully invisible and lose health over time because of it's curse.") function lifesteal(cid) steal = addEvent(lifesteal, 1000*tempo, cid) if isCreature(cid) then doSendAnimatedText(getCreaturePos(cid), "-"..math.floor((getCreatureMaxHealth(cid) * (percent/100))), 144, cid) doCreatureAddHealth(cid, -math.floor(getCreatureMaxHealth(cid) * (percent/100))) end end lifesteal(cid) doAddCondition(cid, invisible) doAddCondition(cid, outfit) doSendMagicEffect(getCreaturePos(cid), 12) return true end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2165) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") stopEvent(steal) doRemoveCondition(cid, CONDITION_INVISIBLE) doSendMagicEffect(getCreaturePos(cid), 12) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) return true end   2ª versão (a cada 1,5 segundos ele te tira um dano configurado e deixa uma poça de sangue embaixo de vc facilitando que te identifiquem mesmo estando invisivel):
      local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE) local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false) local condition = createConditionObject(CONDITION_PHYSICAL) setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE) addDamageCondition(condition, -1, 1500, -500) function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "By using this ring you will become fully invisible and lose health over time because of it's curse.") doAddCondition(cid, condition) doAddCondition(cid, invisible) doAddCondition(cid, outfit) doSendMagicEffect(getCreaturePos(cid), 12) return true end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 2165) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You're no longer receiving the special bonus..") doRemoveCondition(cid, CONDITION_PHYSICAL) doRemoveCondition(cid, CONDITION_INVISIBLE) doSendMagicEffect(getCreaturePos(cid), 12) doRemoveCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) return true end Agora edite no items.xml o stealth ring pra que ele seja infinito:
      <item id="2202" article="a" name="stealth ring"> <attribute key="weight" value="100" /> <attribute key="slotType" value="ring" /> <attribute key="transformDeEquipTo" value="2165" /> </item> e em movements.xml adicione essas linhas:
      <movevent type="Equip" itemid="2202" slot="ring" event="script" value="stealth.lua"/> <movevent type="DeEquip" itemid="2202" slot="ring" event="script" value="stealth.lua"/> Editando:
      Na primeira versão vc pode alterar as seguintes coisas que estão em colorido:
      local invisible = createConditionObject(CONDITION_GAMEMASTER, -1, false, GAMEMASTER_INVISIBLE)
      local outfit = createConditionObject(CONDITION_INVISIBLE, -1, false)
      local percent = 3
      local tempo = 1 -- em segundos
       
      em vermelho é o tempo que dura a invisibilidade... -1 é infinito
      em azul é a porcentagem de vida que perde por tempo
      em verde é o tempo em que se perde vida.. nesse caso a cada 1 segundo perde 3%
       
      Na segunda versão vc pode editar as mesmas coisas do primeiro só que o tempo e o dano pelo tempo estão na condition:
       
      local condition = createConditionObject(CONDITION_PHYSICAL)
      setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE)
      addDamageCondition(condition, -1, 1500, -500)
       
      em vermelho é o numero de vezes que vai tirar vida. Mais uma vez -1 significa infinito (infinito até remover o anel)
      em azul é o dano que vc toma a cada tempo (lembre-se de deixar sempre um - na frente se não ele vai adicionar vida)
      em verde é o tempo em que se perde vida.. nesse caso a cada 1 segundo e meio retira 500 de vida
       
       
      Bom, é isso.. um script simples mas que vai ajudar muita gente pelo fato de usar conditions não tão comuns e de uma forma diferente haha
    • Por Vodkart
      Créditos: AnneMotta & Vodkart
      Descrição: Ao andar com o full addon de algumas outfits irá sair um efeito.
      Em creaturescript/script crie um arquivo.lua e renomeie para:
      outfiteffect.lua
        function onLogin(cid) registerCreatureEvent(cid, "EffectOutLogin") registerCreatureEvent(cid, "OutfitEffects") return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end local events = {} function onOutfit(cid, old, current) local effect = { [136] = 3, [128] = 3, -- citizen [270] = 27,[273] = 27, -- jester [156] = 61,[152] = 61, -- assassin [147] = 44,[143] = 44, -- barbarian [148] = 45,[144] = 45, -- druid [157] = 68,[153] = 68, -- beggar [149] = 36,[145] = 36, -- wizard [279] = 17,[278] = 17, -- brotherwood [137] = 39,[129] = 39, -- hunter [141] = 66,[133] = 66, -- summoner [142] = 34,[134] = 34, -- warrior [155] = 31,[151] = 31, -- pirate [158] = 46,[154] = 46, -- shaman [288] = 6,[289] = 6 -- demonhunter } local o,c= effect[old.lookType],effect[current.lookType] if getPlayerAccess(cid) > 2 then return true elseif (not o or not c or old.lookAddons == 3 and o) then stopEvent(events[getPlayerGUID(cid)]) end if current.lookAddons == 3 and c then function WalkEffect(cid, c, pos) if not isCreature(cid) then return LUA_ERROR end if c then frompos = getThingPos(cid) if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos) end return true end WalkEffect(cid, c, {x=0, y=0, z=0}) end return true end em creaturescript.xml adicione as tags:
        <event type="login" name="EffectOutLogin" event="script" value="outfiteffect.lua"/> <event type="outfit" name="OutfitEffects" event="script" value="outfiteffect.lua"/> Como configurar:
      [iD DA OUTFIT] = N° DO EFEITO
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo