TI
talkaction

[Talkaction] Espiar Equipamentos

Por tibiaa4e, 04 de mar. de 2010 em Actions e Talkactions

script
5
2.9k
tibiaa4eT
04 de março de 2010 às 02:38

Uma action tosca, mais legal na qual você descobre o equipamento do outro player

Funcionado como a exiva.

 

-- Equipment spy by Azi [ersiu] --
function getItemsInContainer(cont, sep)
   local text = ""
   local tsep = ""
   local count = ""
   for i=1, sep do
       tsep = tsep.."-"
   end
   tsep = tsep..">"
   for i=0, getContainerSize(cont.uid)-1 do
       local item = getContainerItem(cont.uid, i)
       if isContainer(item.uid) == FALSE then
           if item.type > 0 then
               count = "("..item.type.."x)"
           end
           text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
       else
           if getContainerSize(item.uid) > 0 then
               text = text.."\n"..tsep..getItemNameById(item.itemid) 
               text = text..getItemsInContainer(item, sep+2)
           else
               text = text.."\n"..tsep..getItemNameById(item.itemid)
           end
       end
   end
   return text
end

function onSay(cid, words, param, channel)
   if(param == "") then
       doPlayerSendCancel(cid, "Command requires param.")
       return TRUE
   end
   local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
   local player = getPlayerByNameWildcard(param)
   if isPlayer(player) == TRUE then
       local text = getPlayerName(player).."'s Equipment: "    
       for i=1, 10 do
           text = text.."\n\n"
           local item = getPlayerSlotItem(player, i)
           if item.itemid > 0 then
               if isContainer(item.uid) == TRUE then
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
               else
                   text = text..slotName[i]..": "..getItemNameById(item.itemid)
               end
           else
               text = text..slotName[i]..": Empty"
           end
       end
       doShowTextDialog(cid, 6579, text)
   else
       doPlayerSendCancel(cid, "This player is not online.")
   end
   return TRUE
end

 

e em talkactions.xml adicione:

<talkaction log="yes" access="3" words="!equipment" event="script" value="equipment.lua"/>  

 

O access 3 so permite gods ver

se quiser que qualquer um use

use access 0

 

Creditos: Azi

4 meses depois...
caiocesar2C
06 de julho de 2010 às 17:52

Gostei do Script, irei testar em meu servidor.

 

Obrigado.

 

Abraços

zani123Z
06 de julho de 2010 às 18:07

Eu gostei desse script... ja coloquei ele num OT aqui.

Seria legal se você colocasse uma função para espiar skills dos outros :D

ciappabrotherC
10 de julho de 2010 às 18:24

Gostei Muito! Ja Coloquei no meu OT!

 

Mas Sei de um jwito cara que deixaria ele Muito Tesao!

 

Quando o God Falar o Comando Em Ves de Apareser Nome , Aparesese a Imagen do Item! Dai no Exemplo da Backpack Embaixo dela Taria o Que Tivese dentro!

 

 

Tenta Faser Abracs

2 semanas depois...
rlvpR
20 de julho de 2010 às 13:33

Aí você ja quer demais né anfarosx :)

Esse seu script é muito bom, ajuda muito a descobrir bugs.