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