Old Old School Server
Welcome 2 Old School
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  GalleriesGalleries   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[7.6][lua] Zbiornik Na Mane.

 
Post new topic   Reply to topic    Old School Server Forum Index -> Skrypty
View previous topic :: View next topic  
Author Message
RHTM
Hoster
<font color=blue>Hoster</font>



Joined: 14 Feb 2007
Posts: 1341
Read: 0 topics

Warns: 0/5
Location: Wrocław

PostPosted: Sat 14:00, 07 Apr 2007    Post subject: [7.6][lua] Zbiornik Na Mane.

Witam.Skrtpt polega na :
-wysysaniu many do zbiornika)przechowanie
-wypijaniu many ze zbiornika kiedy chcemy

Przykład: idziemy sobie i jezeli mamy za duzo many i jest niepotzrebna klikamy na zbiornik i uzywamy go na siebie.nastepnie gd jest nam brak many mozemy wypic to o wczesniej zostawilismy ;)

Tworzymy zbiornik.lua

Code:
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


w actions.xml dodajemy:

Code:
<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 do dzieła ;)

Skrytp by Medyk II


The post has been approved 0 times
Back to top
View user's profile
eVul
Tutor



Joined: 14 Feb 2007
Posts: 210
Read: 0 topics

Warns: 1/5
Location: GzK

PostPosted: Sat 14:01, 07 Apr 2007    Post subject:

Bardzo przydatne.
Btw. Jak określimy ile many chcemy zostawić?


The post has been approved 0 times
Back to top
View user's profile
Gumis Mkr
Style



Joined: 18 Feb 2007
Posts: 468
Read: 0 topics

Warns: 1/5

PostPosted: Sat 14:03, 07 Apr 2007    Post subject:

chyba max zabiera ci 400

The post has been approved 0 times
Back to top
View user's profile
Shadow smierci
Senior Tutor



Joined: 14 Feb 2007
Posts: 1038
Read: 0 topics

Warns: 5/5
Location: z Żyrardowa xD

PostPosted: Sat 14:04, 07 Apr 2007    Post subject:

taaa... se sork idzie pakuje all mane do zbiorniczka potem ktos mu sciaga knighta np. slowlego i ten wali spam love laduej mane i poprawa i slwoly pada,,xD??

The post has been approved 0 times
Back to top
View user's profile
eVul
Tutor



Joined: 14 Feb 2007
Posts: 210
Read: 0 topics

Warns: 1/5
Location: GzK

PostPosted: Sat 14:05, 07 Apr 2007    Post subject:

Chyba jest limit, bo tak to gra nie miałaby sensu...

The post has been approved 0 times
Back to top
View user's profile
RHTM
Hoster
<font color=blue>Hoster</font>



Joined: 14 Feb 2007
Posts: 1341
Read: 0 topics

Warns: 0/5
Location: Wrocław

PostPosted: Sat 14:08, 07 Apr 2007    Post subject:

tak chyba 400 many można max xD

The post has been approved 0 times
Back to top
View user's profile
Shadow smierci
Senior Tutor



Joined: 14 Feb 2007
Posts: 1038
Read: 0 topics

Warns: 5/5
Location: z Żyrardowa xD

PostPosted: Sat 14:11, 07 Apr 2007    Post subject:

eee tam to max Muminek moze przez to pasc;/

The post has been approved 0 times
Back to top
View user's profile
Sorcerer
Newbie



Joined: 31 Mar 2007
Posts: 5
Read: 0 topics

Warns: 0/5
Location: Old School

PostPosted: Sun 23:10, 08 Apr 2007    Post subject:

klikasz na siebie dodajesz 400 max (chyba ze masz mniej) manny i klikając na to dodajesz tyle manny ile tam jest i nie tak jak pisal rht tylko aby to zrobic wpisujesz

/i 4864 1 (i masz w tym 1 many)
/i 4864 100 (masz 100)


The post has been approved 0 times
Back to top
View user's profile
RHTM
Hoster
<font color=blue>Hoster</font>



Joined: 14 Feb 2007
Posts: 1341
Read: 0 topics

Warns: 0/5
Location: Wrocław

PostPosted: Mon 0:22, 09 Apr 2007    Post subject:

Sorcerer wrote:
klikasz na siebie dodajesz 400 max (chyba ze masz mniej) manny i klikając na to dodajesz tyle manny ile tam jest i nie tak jak pisal rht tylko aby to zrobic wpisujesz

/i 4864 1 (i masz w tym 1 many)
/i 4864 100 (masz 100)


Raczej my nie działało /i 4864 100 (masz 100) poniewaz moza było by zrobic tylko jeden ziornik, to tak sało jak bys chciał zrobic tak np. 100 MPA


The post has been approved 0 times
Back to top
View user's profile
Sorcerer
Newbie



Joined: 31 Mar 2007
Posts: 5
Read: 0 topics

Warns: 0/5
Location: Old School

PostPosted: Mon 10:08, 09 Apr 2007    Post subject:

Hmm... Może masz inna wersje skryptu ? bo ja edytowałem i mam tak ile dam tyle robi :D

A na nie których OTS nie da sie zrobić 100 MPA wpisując np. /i 8888 100 a u mnie da :)


The post has been approved 0 times
Back to top
View user's profile
RHTM
Hoster
<font color=blue>Hoster</font>



Joined: 14 Feb 2007
Posts: 1341
Read: 0 topics

Warns: 0/5
Location: Wrocław

PostPosted: Mon 10:54, 09 Apr 2007    Post subject:

Sorcerer wrote:
Hmm... Może masz inna wersje skryptu ? bo ja edytowałem i mam tak ile dam tyle robi :D

A na nie których OTS nie da sie zrobić 100 MPA wpisując np. /i 8888 100 a u mnie da :)


hmm... nie wiem nie spotkalem sie jeszcze z takim otsem xD


The post has been approved 0 times
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Old School Server Forum Index -> Skrypty All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group
Regulamin