• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Can anyone fix the error with this?

Ezzam

New Member
Joined
Jan 16, 2008
Messages
213
Reaction score
2
Solved it. [TFS 0.3 beta2]


First, when you create quest put UniqueID=ItemID & ActionID=Count+100

Ex. Golden armor would be like this:[/B]
14500727zh5.png

AID=101(OBS: You must set AID, to only get 1 item write AID: 101)
UID=2466 (ID of g-arm)


Save as "Quest.lua" in "...\data\actions\scripts\
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	price = item.uid
	count = item.actionid - 100

  if price > 1000 and price < 10000 then
    queststatus = getPlayerStorageValue(cid, price)
    local itemWeight = getItemWeight(price, count)
    local playerCap = getPlayerFreeCap(cid)

    if queststatus == -1 then
      if playerCap >= itemWeight then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found ' .. count .. ' ' .. getItemName(price) .. '.')
        doPlayerAddItem(cid, price, count)
        setPlayerStorageValue(cid, price, 1)
      else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found ' .. count .. ' ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
      end
    else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
  end
  return TRUE
end

Put in "...\data\actions\actions.xml"

Code:
<action itemid="1740" script="Quest.lua"/>
<action fromid="1747" toid="1749" script="Quest.lua"/>
 
Last edited:
Hi,
You Try This Script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid > 1000 and item.uid < 10000 then
		local itemWeight = getItemWeight(item.uid, 1)
		local playerCap = getPlayerFreeCap(cid)
		if isInArray(annihilatorReward, item.uid) == TRUE then
			if getPlayerStorageValue(cid, 30015) == -1 then
				if playerCap >= itemWeight then
					if item.uid == 1990 then
						container = doPlayerAddItem(cid, 1990, 1)
						doContainerAddItem(container, 2326, 1)
					else
						doPlayerAddItem(cid, item.uid, 1)
					end
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
					setPlayerStorageValue(cid, 30015, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
			end
		elseif getPlayerStorageValue(cid, item.uid) == -1 then
			if playerCap >= itemWeight then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
				doPlayerAddItem(cid, item.uid ,1)
				setPlayerStorageValue(cid, item.uid, 1)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end
	else
		return FALSE
	end
	return TRUE
end
 
I edited that script to make it smaller (without annihilator) and able to use count, Ex.
UID=2160 (Crystal Coin)
AID=125 (Action id -100 = 25 CC)
 
Have you tried to get the code from 0.2.22?
And, if it returns any error, try to fix it by yourself...

Tprocheira
 
As I said.

I have edited the TFS script to be better.
AID -100 is the count you get.
And it still checks the correct weight if it's multiple items.
 
Back
Top