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

doSendAnimatedText - Spells

norrow

Member
Joined
Dec 16, 2012
Messages
129
Reaction score
7
Location
Poland
Witam, chce dodać do spella (heal) doSendAnimatedText pod funkcje onCastSpell by wyświetlało ile cid się leczy, proszę abyście nie pisali, że mam dodać w configu linijkę showHealingDamage bo chce zrobić to jednorazowo w spellu poniżej.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 3, 4, 2, 3)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
Uzylem tego tak doSendAnimatedText(getCreaturePosition(cid), combat, 66)
I dziala, lecz pokazuje stala sumę healu, nie zależnie jaki ktoś ma lvl/magic skill. Problemem jest pewnie samo combat bo nie zwraca liczby formuly, tylko co tu dodać by pokazywalo prawidlową formule leczenia.
doSendAnimatedText(getCreaturePosition(cid), zle , 66)
 
Last edited:
A więc na początku, zapoznaj się:
http://otland.net/threads/spell-formulas.125890/
http://otland.net/threads/combat_formula-how.110625/

Ta linijka jest nie logiczna:
Code:
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 3, 4, 2, 3)
Mniejsza wartość nie może być większa od większej wartości.

Funkcja doSendAnimatedText nie będzie w tym przypadku działać jeśli używasz kalkulacji poza funkcją onCastSpell!
Code:
local cfg = {
    3, 4, 2, 3
}

function onCastSpell(cid, var)
    local pos = getCreaturePosition(cid)
    local lv = getPlayerLevel(cid) + getPlayerMagLevel(cid)
    local heal = math.random(lv * cfg[1] - cfg[2], lv * cfg[3] - cfg[4])
   
    if doCreatureAddHealth(cid, heal) == LUA_NO_ERROR then
        doSendMagicEffect(pos, 12)
        doCreatureAddHealth(cid, heal)
        doRemoveCondition(cid, CONDITION_PARALYZE)
        doSendAnimatedText(pos, heal, 100)
    end
    return true
end
 
Back
Top