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

Lua Spell monster

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
I'm trying to make a monster spell that put the player drunk, but it does not get drunk and we have no error on the screen, what am I doing wrong?
tfs 1.3

LUA:
local spellConf = {
    magicEffect = 32,
    bleedingDuration = 10,
    interval = 1000,
    damage = 50,

    area = {
        {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
        {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
        {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
        {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
        {0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
    },
}

local condition = Condition(CONDITION_DRUNK)
condition:setParameter(CONDITION_PARAM_TICKINTERVAL, spellConf.interval)

function onTargetTile(creature, position)
    position:sendMagicEffect(spellConf.magicEffect)
    local WhattheFuck = Player(creature)
   
     if not WhattheFuck then
     print("wtf 1")
        return
    end
    print("wtf 2")
   
    WhattheFuck:addCondition(condition)
end

local combat = Combat()
combat:setArea(createCombatArea(spellConf.area))
combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(creature, variant, isHotkey)

    return combat:execute(creature, variant)
end
 
Back
Top