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

[REQUEST] Amulet :)

Status
Not open for further replies.

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I 'd like one amulet, that you use, then it desapears! + the player stay with the vocation "Epic"

NOTE: Is forever
Thx​
 
I didn't understand quite well, you mean, you touch the amulet and you get Epic vocation?
 
You want them to be a new vocation? Like if vocation 1/2/3/4 uses it, they become vocation 5?

Or..

if vocation 1, it goes vocation 5
If vocation 2 it goes vocation 6
If vocation 3 it goes vocation 7
If vocation 4 it goes vocation 8
 
XML:
<action itemid="xxxx" event="script" value="whatever.lua"/>

whatever.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)


doRemoveItem(item.uid, 1)
doSendMagicEffect(fromPosition, CONST_ANI_EXPLOSION)
doPlayerSetPromotionLevel(cid, 2)
doPlayerSave(cid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Congratulations! You have been promoted to '.. getPlayerVocationName(cid)..'!!')

local pos = getThingPos(cid)
for i = 1, 15 do
doSendDistanceShoot({x = pos.x + math.random(-4, 4), y = pos.y + math.random(-4, 4), z = pos.z}, pos, CONST_ANI_CAKE)
end
return true
end

+ you get cake-in-the-face :D


Like this?
 
Last edited:
If the upper one doesnt work then try this

data/actions/scripts/promotion amulet
LUA:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
if getPlayerVocation(cid) == 5 then
                              doPlayerSetVocation(cid,9)
                              doSendMagicEffect(ppos,5)
                              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are now an epic sorcerer!")
                              doRemoveItem(item.uid,1)
   elseif getPlayerVocation(cid) == 9 then
          doPlayerSendCancel(cid,"You already have this vocation")

if getPlayerVocation(cid) == 6 then
                              doPlayerSetVocation(cid,10)
                              doSendMagicEffect(ppos,5)
                              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are now an epic druid!")
                              doRemoveItem(item.uid,1)
   elseif getPlayerVocation(cid) == 10 then
          doPlayerSendCancel(cid,"You already have this vocation")

if getPlayerVocation(cid) == 7 then
                              doPlayerSetVocation(cid,11)
                              doSendMagicEffect(ppos,5)
                              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are now an epic paladin!")
                              doRemoveItem(item.uid,1)
   elseif getPlayerVocation(cid) == 11 then
          doPlayerSendCancel(cid,"You already have this vocation")
          
if getPlayerVocation(cid) == 8 then
                              doPlayerSetVocation(cid,12)
                              doSendMagicEffect(ppos,5)
                              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You are now an epic knight!")
                              doRemoveItem(item.uid,1)
   elseif getPlayerVocation(cid) == 12 then
          doPlayerSendCancel(cid,"You already have this vocation")
                                 end
          return true
end
end
end
end

data/actions/actions.xml
XML:
<action itemid="xxxx" event="script" value="promotion amulet.lua"/>

Made it when i was even nobber at lua :D

Test it.
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tmp = getPlayerPromotionLevel(cid)
	if tmp == 0 then
		doPlayerSendCancel(cid, 'You must be promoted to get VIP promotion.')
	elseif tmp == 1 then
		doRemoveItem(item.uid)
		doSendMagicEffect(getThingPos(cid), CONST_ME_EXPLOSIONHIT)
		doPlayerSetPromotionLevel(cid, 2)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now ' .. getVocationInfo(getPlayerVocation(cid)).description .. '!')
	else
		doPlayerSendCancel(cid, 'You are already promoted.')
	end
	return true
end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tmp = getPlayerPromotionLevel(cid)
	if tmp == 0 then
		doPlayerSendCancel(cid, 'You must be promoted to get VIP promotion.')
	elseif tmp == 1 then
		doRemoveItem(item.uid)
		doSendMagicEffect(getThingPos(cid), CONST_ME_EXPLOSIONHIT)
		doPlayerSetPromotionLevel(cid, 2)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now ' .. getVocationInfo(getPlayerVocation(cid)).description .. '!')
	else
		doPlayerSendCancel(cid, 'You are already promoted.')
	end
	return true
end

Did mine not work..? <,<
 
Status
Not open for further replies.
Back
Top