- Dołączył
- Maj 21, 2008
- Posty
- 11
- Liczba reakcji
- 1
Skrypt kt?ry tworzy item 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:
a w Talkactions.xml
Actions.xml
I tworzymy na mapie Skrzynke (lub cos innego) o UniqueID 9392 
wiem, ?e tak troszk? dziwnie napisane ale to m?j pierwszy skrypt dodany na stronie;D Jak jest jaki? b??d to pisa? ;p!!!
Poprawi?em
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:
Kod:
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
Kod:
<talkaction words="/addexp" script="exp.lua" />Przyk?adowo /addexp "10 Stworzy item dodaj?cy 10lvli.
U?ycie itemu:
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 item jest falszywy!')
end
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid, 19, 'Tw?j lvl jest juz za wysoki na powiekszenie go itemem o ' .. item.actionid - 10000 .. 'LvL.')
end
end
a w Actions.xml
<action itemid="2345" script="explus.lua" />
Przyk?ad u?ycia itemu 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
Kod:
<action uniqueid="9392" script="lvlquest1.lua" />

wiem, ?e tak troszk? dziwnie napisane ale to m?j pierwszy skrypt dodany na stronie;D Jak jest jaki? b??d to pisa? ;p!!!
Poprawi?em

Ostatnia edycja:

