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

MoveEvent Quest Tile Script (That raises your exp rate)

Ascendia

Premium User
Premium User
Joined
Nov 23, 2008
Messages
1,865
Reaction score
123
LUA:
------------------------------------
-----------Made by Tauku------------
----------Thanks to Fare------------
----------For helping me------------
----------Correcting my Errors------
function onStepIn(cid, item, frompos, itemEx, topos)
	if item.itemid == 9067 and getPlayerLevel(cid) >= 70 getPlayerVocation(cid) == 2 then --The ground is itemID ID 9067 and the player should be level 70 or above and he must carry the vocation of a druid
		doItemSetAttribute(item.uid, "aid", 9000)--The ActionID of the tile, set in mapeditor.
		doPlayerSetExtraExpRate(cid, 3) and --This is how much his Exp Rate raises when he walks on the tile
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Destiny has been set, prepair for a long journey "..getCreatureName(cid).." where you'll become a new man") --Message he gets if his lvl 70+ and Druid
		end
	if getPlayerLevel(cid) < 70 then --If the player is lower than level 70
		doTeleportThing(cid, frompos, true) --He will be pushed back to his old position
		doPlayerSendCancel(cid,"You don't have the required level to step on this tile.") --And he'll receive this message
		if getPlayerVocation(cid) == 2 false then --If it's anybody other than vocation 2 = a druid then
		doPlayerSendCancel(cid,"You have to be a druid in order to step on this tile.") then --He'll receive this message
		doTeleportThing(cid, frompos, true) --Does teleport the player back to his original spot for returning true
		end
		return true
		end

and in movements.lua you add

LUA:
	<movevent type="StepIn" itemid="9067" event="script" value="Name OF YOUR SCRIPT HERE.lua"/>

Note
It's not tested yet.

There's an explanation to what it does if you look at the right side of the script, thanks.

It's for 0.3.6pl1
 
Last edited:
Code:
local config = {
		level = 70, -- Level needed so the tile will work.
		extraExp = 3, -- This is how much your exp rate raises when you walk on the tile.
		action = 1234, -- Action id on the tile
		voc = 2, -- Vocation you must be so the tile will work.
		vocName = "Druid", -- Name of the vocation you must be so the will will work
	}


function onStepIn(cid, item, frompos, itemEx, topos)
		if item.actionid == config.action and getPlayerLevel(cid) >= config.level getPlayerVocation(cid) == 2 then --The ground is itemID ID 9067 and the player should be level 70 or above and he must carry the vocation of a druid
			if getPlayerVocation(cid) == config.voc then
				doPlayerSetExtraExpRate(cid, config.extraExp)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Destiny has been set, prepair for a long journey "..getCreatureName(cid).." where you'll become a new man") --Message he gets if his lvl 70+ and Druid
			else
				doPlayerSendCancel(cid,"You have to be a " .. config.vocName .. " in order to step on this tile.")
				doTeleportThing(cid, frompos, false)
			end
		else
			doPlayerSendCancel(cid,"You must be level " .. config.level .. " or higher!")
			doTeleportThing(cid, frompos, true)
		end
	return true
end
 
Code:
local config = {
		level = 70, -- Level needed so the tile will work.
		extraExp = 3, -- This is how much your exp rate raises when you walk on the tile.
		action = 1234, -- Action id on the tile
		voc = 2, -- Vocation you must be so the tile will work.
		vocName = "Druid", -- Name of the vocation you must be so the will will work
	}


function onStepIn(cid, item, frompos, itemEx, topos)
		if item.actionid == config.action and getPlayerLevel(cid) >= config.level getPlayerVocation(cid) == 2 then --The ground is itemID ID 9067 and the player should be level 70 or above and he must carry the vocation of a druid
			if getPlayerVocation(cid) == config.voc then
				doPlayerSetExtraExpRate(cid, config.extraExp)
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Destiny has been set, prepair for a long journey "..getCreatureName(cid).." where you'll become a new man") --Message he gets if his lvl 70+ and Druid
			else
				doPlayerSendCancel(cid,"You have to be a " .. config.vocName .. " in order to step on this tile.")
				doTeleportThing(cid, frompos, false)
			end
		else
			doPlayerSendCancel(cid,"You must be level " .. config.level .. " or higher!")
			doTeleportThing(cid, frompos, true)
		end
	return true
end

I'm not that advanced yet :p
 
!!!
Code:
[B]and[/B] getPlayerLevel(cid) >= 70 getPlayerVocation(cid) ==  2 ...
doPlayerSetExtraExpRate(cid, 3) [B]and ...[/B]
if getPlayerVocation(cid) == 2 [B]false[/B]  [B]then[/B] ...
doPlayerSendCancel(cid,"You have to be a druid in order to step on this tile.") [B]then[/B] ...
well it obviously has not been tested. it won't work tho
 
!!!
Code:
[B]and[/B] getPlayerLevel(cid) >= 70 getPlayerVocation(cid) ==  2 ...
doPlayerSetExtraExpRate(cid, 3) [B]and ...[/B]
if getPlayerVocation(cid) == 2 [B]false[/B]  [B]then[/B] ...
doPlayerSendCancel(cid,"You have to be a druid in order to step on this tile.") [B]then[/B] ...
well it obviously has not been tested. it won't work tho

;)^_^
 
Back
Top