• 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 0.X addon bonus, not equiped outfit

dawnking

Member
Joined
Jun 23, 2016
Messages
176
Reaction score
22
What do i need to change in my outfit.cpp (Fir3element/3777 (https://github.com/Fir3element/3777/blob/master/src/outfit.cpp))
To add all those bonus from:

example:
Code:
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
            <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="128" name="Citizen">
            <stats maxHealth="100"/>
        </list>
    </outfit>

Without need to be using the outfit+addons?



I mean to receive the outfit bonus u have to equip full addon
This is good, but it make the players fight for only 1 or 2 addons
What i think is better is: player have the addon recive the bonus, without need to equip the addon
So players will fight for all addons
 
What do i need to change in my outfit.cpp (Fir3element/3777 (https://github.com/Fir3element/3777/blob/master/src/outfit.cpp))
To add all those bonus from:

example:
Code:
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
            <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="128" name="Citizen">
            <stats maxHealth="100"/>
        </list>
    </outfit>

Without need to be using the outfit+addons?



I mean to receive the outfit bonus u have to equip full addon
This is good, but it make the players fight for only 1 or 2 addons
What i think is better is: player have the addon recive the bonus, without need to equip the addon
So players will fight for all addons
Lua:
function onThink(interval, lastExecution)
local outfits = {-- 136 number of female outfit its work for female and male np , Storage for check outfit with canPlayerWearOutfit , if u set enable true will add the bouns example if u set maxHealth true will add 100 health to player when get outfit
[136] = {Storage = 90001 , bonus = {{enable = true, type = "maxHealth", values = 100}, {enable = true, type = "maxMana", values = 100},{enable = true, type = "speed", values = 200},{enable = true, type = "Distance", values = 200},{enable = true, type = "Sword", values = 200},{enable = true, type = "Axe", values = 10},{enable = true, type = "Club", values = 10},{enable = true, type = "Shield", values = 10},{enable = true, type = "Magic", values = 1}}},
[137] = {Storage = 90002 , bonus = {{enable = true, type = "maxHealth", values = 100}, {enable = true, type = "maxMana", values = 100},{enable = true, type = "speed", values = 200},{enable = true, type = "Distance", values = 200},{enable = true, type = "Sword", values = 200},{enable = true, type = "Axe", values = 10},{enable = true, type = "Club", values = 10},{enable = true, type = "Shield", values = 10},{enable = true, type = "Magic", values = 1}}}

}
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
for k,v in pairs(outfits) do
    if canPlayerWearOutfit(cid,k, 3) and getPlayerStorageValue(cid,v.Storage) <= 0 then
        for i = 1, table.maxn(v.bonus) do
            if(v.bonus[i].enable) then
                if isInArray({"maxHealth", "Health", 1}, v.bonus[i].type) then
                     setCreatureMaxHealth(cid,(getCreatureMaxHealth(cid) + v.bonus[i].values))
                        elseif isInArray({"maxMana","Mana", 2}, v.bonus[i].type) then
                            setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+ v.bonus[i].values))
                                elseif isInArray({"speed", 3}, v.bonus[i].type) then
                                    doChangeSpeed(cid,getCreatureSpeed(cid) + v.bonus[i].values )
                                    elseif isInArray({"Distance", 4}, v.bonus[i].type) then
                                        doPlayerAddSkillTry(cid,SKILL_DISTANCE, getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, getPlayerSkillLevel(cid, SKILL_DISTANCE) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_DISTANCE), true)
                                        elseif isInArray({"Sword", 5}, v.bonus[i].type) then
                                            doPlayerAddSkillTry(cid,SKILL_SWORD, getPlayerRequiredSkillTries(cid, SKILL_SWORD, getPlayerSkillLevel(cid, SKILL_SWORD) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_SWORD), true)
                                            elseif isInArray({"Axe", 7}, v.bonus[i].type) then
                                                doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_AXE, getPlayerSkillLevel(cid, SKILL_AXE) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_AXE), true)
                                                    elseif isInArray({"Club", 8}, v.bonus[i].type) then
                                                        doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_CLUB, getPlayerSkillLevel(cid, SKILL_CLUB) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_CLUB), true)
                                                            elseif isInArray({"Shield", 9}, v.bonus[i].type) then
                                                                doPlayerAddSkillTry(cid,SKILL_AXE, getPlayerRequiredSkillTries(cid, SKILL_SHIELD, getPlayerSkillLevel(cid, SKILL_SHIELD) + v.bonus[i].values) - getPlayerSkillTries(cid, SKILL_SHIELD), true)
                                                                    elseif isInArray({"Magic", 10}, v.bonus[i].type) then
                                                                        doPlayerAddMagLevel(cid,v.bonus[i].values)
                             
                    else
                        print("Bad bonus type: " .. v.bonus[i].type .. ", bonus could not be loaded.")
                end
            end
        end
     
        setPlayerStorageValue(cid, v.Storage,1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have new bonus.")
     
    end
end
end
return true
end

in creaturescript and add xml
<event type="think" name="outfitbouns" event="script" value="outfit bouns.lua"/>
in login
registerCreatureEvent(cid, "outfitbouns")

add all outfit i just add 2 outfit for test just add one female or male not add 2 exmaple Citizen (136) hunter(137) mage (138) etc
 
Last edited:
What do i need to change in my outfit.cpp (Fir3element/3777 (https://github.com/Fir3element/3777/blob/master/src/outfit.cpp))
To add all those bonus from:

example:
Code:
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen">
            <stats maxHealth="100"/>
        </list>
        <list gender="1" lookType="128" name="Citizen">
            <stats maxHealth="100"/>
        </list>
    </outfit>

Without need to be using the outfit+addons?



I mean to receive the outfit bonus u have to equip full addon
This is good, but it make the players fight for only 1 or 2 addons
What i think is better is: player have the addon recive the bonus, without need to equip the addon
So players will fight for all addons

Your script gives only:
Code:
Magic
Shield
Club
Axe
Sword
Distance
speed
maxMana
maxHealth

That script [Outfit] Adding bonus to your addons at WITHOUT BUG using sources functions! (https://otland.net/threads/outfit-adding-bonus-to-your-addons-at-without-bug-using-sources-functions.100186/)
Gives:
Code:
manaShield
invisible
healthGain/healthTicks
manaGain/manaTicks
speed
--------------
reflect percentAll
reflect percentElements
reflect percentMagic
reflect percentEnergy
reflect percentFire
reflect percentPoison
reflect percentIce
reflect percentHoly
reflect percentDeath
reflect percentLifeDrain
reflect percentManaDrain
reflect percentDrown
reflect percentPhysical
reflect percentHealing
reflect percentUndefined
reflect chanceAll
reflect chanceElements
reflect chanceMagic
reflect chanceEnergy
reflect chancetFire
reflect chancePoison
reflect chanceIce
reflect chanceHoly
reflect chanceDeath
reflect chanceLifeDrain
reflect chanceManaDrain
reflect chanceDrown
reflect chancePhysical
reflect chanceHealing
reflect chanceUndefined
--------------
absorb percentAll
absorb percentElements
absorb percentMagic
absorb percentEnergy
absorb percentFire
absorb percentPoison
absorb percentIce
absorb percentHoly
absorb percentDeath
absorb percentLifeDrain
absorb percentManaDrain
absorb percentDrown
absorb percentPhysical
absorb percentHealing
absorb percentUndefined
--------------
skills fist
skills club
skills axe
skills sword
skills distance
skills shielding
skills fishing
skills melee (fist, club, sword y axe)
skills weapon (club, sword, axe, dist)
skills fistPercent
skills clubPercent
skills axePercent
skills swordPercent
skills distancePercent
skills shieldingPercent
skills fishingPercent
skills meleePercent (fist, club, sword y axe)
skills weaponPercent (club, sword, axe, dist)
--------------
stats maxHealth
stats maxMana
stats soul
stats level
stats magLevel
stats maxHealthPercent
stats maxManaPercent
stats soulPercent
stats levelPercent
stats magLevelPercent
--------------
supress poison
supress fire
supress energy
supress physical
supress haste
supress paralyze
supress invisible
supress light
supress manaShield
supress drunk
supress drown
supress muted

is it hard to change for always give the bonus instead of give only when equip the outfit?
 
Your script gives only:
Code:
Magic
Shield
Club
Axe
Sword
Distance
speed
maxMana
maxHealth

That script [Outfit] Adding bonus to your addons at WITHOUT BUG using sources functions! (https://otland.net/threads/outfit-adding-bonus-to-your-addons-at-without-bug-using-sources-functions.100186/)
Gives:
Code:
manaShield
invisible
healthGain/healthTicks
manaGain/manaTicks
speed
--------------
reflect percentAll
reflect percentElements
reflect percentMagic
reflect percentEnergy
reflect percentFire
reflect percentPoison
reflect percentIce
reflect percentHoly
reflect percentDeath
reflect percentLifeDrain
reflect percentManaDrain
reflect percentDrown
reflect percentPhysical
reflect percentHealing
reflect percentUndefined
reflect chanceAll
reflect chanceElements
reflect chanceMagic
reflect chanceEnergy
reflect chancetFire
reflect chancePoison
reflect chanceIce
reflect chanceHoly
reflect chanceDeath
reflect chanceLifeDrain
reflect chanceManaDrain
reflect chanceDrown
reflect chancePhysical
reflect chanceHealing
reflect chanceUndefined
--------------
absorb percentAll
absorb percentElements
absorb percentMagic
absorb percentEnergy
absorb percentFire
absorb percentPoison
absorb percentIce
absorb percentHoly
absorb percentDeath
absorb percentLifeDrain
absorb percentManaDrain
absorb percentDrown
absorb percentPhysical
absorb percentHealing
absorb percentUndefined
--------------
skills fist
skills club
skills axe
skills sword
skills distance
skills shielding
skills fishing
skills melee (fist, club, sword y axe)
skills weapon (club, sword, axe, dist)
skills fistPercent
skills clubPercent
skills axePercent
skills swordPercent
skills distancePercent
skills shieldingPercent
skills fishingPercent
skills meleePercent (fist, club, sword y axe)
skills weaponPercent (club, sword, axe, dist)
--------------
stats maxHealth
stats maxMana
stats soul
stats level
stats magLevel
stats maxHealthPercent
stats maxManaPercent
stats soulPercent
stats levelPercent
stats magLevelPercent
--------------
supress poison
supress fire
supress energy
supress physical
supress haste
supress paralyze
supress invisible
supress light
supress manaShield
supress drunk
supress drown
supress muted

is it hard to change for always give the bonus instead of give only when equip the outfit?
u can add all you want but need source edit
i use this script in my server for this bouns
Magic level , % Spell damage , % physical protection , % Mana drain protection , % death protection , Health points , % ice protection , 10 Shield , Rune health point , Mana points , % energy protection , Rune mana point , regenerations , % earth protection , % fire protection , Weapon attack , Melee , % holy protection , speed , % Healing bouns.
 
You want the bonus work without need to have the addons or work without being equipped?

Without being equipped
Because if u put to receive bonus only equipped, players fight just for 1,2 addons
If they got bonus to every addon they have, they fight for all addons, gottcha?
 
Without being equipped
Because if u put to receive bonus only equipped, players fight just for 1,2 addons
If they got bonus to every addon they have, they fight for all addons, gottcha?
Yes i got it,
Look i am using mobile now.
But i can give you the idea, you can make a storage valur for each outfit addons they got and make a login creature script with conditions (bonus).
So once they login and have the storage, they get the bonus.

Something like that, i am on mobile and can’t edit it.
I copied mine from github project.

Lua:
local config = {
    storage = PlayerStorageKeys.all_addons_bonus,
}

local cond1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(cond1, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXMANAPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_SKILL_FIST, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_CLUB, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SWORD, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_DISTANCE, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SHIELD, 10)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(cond1, CONDITION_PARAM_SUBID, 521)

local cond2 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(cond2, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond2, CONDITION_PARAM_HEALTHGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_HEALTHTICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_MANAGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_SUBID, 522)

local cond3 = createConditionObject(CONDITION_HASTE)
setConditionParam(cond3, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond3, CONDITION_PARAM_SPEED, 300)
setConditionParam(cond3, CONDITION_PARAM_SUBID, 523)

function onLogin(cid)
    if isPlayer(cid) then
        if getPlayerStorageValue(cid, config.storage) < 1 then
            if getPlayerStorageValue(cid, PlayerStorageKeys.assassin_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.barbarian_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.beggar_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.brotherhood_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.citizen_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.demonhunter_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.druid_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.hunter_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.jester_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.knight_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.mage_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.nightmare_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.nobleman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.norseman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.oriental_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.pirate_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.shaman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.summoner_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.warmaster_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.warrior_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.wayfarer_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.wizard_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.yalaharian_addons) >= 1 then
                setPlayerStorageValue(cid, config.storage, 1)
                doAddCondition(cid, cond1)
                doAddCondition(cid, cond2)
                doAddCondition(cid, cond3)
                doSendMagicEffect(getPlayerPosition(cid), 61)
                if not doPlayerOpenChannel(cid, 12) then
                    doPlayerOpenChannel(cid, 12)
                    doPlayerSendChannelMessage(cid, '', "Congratulations, you have been awarded by permanent bonus for collecting all addons. Please relog to make the bonus active.", TALKTYPE_CHANNEL_W, 12)  
                else
                    doPlayerSendChannelMessage(cid, '', "Congratulations, you have been awarded by permanent bonus for collecting all addons. Please relog to make the bonus active.", TALKTYPE_CHANNEL_W, 12)
                end
            end
        elseif getPlayerStorageValue(cid, config.storage) >= 1 then
            doAddCondition(cid, cond1)
            doAddCondition(cid, cond2)
            doAddCondition(cid, cond3)
        end
    end
    return true
end
This script means, when they collect all addons, they get a storage once they login and bonus.
When they login after that with the all addons bonus they get the bonus immediately.
You can edit it, got it?
Post automatically merged:

Plus you can’t use the same attributes and stats from outfits.xml into creature event script.
You have to create your own using source or creature events to give that bonus like reflection or damage reduction and so on.
 
Last edited:
Yes i got it,
Look i am using mobile now.
But i can give you the idea, you can make a storage valur for each outfit addons they got and make a login creature script with conditions (bonus).
So once they login and have the storage, they get the bonus.

Something like that, i am on mobile and can’t edit it.
I copied mine from github project.

Lua:
local config = {
    storage = PlayerStorageKeys.all_addons_bonus,
}

local cond1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(cond1, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXMANAPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_SKILL_FIST, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_CLUB, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SWORD, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_DISTANCE, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SHIELD, 10)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(cond1, CONDITION_PARAM_SUBID, 521)

local cond2 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(cond2, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond2, CONDITION_PARAM_HEALTHGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_HEALTHTICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_MANAGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_SUBID, 522)

local cond3 = createConditionObject(CONDITION_HASTE)
setConditionParam(cond3, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond3, CONDITION_PARAM_SPEED, 300)
setConditionParam(cond3, CONDITION_PARAM_SUBID, 523)

function onLogin(cid)
    if isPlayer(cid) then
        if getPlayerStorageValue(cid, config.storage) < 1 then
            if getPlayerStorageValue(cid, PlayerStorageKeys.assassin_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.barbarian_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.beggar_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.brotherhood_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.citizen_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.demonhunter_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.druid_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.hunter_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.jester_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.knight_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.mage_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.nightmare_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.nobleman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.norseman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.oriental_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.pirate_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.shaman_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.summoner_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.warmaster_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.warrior_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.wayfarer_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.wizard_addons) >= 1 and
            getPlayerStorageValue(cid, PlayerStorageKeys.yalaharian_addons) >= 1 then
                setPlayerStorageValue(cid, config.storage, 1)
                doAddCondition(cid, cond1)
                doAddCondition(cid, cond2)
                doAddCondition(cid, cond3)
                doSendMagicEffect(getPlayerPosition(cid), 61)
                if not doPlayerOpenChannel(cid, 12) then
                    doPlayerOpenChannel(cid, 12)
                    doPlayerSendChannelMessage(cid, '', "Congratulations, you have been awarded by permanent bonus for collecting all addons. Please relog to make the bonus active.", TALKTYPE_CHANNEL_W, 12) 
                else
                    doPlayerSendChannelMessage(cid, '', "Congratulations, you have been awarded by permanent bonus for collecting all addons. Please relog to make the bonus active.", TALKTYPE_CHANNEL_W, 12)
                end
            end
        elseif getPlayerStorageValue(cid, config.storage) >= 1 then
            doAddCondition(cid, cond1)
            doAddCondition(cid, cond2)
            doAddCondition(cid, cond3)
        end
    end
    return true
end
This script means, when they collect all addons, they get a storage once they login and bonus.
When they login after that with the all addons bonus they get the bonus immediately.
You can edit it, got it?
Post automatically merged:

Plus you can’t use the same attributes and stats from outfits.xml into creature event script.
You have to create your own using source or creature events to give that bonus like reflection or damage reduction and so on.

No i want the bonus to each outfit...
And storages are no necessary... there is a function called canPlayerWearOutfitId

Code:
local cond1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(cond1, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAXMANAPERCENT, 110)
setConditionParam(cond1, CONDITION_PARAM_SKILL_FIST, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_CLUB, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SWORD, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_DISTANCE, 10)
setConditionParam(cond1, CONDITION_PARAM_SKILL_SHIELD, 10)
setConditionParam(cond1, CONDITION_PARAM_STAT_MAGICLEVEL, 10)
setConditionParam(cond1, CONDITION_PARAM_SUBID, 521)

local cond2 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(cond2, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond2, CONDITION_PARAM_HEALTHGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_HEALTHTICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_MANAGAIN, 300)
setConditionParam(cond2, CONDITION_PARAM_MANATICKS, 1000)
setConditionParam(cond2, CONDITION_PARAM_SUBID, 522)

local cond3 = createConditionObject(CONDITION_HASTE)
setConditionParam(cond3, CONDITION_PARAM_TICKS, -1)
setConditionParam(cond3, CONDITION_PARAM_SPEED, 300)
setConditionParam(cond3, CONDITION_PARAM_SUBID, 523)

function onLogin(cid)
    if isPlayer(cid) then
        -- citizen
        if canPlayerWearOutfitId(cid, 136, 3) or canPlayerWearOutfitId(cid, 128, 3) then
            doAddCondition(cid, cond1)
        -- hunter
        if canPlayerWearOutfitId(cid, 137, 3) or canPlayerWearOutfitId(cid, 129, 3) then
            doAddCondition(cid, cond2)
        -- mage
        if canPlayerWearOutfitId(cid, 138, 3) or canPlayerWearOutfitId(cid, 130, 3) then
            doAddCondition(cid, cond3)
        -- knight
        if canPlayerWearOutfitId(cid, 139, 3) or canPlayerWearOutfitId(cid, 131, 3) then
            -- 
        end
    end
    return true
end

So that is the way to add temporary attributes?

That is ugly haha
There isn't a better way to do this script?
 
Back
Top