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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,825
Solutions
586
Reaction score
5,404
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
I thought of this as well, but what if they want multiple spots for this script?
They would need to create a separate file for each spot, no?
Then you use a global table and put the POS there plus the bool(only the first time if it doesnt find that pos in the table)

Edit: But your script isn't going to work for multiple spots anyway because you used the position upvalue in the loop
 
thanks alot xiniki :D, i can request another script or only one per day ?
As many as you feel you want to.
Then you use a global table and put the POS there plus the bool(only the first time if it doesnt find that pos in the table)

Edit: But your script isn't going to work for multiple spots anyway because you used the position upvalue in the loop
Oh darn, I just tested and your right. I only just started using this new looping method, so I'm still working out new problems I find. :p
I'll just add a global storage to the script for the check, I suppose.
 
use 5x of the item it transfers into a new item, like you have to collect 5 items the same type and click one of them and they transform into one item :D, if you need any details or anything is not clear let me know :)
 
use 5x of the item it transfers into a new item, like you have to collect 5 items the same type and click one of them and they transform into one item :D, if you need any details or anything is not clear let me know :)
Are you using it for like.. currency conversion?
Use gold nugget -> turn into steel bar?
In either case, it's a simple script.
Just note, you won't be able to use those items in another script, I don't think.
(sorry not testing it.)
Code:
<action itemid="11111" event="script" value="currency_convertor.lua"/>
Code:
local item_to_turn_into = 1111

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

   if getPlayerItemCount(cid, item.itemid) >= 5 then
     doPlayerRemoveItem(cid, item.itemid, 5)
     doPlayerAddItem(cid, item_to_turn_into, 1, true)
   end

   return true
end
 
As many as you feel you want to.

Oh darn, I just tested and your right. I only just started using this new looping method, so I'm still working out new problems I find. :p
I'll just add a global storage to the script for the check, I suppose.

Code:
local reward_items = {
     [1] = {item = 2159},
}

local config = {
     sacrifice_item = 5880, -- 5880 = iron ore (Note: Item must be 'stackable')
     multi_sacrifice = 1, -- 1 = can put stacks of 100 sacrifice_item | 0 = only 1 item at a time.
     loop_1_delay = 3000, -- 1000 = 1 second
     effect = CONST_ME_HITBYFIRE,
     global_storage = 45001 -- Only required if using 'multi_sacrifice'
}

BASINEVENTS = {}

function getBasinEventIdByPos(position)
    for i, info in pairs(BASINEVENTS) do
        if type(info[1]) == "table" then
            if info[1].x == position.x and info[1].y == position.y and info[1].z == position.z then
                return i
            end
        end
    end
end

