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

[TFS 1.2/1.3] Free scripting service

Status
Not open for further replies.
Is it possible a script add attributes by vocation?
#add item attributes
 
Last edited:
@Xeraphus I´d like to request a script that has this function. TFS 1.2
"Prevent noob chars from blocking players. Only players above lvl X can block chars from going through player . and if magicwall is used people cant get white skull of characters under x lvl.

This will prevent the annoying thing that when there is a big fight between guilds or players, noob chars cant block nor give white skulls to poeple who use magic walls and fire fields etc..
 
Last edited by a moderator:
yes, one set for all vocations if knight use add male, mage add magic and palla dist
you could but it would be awful to set up
you'd have a file with tons of conditions since you cant create conditions on the fly inside of functions (nor combats)
 
you could but it would be awful to set up
you'd have a file with tons of conditions since you cant create conditions on the fly inside of functions (nor combats)
that's we make a table where we write unique names for conditions and load them on startup.
Then we can use conditions on the fly

@Xeraphus I´d like to request a script that has this function. TFS 1.2
"Prevent noob chars from blocking players. Only players above lvl X can block chars from going through player . and if magicwall is used people cant get white skull of characters under x lvl.

This will prevent the annoying thing that when there is a big fight between guilds or players, noob chars cant block nor give white skulls to poeple who use magic walls and fire fields etc..
to make people able to step into object which has SOLID flag. Source edit is required.
Not sure about able to pass creatures, but I think its also requires source edit.
However field related scripts can be done in Lua

I want to request a script that I don't really know is possible. What I want is a command (maybe more funtions added to /attr) that would modify a certain monster's attacks, armor, name, flags, etc.. in-game. Like for example, I'd summon an Orc, rename is as Garrosh, and give it increased armor and attack.
Is that possible? mybe it would be a talkaction?
yes its possible.
But you will have to rewrite the meaning(formula) of attack and armor values in healthChange creaturescript.
To change name I think its only possible with source edit.

CAN YOU HELP ME MAKE LEVER GIVE XP??? I ALSO HAVE SCRIPT PROBLEM PLS HELP!!!
player:addExperience(1)
 
that's we make a table where we write unique names for conditions and load them on startup.
Then we can use conditions on the fly

if you create a condition or combat object you have to assign parameters and values outside of functions, so it's still not on the fly.
if there were preset combat/conditions he could use one for each vocation for every eq piece
but if he wanted different values for each vocation for each eq piece, all of the conditions will get messy since you cannot edit condition/combat param values in time of execution.
 
if you create a condition or combat object you have to assign parameters and values outside of functions, so it's still not on the fly.
if there were preset combat/conditions he could use one for each vocation for every eq piece
but if he wanted different values for each vocation for each eq piece, all of the conditions will get messy since you cannot edit condition/combat param values in time of execution.
wrong.
You only need to make condition
You can set parameters to condition inside the function
 
yes, one set for all vocations if knight use add male, mage add magic and palla dist
Lua:
--// Do not touch
local conditionSlots = {
    [CONST_SLOT_HEAD]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_HEAD),     id = CONDITIONID_HEAD},
    [CONST_SLOT_NECKLACE] = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_NECKLACE), id = CONDITIONID_NECKLACE},
    [CONST_SLOT_BACKPACK] = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_BACKPACK), id = CONDITIONID_BACKPACK},
    [CONST_SLOT_ARMOR]    = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_ARMOR),    id = CONDITIONID_ARMOR},
    [CONST_SLOT_RIGHT]    = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_RIGHT),    id = CONDITIONID_RIGHT},
    [CONST_SLOT_LEFT]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_LEFT),     id = CONDITIONID_LEFT},
    [CONST_SLOT_LEGS]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_LEGS),     id = CONDITIONID_LEGS},
    [CONST_SLOT_FEET]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_FEET),     id = CONDITIONID_FEET},
    [CONST_SLOT_RING]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_RING),     id = CONDITIONID_RING},
    [CONST_SLOT_AMMO]     = {condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_AMMO),     id = CONDITIONID_AMMO}
}

-- Set all conditions to infinite ticks
for i = 1, #conditionSlots do
    conditionSlots[i].condition:setParameter(CONDITION_PARAM_TICKS, -1)
end

local params = {
    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_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
}
--\\

-- Item config
local items = {
    -- ItemID
    [2506] = {
        -- Vocation ID 4
        [4] = {
            {param = CONDITION_PARAM_SKILL_MELEE, value = 30},
            {param = CONDITION_PARAM_SKILL_AXE, value = 15}
        },
    }
}

function onEquip(player, item, slot)
    local statItem = items[item.itemid]
    local vocStats = statItem and statItem[player:getVocation():getId()]

    if not vocStats then
        return true
    end

    local condition = conditionSlots[slot].condition

    -- Remove previous parameters so all params don't get added
    for p = 1, #params do
        condition:setParameter(params[p], 0)
    end

    -- Set new parameters
    for i = 1, #vocStats do
        condition:setParameter(vocStats[i].param, vocStats[i].value)
    end

    player:addCondition(condition)
    player:getPosition():sendMagicEffect(CONST_ME_FIREAREA)

    return true
end

function onDeEquip(player, item, slot)
    local conditionId = conditionSlots[slot].id
    if player:getCondition(CONDITION_ATTRIBUTES, conditionId) then
        player:removeCondition(CONDITION_ATTRIBUTES, conditionId)
    end
    return true
end
add this script to whatever items you put in the item config table in movements.xml
i only have 2506 in the config so i have this
XML:
    <movevent event="Equip" itemid="2506" slot="head" script="equip_dequip.lua" />
    <movevent event="DeEquip" itemid="2506" slot="head" script="equip_dequip.lua" />
 
Last edited:
Code:
add this script to whatever items you put in the item config table in movements.xml
i only have 2506 in the config so i have this
[code]
    <movevent event="Equip" itemid="2506" slot="head" script="equip_dequip.lua" />
    <movevent event="DeEquip" itemid="2506" slot="head" script="equip_dequip.lua" />
Thank you @Xeraphus
as always you are best.
 
Hey,
I need action script with an easy way to change/add sacrificedItems and rewardItems,
two of the same items will be removed and replaced by award (20% chance for rewardItem from list) or 20% chance for each trash item (4 trash items). Screen is only for example id of items can be any.
28twf1v.jpg


I would be very grateful!
Thanks for Help =]
 
Status
Not open for further replies.
Back
Top