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

Want Lua Scripts? Request here.

Flourence

New Member
Joined
Sep 22, 2009
Messages
60
Reaction score
4
Ok Me and Doggynub opening this to help you guys a bit.
[If i didnt know somthng i will ask Doggynub to help , so your request will most likely be done :p]

How requests should be written?
Script name : Speed Item
Description : When you click on this item you get a definite amount of speed according to your level
Options : yes i need some tables and locals to edit what i want. / No no need.



Rules :
1- In Clear English language
2- No very Big event scripts
2- No very big npc script

----------------------------------------------------------
Requests & Scripts with links :

[1]
Requested by Fresh : Healing potion like World of Warcraft Style.
Script by Flourence & little check by Doggynub: The script


[2]
Requested by Tibiamakers : Click 5 levers in x postions destroy a wall - with some checks
Script by Flourence : The script
 
Last edited:
Script name : Healing Potion
Description : Healing potion like World of Warcraft Style.
Options:
- You cannot use potion when you are in combat (in-fight)(have cross in status bar)
- Potion gives you 50 hp/second, after getting full hp the potion stop heals you.
- Potions cant be stackable (if you use 1 potion, you cant use other one as same type)
- If somebody damage you (you got hit from monster or player) the potion stop heals you.
- If player have 100% hp, cannot use potion.
 
Script name : Lever
Description : click 5 levers in x postions destroy a wall
Options:
- Clicking the 5 levers with the id (9825) in different positions of the map destroys a wall in X position and in X time, will appear again

- When you click a lever say in broadcast a message like: 1/5 levers are clicked, the second lever clicked will say 2/5 levers are clicked and the last will say: all levers are clicked!

- You cant click again the levers in 3 minutes

- The wall will appear again at 20 secs after you click the 5 levers


I hope you understeand if not ask me :peace:

a lot of thanks :)
 
Ok ,Please keep this only on requests. Also the request and script will be done in organized way and at main post will be each request and lonk to the script.

Fresh and tibia makers , will do. But i need to go to college now.It is 8 am.
 
@ Fresh

Will this item (potion) is a usable item i mean is it one of the items liek shovel you use it then you use on somthng else?


And will it have potions that heals both mana and health? and if so what if he used on of these potions and he have one of his heal or mana at max points :p

Btw, i already finished the script but need to know these stuff
 
Last edited:
Will this item (potion) is a usable item i mean is it one of the items liek shovel you use it then you use on somthng else?

Useable on you (Use) (NOT USE WITH.)

And will it have potions that heals both mana and health? and if so what if he used on of these potions and he have one of his heal or mana at max points
Its heal only you.
If you got full hp you cant use potion.
And you can use one potion (you cant use 2 potions at same time)
 
Healing potion like World of Warcraft Style.
in actuion create new healing.lua
Lua:
local removeonuse = true -- remove item on use false if not
 
 
local animation = false --- send green or blue animation of the amount he is healed per time
 
local runes = { --[itemid] = {type = 1[mana] - 2[health], amount = amount healed random amount so if you want from 60 to 70 then {60,70} , amounttime = time per each heal (in seconds) , vocations = you put here hte vocation s that can use this, vocstr = "You put here the names of voc that can use this", storage = put empty storage}
 
					[7440] = { type = 2, amount = {50,60}, amounttime = 1, vocations = {1,2,3,4}, vocstr = "sorcerers, druids, paladins and knights" , storage = 12647 },
 
					[7439] = { type = 1, amount = {60,100}, amounttime = 0.5 , vocations = {1,2,3,4}, vocstr = "sorcerers, druids, paladins and knights", storage = 12648}
 
				}
 
function repeating(cid,id)
		local r = runes[id.itemid]
		if r.type == 1 then
			local manaamount = math.random(r.amount[1],r.amount[2])
			if getCreatureMana(cid) == getCreatureMaxMana(cid) then
				return doPlayerSendTextMessage(cid,27,"Potion effect stopped as you reached your max mana.") and setPlayerStorageValue(cid,r.storage,-1)
			end
			if hasCondition(cid,CONDITION_INFIGHT) then
				return doPlayerSendTextMessage(cid,27,"Potion effect stopped as you have a battle sign.") and setPlayerStorageValue(cid,r.storage,-1)
			end
			doCreatureAddMana(cid, manaamount )
				if animation == true then
					doSendAnimatedText(getThingPos(cid),"+"..manaamount.."",TEXTCOLOR_LIGHTBLUE)
				end
			addEvent(repeating,r.amounttime * 1000, cid, id)
 
		elseif  r.type == 2 then
			local healthamount = math.random(r.amount[1],r.amount[2])
			if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then
				return doPlayerSendTextMessage(cid,27,"Potion effect stopped as you reached your max health.") and setPlayerStorageValue(cid,r.storage,-1)
			end
			if hasCondition(cid,CONDITION_INFIGHT) then
				return doPlayerSendTextMessage(cid,27,"Potion effect stopped as you have a battle sign.") and setPlayerStorageValue(cid,r.storage,-1)
			end
			doCreatureAddHealth(cid, healthamount )
				if animation == true then
					doSendAnimatedText(getThingPos(cid),"+".. healthamount.."",TEXTCOLOR_GREEN)
				end
			addEvent(repeating,r.amounttime * 1000, cid, id)
		end
		return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)	
	local f = runes[item.itemid]
	if f then

 
			if getPlayerStorageValue(cid,f.storage) > 0 then
				return doPlayerSendCancel(cid,"The effect of the rune you used before is still running.")
			end
 
			if hasCondition(cid,CONDITION_INFIGHT) then
				return doPlayerSendCancel(cid,"You cant use this While you have a battle sign.")
			end
 
			if f.type == 1 then
				if getCreatureMana(cid) == getCreatureMaxMana(cid) then
					return doPlayerSendCancel(cid,"Sorry, you have full mana.")
				end
			elseif f.type == 2 then
				if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then
					return doPlayerSendCancel(cid,"Sorry, you have full health.")
				end
			end
 
			setPlayerStorageValue(cid,f.storage,1)
			repeating(cid,item)
 
				if removeonuse == true then
					doRemoveItem(item.uid,1)
				end
	end			
	return true
