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

A few requests

Tibia Rox

Member
Joined
Feb 4, 2009
Messages
1,181
Reaction score
9
Location
U.S.A
I have a lot of ideas I'd like to put into my server, and was wondering if anyone could make the following scripts for me:

[4]
Code:
When you use item 2345, you are blessed, and the item dissapears.

[5]
Code:
When you click a switch,1945, the item 8297 dissapears from you backpack and you receive anywhere from 0-10 fish (2667), 0-6 northern pike (2669), 0-3 rainbow trout (7158), and 0-2 green perch (7159), and you get an orange text saying 'You succesfully used the fishing nets, and you fished up some fish!  Sell them to Jared, or eat them if you'd like'. If you dont have 8297, you cant use the switch, and an orange text appears saying 'You need bait to use the nets'.


I'll be needing more soon, and instead of making new threads, I'll just expand this thread.

Thanks so much in advance to those who can help me!
 
Last edited:
[2]
LUA:
function onStepIn(cid, item, frompos, itemEx, topos)
local storage = 1111 -- storage quest
if getPlayerStorageValue(cid, storage) == -1 then
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "You dont have completed a quest.")
end
return true
end

movement.xml
XML:
<movevent event="StepIn" itemid="5068;5070" script="name.lua"/>
 
[2]
LUA:
function onStepIn(cid, item, frompos, itemEx, topos)
local storage = 1111 -- storage quest
if getPlayerStorageValue(cid, storage) == -1 then
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "You dont have completed a quest.")
end
return true
end

movement.xml
XML:
<movevent event="StepIn" itemid="5068;5070" script="name.lua"/>

It's not working for some reason...
 
It's not working for some reason...

[1]
cracks.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getCreatureStorage(cid, 6299) < 1) then
		doPlayerAddItem(cid, ITEMID, COUNT, false)
		doCreatureSetStorage(cid, 6299, 1)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)

	return true
end

bigclouds.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doSendMagicEffect(fromPosition, CONST_ME_BIGCLOUDS, false)
	return true
end

In actions.xml:
Code:
	<action itemid="6299" event="script" value="cracks.lua"/>
	<action itemid="ITEMID" event="script" value="bigclouds.lua"/>

[2]
electricsparks.lua:
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local key = 1111 -- Quest Storage Value
	if(getCreatureStorage(cid, key) > 0) then
		if(getCreatureLookDirection(cid) == NORTH) then
			doMoveCreature(cid, SOUTH)
		elseif(getCreatureLookDirection(cid) == EAST) then
			doMoveCreature(cid, WEST)
		elseif(getCreatureLookDirection(cid) == SOUTH) then
			doMoveCreature(cid, NORTH)
		elseif(getCreatureLookDirection(cid) == WEST) then
			doMoveCreature(cid, EAST)
		end

	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end

	return true
end

In movements.xml:
Code:
	<movevent type="StepIn" itemid="5068-5070" event="script" value="electricsparks.lua"/>

[3]
oracle.lua:
Code:
local ORACLE =
{
	[ITEMID] = {position = {x = POSITION.X, y = POSITION.Y, z = POSITION.Z}, vocation = Knight},
	[ITEMID] = {position = {x = POSITION.X, y = POSITION.Y, z = POSITION.Z}, vocation = Druid},
	[ITEMID] = {position = {x = POSITION.X, y = POSITION.Y, z = POSITION.Z}, vocation = Paladin},
	[ITEMID] = {position = {x = POSITION.X, y = POSITION.Y, z = POSITION.Z}, vocation = Sorcerer}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local oracle = ORACLE[item.itemid]
	if(not oracle) then
		return false
	end

	doTeleportThing(cid, oracle.position, false)
	doPlayerSetVocation(cid, oracle.vocation)
	doSendMagicEffect(oracle.position, CONST_ME_TELEPORT, false)
	return true
end

In actions.xml:
Code:
	<action itemid="ITEMID" event="script" value="oracle.lua"/>
	<action itemid="ITEMID" event="script" value="oracle.lua"/>
	<action itemid="ITEMID" event="script" value="oracle.lua"/>
	<action itemid="ITEMID" event="script" value="oracle.lua"/>
 
Last edited:
3

Code:
local config = {
	[item_id] = {
		{x = 100, y = 100, z = 7}, voc = 1
	},
	[item_id] = {
		{x = 100, y = 100, z = 7}, voc = 2
	},
	[item_id] = {
		{x = 100, y = 100, z = 7}, voc = 3
	},
	[item_id] = {
		{x = 100, y = 100, z = 7}, voc = 4
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = config[item.itemid]
	if v then
		if getPlayerVocation(cid) == 0 then
			doPlayerSetVocation(cid, v.voc)
			doTeleportThing(cid, v[1], true)
			doSendMagicEffect(v[1], CONST_ME_TELEPORT)
			doRemoveItem(item.uid, 1)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		end
	end
	
	return true
end
 
[1]
cracks.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerAddItem(cid, ITEMID, COUNT, false)
	return true
end

bigclouds.lua:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doSendMagicEffect(cid, CONST_ME_BIGCLOUDS, false)
	return true
end

In actions.xml:
Code:
	<action itemid="6299" event="script" value="cracks.lua"/>
	<action itemid="ITEMID" event="script" value="bigclouds.lua"/>

Can you make it so you can only use the cracks once? And the clouds dont work.
 
Back
Top