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

Scripter Looking for a scripter to buy a creaturescript

Just a misplacement of the second part
this
Code:
local b = bonuses[player:getVocation():getId()]
for i = 1, #b do
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(b.bonus[i], b.value[i])
condition:setParameter(CONDITION_PARAM_TICKS, -1)
condition:setParameter(CONDITION_PARAM_SUBID, 200)
player:addCondition(condition)
end
should be after this
Code:
loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
I didn't realize that last line there existed elsewhere, it's just not working because it's calling the code only for first login.
@whitevo tits or gtfo, don't be a twat.

Sorry ><
Stills doesn't works :c
 
I found this piece of addons bonus script:

local hunter = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(hunter, CONDITION_PARAM_TICKS, -1)
setConditionParam(hunter, CONDITION_PARAM_SKILL_DISTANCE, 3)

local knight = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(knight, CONDITION_PARAM_TICKS, -1)
setConditionParam(knight, CONDITION_PARAM_SKILL_SWORD, 3)

local mage = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(mage, CONDITION_PARAM_TICKS, -1)
setConditionParam(mage, CONDITION_PARAM_STAT_MAGICLEVEL, 2)

local barbarian = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(barbarian, CONDITION_PARAM_TICKS, -1)
setConditionParam(barbarian, CONDITION_PARAM_SKILL_AXE, 3)

local norse = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(norse, CONDITION_PARAM_TICKS, -1)
setConditionParam(norse, CONDITION_PARAM_SKILL_SHIELD, 2)
setConditionParam(norse, CONDITION_PARAM_STAT_MAXHEALTH, 200) --- hp

local nightmare = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(nightmare, CONDITION_PARAM_TICKS, -1)
setConditionParam(nightmare, CONDITION_PARAM_SKILL_SHIELD, 3)
setConditionParam(nightmare, CONDITION_PARAM_STAT_MAXHEALTH, 100) --- hp

local yalaharian = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(yalaharian, CONDITION_PARAM_TICKS, -1)
setConditionParam(yalaharian, CONDITION_PARAM_STAT_MAGICLEVEL, 2)
setConditionParam(yalaharian, CONDITION_PARAM_STAT_MAXHEALTH, 200) --- hp
setConditionParam(yalaharian, CONDITION_PARAM_STAT_MAXMANA, 200) --- mana

local demonhunter = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(demonhunter, CONDITION_PARAM_TICKS, -1)
setConditionParam(demonhunter, CONDITION_PARAM_STAT_MAXHEALTH, 500) --- hp
setConditionParam(demonhunter, CONDITION_PARAM_STAT_MAXMANA, 500) -- mana

local brotherhood = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(brotherhood, CONDITION_PARAM_TICKS, -1)
setConditionParam(brotherhood, CONDITION_PARAM_STAT_MAXHEALTH, 200) --- hp

local hpmana100 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(hpmana100, CONDITION_PARAM_TICKS, -1)
setConditionParam(hpmana100, CONDITION_PARAM_STAT_MAXHEALTH, 100) --- hp
setConditionParam(hpmana100, CONDITION_PARAM_STAT_MAXMANA, 100) --- mana

local hpmana200 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(hpmana200, CONDITION_PARAM_TICKS, -1)
setConditionParam(hpmana200, CONDITION_PARAM_STAT_MAXHEALTH, 200) --- hp
setConditionParam(hpmana200, CONDITION_PARAM_STAT_MAXMANA, 200) --- mana

local mana100 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(mana100, CONDITION_PARAM_TICKS, -1)
setConditionParam(mana100, CONDITION_PARAM_STAT_MAXMANA, 100) --- mana

local mana200 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(mana200, CONDITION_PARAM_TICKS, -1)
setConditionParam(mana200, CONDITION_PARAM_STAT_MAXMANA, 200) --- mana

local hp100 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(hp100, CONDITION_PARAM_TICKS, -1)
setConditionParam(hp100, CONDITION_PARAM_STAT_MAXHEALTH, 100) --- hp

local speed1 = createConditionObject(CONDITION_HASTE)
setConditionParam(speed1, CONDITION_PARAM_TICKS, -1)
setConditionParam(speed1, CONDITION_PARAM_SPEED, 10)

local speed2 = createConditionObject(CONDITION_HASTE)
setConditionParam(speed2, CONDITION_PARAM_TICKS, -1)
setConditionParam(speed2, CONDITION_PARAM_SPEED, 20)

--- CONDITION_PARAM_STAT_MAXHEALTH, CONDITION_PARAM_STAT_MAXMANA
--- CONDITION_PARAM_BUFF
outfitBonusTable = { --- [] = {condition = , typ = }
[128] = {condition = {speed1, hp100}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, [136] = {condition = {speed1, hp100}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, --Citizen --[maxHealth = 100]
[129] = {condition = hunter}, [137] = {condition = hunter}, --Hunter
[130] = {condition = mana200, typ = CONDITION_ATTRIBUTES}, [138] = {condition = mana200, typ = CONDITION_ATTRIBUTES}, --Mage
[131] = {condition = knight, typ = CONDITION_ATTRIBUTES}, [139] = {condition = knight, typ = CONDITION_ATTRIBUTES}, --Knight
[133] = {condition = mana100, typ = CONDITION_ATTRIBUTES}, [141] = {condition = mana100, typ = CONDITION_ATTRIBUTES}, --Summoner -- [maxMana = 100]
[134] = {condition = knight, typ = CONDITION_ATTRIBUTES}, [142] = {condition = knight, typ = CONDITION_ATTRIBUTES}, --Warrior
[143] = {condition = barbarian, typ = CONDITION_ATTRIBUTES}, [147] = {condition = barbarian, typ = CONDITION_ATTRIBUTES}, --Barbarian
[144] = {condition = mage, typ = CONDITION_ATTRIBUTES}, [148] = {condition = mage, typ = CONDITION_ATTRIBUTES}, --Druid
[145] = {condition = {hpmana100}, typ = CONDITION_ATTRIBUTES}, [149] = {condition = {hpmana100}, typ = CONDITION_ATTRIBUTES}, --Wizard --[maxHealth = 100, maxMana = 100]
[146] = {condition = {speed1, hpmana200}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, [150] = {condition = {speed1, hpmana200}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, --Oriental --[maxHealth = 200, maxMana = 200]
[152] = {condition = speed2, typ = CONDITION_HASTE}, [156] = {condition = speed2, typ = CONDITION_HASTE}, --Assassin
[154] = {condition = mage, typ = CONDITION_ATTRIBUTES}, [158] = {condition = mage, typ = CONDITION_ATTRIBUTES}, --Shaman
[251] = {condition = norse, typ = CONDITION_ATTRIBUTES}, [252] = {condition = norse, typ = CONDITION_ATTRIBUTES}, --Norse [maxHealth = 200]
[268] = {condition = nightmare, typ = CONDITION_ATTRIBUTES}, [269] = {condition = nightmare, typ = CONDITION_ATTRIBUTES}, --Nightmare --[maxHealth = 100]
[270] = {condition = {speed1, hpmana100}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, [273] = {condition = {speed1, hpmana100}, typ = {CONDITION_HASTE, CONDITION_ATTRIBUTES}}, --Jester --[maxHealth = 100, maxMana = 100]
[278] = {condition = brotherhood, typ = CONDITION_ATTRIBUTES}, [279] = {condition = brotherhood, typ = CONDITION_ATTRIBUTES}, --Brotherhood -- [maxHealth = 200]
[288] = {condition = speed2, typ = CONDITION_HASTE}, [289] = {condition = speed2, typ = CONDITION_HASTE}, --Demonhunter --[maxHealth = 500, maxMana = 500]
[324] = {condition = yalaharian, typ = CONDITION_ATTRIBUTES}, [325] = {condition = yalaharian, typ = CONDITION_ATTRIBUTES} --Yalaharian -- [maxHealth = 200, maxMana = 200]
}

function onLogin(cid)
registerCreatureEvent(cid, "Addons")
--- local current = getCreatureOutfit(cid)
return onOutfit(cid, {lookAddons = 1}, getCreatureOutfit(cid)) and true
end

function onOutfit(cid, old, current)
if getPlayerAccess(cid) >= 3 then
return print("Staff/support can't get any addon bonus!") and true
end
if old.lookAddons == 3 and outfitBonusTable[old.lookType] then --Bonus off
if (outfitBonusTable[old.lookType]).typ ~= nil then
if type((outfitBonusTable[old.lookType]).typ) == "table" then
for _, value in pairs((outfitBonusTable[old.lookType]).typ) do
doRemoveCondition(cid, value)
end
else
doRemoveCondition(cid, (outfitBonusTable[old.lookType]).typ)
end
end
end
if current.lookAddons == 3 and outfitBonusTable[current.lookType] then --Bonus on
if (outfitBonusTable[current.lookType]).condition ~= nil then
if type((outfitBonusTable[current.lookType]).condition) == "table" then
for _, value in pairs((outfitBonusTable[current.lookType]).condition) do
doAddCondition(cid, value)
end
else
doAddCondition(cid, (outfitBonusTable[current.lookType]).condition)
end
end
end
return true
end

I'm trying to make up something with those lines but not even sure what the hell I'm doing haha
 
Really @whitevo if you're going to complain on people trying to help this person please make a better script yourself, right now you're not helping anyone at all just posting useless messages.
Ps. I do understand that this post is useless aswell :)
Regards Alw
There is a reason for complaining and i did help with complain too.. Although maybe only few understood where i was pointing at..

So fine here is what I would do if someone asked me this script..
Code:
--[[ config guide table
    [STR] = {           STR = vocationName in lower letters!
        [STR] = INT     STR = Param, INT = value for param
                        params: CONDITION_PARAM_STAT_MAGICPOINTS
                                CONDITION_PARAM_SKILL_DISTANCE
                                CONDITION_PARAM_SKILL_SHIELD
                                CONDITION_PARAM_SKILL_DISTANCE
                                CONDITION_PARAM_SKILL_FIST
                                CONDITION_PARAM_SKILL_CLUB
                                CONDITION_PARAM_SKILL_SWORD
                                CONDITION_PARAM_SKILL_AXE
]]
local SUBID = 300 --give your won sub id for attributes if 1 is in use already.
local config = {
    ["druid"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 3,
    },
    ["paladin"] = {
        CONDITION_PARAM_SKILL_DISTANCE = 4,
    },
    ["knight"] = {
        CONDITION_PARAM_SKILL_CLUB = 1,
        CONDITION_PARAM_SKILL_SWORD = 1,
        CONDITION_PARAM_SKILL_AXE = 1,
        CONDITION_PARAM_SKILL_SHIELD = 2,
    },
    ["mage"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 5,
    },
}
-- "system" what you don't have to understand...
local boostConditions = {}
for vocation, boostT in pairs(config) do
    boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID)
    boostConditions[vocation]:setTicks(-1)
  
    for param, v in pairs(boostT) do
        boostConditions[vocation]:setParameter(_G[param], v)
    end
end
--- ALL above goes OUTSIDE the functions
--- ALL below goes INSIDE the onLogin() function
local vocationNameLow = player:getVocation():getName():lower()
if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end
 
There is a reason for complaining and i did help with complain too.. Although maybe only few understood where i was pointing at..

So fine here is what I would do if someone asked me this script..
Code:
--[[ config guide table
    [STR] = {           STR = vocationName in lower letters!
        [STR] = INT     STR = Param, INT = value for param
                        params: CONDITION_PARAM_STAT_MAGICPOINTS
                                CONDITION_PARAM_SKILL_DISTANCE
                                CONDITION_PARAM_SKILL_SHIELD
                                CONDITION_PARAM_SKILL_DISTANCE
                                CONDITION_PARAM_SKILL_FIST
                                CONDITION_PARAM_SKILL_CLUB
                                CONDITION_PARAM_SKILL_SWORD
                                CONDITION_PARAM_SKILL_AXE
]]
local SUBID = 300 --give your won sub id for attributes if 1 is in use already.
local config = {
    ["druid"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 3,
    },
    ["paladin"] = {
        CONDITION_PARAM_SKILL_DISTANCE = 4,
    },
    ["knight"] = {
        CONDITION_PARAM_SKILL_CLUB = 1,
        CONDITION_PARAM_SKILL_SWORD = 1,
        CONDITION_PARAM_SKILL_AXE = 1,
        CONDITION_PARAM_SKILL_SHIELD = 2,
    },
    ["mage"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 5,
    },
}
-- "system" what you don't have to understand...
local boostConditions = {}
for vocation, boostT in pairs(config) do
    boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID)
    boostConditions[vocation]:setTicks(-1)
 
    for param, v in pairs(boostT) do
        boostConditions[vocation]:setParameter(_G[param], v)
    end
end
--- ALL above goes OUTSIDE the functions
--- ALL below goes INSIDE the onLogin() function
local vocationNameLow = player:getVocation():getName():lower()
if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end


I Installed as you say there and this error shows up:

J8i0eUS.png


Here's my login.lua:

Code:
local SUBID = 300 --give your won sub id for attributes if 1 is in use already.
local config = {
    ["druid"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 3,
    },
    ["paladin"] = {
        CONDITION_PARAM_SKILL_DISTANCE = 4,
    },
    ["knight"] = {
        CONDITION_PARAM_SKILL_CLUB = 1,
        CONDITION_PARAM_SKILL_SWORD = 1,
        CONDITION_PARAM_SKILL_AXE = 1,
        CONDITION_PARAM_SKILL_SHIELD = 2,
    },
    ["mage"] = {
        CONDITION_PARAM_STAT_MAGICPOINTS = 5,
    },
}
-- "system" what you don't have to understand...
local boostConditions = {}
for vocation, boostT in pairs(config) do
    boostConditions[vocation] = Condition(CONDITION_ATTRIBUTES, SUBID)
    boostConditions[vocation]:setTicks(-1)
   
    for param, v in pairs(boostT) do
        boostConditions[vocation]:setParameter(_G[param], v)
    end
end
Uprint(boostConditions)
--- ALL above goes OUTSIDE the functions
--- ALL below goes INSIDE the onLogin() function

function onLogin(player)
   
    -- Free bless
    freeBless = {
        level = 200,
        blesses = {1, 2, 3, 4, 5}
    }

    local loginStr = "Welcome to " .. configManager.getString(configKeys.SERVER_NAME) .. "!"
    if player:getLastLoginSaved() <= 0 then
        loginStr = loginStr .. " Please choose your outfit."
        player:sendOutfitWindow()
    else
        if loginStr ~= "" then
            player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
        end

        loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
    end
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
   
    local vocationNameLow = player:getVocation():getName():lower()
if config[vocationNameLow] then player:addCondition(boostConditions[vocationNameLow]) end
   
    if player:getLevel() <= freeBless.level then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received the free blessings available untill level 200.")
        for i=1,#freeBless.blesses do
            player:addBlessing(freeBless.blesses[i])
        end
    end

    -- Stamina
    nextUseStaminaTime[player.uid] = 0

    -- Promotion
    local vocation = player:getVocation()
    local promotion = vocation:getPromotion()
    if player:isPremium() then
        local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
        if not promotion and value ~= 1 then
            player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
        elseif value == 1 then
            player:setVocation(promotion)
        end
    elseif not promotion then
        player:setVocation(vocation:getDemotion())
    end

    -- Events
    player:registerEvent("PlayerDeath")
    player:registerEvent("DropLoot")
    return true
end
 
remove the Uprint that is my testing tool. I tested entire script before too. but seems I missed a line. just delete that line.
 
Found the problem with mine.
just needed to change
Code:
for i = 1, #b do
to
Code:
for i = 1, #b.bonus do
 
I'll also test yours Razor and reply, thanks a lot for the help you both!

Question: Where i can see all the conditions params?
Like speed, or health, mana, maybe if theres counter or drain bonus param? :P
 
Code:
CONDITION_PARAM_OWNER
CONDITION_PARAM_TICKS
CONDITION_PARAM_HEALTHGAIN
CONDITION_PARAM_HEALTHTICKS
CONDITION_PARAM_MANAGAIN
CONDITION_PARAM_MANATICKS
CONDITION_PARAM_DELAYED
CONDITION_PARAM_SPEED
CONDITION_PARAM_LIGHT_LEVEL
CONDITION_PARAM_LIGHT_COLOR
CONDITION_PARAM_SOULGAIN
CONDITION_PARAM_SOULTICKS
CONDITION_PARAM_MINVALUE
CONDITION_PARAM_MAXVALUE
CONDITION_PARAM_STARTVALUE
CONDITION_PARAM_TICKINTERVAL
CONDITION_PARAM_FORCEUPDATE
CONDITION_PARAM_SKILL_MELEE
CONDITION_PARAM_SKILL_FIST
CONDITION_PARAM_SKILL_CLUB
CONDITION_PARAM_SKILL_SWORD
CONDITION_PARAM_SKILL_AXE
CONDITION_PARAM_SKILL_DISTANCE
CONDITION_PARAM_SKILL_SHIELD
CONDITION_PARAM_SKILL_FISHING
CONDITION_PARAM_STAT_MAXHITPOINTS
CONDITION_PARAM_STAT_MAXMANAPOINTS
CONDITION_PARAM_STAT_SOULPOINTS
CONDITION_PARAM_STAT_MAGICPOINTS
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT
CONDITION_PARAM_STAT_SOULPOINTSPERCENT
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT
CONDITION_PARAM_PERIODICDAMAGE
CONDITION_PARAM_SKILL_MELEEPERCENT
CONDITION_PARAM_SKILL_FISTPERCENT
CONDITION_PARAM_SKILL_CLUBPERCENT
CONDITION_PARAM_SKILL_SWORDPERCENT
CONDITION_PARAM_SKILL_AXEPERCENT
CONDITION_PARAM_SKILL_DISTANCEPERCENT
CONDITION_PARAM_SKILL_SHIELDPERCENT
CONDITION_PARAM_SKILL_FISHINGPERCENT
CONDITION_PARAM_BUFF_SPELL
CONDITION_PARAM_SUBID
CONDITION_PARAM_FIELD
 
Razor, the only thing doesn't properly works on your script is the multiple bonuses:

[8] = {bonus = {CONDITION_PARAM_SKILL_MELEE, CONDITION_PARAM_SKILL_SHIELD}, value = {2, 2}}, -- elite knight

I promoted a knight and the only bonus working is +2 shielding.
But that's ok for me, I'm only going to use 1 bonus per voc or promotion (:
 
Ah, right. subid conflict :3
quickest fix would be changing
Code:
condition:setParameter(CONDITION_PARAM_SUBID, 200)
to
Code:
condition:setParameter(CONDITION_PARAM_SUBID, 200 + i)
 
Ah, right. subid conflict :3
quickest fix would be changing
Code:
condition:setParameter(CONDITION_PARAM_SUBID, 200)
to
Code:
condition:setParameter(CONDITION_PARAM_SUBID, 200 + i)

Thanks Razor :D
One last question!

CONDITION_PARAM_SPEED is not working for me, either CONDITION_HASTE (I know, it was a fail try using the condition from haste spell xD)

Is not possible to add movement speed on this bonus script or am i doing something wrong? I already tested few others and works good
 
you'd have to create the condition as haste
local condition = Condition(CONDITION_HASTE)
then set the condition parameter of speed, mine isn't really set up to work with that since it uses CONDITION_ATTRIBUTES for skills and stats
 
Ohh.. I'll see what happends..

Thank you so much everyone!
This is been so helpful, not only for the script, i also learn some scripting things! (:

I hope someday i be able to payback all your help :rolleyes:
 
Ohh.. I'll see what happends..

Thank you so much everyone!
This is been so helpful, not only for the script, i also learn some scripting things! :)

I hope someday i be able to payback all your help :rolleyes:
Just pay it forward :)
 
Ohh.. I'll see what happends..

Thank you so much everyone!
This is been so helpful, not only for the script, i also learn some scripting things! :)

I hope someday i be able to payback all your help :rolleyes:
Oh, also, in regards to haste, it's still haste even if it's an infinite condition, so it'll be overwritten by paralyze and I don't think it would re-engage until after relogging, so I wouldn't recommend using it for this type of thing.
 
Oh, also, in regards to haste, it's still haste even if it's an infinite condition, so it'll be overwritten by paralyze and I don't think it would re-engage until after relogging, so I wouldn't recommend using it for this type of thing.

Whoa, did not thought on that.... Thanks for the observation!

I'll try to figure how to use it, looking for the way the BOH works or something like that :P
If i find a way to make it work i'll let you know
 
Back
Top