Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
i need make all knight weapons in one weapons like when player click on weapon change to other weapon .
local ITEM_IDS = {
[7850] = 7839,
[7838] = 7839,
[7839] = 7840,
[7840] = 7838,
[7838] = 7850,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not ITEM_IDS[item.itemid]) then
return false
end
doTransformItem(item.uid, ITEM_IDS[item.itemid])
doDecayItem(item.uid)
return true
end
its work thx but i need some edite when player change it say weapon name like if i changed fire sword t fire axe say You transformed fire sword to fire axe.Code:local ITEM_IDS = { [7850] = 7839, [7838] = 7839, [7839] = 7840, [7840] = 7838, [7838] = 7850, } function onUse(cid, item, fromPosition, itemEx, toPosition) if(not ITEM_IDS[item.itemid]) then return false end doTransformItem(item.uid, ITEM_IDS[item.itemid]) doDecayItem(item.uid) return true end
That is clearly a clerical error.. or idk i just woke up loldoes having two of the same kind break it?Code:[7838] = 7839,
Not tested, but give this a tryits work thx but i need some edite when player change it say weapon name like if i changed fire sword t fire axe say You transformed fire sword to fire axe.
-- not tested
local ITEM_IDS = {
[7850] = 7850,
[7838] = 7839,
[7839] = 7840,
[7840] = 7838,
[7838] = 7850,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not ITEM_IDS[item.itemid]) then
return false
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You changed "..getItemInfo(item.itemid).name.." to "..getItemInfo(ITEM_IDS[item.itemid]).name..".")
doTransformItem(item.uid, ITEM_IDS[item.itemid])
doDecayItem(item.uid)
return true
end
local disteffect = 35
local effect = 66
local ITEM_IDS = {
[7838] = 7839,
[7839] = 7840,
[7840] = 7838,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not ITEM_IDS[item.itemid]) then
return false
end
if (exhaustion.check(cid, 17024)) then
doPlayerSendCancel(cid, "You will be able to use this GEM again in "..tostring(exhaustion.get(cid, 17024)).." seconds.")
return true
end
local position = getCreaturePosition(cid)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, disteffect)
end
doPlayerSendTextMessage(cid, 22, "You changed "..getItemInfo(item.itemid).name.." to "..getItemInfo(ITEM_IDS[item.itemid]).name..".")
exhaustion.set(cid, 17024, 5)
doTransformItem(item.uid, ITEM_IDS[item.itemid])
doDecayItem(item.uid)
doSendMagicEffect(getCreaturePosition(cid), 29)
return true
end