TFS 0.X 2+ Players standing in the same SQM, one use spell, both get buffed.

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
417
Best answers
2
Likes
21
Location
México
#1
hey otlanders, i found a critical bug, as title says. If 2 or more players stands in the same SQM (like they up and down a stairs) and one player uses a buff spell, all the players standing in the same SQM gets the buff!

Is there any way to fix this? like a working source edit or a lua patch?

thanks

im using TFS 0.4 rev 3774.
 

Xikini

I whore myself out for likes
Joined
Nov 17, 2010
Messages
3,878
Best answers
122
Likes
2,010
#3
Can you post a spell that has this issue?
If you can post a video of 2 clients side by side with someone using the spell would be helpful as well.
 

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
417
Best answers
2
Likes
21
Location
México
#4
Can you post a spell that has this issue?
If you can post a video of 2 clients side by side with someone using the spell would be helpful as well.
these are 2 of spells that causes this issue.

morph bear
Lua:
local outfit = {lookType = 16} -- Roupa que ira transformar no caso seu corpo ficara em choque
local tempo = 2 * 60 * 1000 -- Tempo, nesse caso esta 60 segundos Lembrando que 1000 = 1 segundo

local ml = 15 -- quantos ira aumentar o skill de ML
local skillfist = 20 -- quantos ira aumentar o skill de Fist
local skillsword = -150 -- quantos ira aumentar o skill de Sword
local skillaxe = -150 -- quantos ira aumentar o skill de Axe
local skillclub = -150 -- quantos ira aumentar o skill de Club
local skilldistance = -150 -- quantos ira aumentar o skill de Distance
local skillshield = 20 -- quantos ira aumentar o skill de Shield
local health = 5 -- A cada 1 segundo quantos aumentar de vida
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 10)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)
setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)
setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)
setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_SPEED, -150)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000)
setCombatCondition(combat, condition)

local sys = createConditionObject(CONDITION_OUTFIT)
setConditionParam(sys, CONDITION_PARAM_TICKS, tempo)
addOutfitCondition(sys, outfit)
setCombatCondition(combat, sys)

function onCastSpell(cid, var)
setPlayerStorageValue (cid, 5353, 1)
       addEvent(function()
           if isPlayer(cid) then
               setPlayerStorageValue (cid, 5353, 0)
               doSendAnimatedText(toPosition, "Human", TEXTCOLOR_GREEN)
           end
       end, 2 * 60 * 1000)
return doCombat(cid, combat, var)
end
power word
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2*60*1000)
setConditionParam(condition, CONDITION_PARAM_SUBID, 195)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 50)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 150)
--setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
the cat spell has the same strucure as bear spell (and also both have the same problem)
 

Attachments

Joined
Dec 4, 2017
Messages
69
Best answers
11
Likes
26
#5
just tested this on 1.x and the same issue occurs.
i don't have a 0.2 server, but I had to add selftarget="1" to the spells.xml of the spell.
Does 0.2 use this same thing?
 

elnelson

Lunaria World Dev
Joined
Jun 20, 2009
Messages
417
Best answers
2
Likes
21
Location
México
#6
just tested this on 1.x and the same issue occurs.
i don't have a 0.2 server, but I had to add selftarget="1" to the spells.xml of the spell.
Does 0.2 use this same thing?
i will test and edit this post later thanks.

that was the solution, selftarget="1" is the way to fix this, thanks.
 
Last edited:
Top