end
And by adding new items in script you need to add their xml line in action.xml like this
Code:
	<action itemid="7440" event="script" value="healing.lua"/>
	<action itemid="7439" event="script" value="healing.lua"/>
 
Last edited:
Click 5 levers in x postions destroy a wall :

How you set it up ?
You will have to put 5 different actionids on each lever in my case i made it (6001,6002,6003,6004,6005). You put those actionid in the action.xml and in the script it self. You will understand where when you look at script.


Lua:
local c = 	{
				used_lever_id = 9826,   												--- the id of the lever when it is used
				
				unused_lever_id = 9825,													-- the id of the lever when it is unused
				
				levers_main_storage = 39484,											-- put empty storage
				
				time_lever_use_again = 1,												-- time where the lever cauld be use again in min
				
				wall_id = 1515,															-- put the wall id that will be removed
				
				wall_place = {x=94,y=126,z=7},												-- place of the wall that will be removed
				
				wall_respawn_time = 20													-- time for wall to be recreated in seconds
				
				
			}
local pos = {	--[[ Action ids & Storages]]--
				[6001] = {storage = 19351},	  ---[action id on the lever] = {lever storager}
				[6002] = {storage = 19352},	
				[6003] = {storage = 19353},	
				[6004] = {storage = 19354},	
				[6005] = {storage = 19355}
			}	

function onUse(cid, item, fromPosition, itemEx, toPosition)	
	local t = pos[item.actionid]
	if t then
			if getStorage(t.storage) < 1 then
				doSetStorage(t.storage,1)
				addEvent(reset,c.time_lever_use_again *60*1000)
					if getStorage(c.levers_main_storage) < 4 then
						doSetStorage(c.levers_main_storage, math.max(1, getStorage(c.levers_main_storage)+1))
						doBroadcastMessage(getStorage(c.levers_main_storage).." of 5 leavers are used.")
					else
						if getTileItemById(c.wall_place,c.wall_id).uid > 0 then
							doRemoveItem(getTileItemById(c.wall_place,c.wall_id).uid)
							addEvent(doCreateItem,c.wall_respawn_time*1000,c.wall_id,1,c.wall_place)
							doSetStorage(c.levers_main_storage, 0)
							doBroadcastMessage("last lever was used. The wall is removed and will respawn in "..c.wall_respawn_time.." seconds.")
						end
					end
				
			else
				doPlayerSendCancel(cid,"This cant be used again for "..c.time_lever_use_again.." minutes from last use.")
			end
	end
	return doTransformItem(item.uid,item.itemid == 9826 and 9825 or 9826) and true
end

Now in this the action.xml , {fromaid , to aid } --> means from this actionid to that actionid including numbers between them . So i recommend using conscutive numbers. like {1,2,3,4,5} - { 5000,5001,5002,5003,5004} - ....... etc.

Code:
<action fromaid="6001" toaid="6005" event="script" value="other/tests.lua"/>
 
Last edited:
Script name : Ship
Description : MMORPG ship.
Options:
- If players are in zone (from X to Y) and ship arrived it says on player console: "The ship of lost island has been arrived to north port."
- The ship will be able to get in after 20 minutes (real time)
- If you enter the ship its teleport you to X,Y,Z position
- You waiting in X,Y,Z zone 10 minutes, after that it says in console : "Your travel has been finished. Welcome in Island." and teleport you and other ppl from zone to X,Y,Z
- After 10 minutes the ship is leaving the island (you cant get in [step on certain floor]) : "Ship isnt arrived. Please come back into a while."
 
@up

Please write in the way of writinig a request , and be more specific.

@Fresh

Ok i will look about that when i get from my lesson :p

But tell me the boat come to the island every 20 min? when it come to lost island it wait how many time? then it send to the people in waiting place ship is leaving in 1 min and then it wait in 10 min. Then it teleport them to other city? and then what happens? when it comes back again? And how will this ship be like :p more info
 
Last edited:
Its like about World of Warcraft Ratchet -> Durotar if you played wow you know what i mean.
The ship is come to island every 20 minutes ["Ship is arrived to lost island. Hurry up! It take off in 2 minutes!"]. It stays and waiting for players about 2 minutes and it take off to next island ["Ship taked off to next island, next ship arrive in 20 minutes"] :) .

Of course its real time (20 minutes = 1200 seconds)
 
Ye and how this ship is like ? you mean like some tiles that are created in a place on water and waitng for ppl? and then drop them at another place? then it disappear and be created in the same place again, to wait for 2 min for gathering travellers?
 
Back
Top