Twój OTS

Wszystko Do Twego OTsa


#1 2008-07-11 11:21:40

MiniTibijczyk

http://opentibia.xad.pl/templates/UnholyDark/images/ranks/60.png

Zarejestrowany: 2008-07-11
Posty: 26
Punktów :   

8.1 Artefakt dodający lvl

Skrypt który tworzy artefakt dodający lvl.
Może go stworzyć GameMaster, lub można zrobić z niego nagrodę w queście!

w data/Talkactions/scripts twożymy
exp.lua i wklejamy


function onSay(cid, words, param)

       
    if getPlayerAccess(cid) > 2 then

       
        it = doPlayerAddItem(cid,2345,1)   
        doSetItemSpecialDescription(it, param .. ' LvL +')
        doSetItemActionId(it,'10000'+param)

    else
      doPlayerSendCancel(cid, 'Nie jestes GMem!')
    end

end


a w Talkactions.xml

<talkaction words="/addexp" script="exp.lua" />Przykładowo /addexp "10 Stworzy artefakt dodający 10lvli.





Użycie artefaktu:

Twożymy w data/actions/scripts/explus.lua i wklejamy


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

    lvl = getPlayerLevel(cid)
if lvl + item.actionid - 10000 < 501 then
   if item.actionid ~= 0 then
    now = ((50/3)*lvl*lvl*lvl)-(100*lvl*lvl)+((850/3)*lvl)-200
    lvl = lvl + item.actionid - 10000
    exp = ((50/3)*lvl*lvl*lvl)-(100*lvl*lvl)+((850/3)*lvl)-200 - now
    doPlayerAddExp(cid,exp)
    doSendAnimatedText(frompos, item.actionid - 10000 .. 'LvL +', 8)
    doSendMagicEffect(frompos,40)
   else
      doPlayerSendTextMessage(cid, 19, 'Ten artefakt jest falszywy!')
   end
    doRemoveItem(item.uid,1)
else
   doPlayerSendTextMessage(cid, 19, 'Twój lvl jest juz za wysoki na powiekszenie go artefaktem o ' .. item.actionid - 10000 .. 'LvL.')
end

end


a w Actions.xml

<action itemid="2345" script="explus.lua" />




Przykład użycia artefaktu w queście:




w actions/scripts/lvlquest1.lua

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

if getPlayerStorageValue(cid,3957) == -1 then
  doPlayerSendTextMessage(cid,22,"Znalazles 5lvl+.")
  it = doPlayerAddItem(cid,2345,1)
  doSetItemSpecialDescription(it, param .. ' LvL +')
  doSetItemActionId(it,10005)
  setPlayerStorageValue(cid,3957,1)
else
  doPlayerSendTextMessage(cid,22,"It is empty.")
end
end



Actions.xml

<action uniqueid="9392" script="lvlquest1.lua" />I tworzymy na mapie Skrzynke (lub cos innego) o UniqueID 9392.

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.hateandlove.pun.pl www.skate-in-zyrardow.pun.pl www.ogamedodatki.pun.pl www.landwirtshaft2009.pun.pl www.festivalparkopole.pun.pl