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

Why outfit condition don't work in this script?

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
549
Solutions
6
Reaction score
124
Location
player:getTown()
TFS 0.3.6pl1


LUA:
local werewolf = {lookType = 308}

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat5, COMBAT_PARAM_AGGRESSIVE, 0)

local outfit3 = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit3, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit3, 0, werewolf.lookType, 0, 0, 0, 0)
setCombatCondition(combat5, outfit3)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	doCombat(cid, combat1, var)
end

Error in console, befor server started:
Code:
[14/03/2010 15:56:41] [Error - Action Interface] 
[14/03/2010 15:56:41] data/actions/scripts/RPG/wolf.lua
[14/03/2010 15:56:41] Description: 
[14/03/2010 15:56:41] attempt to index a number value
[14/03/2010 15:56:41] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/RPG/wolf.lua)
 
All I can see is tons of unnecessary code but ya could atleast dump the local werewolf and use

LUA:
addOutfitCondition(outfit3, {lookType = 308})

Also i assume there's more than those lines in the script.. or?
 
#SexyDevil#
I will try.

#Chojrak#
I know that, but only this part isn't correct:
LUA:
local outfit3 =  createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit3, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit3, 0, werewolf.lookType, 0, 0, 0, 0)
setCombatCondition(combat5, outfit3)

#hxzr#
1. I will try
2. Yes, you are right :P

#EDIT#
hxzr thx, it work's

Correct condition:
LUA:
local outfit3 = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit3, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit3, {lookTypeEx = 0, lookType = werewolf.lookType, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
setCombatCondition(combat5, outfit3)

REP+

#EDIT2#
Now I need 'var' parameter for this function
Code:
doCombat(cid, combat5, var)

What I know about 'var'?
1. It must be table with variables 'type' and 'number'

I try this, and it won't work xS

LUA:
  local werewolf = {lookType = 308}

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat5, COMBAT_PARAM_AGGRESSIVE, 0)

local outfit3 = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit3, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit3, 0, werewolf.lookType, 0, 0, 0, 0)
setCombatCondition(combat5, outfit3)

function onUse(cid, item, fromPosition, itemEx, toPosition)
        doCombat(cid, combat5, {number = ?, type = 1})
end

No errors in console.
 
Last edited:
Code:
local werewolf =  {lookType = 308}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(outfit, 0, werewolf.lookType, 0, 0, 0, 0)
setCombatCondition(combat, outfit)

function onUse(cid, item, fromPosition, itemEx, toPosition)
        doCombat(cid, combat, numberToVariant(cid))
	return true
end
 
OK I have one more question.
How add condition exhaust for healing spells or agresive spells, I try sth like this, but it don't work:
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local exhaust = createConditionObject(CONDITION_EXHAUST) --- EXHAUST_HEALING
-- setConditionParam(exhaust, CONDITION_PARAM_TICKS, -1)
setConditionParam(exhaust, EXHAUST_HEALING, -1)
setCombatCondition(combat, exhaust)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	return doCombat(cid, combat, numberToVariant(cid))
end

In constant.lua I found this:
Code:
CONDITION_EXHAUST

EXHAUST_OTHER
EXHAUST_COMBAT
EXHAUST_HEALING
EXHAUST_WEAPON
 
Another questions:
1. It's possible to set player light visible only for him (cid) in function simmilar to doSetCreatureLight(cid, lightLevel, lightColor, time)?

2. How I can disable equiping weapon and attacking with weapon for player at example 10 min?

3. It's possible to set flag "ignored by monster type"?
 
Back
Top