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

Blad w addon bonusie

Stefan1307

New Member
Joined
Mar 14, 2009
Messages
36
Reaction score
0
Witam. Mam taki problem, przerobiłem sobie skrypt addon bonus system lecz gdy postać się relognie dodane bonusy mu znikają, a co najgorsze gracze tracą mane i hp prze ten skrypt, ponieważ jest w nim jakiś błąd. Prosil bym o pomoc. Pozdrawiam.

Code:
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, 1)
local yalahar = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(yalahar, CONDITION_PARAM_TICKS, -1)
setConditionParam(yalahar, CONDITION_PARAM_STAT_MAGICLEVEL, 1)
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)
local nightmare = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(norse, CONDITION_PARAM_TICKS, -1)
setConditionParam(norse, CONDITION_PARAM_SKILL_SHIELD, 3)
function onOutfit(cid, old, current)
        if(current.lookType == old.lookType) then
                return TRUE
        end
        --Citizen
        if(current.lookType == 128 and current.lookAddons == 3 or current.lookType == 136 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
                doCreatureAddHealth(cid, 100)
                doChangeSpeed(cid, 10)
        elseif(old.lookType == 128 and old.lookAddons == 3 or old.lookType == 136 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
                doCreatureAddHealth(cid, -100)
                doChangeSpeed(cid, -10) 
        end
        --Hunter
        if(current.lookType == 129 and current.lookAddons == 3 or current.lookType == 137 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, hunter)
        elseif(old.lookType == 129 and old.lookAddons == 3 or old.lookType == 137 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Mage
        if(current.lookType == 130 and current.lookAddons == 3 or current.lookType == 138 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, yalahar)
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300)
                doCreatureAddMana(cid, 300)
        elseif(old.lookType == 130 and old.lookAddons == 3 or old.lookType == 138 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300)
                doCreatureAddMana(cid, -300)
        end
        --Knight
        if(current.lookType == 131 and current.lookAddons == 3 or current.lookType == 139 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, knight)
        elseif(old.lookType == 131 and old.lookAddons == 3 or old.lookType == 139 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Nobleman
        if(current.lookType == 132 and current.lookAddons == 3 or current.lookType == 140 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
                doCreatureAddHealth(cid, 200)
                doChangeSpeed(cid, 10)
        elseif(old.lookType == 132 and old.lookAddons == 3 or old.lookType == 140 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 200)
                doCreatureAddHealth(cid, -200)
                doChangeSpeed(cid, -10) 
        end
        --Summoner
        if(current.lookType == 133 and current.lookAddons == 3 or current.lookType == 141 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100)
                doCreatureAddMana(cid, 100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
                doCreatureAddHealth(cid, 100)
        elseif(old.lookType == 133 and old.lookAddons == 3 or old.lookType == 141 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 100)
                doCreatureAddMana(cid, -100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
                doCreatureAddHealth(cid, -100)
        end
        --Warrior
        if(current.lookType == 134 and current.lookAddons == 3 or current.lookType == 142 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, knight)
        elseif(old.lookType == 134 and old.lookAddons == 3 or old.lookType == 142 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Barbarian
        if(current.lookType == 143 and current.lookAddons == 3 or current.lookType == 147 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, barbarian)
        elseif(old.lookType == 143 and old.lookAddons == 3 or old.lookType == 147 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Druid
        if(current.lookType == 144 and current.lookAddons == 3 or current.lookType == 148 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, mage)
        elseif(old.lookType == 144 and old.lookAddons == 3 or old.lookType == 148 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Wizard
        if(current.lookType == 145 and current.lookAddons == 3 or current.lookType == 149 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100)
                doCreatureAddMana(cid, 100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
                doCreatureAddHealth(cid, 100)
        elseif(old.lookType == 145 and old.lookAddons == 3 or old.lookType == 149 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 100)
                doCreatureAddMana(cid, -100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
                doCreatureAddHealth(cid, -100)
        end
        --Oriental
        if(current.lookType == 146 and current.lookAddons == 3 or current.lookType == 150 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 150)
                doCreatureAddMana(cid, 150)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 150)
                doCreatureAddHealth(cid, 150)
                doChangeSpeed(cid, 10)
        elseif(old.lookType == 146 and old.lookAddons == 3 or old.lookType == 150 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 150)
                doCreatureAddMana(cid, -150)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 150)
                doCreatureAddHealth(cid, -150)
                doChangeSpeed(cid, -10)
        end
        --Assassin
        if(current.lookType == 152 and current.lookAddons == 3 or current.lookType == 156 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, hunter)
                doChangeSpeed(cid, 30)
        elseif(old.lookType == 152 and old.lookAddons == 3 or old.lookType == 156 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                doChangeSpeed(cid, -30)
        end
        --Shaman
        if(current.lookType == 154 and current.lookAddons == 3 or current.lookType == 158 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, mage)
        elseif(old.lookType == 154 and old.lookAddons == 3 or old.lookType == 158 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
        end
        --Norse
        if(current.lookType == 251 and current.lookAddons == 3 or current.lookType == 252 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, norse)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
                doCreatureAddHealth(cid, 200)
        elseif(old.lookType == 251 and old.lookAddons == 3 or old.lookType == 252 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 200)
                doCreatureAddHealth(cid, -200)
        end
        --Nightmare
        if(current.lookType == 268 and current.lookAddons == 3 or current.lookType == 269 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, nightmare)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
                doCreatureAddHealth(cid, 200)
        elseif(old.lookType == 268 and old.lookAddons == 3 or old.lookType == 269 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 200)
                doCreatureAddHealth(cid, -200)
        end
        --Jester
        if(current.lookType == 270 and current.lookAddons == 3 or current.lookType == 273 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100)
                doCreatureAddMana(cid, 100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
                doCreatureAddHealth(cid, 100)
                doChangeSpeed(cid, 10)
        elseif(old.lookType == 270 and old.lookAddons == 3 or old.lookType == 273 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 100)
                doCreatureAddMana(cid, -100)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
                doCreatureAddHealth(cid, -100)
                doChangeSpeed(cid, -10)
        end
        --Brotherhood
        if(current.lookType == 278 and current.lookAddons == 3 or current.lookType == 279 and current.lookAddons == 3) then --Bonus on
                doAddCondition(cid, yalahar)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
                doCreatureAddHealth(cid, 100)
        elseif(old.lookType == 278 and old.lookAddons == 3 or old.lookType == 279 and old.lookAddons == 3) then --Bonus off
                doRemoveCondition(cid, CONDITION_ATTRIBUTES)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 100)
                doCreatureAddHealth(cid, -100)
        end
        --Demonhunter
        if(current.lookType == 288 and current.lookAddons == 3 or current.lookType == 289 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)
                doCreatureAddMana(cid, 200)
        elseif(old.lookType == 288 and old.lookAddons == 3 or old.lookType == 289 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 200)
                doCreatureAddMana(cid, -200)
        end
        --Yalaharian
        if(current.lookType == 324 and current.lookAddons == 3 or current.lookType == 325 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)
                doCreatureAddMana(cid, 200)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
                doCreatureAddHealth(cid, 200)
                doAddCondition(cid, yalahar)
        elseif(old.lookType == 324 and old.lookAddons == 3 or old.lookType == 325 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 200)
                doCreatureAddMana(cid, -200)
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 200)
                doCreatureAddHealth(cid, -200)
                doRemoveCondition(cid, yalahar)
        end
        --Warmaster
        if(current.lookType == 336 and current.lookAddons == 3 or current.lookType == 335 and current.lookAddons == 3) then --Bonus on
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
                doCreatureAddHealth(cid, 200)
        elseif(old.lookType == 336 and old.lookAddons == 3 or old.lookType == 335 and old.lookAddons == 3) then --Bonus off
                setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 200)
                doCreatureAddHealth(cid, -200)
        end
        return TRUE
end
 
Last edited by a moderator:
Addon bonusy są niedopracowane i mają kilka wad np można sobie na stałe zwiększać hp/mp usuwać skulla czy też blokują inne czary dodające skille np Utito Tempo San. Testowałem kilka takich systemów jednak uważam że i tak nie warto tego stosować bo gracze będą biegali w najlepszym przez co będą używane może 4 outfity.

Nie wątpię że są osoby które mają takowy system w pełni działający jednak mi nie chciało się bawić z tym.
 
@Kamil

Co racja to racja, ja nigdy tego nie stosowałem a do dyspozycji jest spora liczba "bonusów".
 
Diath a powiedzial bys mi jak to zrobic? bo w outfits.xml mam tylko ustawione protekcje np. od ognia, smierci itp. Gdybys mi powiedzial jak tam wpisac mane i hp to byl bym wdzieczny, tak tez wczoraj myslalem zeby w outfits.xml lecz skryptu za bardzo nie znam na mane i hp.
 
Code:
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)
doCreatureAddMana(cid, 200)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
doCreatureAddHealth(cid, 200)
 
jeszcze sobie zablokuj np. utevo res ina "assassin < bo na kilku otsach zamiana w potwory podobne do addon bonusowych dodaja normalnie bonusy.
 
To nie dziala,
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)
doCreatureAddMana(cid, 200)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
doCreatureAddHealth(cid, 200)
Co mam tu wpisac by dodawalo 200 many i 200 hp, a po zmianie na inny zabieralo te 200hp i 200 many?
Code:
<outfit id="21" premium="yes">
<list gender="0" lookType="324" name="Yalaharian">
</list>
<list gender="1" lookType="325" name="Yalaharian">
</list>
</outfit>
 
Last edited by a moderator:
Back
Top