Forum Tibiaaforum.fora.pl Strona Główna


Tibiaaforum.fora.pl
.:Open Tibia Server!:.
Odpowiedz do tematu
[7.6] Zbiornik na mane :)
piotres62



Dołączył: 01 Sie 2007
Posty: 2
Przeczytał: 0 tematów

Ostrzeżeń: 0/10
Skąd: Poznań

Temat * Zbiornik na mane!
Klient * 7.6
Informacja:
Skypt Polega Na:
- Wysysaniu many do zbiornika ( przechowanie )
- Wypijaniu many ze zbiornika kiedy chcemy.
Przykład: Idziemy sobie i jeżeli mamy za dużo many i jest niepotrzebna klikamy na zbiornik i używamy go na siebie. Nastęnie gdy jest nam brak many możemy wypić to co wcześniej zostawiliśm Smile
Tworzymy w Data/Actions/zbiornik.lua

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


maxmana = 400 -- ile many ma dodawać
notfullmana = getPlayerMana(cid)

if item.itemid == 4864 then
doTransformItem(item2.uid,4863)
doPlayerAddMana(cid,getPlayerStorageValue(cid,1))
doPlayerSendCancel(cid,'You recovered ' .. getPlayerStorageValue(cid,1) .. ' of mana.')
doSendMagicEffect(topos,1)

elseif item.itemid == 5884 and getPlayerMana(cid) >= maxmana-getPlayerStorageValue(cid,1) then
doTransformItem(item.uid,4864)
doPlayerSendCancel(cid,'You kept more '.. maxmana-getPlayerStorageValue(cid,1) ..' of mana.')
doPlayerAddMana(item2.uid,maxmana-getPlayerStorageValue(cid,1))
doSendMagicEffect(frompos,1)

elseif item.itemid == 5884 then
doTransformItem(item2.uid,4863)
doPlayerAddMana(cid,getPlayerStorageValue(cid,1))
doPlayerSendCancel(cid,'You recovered ' .. getPlayerStorageValue(cid,1) .. ' of mana.')
setPlayerStorageValue(cid,1,1)
doSendMagicEffect(topos,1)

elseif getPlayerMana(cid) >= maxmana and item.itemid == 4863 then
doTransformItem(item.uid,4864)
doPlayerSendCancel(cid,"You kept ' .. maxmana .. ' of mana.")
doPlayerAddMana(item2.uid,-maxmana)
setPlayerStorageValue(cid,1,maxmana)
doSendMagicEffect(topos,1)
else
doTransformItem(item.uid,5884)
doPlayerSendCancel(cid,'You kept ' .. notfullmana .. ' of mana.')
setPlayerStorageValue(cid,1,notfullmana)
doPlayerAddMana(item2.uid,-notfullmana)
doSendMagicEffect(topos,1)


end

return 1
end

Zaś w actions.xml dodajemy:

<action itemid="4863" script="zbiornik.lua" allowfaruse="0" />
<action itemid="4864" script="zbiornik.lua" allowfaruse="0" />
<action itemid="5884" script="zbiornik.lua" allowfaruse="0" />

Potem tworzymy: /i 4836 1 i mamy Very Happy
Skrypt nie jest mój.
Pozdro piotres62 Wink


Post został pochwalony 0 razy
Zobacz profil autora
Mila1987



Dołączył: 23 Sty 2008
Posty: 3
Przeczytał: 0 tematów

Ostrzeżeń: 1/10

dobre, mi sie podoba na moim otsie


Post został pochwalony 0 razy
Zobacz profil autora
[7.6] Zbiornik na mane :)
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Wszystkie czasy w strefie EET (Europa)  
Strona 1 z 1  

  
  
 Odpowiedz do tematu