KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local vocs = {
[1] = {8871, 2647, 2641, 2190, 2525, 2457, 2003, 2160}, -- items sorc
[2] = {8871, 2647, 2641, 2182, 2525, 2457, 2003, 2160}, -- items druid
[3] = {2473, 2647, 2641, 7408, 2525, 2457, 2003, 2160}, -- items paladin
[4] = {8872, 2647, 2641, 2399, 2525, 2457, 2003, 2160} -- items knight
}
local voc = vocs[getPlayerVocation(cid)]
if item.itemid == 1740 and item.actionid == 4444 then
if voc then
if getPlayerStorageValue(cid, 155) == 0 then
doPlayerSetStorageValue(cid, 155, 1)
doPlayerAddItem(cid, voc[1], 1)
doPlayerAddItem(cid, voc[2], 1)
doPlayerAddItem(cid, voc[3], 1)
doPlayerAddItem(cid, voc[4], 1)
doPlayerAddItem(cid, voc[5], 1)
doPlayerAddItem(cid, voc[6], 1)
doPlayerAddItem(cid, voc[7], 10)
elseif getPlayerStorageValue(cid, 155) == 1 then
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "It is empty.")
end
end
end
return true
end
actions.xml =
Code:
<action actionid="4444" event="script" value="name.lua"/>
:thumbup: