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

Full Helmet of ancient

Bulet

Knight of Apocalypse
Joined
Jul 12, 2009
Messages
183
Reaction score
9
Location
Brazil
I had this script but him inst work cause shirres script i cant use red gem id and need do that with hota id
Any one can helop me inprove that best than are cause with this script if helmet on the ground and player use helmet on red gem they will clone hota with one full and if have more than one gem will lose all

I need one ancient helmet script full working like rl tibia but or update mine shire script ... whow ?
Or make another script with hota


Code:
local newId = 2343

function onUse(cid, item, fromPosition, itemEx, toPosition)

    if itemEx.itemid == 2147 then
		doTransformItem(itemEx.uid, newId, 1)	 
		doPlayerRemoveItem(cid,2342,1) 
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You rebooted your "..getItemNameById(newId))
		doSendMagicEffect(fromPosition, 39) 
		
		
		else
			doCreatureSay(cid,"You dont have a necessary item with you.",TALKTYPE_ORANGE_1)
		end
	end

Sorry mine bad english
 
Code:
local t = {
	useOn = 2147,
	newId = 2343
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if itemEx.itemid == t.useOn then
		doRemoveItem(itemEx.uid, 1)
		doTransformItem(item.uid, t.newId)
		doCreatureSay(cid, 'You recharged your ' .. getItemNameById(item.itemid), TALKTYPE_ORANGE_1)
		doSendMagicEffect(toPosition, CONST_ME_HOLYDAMAGE)
	else
		doCreatureSay(cid, 'You must use it on a ' .. getItemNameById(t.useOn), TALKTYPE_ORANGE_1)
	end
	return true
end
 
@Cyko
work like mine script but with him i can clone HOTA cause when i click on helmet and click on jewel he use all jewels and if helmet on ground the ground helmet dont disapear and on mine backpack appear a new FULL HOTA...
And i cant use id of jewel cause enchanting.lua use the jewel id

actions.xml
Code:
	<!-- Weapons enchanting (Gems) -->
	 <action itemid="2146" event="script" value="other/enchanting.lua"/>
	 <action itemid="2147" event="script" value="other/enchanting.lua"/>
	 <action itemid="2150" event="script" value="other/enchanting.lua"/>
	 <action itemid="2149" event="script" value="other/enchanting.lua"/>
	 <action itemid="7759" event="script" value="other/enchanting.lua"/>
	 <action itemid="7760" event="script" value="other/enchanting.lua"/>
	 <action itemid="7761" event="script" value="other/enchanting.lua"/>
	 <action itemid="7762" event="script" value="other/enchanting.lua"/>
	 
	<!-- Full Helmet Of The Ancients -->
	<action itemid="2342" event="script" value="other/full-hota.lua"/>
 
And i cant use id of jewel cause enchanting.lua use the jewel id
enchating.lua already has this script inside it

Code:
local config = {
	manaCost = 300,
	soulCost = 2
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
[B][COLOR="Red"]	if(item.itemid == 2147 and itemEx.itemid == 2342) then
		doTransformItem(itemEx.uid, 2343)
		doDecayItem(itemEx.uid)
		doRemoveItem(item.uid, 1)

		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end[/COLOR][/B]

	if(item.itemid == 7760 and isInArray({9934, 10022}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 9933)
		doRemoveItem(item.uid, 1)

		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end

	if(isInArray(enchantableGems, item.itemid)) then
		local subtype = item.type
		if(subtype == 0) then
			subtype = 1
		end

		local mana = config.manaCost * subtype
		if(getPlayerMana(cid) < mana) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
			return true
		end

		local soul = config.soulCost * subtype
		if(getPlayerSoul(cid) < soul) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHSOUL)
			return true
		end

		local a = table.find(enchantableGems, item.itemid)
		if(a == nil or not isInArray(enchantingAltars[a], itemEx.itemid)) then
			return false
		end

		doTransformItem(item.uid, enchantedGems[a])
		doPlayerAddMana(cid, -mana)
		doPlayerAddSoul(cid, -soul)

		doPlayerAddSpentMana(cid, mana)
		doSendMagicEffect(fromPosition, CONST_ME_HOLYDAMAGE)
		return true
	end
 
	if(isInArray(enchantedGems, item.itemid)) then
		if(not isInArray(enchantableItems, itemEx.itemid)) then
			doSendMagicEffect(fromPosition, CONST_ME_POFF)
			return false
		end

		local b = table.find(enchantedGems, item.itemid)
		if(b == nil) then
			return false
		end

		local subtype = itemEx.type
		if(not isInArray({2544, 8905}, itemEx.itemid)) then
			subtype = 1000
		end

		doTransformItem(itemEx.uid, enchantedItems[itemEx.itemid][b], subtype)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYDAMAGE)
		doDecayItem(itemEx.uid)

		doRemoveItem(item.uid, 1)
		return true
	end

	return false
end
 
Mine enchanting is diferent i use keraxel version and dont have im BEGGINER on scripts i dont know whow too add hota and firewalker i put firewalker but as wrong way you can help me with that plx firewalker and hota recharche by jewel i will glad you and if possible rep ++ you ... Some times i cant rep ++ cause you alyaaws help me ^_^

Code:
--by Keraxel 
function onUse(cid, item, fromPosition, itemEx, toPosition) 

--CONFIG 
local config = { 
mana = 300, 
soul = 2, 
messNotEnoughSoul = "You don't have enough soul points.", 
messNotEnoughMana = "You don't have enough mana points.", 
effect = 39 --you can test effects with !z command (ex. !z 23) 
} 
--/CONFIG 

local array = { [7759] = 8907, [7760] = 8906, [7761] = 8909, [7762] = 8908 } 
local altars = {{7516, 7517, 7518, 7519}, {7504, 7505, 7506, 7507}, {7512, 7513, 7514, 7515}, {7508, 7509, 7510, 7511}} 
local gems = {2149, 2147, 2150, 2146} 
local enchantedGems = {7761, 7760, 7762, 7759}

local weapons = { 
	-- {fire, ice, earth, energy} 
    [2383] = {7744, 7763, 7854, 7869},
	[7383] = {7745, 7764, 7855, 7870},
	[7384] = {7746, 7765, 7856, 7871},
	[7406] = {7747, 7766, 7857, 7872},
	[7402] = {7748, 7767, 7858, 7873},
	[2429] = {7749, 7768, 7859, 7874},
	[2430] = {7750, 7769, 7860, 7875},
	[7389] = {7751, 7770, 7861, 7876},
	[7380] = {7752, 7771, 7862, 7877},
	[2454] = {7753, 7772, 7863, 7878},
	[2423] = {7754, 7773, 7864, 7879},
	[2445] = {7755, 7774, 7865, 7880},
	[7415] = {7756, 7775, 7866, 7881},
	[7392] = {7757, 7776, 7867, 7882},
	[2391] = {7758, 7777, 7868, 7883},
	[2544] = {7840, 7839, 7850, 7838},
	[8905] = {8906, 8907, 8909, 8908},
    [9934] = {9934, 9933, 9934, 9934},
    [9949] = {9949, 9949, 9948, 9949},	
    [9954] = {9954, 9954, 9953, 9954},
    [10022] = {10022, 9933, 10022, 10022}
}
     
         
        if itemEx.itemid == 8905 and isInArray(enchantedGems, item.itemid) then 
            for k, v in pairs(array) do 
                if item.itemid == k then 
                    doTransformItem(itemEx.uid, v) 
                    doRemoveItem(item.uid, 1) 
                    doSendMagicEffect(fromPosition, config.effect) 
                    return TRUE 
                end 
            end 
        elseif isInArray(gems, item.itemid) == TRUE then 
            for i=1, #gems do 
                if isInArray(altars[i], itemEx.itemid) == TRUE and item.itemid == gems[i] then 
                    if getPlayerMana(cid) >= config.mana then 
                        if getPlayerSoul(cid) >= config.soul then
                            doRemoveItem(item.uid, 1) 
                            doPlayerAddItem(cid, enchantedGems[i], 1) 
                            doPlayerAddSoul(cid,-config.soul) 
                            doPlayerAddMana(cid,-config.mana) 
                        else 
                            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, config.messNotEnoughSoul) 
                            doSendMagicEffect(fromPosition, 2) 
                            return FALSE 
                        end 
                    else 
                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, config.messNotEnoughMana) 
                        doSendMagicEffect(fromPosition, 2) 
                        return FALSE 
                    end 
                    doSendMagicEffect(toPosition, config.effect) 
                    return TRUE 
                end 
            end 
                 
        else 
            for k, v in pairs(weapons) do 
                if itemEx.itemid == k then 
                    for i=1, #enchantedGems do 
                        if item.itemid == enchantedGems[i] then 
                            doTransformItem(itemEx.uid, v[i], 1000) 
                            doRemoveItem(item.uid, 1) 
                            doSendMagicEffect(fromPosition, config.effect) 
                            return TRUE 
                        end 
                    end 
                end 
            end     
        end 
    return TRUE 
end
 
Tks cyko your script give me a idea i fixed mine script and added the newest things like firewalker boots Full-Helmet of ancients and gargole statue for who want.:thumbup:

enchanting.lua
Code:
--by Keraxel Updated by Bulet
function onUse(cid, item, fromPosition, itemEx, toPosition) 

--CONFIG 
local config = { 
mana = 300, 
soul = 2, 
messNotEnoughSoul = "You don't have enough soul points.", 
messNotEnoughMana = "You don't have enough mana points.", 
effect = 39 --you can test effects with !z command (ex. !z 23) 
} 
--/CONFIG 

local array = { [7759] = 8907, [7760] = 8906, [7761] = 8909, [7762] = 8908 } 
local altars = {{7516, 7517, 7518, 7519}, {7504, 7505, 7506, 7507}, {7512, 7513, 7514, 7515}, {7508, 7509, 7510, 7511}} 
local gems = {2149, 2147, 2150, 2146} 
local enchantedGems = {7760, 7759, 7761, 7762}

local weapons = { 
	-- {fire, ice, earth, energy} 
    [2383] = {7744, 7763, 7854, 7869},
	[7383] = {7745, 7764, 7855, 7870},
	[7384] = {7746, 7765, 7856, 7871},
	[7406] = {7747, 7766, 7857, 7872},
	[7402] = {7748, 7767, 7858, 7873},
	[2429] = {7749, 7768, 7859, 7874},
	[2430] = {7750, 7769, 7860, 7875},
	[7389] = {7751, 7770, 7861, 7876},
	[7380] = {7752, 7771, 7862, 7877},
	[2454] = {7753, 7772, 7863, 7878},
	[2423] = {7754, 7773, 7864, 7879},
	[2445] = {7755, 7774, 7865, 7880},
	[7415] = {7756, 7775, 7866, 7881},
	[7392] = {7757, 7776, 7867, 7882},
	[2391] = {7758, 7777, 7868, 7883},
	[2544] = {7840, 7839, 7850, 7838},
	[8905] = {8906, 8907, 8909, 8908},
}
     
    if(item.itemid == 2150 and itemEx.itemid == 9949) then
		doTransformItem(itemEx.uid, 9948)
		doDecayItem(itemEx.uid)
		doRemoveItem(item.uid, 1)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end
	
	if(item.itemid == 2150 and itemEx.itemid == 9954) then
		doTransformItem(itemEx.uid, 9953)
		doDecayItem(itemEx.uid)
		doRemoveItem(item.uid, 1)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end
	
	if(item.itemid == 2147 and itemEx.itemid == 2342) then
		doTransformItem(itemEx.uid, 2343)
		doDecayItem(itemEx.uid)
		doRemoveItem(item.uid, 1)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end

	if(item.itemid == 7760 and isInArray({9934, 10022}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 9933)
		doRemoveItem(item.uid, 1)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		return true
	end
 
        if itemEx.itemid == 8905 and isInArray(enchantedGems, item.itemid) then 
            for k, v in pairs(array) do 
                if item.itemid == k then 
                    doTransformItem(itemEx.uid, v) 
                    doRemoveItem(item.uid, 1) 
                    doSendMagicEffect(fromPosition, config.effect) 
                    return TRUE 
                end 
            end 
        elseif isInArray(gems, item.itemid) == TRUE then 
            for i=1, #gems do 
                if isInArray(altars[i], itemEx.itemid) == TRUE and item.itemid == gems[i] then 
                    if getPlayerMana(cid) >= config.mana then 
                        if getPlayerSoul(cid) >= config.soul then
                            doRemoveItem(item.uid, 1) 
                            doPlayerAddItem(cid, enchantedGems[i], 1) 
                            doPlayerAddSoul(cid,-config.soul) 
                            doPlayerAddMana(cid,-config.mana) 
                        else 
                            doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, config.messNotEnoughSoul) 
                            doSendMagicEffect(fromPosition, 2) 
                            return FALSE 
                        end 
                    else 
                        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, config.messNotEnoughMana) 
                        doSendMagicEffect(fromPosition, 2) 
                        return FALSE 
                    end 
                    doSendMagicEffect(toPosition, config.effect) 
                    return TRUE 
                end 
            end 
                 
        else 
            for k, v in pairs(weapons) do 
                if itemEx.itemid == k then 
                    for i=1, #enchantedGems do 
                        if item.itemid == enchantedGems[i] then 
                            doTransformItem(itemEx.uid, v[i], 1000) 
                            doRemoveItem(item.uid, 1) 
                            doSendMagicEffect(fromPosition, config.effect) 
                            return TRUE 
                        end 
                    end 
                end 
            end     
        end 
    return TRUE 
end

If i help you i will be glad you for REP me +++
 
Last edited:
Back
Top