Hello. I use TFS 0.3.7 [based on OTX2]
Who Can optimized for me desert quest [solo] ?
This is my code.
Who Can optimized for me desert quest [solo] ?
This is my code.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storageValue = 61111 -- only if status is false this will be used
local sorcerer = {1,5}
local itemId1 = 2175
local druid = {2,6}
local itemId2 = 2674
local paladin = {3,7}
local itemId3 = 2455
local knight = {4,8}
local itemId4 = 2376
local newPos = {x = 1835, y = 1143, z = 8} -- Position of the reward room.
local itemPos = {x=1827,y=1133,z=9,stackpos=2} -- Position of Spellbook "Sorcerer".
local stackpos = {2,3,4,5,6,7,8,9,10}
local pos = {x = 1827, y = 1134, z = 9}
if getPlayerVocation(cid) == 1 or 5 and getItemCountFromPosition(itemId1, itemPos) == 1 then
doRemoveItem(getTileItemById(itemPos,itemId1).uid,1)
doSendMagicEffect(itemPos, CONST_ME_HITBYFIRE)
setPlayerStorageValue(cid, storageValue, 1)
doTeleportThing(cid, newPos)
doCreatureSay(cid, "Done! Reward Desert Room.", TALKTYPE_ORANGE_1, false, cid, pos)
else if getPlayerVocation(cid) == 2 or 6 and getItemCountFromPosition(itemId2, itemPos) == 1 then
doRemoveItem(getTileItemById(itemPos,itemId2).uid,1)
doSendMagicEffect(itemPos, CONST_ME_HITBYFIRE)
setPlayerStorageValue(cid, storageValue, 1)
doTeleportThing(cid, newPos)
doCreatureSay(cid, "Done! Reward Desert Room.", TALKTYPE_ORANGE_1, false, cid, pos)
else if getPlayerVocation(cid) == 3 or 7 and getItemCountFromPosition(itemId3, itemPos) == 1 then
doRemoveItem(getTileItemById(itemPos,itemId3).uid,1)
doSendMagicEffect(itemPos, CONST_ME_HITBYFIRE)
setPlayerStorageValue(cid, storageValue, 1)
doTeleportThing(cid, newPos)
doCreatureSay(cid, "Done! Reward Desert Room.", TALKTYPE_ORANGE_1, false, cid, pos)
else if getPlayerVocation(cid) == 4 or 8 and getItemCountFromPosition(itemId4, itemPos) == 1 then
doRemoveItem(getTileItemById(itemPos,itemId4).uid,1)
doSendMagicEffect(itemPos, CONST_ME_HITBYFIRE)
setPlayerStorageValue(cid, storageValue, 1)
doTeleportThing(cid, newPos)
doCreatureSay(cid, "Done! Reward Desert Room.", TALKTYPE_ORANGE_1, false, cid, pos)
else
doCreatureSay(cid, "You don't have items for your vocation or you don't have 20 level!", TALKTYPE_ORANGE_1, false, cid, pos)
return TRUE
end
end
end
end
end