function loop_1(position, n)
     if getTileItemById(position, config.sacrifice_item).type > 0 then
         doRemoveItem(getTileItemById(position, config.sacrifice_item).uid, 1)
         doSendMagicEffect(position, config.effect)
         local rand = reward_items[math.random(#reward_items)]
         doCreateItem(rand.item, 1, position)
         if config.multi_sacrifice == 1 then
             n = 1
         else
             n = 0
         end
     end

     if(n > 0) then
         addEvent(loop_1, config.loop_1_delay, position, n - 1)
     else
        local basinId = getBasinEventIdByPos(position)
        if basinId then
            BASINEVENTS[basinId][2] = false
        end
     end
end

function onAddItem(moveitem, tileitem, pos, cid)
     if moveitem.itemid == config.sacrifice_item then
        local basinId = getBasinEventIdByPos(pos)
        if not basinId then
            table.insert(BASINEVENTS, {pos, true})
        elseif BASINEVENTS[basinId] then
            if BASINEVENTS[basinId][2] then
                return true
            else
                BASINEVENTS[basinId][2] = true
            end
        end

        addEvent(loop_1, 0, pos, 1)
     end
     return true
end


Can't test it but it should work for multiple spots and fix the addEvent issue :p
 
Last edited:
Code:
local reward_items = {
     [1] = {item = 2159},
     [2] = {item = 1988},
     [3] = {item = 1998}
}

local config = {
     sacrifice_item = 5880, -- 5880 = iron ore (Note: Item must be 'stackable')
     multi_sacrifice = 1, -- 1 = can put stacks of 100 sacrifice_item | 0 = only 1 item at a time.
     loop_1_delay = 1000, -- 1000 = 1 second
     effect = CONST_ME_HITBYFIRE,
     global_storage = 45001 -- Only required if using 'multi_sacrifice'
}

BASINEVENTS = {}

function getBasinEventIdByPos(position)
    for i, info in pairs(BASINEVENTS) do
        if type(info[1]) == "table" then
            if info[1].x == position.x and info[1].y == position.y and info[1].z == position.z then
                return i
            end
        end
    end
end

function loop_1(position, n)
     if getTileItemById(position, config.sacrifice_item).type > 0 then
         doRemoveItem(getTileItemById(position, config.sacrifice_item).uid, 1)
         doSendMagicEffect(position, config.effect)
         local rand = reward_items[math.random(#reward_items)]
         doCreateItem(rand.item, 1, position)
         if config.multi_sacrifice == 1 then
             n = 1
         else
             n = 0
         end
     end

     if(n > 0) then
         addEvent(loop_1, config.loop_1_delay, position, n - 1)
     else
        local basinId = getBasinEventIdByPos(position)
        if basinId then
            BASINEVENTS[basinId][2] = false
        end
     end
end

function onAddItem(moveitem, tileitem, pos, cid)
     if moveitem.itemid == config.sacrifice_item then
        local basinId = getBasinEventIdByPos(pos)
        if not basinId then
            table.insert(BASINEVENTS, {pos, true})
        elseif BASINEVENTS[basinId] and BASINEVENTS[basinId][2] then
            return true
        end
 
        addEvent(loop_1, 0, pos, 1)
     end
     return true
end

Can't test it but it should work for multiple spots and fix the addEvent issue :p
It works perfectly. :( :oops: :eek: :p :D
I'm definitely looking through this.
I'll put a simple version up, and replace yours with mine. mine with yours.
 
Last edited:
Well, i want a rune for pally that heal both health and mana, and its only useable by paladins, cuz i have tried to fix one but sadly, every other vocs could use it, and second request is a slow rune that paralyze the target for 6 sec and spams slow aboe him until its over, hope u got me if anything is not clear i can try to explain again, thanks
 
Hello, xikini. How are you?
You could change this script to enter 4 players at once?
All untested.
Install it the same way.
Please let me know if it works or not.
Thanks!


data/actions/scripts/Arena_Lever.lua
Code:
---------------------------------- Start Config -------------------------------

local config = {
   failed_position = {x = 111111, y = 111111, z = 111}, -- Player took too long position
   lever_reset_time = 15, -- in minutes (how long until another player can kick them out)
   global_storage = 1111111, -- any free storage
   top_left_corner = {x = 111111, y = 111111, z = 111}, -- top left corner of arena
   bottom_right_corner = {x = 111111, y = 111111, z = 111}, -- bottom right corner of arena
   joke_monster = "rat" -- They will kill this monster to start the waves
}

local players = {
   [1] = { player_start_pos = {x = 111111, y = 111111, z = 111}, player_arena_pos = {x = 111111, y = 111111, z = 111} },
   [2] = { player_start_pos = {x = 222222, y = 222222, z = 222}, player_arena_pos = {x = 222222, y = 222222, z = 222} },
   [3] = { player_start_pos = {x = 333333, y = 333333, z = 333}, player_arena_pos = {x = 333333, y = 333333, z = 333} },
   [4] = { player_start_pos = {x = 444444, y = 444444, z = 444}, player_arena_pos = {x = 444444, y = 444444, z = 444} }
}
----------------------------------- End Config --------------------------------

local function reset(p)
   doTransformItem(getTileItemById(p, 1946).uid, 1945)
end

local function teleport()
   for i = 1, #players do
     pid = getTopCreature(players[i].player_start_pos).uid
     doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "---------------------------------------")
     doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Kill the creature to start Wave 1.")
     doTeleportThing(pid, players[i].player_arena_pos)
   end 
   doCreateMonster(config.joke_monster, players[1].player_arena_pos)
end

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

   -- check if lever is currently used
   if item.itemid == 1946 then
     return doPlayerSendTextMessage(cid, 22, "Wait for switch to reset. It resets automatically every ".. config.lever_reset_time .." minutes.")
   end
 
   -- check if players are standing on tiles
   local count = 0
   for i = 1, #players do
     pid = getTopCreature(players[i].player_start_pos).uid
     if isPlayer(pid) == true then
       count = count + 1
     end
   end
   if count < #players then
     return doPlayerSendTextMessage(cid, 22, "All players must be standing on their respective tiles to enter the arena.")
   end
 
   -- check for players/monsters in arena, and kick them out/remove them
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if isPlayer(pid) then
         doTeleportThing(pid, config.failed_position)
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Another group of players started the arena. You have been removed. Better luck next time!")
       end
       if isMonster(pid) then
         doRemoveCreature(pid)
       end
     end
   end
 
   -- tell players what to do
   for i = 1, #players do
     pid = getTopCreature(players[i].player_start_pos).uid
     doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Lever resets automatically every ".. config.lever_reset_time .." minutes.")
     doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Once the lever resets another group of players can start the arena.")
     doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "If your group is still inside when another group starts, you will be removed from the arena and unable to continue.")
   end
 
   -- reset global storage
   setGlobalStorageValue(global_storage, 0)
 
   -- teleport player to arena, send start message, create start/joke monster
   addEvent(teleport, 5000)
 
   -- transform lever, and add reset
   doTransformItem(item.uid, item.itemid + 1)
   addEvent(reset, ((config.lever_reset_time * 60 * 1000) + 5000), toPosition)
 
   return true
end
data/creaturescripts/scripts/Arena_Death.lua
Code:
local config = {
   reward_position = {x = 111111, y = 111111, z = 111}, -- Teleport location when Arena is Cleared.
   global_storage = 1111111, -- any free storage
   top_left_corner = {x = 111111, y = 111111, z = 111}, -- top left corner of arena
   bottom_right_corner = {x = 111111, y = 111111, z = 111} -- bottom right corner of arena
}

local monsters = { -- All monsters in arena (including joke monster)
   [1] = "rat",
   [2] = "cave rat",
   [3] = "spider",
   [4] = "snake",
   [5] = "bug"
}

local monster_config_wave_one = { -- wave 1
   [1] = {position = {x = 111111, y = 111111, z = 111}, name = "cave rat"},
   [2] = {position = {x = 111111, y = 111111, z = 111}, name = "spider"},
   [3] = {position = {x = 111111, y = 111111, z = 111}, name = "snake"},
   [4] = {position = {x = 111111, y = 111111, z = 111}, name = "bug"}
}

local monster_config_wave_two = { -- wave 2
   [1] = {position = {x = 111111, y = 111111, z = 111}, name = "cave rat"},
   [2] = {position = {x = 111111, y = 111111, z = 111}, name = "spider"},
   [3] = {position = {x = 111111, y = 111111, z = 111}, name = "snake"},
   [4] = {position = {x = 111111, y = 111111, z = 111}, name = "bug"}
}

local monster_config_wave_three = { -- wave 3
   [1] = {position = {x = 111111, y = 111111, z = 111}, name = "cave rat"},
   [2] = {position = {x = 111111, y = 111111, z = 111}, name = "spider"},
   [3] = {position = {x = 111111, y = 111111, z = 111}, name = "snake"},
   [4] = {position = {x = 111111, y = 111111, z = 111}, name = "bug"}
}

local function teleport()
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if isPlayer(pid) then
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! Go collect your reward.")
         doTeleportThing(pid, config.reward_position)
       end
     end
   end
end

function onKill(cid, target, damage, flags)
   -- check if target is player
   if isPlayer(target) then
     return true
   end
 
   -- check if target is on list of monsters in arena
   local name = getCreatureName(target):lower()
   count = 0
   for i = 1, #monsters do
     if name == monsters[i]:lower() then
       count = count + 1
     end
   end
   if count == 0 then -- if target is not on list
     return true
   end
 
   -- check if target is in area and add to global storage if it is
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if pid == target then
         setGlobalStorageValue(global_storage, getGlobalStorageValue(global_storage) + 1)
       end
     end
   end
 
   -- Start checks for waves of arena
 
   -- Wave 1
   if getGlobalStorageValue(global_storage) == 1 then
     for i = 1, #monster_config_wave_one do
       doCreateMonster(monster_config_wave_one[i].name, monster_config_wave_one[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 1.")
   end
 
   -- Wave 2
   if getGlobalStorageValue(global_storage) == 5 then
     for i = 1, #monster_config_wave_two do
       doCreateMonster(monster_config_wave_two[i].name, monster_config_wave_two[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 2.")
   end
 
   -- Wave 3
   if getGlobalStorageValue(global_storage) == 9 then
     for i = 1, #monster_config_wave_three do
       doCreateMonster(monster_config_wave_three[i].name, monster_config_wave_three[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 3. Final Wave.")
   end
 
   -- When final wave ends
 
   -- Teleport player
   if getGlobalStorageValue(global_storage) == 13 then
     addEvent(teleport, 5000)
     setGlobalStorageValue(global_storage, 0)
   end
 
   return true
end
 
Last edited:
Well, i want a rune for pally that heal both health and mana, and its only useable by paladins, cuz i have tried to fix one but sadly, every other vocs could use it, and second request is a slow rune that paralyze the target for 6 sec and spams slow aboe him until its over, hope u got me if anything is not clear i can try to explain again, thanks
This is just a quick edit of an old script I created.

Use something similar for both runes
Code:
<action itemid="1111" event="script" value="scriptttttt.lua"/>
heal/mana rune -- untested
Code:
--   -- advanced
--   level = 2.5,     -- player level * amount
--   magic = 3,       -- player magic level * amount
--   min = 4.6,       -- min heal |
--   max = 5.2,       -- max heal |
--
--     -- Example: Player_level 50, Magic_level 65
--     -- (50 * 2.5 + 65 * 3) * 4.6 == 1472 -- Min_heal
--     -- (50 * 2.5 + 65 * 3) * 5.2 == 1664 -- Max_heal
--
--   --basic
--   min_heal = 700,  -- min heal
--   max_heal = 1000  -- max heal

--///////////
-- USE BASIC if you want to set how much they heal, doesn't matter what level or magic level they have
-- In config below IGNORE level, magic, min, max.
--///////////
-- USE ADVANCED if you want the rune to heal more as they get more skills and levels.
-- In config below IGNORE min_heal, max_heal
--///////////

local cfg = {
   removeOnUse = 1, -- remove item on use | 1 = true  0 = false |
   advanced = 1,    -- 1 = Use Advanced, 0 = use Basic
   lvl = 35,      -- level required to use the item
}
local vocation = {
   [1] = { level = 2.5, magic = 3, min = 4.6, max = 5.2, min_heal = 700, max_heal = 1000, name = "paladin"},
   [2] = { level = 3.5, magic = 4, min = 5.6, max = 7.2, min_heal = 1700, max_heal = 2500, name = "royal paladin"}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)

   if getPlayerVocation(cid) ~= 4 or not 8 then
     doPlayerSendCancel(cid, "Only paladin's can use this rune.")
     return true
   end

   if isPlayer(itemEx.uid) and getPlayerLevel(cid) >= cfg.lvl then
     for i = 1, #vocation do
       if vocation[i].name == getPlayerVocationName(itemEx.uid):lower() then
         if cfg.advanced == 1 then
           mini = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].min
           maxi = (getPlayerLevel(cid) * vocation[i].level + getPlayerMagLevel(cid) * vocation[i].magic) * vocation[i].max
           local randa = math.random(mini, maxi)
           doCreatureAddHealth(itemEx.uid, randa)
           doCreatureAddMana(itemEx.uid, randa)
           doCreatureSay(itemEx.uid, "+".. randa .."", TALKTYPE_ORANGE_1)
         else
           local randb = math.random(vocation[i].min_heal, vocation[i].max_heal)
           doCreatureAddHealth(itemEx.uid, randb)
           doCreatureAddMana(itemEx.uid, randb)
           doCreatureSay(itemEx.uid, "+".. randb .."", TALKTYPE_ORANGE_1)
         end
         break
       end
     end
     doSendMagicEffect(toPosition, 12)
     doRemoveCondition(cid, 32)
     if cfg.removeOnUse == 1 then
       doRemoveItem(item.uid, 1)
     end
   else
     doCreatureSay(cid, "You must be level ".. cfg.lvl .." to use this rune.", TALKTYPE_ORANGE_1)
   end
   return true
end
slow rune -- fully tested
Code:
local cfg = {
   removeOnUse = 1, -- remove item on use | 1 = true  0 = false |
   lvl = 35,      -- level required to use the item  
   seconds_of_slow = 6,
   percent_of_slow = 0.65 -- 65%
}

local function slowed_text(n, cid)
   if isPlayer(cid) then
     doCreatureSay(cid, "Slowed!", TALKTYPE_ORANGE_1, nil, nil, getThingPos(cid))  
     if(n > 0) then
       addEvent(slowed_text, 1000, n - 1, cid)
     end
   end
end

local function change_speed(cid, speed)
   if isPlayer(cid) then
     doChangeSpeed(cid, speed)
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if cid == itemEx.uid then
     doSendMagicEffect(toPosition, 13)
     return true
   end
   if isPlayer(itemEx.uid) and getPlayerLevel(cid) >= cfg.lvl then
     speed = (getCreatureSpeed(itemEx.uid) * cfg.percent_of_slow)
     doChangeSpeed(itemEx.uid, -speed)
     addEvent(change_speed, 1000 * cfg.seconds_of_slow, itemEx.uid, speed)
     addEvent(slowed_text, 0, cfg.seconds_of_slow - 1, itemEx.uid)
     doSendMagicEffect(toPosition, 12)
     if cfg.removeOnUse == 1 then
       doRemoveItem(item.uid, 1)
     end
   else
     doCreatureSay(cid, "You must be level ".. cfg.lvl .." to use this rune.", TALKTYPE_ORANGE_1)
   end
  
   return true
end
 
Last edited:
@Xikini sorry for asking here but you might know how to fix it, is there anyway to make the paladin/knight hits constant according to the skills, cuz now it hits like 500/600/1k randomly, is there a way to make it hit the same hit with the skills, or it requires a script
 
@Xikini Is slow rune will be able to use by hotkeys? if is it, may you do same rune but not usable by hotkeys like old tibia? 7.+ and another thing if the player who slowed will use hur, it won't be removed until the time done.
TFS 0.4
 
@Xikini sorry for asking here but you might know how to fix it, is there anyway to make the paladin/knight hits constant according to the skills, cuz now it hits like 500/600/1k randomly, is there a way to make it hit the same hit with the skills, or it requires a script
You would have to make a script and attach it to every weapon.. or it would require a source edit.
Are the scripts above both working?
@Xikini Is slow rune will be able to use by hotkeys? if is it, may you do same rune but not usable by hotkeys like old tibia? 7.+ and another thing if the player who slowed will use hur, it won't be removed until the time done.
TFS 0.4
If your server allows and uses hotkeys, then yes, it's available to be used with a hotkey.
If your server does not allow use of hotkeys, then no, it's not possible to be used with a hotkey.
I did a little bit of searching, and cannot find a way to disable a single items use with hotkey.
If it is possible, I don't care to search for the answer, or create it. If you can link me to somewhere that shows that it is possible without a source edit, I will definitely attempt to modify the script with it's enhancement.
 
Last edited:
@Supert you may use it like this with formula
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WHIRLWINDSWORD)


function onGetFormulaValues(cid, level, skill, attack, factor)

    local min = skill * 1
    local max = skill * 1
    return -min * 2, -max * 2
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
EDIT: do you need spells or weapon? if you need to use spells you just need to edit
Code:
function onUseWeapon(cid, var)
to
Code:
function onCastSpell(cid, var)
 
@Xikini both works fine thanks, can you help me to make this one for paladin also as well ?
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hpmax = getCreatureMaxHealth(cid)
local hpmin_add = (hpmax * 0.250)
local hpmax_add = (hpmax * 0.280)
local hp_add = math.random(hpmin_add, hpmax_add)
local manamax = getPlayerMaxMana(cid)
local manamin_add = (manamax * 0.100)
local manamax_add = (manamax * 0.100)
local mana_add = math.random(manamin_add, manamax_add)
local storage = 1000
local time = 0.350

if exhaustion.check(cid, storage) then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_POFF)
return doPlayerSendCancel(cid, "You are exhausted")
end
doCreatureAddHealth(cid, hp_add)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYAREA)
exhaustion.set(cid, storage, time)
doCreatureSay(cid, "DONATOR PALLY", TALKTYPE_ORANGE_1)
return TRUE
end
Sorry i don't know how to put them in the code thing.
@Slafesko , thanks alot i will test it
 
@Xikini both works fine thanks, can you help me to make this one for paladin also as well ?
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hpmax = getCreatureMaxHealth(cid)
local hpmin_add = (hpmax * 0.250)
local hpmax_add = (hpmax * 0.280)
local hp_add = math.random(hpmin_add, hpmax_add)
local manamax = getPlayerMaxMana(cid)
local manamin_add = (manamax * 0.100)
local manamax_add = (manamax * 0.100)
local mana_add = math.random(manamin_add, manamax_add)
local storage = 1000
local time = 0.350

if exhaustion.check(cid, storage) then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_POFF)
return doPlayerSendCancel(cid, "You are exhausted")
end
doCreatureAddHealth(cid, hp_add)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HOLYAREA)
exhaustion.set(cid, storage, time)
doCreatureSay(cid, "DONATOR PALLY", TALKTYPE_ORANGE_1)
return TRUE
end
Sorry i don't know how to put them in the code thing.
@Slafesko , thanks alot i will test it
Code:
if getPlayerVocation(cid) ~= 4 or not 8 then
     doPlayerSendCancel(cid, "Only paladin's can use this rune.")
     return true
end
 
Status
Not open for further replies.
Back
Top