• 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!

Action My mision

KylerXX

Active Member
Joined
Jun 24, 2010
Messages
439
Reaction score
30
I made one mision script that you have to search 7 items, if you found all items then you can go to the "statue" and get your reward.
Action script
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- CONFIG
local rewardid = 1111 -- id of reward
local storage = 67675 -- Storage to use on items
local storagequest = 6667 -- Storage of quest
local msg = { -- Messages items
"Msg 1",-- 1  item msg
"Msg 2",-- 2  item msg
"Msg 3",-- 3 item msg
"Msg 4",-- 4 item msg
"Msg 5",-- 5  item msg
"Msg 6",-- 6 item msg
"Msg 7"-- 17 item msg
}
local lev = { -- niveles rekeridos
1, -- 1 required level item
20, -- 2 required level item
40,-- 3 required level item
50,--4 required level item
60,-- 5 required level item
70,--6 required level item
80-- 7 required level item
}
local aid = { -- [actionid] = {dount touch anything}
[5555] = {1, msg[1], 1, lev[1]},
[5556] = {2, msg[2], 2, lev[2]},
[5557] = {3, msg[3], 3, lev[3]},
[5558] = {4, msg[4], 4, lev[4]},
[5559] = {5, msg[5], 5, lev[5]},
[5560] = {6, msg[6], 6, lev[6]},
[5561] = {7, msg[7], 7, lev[7]}
}
local stors = {[1] = {},[2] = {},[3] = {},[4] = {},[5] = {},
[6] = {},[7] = {}
}
local stor = stors[getPlayerStorageValue(cid, storage)]
local aids = aid[item.actionid]
-- END CONFIG
--FUNCTIONS
function stonex(stonenumber)
local stones = {
[1] = {{x = x, y = y, z = z, stackpos = 1}},
[2] = {{x = x, y = y, z = z, stackpos = 1}},
[3] = {{x = x, y = y, z = z, stackpos = 1}},
[4] = {{x = x, y = y, z = z, stackpos = 1}},
[5] = {{x = x, y = y, z = z, stackpos = 1}},
[6] = {{x = x, y = y, z = z, stackpos = 1}},
[7] = {{x = x, y = y, z = z, stackpos = 1}}
}
doRemoveItem(getThingFromPos(stones[stonenumber][1]).uid, 1)
return true
end
-- END FUNCTIONS
	if aids then
		if getPlayerLevel(cid) >= aids[4] then
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
			setPlayerStorageValue(cid, storage, aids[1])
			doPlayerSendTextMessage(cid, 22, aids[2])
			stonex(aids[3])
		else
			doPlayerSendCancel(cid, "You dont have the required level (".. aids[4] ..").")
		end
	end
			if item.actionid == 5562 then -- onuse statue
				if stor then
					if getPlayerStorageValue(cid, storagequest) ~= 1 then
						doPlayerAddItem(cid, rewardid, 100)
						doPlayerSendTextMessage(cid, 22, "You have found all items take your reward: ".. getItemNameById(rewardid) ..".")
						setPlayerStorageValue(cid, storagequest, 1)
					else
						doPlayerSendTextMessage(cid, 22, "You completed statue mision.")
					end
				else
					doPlayerSendTextMessage(cid, 22, "Sorry but have not yet found the required items")
				end
			end
	return true
end

To modify the stone positions you need to go to stonex function.
Now I explain the stones (photo)
dibujo1iy.png

1-7. Stone ( stonex function )
8. Statue ( the item you need to go to take your reward when you have found all items.

Actions.xml
Code:
<action actionid="5555-5562" event="script" value="name.lua"/>



:thumbup:
 
Last edited:
Lua:
for i = stonenumber,stonenumber do 
doRemoveItem(getThingFromPos(stones[i][1]).uid, 1)
end
=
Lua:
doRemoveItem(getThingFromPos(stones[stonenumber][1]).uid, 1)

This loop is not needed.

Nice code anyways. ; )
 
okay teckman now I change, thanks for posting heeh :)
 
Aw, this thing fucked up my brain.
When i add this - the stones just disappear, i want stones to remove item from player, give him stor that he can take reward.
Help?
 
Great! I was looking for solution with 1 script, there I have my answer. Rly thanks
 
Aw, this thing fucked up my brain.
When i add this - the stones just disappear, i want stones to remove item from player, give him stor that he can take reward.
Help?

Fucked up your brian?
Then you are a shit noob. This script is very primitive and is easy to understand it.
 
Back
Top