CA

Aol Especial

Por Carnavotu, 12 de out. de 2011 em Scripts

otserv
tibia
script
24
4.5k
CarnavotuC
12 de outubro de 2011 às 00:53

Bom galera estou com um script de um aol que ele nao perde lvl e quando ta black e red skull nao perde nada, mas o problema e quando o player morre volta pro level 1, alguem sabe resolve?

 

Script:

local config = {
       ammyID = 2130,
       lossExp = false,
       lossItems = false
       }

function onDeath(cid, lastHitKiller, mostDamageKiller)
       if isPlayer(cid) then
                if (getPlayerSlotItem(cid, 2).itemid == config.ammyID) then
                               if (config.lossExp == false) then
                                       doPlayerSetLossPercent(cid, experience, 0)
                               end

                               doCreatureSetDropLoot(cid, config.lossItems)
                               return true
                end
       end

       return true
end

 

Abrass, Bom feriado :thumbsupsmiley:

EskyloE
12 de outubro de 2011 às 01:04

... leia meo post abaixo

Editado Outubro 18 por Eskylo

CarnavotuC
12 de outubro de 2011 às 01:46

Continua voltando ao level 1 :winksmiley02:

 

Abrass

EskyloE
12 de outubro de 2011 às 10:44

ah desculpa. n tinha testado aki, eu acho q precisa ser preparedeath em vez de death na funcao

 

local config = {
       ammyID = 2130,
       lossExp = false,
       lossItems = false
       }

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
       if isPlayer(cid) then
                if (getPlayerSlotItem(cid, 2).itemid == config.ammyID) then
                               if (config.lossExp == false) then
                                       doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
                               end

                               doCreatureSetDropLoot(cid, config.lossItems)
                               return true
                end
       end

       return true
end

 

ai vai ter q troca isso no creaturescripts/xml tb

 

CarnavotuC
12 de outubro de 2011 às 12:28

Eu testei né um ot private aqui deu certo, mas quando vo testa no meu online ele volta pro level 1, sendo que e o mesmo ot.

 

Abrass :thumbsupsmiley:

Editado Outubro 12 por Carnavotu

CarnavotuC
15 de outubro de 2011 às 10:59

Preciso de mais uma ajuda, meu ot e xp alto, level baixo o amulet não faz perder level mais quando almenta de mais ele volta pro level 1, alguém sabe arruma?

 

Abrass

Piabeta KunP
15 de outubro de 2011 às 11:29

isso e erro na distro do seu ot , troque por outra! nunca funcionara se nao mudar!

 

fuiz

CarnavotuC
15 de outubro de 2011 às 11:39

Cabei de troca, e ainda persiste o erro.

 

 

Abrass

15 de outubro de 2011 às 11:53

tenta trocar o loos na vocation com migo tbm foi assim

bota 0 em vez de 30

1418311
15 de outubro de 2011 às 12:08

Em que pasta do seu OT voce colocou esse script ?

Voce precisa colocar em data/creaturescripts e criar um arquivo preparedeath.lua e colocar seu script , dai depois adiciona uma linha em data/creaturescripts/login e adicione isso :

 

registerCreatureEvent(cid, "onPrepareDeath")

end

 

Espero que de certo ..

Editado Outubro 15 por StremeMakky

netflat2N
15 de outubro de 2011 às 12:26

Um outro ponto de vista de fazer o script :)

 

local ammyID = 2130

function onDeath(cid, lastHitKiller, mostDamageKiller)
   registerCreatureEvent(cid, "onPrepareDeath")
   if isPlayer(cid) then
       if (getPlayerSlotItem(cid, 2).itemid == ammyID) then
           for i = 1, 5 do
               doPlayerAddBlessing(cid, i)
           end
       end
   end
   return true
end

Editado Outubro 15 por Busc4pe

CarnavotuC
15 de outubro de 2011 às 12:47

Churupetinhaa já puis e almenta um poco o level depois as pessoas com mais perde de novo. StremeMakky já existe um preparedeath.lua no creatureevents. StremeMakky esse script perde level?

 

Abrass

1418311
15 de outubro de 2011 às 13:06

Entao, amigo, so adiciona a linha em login :

registerCreatureEvent(cid, "onPrepareDeath")

end

 

E no arquivo preparedeath.lua adiciona o script do Eskylo :

 

local config = {

ammyID = 2130,

lossExp = false,

lossItems = false

}

 

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

if isPlayer(cid) then

if (getPlayerSlotItem(cid, 2).itemid == config.ammyID) then

if (config.lossExp == false) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)

end

 

doCreatureSetDropLoot(cid, config.lossItems)

return true

end

end

 

return true

end

 

Caso tenha mais duvidas poste o arquivo preparedeath.lua , eu mostro para voce como colocar .

 

E voce precisa ir em items.xml e colocar isso :

 

</item>

<item id="2130" article="an" name="NOME DO SEU AMULET">

<attribute key="weight" value="420" />

<attribute key="slotType" value="necklace" />

<attribute key="charges" value="1" />

<attribute key="preventDrop" value="1" />

 

Fale se persistir voltando para o level 1 .

Editado Outubro 15 por StremeMakky

15 de outubro de 2011 às 16:50

da uma olhada nesse topico aki

 

Clique aqui

 

tipo assim vai na sua aol red skull bota la <attribute key="preventDrop" value="9999999" />

e la em vacation.xml vc bota nas vocation que nao tem loss vc adiciona o loos e bota 0 se nao for isso me esuqesi

 

Testa Os 3 acho que o utimo e melhor

 

pra ver se vai

 

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

if isPlayer(cid) == true then

if (getPlayerSlotItem(cid, 2).itemid == 2138) then

doCreatureSetDropLoot(cid, false)

doPlayerSetLossPercent(cid, experience, 0)

doCreatureAddHealth(cid, health,40000)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)

return TRUE

end

end

return TRUE

end

 

local config = {

ammyID = 2130,

lossExp = false,

lossItems = false

}

 

function onDeath(cid, lastHitKiller, mostDamageKiller)

if isPlayer(cid) then

if (getPlayerSlotItem(cid, 2).itemid == config.ammyID) then

if (config.lossExp == false) then

doPlayerSetLossPercent(cid, experience, 0)

end

 

doCreatureSetDropLoot(cid, config.lossItems)

return true

end

end

 

return true

end

 

-- Sebasbe and Nicekid(Xtibia) --

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

if isPlayer(cid) == TRUE then

if (getPlayerSlotItem(cid, 2).itemid == 2196) and getPlayerSkullType(cid) >= 4 then

doCreatureSetDropLoot(cid, false)

doPlayerSetLossPercent(cid, experience, 0)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)

return TRUE

end

end

return TRUE

end

Editado Outubro 15 por Churupetinhaa

CarnavotuC
15 de outubro de 2011 às 19:26

StremeMakky ja tem a linha:

 

function onLogin(cid)
registerCreatureEvent(cid, "onPrepareDeath")  
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
	doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

Editado Outubro 15 por Carnavotu