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
Spoiler: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
Spoiler:<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
Spoiler: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
Spoiler:<action itemid="2345" script="explus.lua" />
Przykład użycia artefaktu w queście:
w actions/scripts/lvlquest1.lua
Spoiler: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
Spoiler:<action uniqueid="9392" script="lvlquest1.lua" />I tworzymy na mapie Skrzynke (lub cos innego) o UniqueID 9392.
|