Ir para conteúdo

Posts Recomendados

TUTORIAL CRIANDO UMA RUNE ESPIÃ

 

Atraves desta runa você poderar saber muitas informações sobre os players do seu server.

 

Exemplo: Skills, Level, Magic Level e outras coisas.

 

Quem usar a rune tera que esperar um certo tempo antes de usar outra vez a rune (tempo de alerta, voce escolhe quanto tempo), se você usar a rune antes do tempo de alerta acaba, o oturo cara vai ser notificado que voce esta espiando ele e você perdera um pouco de HP (definido por vocês).

 

Passo no diretório data>actions>scripts crie um novo ficheiro com o nome spy.lua e escreva o seguinte code:

 

------- Spy Rune 2.0 by Colex--------

function onUse(cid, item, frompos, item2, topos)



storevalue = 2468 ---ai sera guardado o tempo de alerta

alerttime = 120 ---tempu de espera antes de usar novamente a rune para naum dar alerta nu outro char

playeraccess = getPlayerAccess(item2.uid)

name = getPlayerName(item2.uid)

name2 = getPlayerName(cid)

level = getPlayerLevel(item2.uid)

ml = getPlayerMagLevel(item2.uid)

fist = getPlayerSkill(item2.uid,0)

club = getPlayerSkill(item2.uid,1)

sword = getPlayerSkill(item2.uid,2)

axe = getPlayerSkill(item2.uid,3)

distance = getPlayerSkill(item2.uid,4)

shield = getPlayerSkill(item2.uid,5)

fish = getPlayerSkill(item2.uid,6)

hp = 100 ---quantu hp vc perde se naum esperar u tempo de alerta passar antes de usar a rune otra vez



if item2.itemid == cid then

if playeraccess == 0 then

 if (alert(cid, storevalue, alerttime) == 1) then

doPlayerSendTextMessage(cid,4,"Name: "..name.."")

doPlayerSendTextMessage(cid,4,"Level: "..level.."")

doPlayerSendTextMessage(cid,4,"Magic Level: "..ml.."")

doPlayerSendTextMessage(cid,4,"Fist: "..fist.."")

doPlayerSendTextMessage(cid,4,"Club: "..club.."")

doPlayerSendTextMessage(cid,4,"Sword: "..sword.."")

doPlayerSendTextMessage(cid,4,"Axe: "..axe.."")

doPlayerSendTextMessage(cid,4,"Distance: "..distance.."")

doPlayerSendTextMessage(cid,4,"Shielding: "..shield.."")

doPlayerSendTextMessage(cid,4,"Fishing: "..fish.."")

 else

doPlayerSendTextMessage(item2.uid,22,""..name2.." is spying you.")

doPlayerAddHealth(cid,-hp)

doPlayerSendTextMessage(cid,22,"Your alert level is too high, beware.")

 end

else

 doPlayerSendCancel(cid,"You can not use this rune on that player.")

end

else

doPlayerSendCancel(cid,"You can not use this rune there.")

end





return 1

end







function alert(cid, storevalue, alerttime)



 newAlert = os.time()

 oldAlert = getPlayerStorageValue(cid, storevalue)

 if (lastalert == nil or lastalert < 0) then

  lastalert = 0

 end

 if (alerttime == nil or alerttime < 0) then

  alerttime = 1

 end

 diffTime = os.difftime(newAlert, oldAlert)

 if (diffTime >= alerttime) then

  setPlayerStorageValue(cid, storevalue, newAlert)

  return 1

 else

  return 0

 end 

end

 

Passo na pasta data>actions abra o ficheiro actions.xml e adicione:

 

<action itemid="2274" script="spy.lua" allowfaruse="1" />

 

Espero que gostem...

 

Creditos: Colex

 

Atenciosamente,

~DD ou ~DarezinhUu - Campeão da 1ª MDS Xtibia

Link para o comentário
https://xtibia.com/forum/topic/57945-criando-runa-espi%C3%A3-creating-the-spy-rune/
Compartilhar em outros sites

  • 8 months later...
  • 4 weeks later...

Teria como fazer da Spy Rune uma magia ???

Trava-se a mira em cima do carinha e ativa o spell(ou o spell por talkaction tanto faz!)... ??

 

=D Se tiver me ajuda PLZZZ

seria um novo tópico até!

Link para o comentário
https://xtibia.com/forum/topic/57945-criando-runa-espi%C3%A3-creating-the-spy-rune/#findComment-538753
Compartilhar em outros sites

  • 2 years later...
  • 7 months later...

Interesante, porem não é uma spell que eu colocaria no meu ot.

Mas sua ideia foi bem legal cara, muito bem pensado :thumbsupsmiley:

Aprovado.

Editado por furlanetto
Link para o comentário
https://xtibia.com/forum/topic/57945-criando-runa-espi%C3%A3-creating-the-spy-rune/#findComment-1051415
Compartilhar em outros sites

  • 3 months later...
×
×
  • Criar Novo...