Ir para conteúdo

Featured Replies

  • 2 years later...
  • Respostas 30
  • Visualizações 4.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 1)  itemport.lua: local config = { storage = 49607,  tempo = 10, itemid = 6217 } local positions = {} function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) <= 0 th

  • eu fiz a segunda spell igualzinha do server dos caras, com o dano e tudo..  dá uma olhada na minha assinatura. A primeira spell o item não some porque o jeito que tem de fazer ele sumir é por Decay e

  • ah desculpa, entendi agora... esse script aí tava cheio de erros, eu refiz nos moldes que você queria, espero que você goste    

Postado
Em 15/06/2014 ás 17:14, xWhiteWolf disse:

1) 

itemport.lua:


local config = {
storage = 49607, 
tempo = 10,
itemid = 6217
}


local positions = {}


function onCastSpell(cid, var)


if getPlayerStorageValue(cid, config.storage) <= 0 then
table.insert(positions, getThingPos(cid))
doPlayerSetStorageValue(cid, config.storage, #positions)
doCreateItem(config.itemid, getThingPos(cid))
doSendMagicEffect(getThingPos(cid), 3)
addEvent(function()
  if isCreature(cid) then
  doPlayerSendTextMessage(cid, 22, "Your item has expired.")
  doPlayerSetStorageValue(cid, config.storage, 0)
  table.remove(positions, getPlayerStorageValue(cid, config.storage))
  end
 end, 1000*config.tempo)
elseif getPlayerStorageValue (cid, config.storage) > 0 then
doTeleportThing(cid, positions[getPlayerStorageValue(cid, config.storage)]) 
doSendMagicEffect(getThingPos(cid), 10)
end
return true
end

2)

playerport.lua 


local config = {
storage = 49608,
tempo = 10
}


function onCastSpell(cid, var)
if isPlayer(getCreatureTarget(cid)) then
local name = getCreatureName(getCreatureTarget(cid))


if getPlayerStorageValue(cid, config.storage) <= 0 then
doPlayerSetStorageValue(cid, config.storage, 1)
doSendMagicEffect(getThingPos(cid), 65)
doSendMagicEffect(getThingPos(getCreatureByName(name)), 65)
addEvent(function()
  if isCreature(cid) then
  doPlayerSetStorageValue(cid, config.storage, 0)
  doTeleportThing(cid, getThingPos(getCreatureByName(name))) 
  end
 end, 1000*config.tempo)
elseif getPlayerStorageValue (cid, config.storage) > 0 then
doSendMagicEffect(getThingPos(cid), 2)
doPlayerSendCancel(cid, "You've already set your target.")
end
else
doPlayerSendCancel (cid, "You can only use this spell on players.")
end
return true
end

e no spells.xml:


<instant name="TK SUPORT" words="itemport" lvl="50" mana="100" prem="1" exhaustion="1000" needlearn="0" event="script" value="especiais/itemport.lua">
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>
<instant name="TK SUPORT" words="playerport" lvl="50" mana="100" prem="1" range="7" needtarget="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="especiais/playerport.lua">
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>

agora vá em creaturescripts\scripts\login.lua e adicione essas linhas antes do ultimo return true


 if getPlayerStorageValue(cid, 49607) == -1 then
        setPlayerStorageValue(cid, 49607, 0) 
    end 

 if getPlayerStorageValue(cid, 49608) ~= 0 then
        setPlayerStorageValue(cid, 49608, 0) 
    end 

Tenho uma grande duvida como eu faço para o item sumir quando expirado ??

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

Postado
3 horas atrás, David Otserver disse:

Tenho uma grande duvida como eu faço para o item sumir quando expirado ??

só botar decay no items.xml. São duas linhas (o tempo que demora em segundos pro item sofrer decay e pra qual id vc vai transformar ele.. pra ele sumir é só botar 0 no id)

Postado
Em 13/02/2017 ás 07:32, xWhiteWolf disse:

só botar decay no items.xml. São duas linhas (o tempo que demora em segundos pro item sofrer decay e pra qual id vc vai transformar ele.. pra ele sumir é só botar 0 no id)

Não consegui pode me explicar melhor?

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo