• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

3 scripts

DiegoRulez

Member
Joined
Apr 16, 2012
Messages
98
Reaction score
13
Location
Feira de Santana - Brasil

Scripts in OTX based in TFS 0.4


1- The script below evolves to wand as the upa player. I would like the same process for paladins, to evolve to spear .. Can anyone adjust?
Code:
local items = {
{13,2191,2186,-1},
{19,2188,2185,0},
{22,8921,8911,1},
{26,2189,2181,2},
{33,2187,2183,3},
{37,8920,8912,4},
{45,8922,8910,5},
{99999999999}
}
local stuff = {2190,2182,2191,2188,8921,2189,2187,8920,8922,2186,2185,8911,2181,2183,8912,8910}
function onAdvance(cid, skill, oldlevel, newlevel)
local place = 0
local st = 23636
local blala = newLevel
if isInArray({1,2,5,6},getPlayerVocation(cid)) then
if skill == 8 then
for x = 1, #items do
if newlevel >= items[x][1] and newlevel < items[x+1][1] then
place = x
end
end
if place > 0 then
if getPlayerStorageValue(cid,st) <= items[place][4] then
local byvoc = getPlayerVocation(cid)
if getPlayerVocation(cid) > 4 then
byvoc = getPlayerVocation(cid)-4
end
if isInArray(stuff,getPlayerSlotItem(cid,5).itemid) then
doRemoveItem(getPlayerSlotItem(cid,5).uid)
elseif isInArray(stuff,getPlayerSlotItem(cid,6).itemid) then
doRemoveItem(getPlayerSlotItem(cid,6).uid)
end
doPlayerAddItem(cid,items[place][byvoc+1],1)
doPlayerSendTextMessage(cid,4,"While upar his wand also evolved: "..getItemNameById(items[place][byvoc+1])..".")
setPlayerStorageValue(cid,st,items[place][4]+1)
end
end
end
end
return TRUE
end

Start Item- Spear
Level 20 - Hunting Spear
Level 25 - Royal Spear
Level 42 - Enchanted Spear
Level 80 - Assassin Star

Spear - ID:2389 | Hunting - ID:3965 | Royal - ID:7378 | Enchanted - ID:7367 | Assassin - ID:7368

--------------------------------------------------

2- SOLVED

--------------------------------------------------

3- SOLVED

--------------------------------------------------

Sorry for bad english, I'm using google translator.
I would be very grateful if anyone could help.


 
Last edited:
Solution
Try
i do not know if it works
[3]
movements/ring.lua
LUA:
function onEquip(cid, item, slot)

doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)


    return true
end


function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
    return true
end
Code:
    <movevent type="Equip" itemid="2164" slot="ring" event="script" value="ring.lua"/>
        <movevent type="DeEquip" itemid="2164" slot="ring" event="script" value="ring.lua"/>
Scripts in OTX based in TFS 0.4

1- The script below evolves to wand as the upa player. I would like the same process for paladins, to evolve to spear .. Can anyone adjust?
Code:
local items = {
{13,2191,2186,-1},
{19,2188,2185,0},
{22,8921,8911,1},
{26,2189,2181,2},
{33,2187,2183,3},
{37,8920,8912,4},
{45,8922,8910,5},
{99999999999}
}
local stuff = {2190,2182,2191,2188,8921,2189,2187,8920,8922,2186,2185,8911,2181,2183,8912,8910}
function onAdvance(cid, skill, oldlevel, newlevel)
local place = 0
local st = 23636
local blala = newLevel
if isInArray({1,2,5,6},getPlayerVocation(cid)) then
if skill == 8 then
for x = 1, #items do
if newlevel >= items[x][1] and newlevel < items[x+1][1] then
place = x
end
end
if place > 0 then
if getPlayerStorageValue(cid,st) <= items[place][4] then
local byvoc = getPlayerVocation(cid)
if getPlayerVocation(cid) > 4 then
byvoc = getPlayerVocation(cid)-4
end
if isInArray(stuff,getPlayerSlotItem(cid,5).itemid) then
doRemoveItem(getPlayerSlotItem(cid,5).uid)
elseif isInArray(stuff,getPlayerSlotItem(cid,6).itemid) then
doRemoveItem(getPlayerSlotItem(cid,6).uid)
end
doPlayerAddItem(cid,items[place][byvoc+1],1)
doPlayerSendTextMessage(cid,4,"While upar his wand also evolved: "..getItemNameById(items[place][byvoc+1])..".")
setPlayerStorageValue(cid,st,items[place][4]+1)
end
end
end
end
return TRUE
end

Start Item- Spear
Level 20 - Hunting Spear
Level 25 - Royal Spear
Level 42 - Enchanted Spear
Level 80 - Assassin Star

Spear - ID:2389 | Hunting - ID:3965 | Royal - ID:7378 | Enchanted - ID:7367 | Assassin - ID:7368

--------------------------------------------------

2- When equipping the ring the player gets a storage X, when unequip the ring it loses the storage.
This is all for an action, where to walk in such area the player is with the storage (ring equipped) and when removing the ring and trying to walk the place, it is teleported to a position to be determined by xyz

--------------------------------------------------

3- I would like a functional XP Ring .. I have already tested 15 scripts here in the forum and none works ..
Please put everything right the script and how it should be put into the movements

--------------------------------------------------

Sorry for bad english, I'm using google translator.
I would be very grateful if anyone could help.

Which tfs
 
Last edited:
Try
i do not know if it works
[3]
movements/ring.lua
LUA:
function onEquip(cid, item, slot)

doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)


    return true
end


function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
    return true
end
Code:
    <movevent type="Equip" itemid="2164" slot="ring" event="script" value="ring.lua"/>
        <movevent type="DeEquip" itemid="2164" slot="ring" event="script" value="ring.lua"/>
 
Solution
[1] i don't understand what do you need ;/

[2] Try movements/scripts/xxx.lua
(also you need add at entrance of that area an storage than only who have storage (35010) == 1 can access) if you need help i can do for you.
LUA:
local storage = 35010
local config: {
areaFrompos = {x=xxx, y=xxx, z=xxx, stackpos=253}, ---- from x
areaTopos = {x=xxx, y=xxx, z=xxx, stackpos=253}, ---- to y
kickFromarea = {x=xxx, y=xxx, z=xxx, stackpos=1} --- where be teleport if not have ring
}

function onEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) ~= 1 then
      setPlayerStorageValue(cid, storage, 1)
   end
return TRUE
end

function onDeEquip(cid, item, slot)
   if getPlayerStorageValue(cid, storage) == 1 and isInArea(getPlayerPosition(cid), config.areaFrompos, config.areaTopos) then
       setPlayerStorageValue(cid, storage, 2)
       doTeleportThing(cid, config.kickFromarea, false)
       doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Sorry, you need use this ring to access this area!")
   elseif getPlayerStorageValue(cid, storage) == 1 then
      setPlayerStorageValue(cid, storage, 2)
   end
return TRUE
end

movements.xml
XML:
     <movevent type="Equip" itemid="xxx" slot="ring" event="script" value="xxx.lua"/>
     <movevent type="DeEquip" itemid="xxx" slot="ring" event="script" value="xxx.lua"/>

[3] Try movements/scripts/xxx2.lua exp [Edit] i didn't see the other script of exp sorry.
LUA:
local rate = 1.50 -- 50%+
local ratenormal = 1.0 -- 0% normal

function onEquip(cid, item, slot)
     doPlayerSetExperienceRate(cid, rate)
return TRUE
end

function onDeEquip(cid, item, slot)
      doPlayerSetExperienceRate(cid, ratenormal)
return TRUE
end

movements.xml
XML:
     <movevent type="Equip" itemid="xxx2" slot="ring" event="script" value="xxx2.lua"/>
     <movevent type="DeEquip" itemid="xxx2" slot="ring" event="script" value="xxx2.lua"/>
 
Last edited:
Back
Top