• 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 Use Item Earn Spell for any vocation

Slave Ots

LUA Newbie™
Joined
Jan 19, 2012
Messages
114
Reaction score
32
Location
/goto Slave Ots
hello this is a useful script will help 999 servers

Lua:
-- Contact ; Slave [email][email protected][/email]
function onUse(cid, item, frompos, item2, topos)
local cfg = {
		sorcerer = { 1, 5, 9, 13, 17 },  -- sorcerer vocations
		druid = { 2, 6, 10, 14, 18 },-- druid vocations
		paladin = { 3, 7, 11, 15, 19 },-- paladin vocations
		knight = { 4, 8, 12, 16, 20 },-- knight vocations
		storage = 12527, -- empty storage
		sorcerer = "exori vis", -- spell for sorcerers 	     dont remove ""
		druid = "exori frigo", -- spell for druids   		 dont remove ""
		paladin = "exori con",  -- spell for paladins  	  	 dont remove ""
		knight = "exori hur" --spell for knights 			 dont remove ""
	}
	

	if getPlayerStorageValue(cid, cfg.storage) > 0 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "you have already learned this spell, check !spells")
			doSendMagicEffect(getPlayerPosition(cid), 2)
			return 1
			end
			
					
	if(isInArray(cfg.sorcerer, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
             doPlayerLearnInstantSpell(cid, cfg.sorcerer)	
			doRemoveItem(item.uid, 1)
			doSendMagicEffect(getPlayerPosition(cid), 27)
			  setPlayerStorageValue(cid, cfg.storage, 1)  
			return true
			end	
			
	if(isInArray(cfg.druid, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
             doPlayerLearnInstantSpell(cid, cfg.druid)

			doRemoveItem(item.uid, 1)
			doSendMagicEffect(getPlayerPosition(cid), 27)
			  setPlayerStorageValue(cid, cfg.storage, 1)
			return true
			end	
			if(isInArray(cfg.paladin, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
             doPlayerLearnInstantSpell(cid, cfg.paladin)
			doRemoveItem(item.uid, 1)
			doSendMagicEffect(getPlayerPosition(cid), 27)
			  setPlayerStorageValue(cid, cfg.storage, 1)
			return true
			end	
			
	if(isInArray(cfg.knight, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
             doPlayerLearnInstantSpell(cid, cfg.knight)
			doRemoveItem(item.uid, 1)
			doSendMagicEffect(getPlayerPosition(cid), 27)
			  setPlayerStorageValue(cid, cfg.storage, 1)
			return true
				end	
					end


king regards
slave ots
 
Last edited by a moderator:
@samuelsami

Simple you could either make a chest that loots a specific item for them to use it. OR you can use "treasure chest" as the item to use with it :)


Btw for any other information this is an action script. Atleast thats how it worked on my ot for me :p
 
@samuelsami

Simple you could either make a chest that loots a specific item for them to use it. OR you can use "treasure chest" as the item to use with it :)


Btw for any other information this is an action script. Atleast thats how it worked on my ot for me :p
lol
 
Back
Top