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

RevScripts Effect should follow player, how to do that?

Status
Not open for further replies.

Marko999x

999x era
Premium User
Joined
Dec 14, 2017
Messages
2,827
Solutions
82
Reaction score
1,948
Location
Germany
How do I let the effect follow the player if its not based as spell at all?

Lua:
local spell = Spell(SPELL_INSTANT)

local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 10000)
condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, 135)
condition:setParameter(CONDITION_PARAM_DISABLE_DEFENSE, true)
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
combat:addCondition(condition)

local function effect(pos)
    local effect = 15
    Position(pos.x+1, pos.y+1, pos.z):sendDistanceEffect(pos, effect)
    pos:sendMagicEffect(9)
    addEvent(function()
        Position(pos.x, pos.y+2, pos.z):sendDistanceEffect(pos, effect)
        pos:sendMagicEffect(21)
    end, 100)
end

function spell.onCastSpell(creature, variant)
    addEvent(effect, 10, creature:getPosition())
    combat:execute(creature, variant)
    return true
end

spell:name("utito poison")
spell:words("utito poison")
spell:group("support")
spell:vocation("druid", "master sorcerer")
spell:id(2)
spell:cooldown(30000)
spell:level(1)
spell:manaPercent(15)
spell:blockWalls(true)
spell:isSelfTarget(true)
spell:register()

Selftarget wont work because its a local function I think?
Post automatically merged:

ePuncker explained me on discord

so instead of put creature:getPosition() in the addEvent, we check the position inside the local function :D
 
Last edited:
ePuncker explained me on discord

so instead of put creature:getPosition() in the addEvent, we check the position inside the local function :D
 
Last edited by a moderator:
Solution
Status
Not open for further replies.
Back
Top