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

[TFS 1.2] Can't hit Invisble enemy with HMM

Lyky

Well-Known Member
Joined
May 27, 2014
Messages
291
Solutions
8
Reaction score
89
Hi,
I have one of the odd ones, i am unable to hit stalker/invisible enemy with runes like hmm/lmm/sd; but I am able from GM account.

Lua:
   local base = 30
   local variation = 10

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

function onGetFormulaValues(cid, level, maglevel)
   local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation) / 100))
   local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation) / 100))
   return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
   return combat:execute(creature, variant)
end

from spells.xml (taking out needtarget, allows player to shoot into empty spot)
XML:
    <rune group="attack" spellid="8" name="Heavy Magic Missile" id="2311" allowfaruse="1" charges="5" lvl="0" exhaustion="2000" groupcooldown="2000" maglv="3" needtarget="1" blocktype="solid" script="attack/heavy magic missile.lua"/>

Stalker is using following defense
XML:
    <defenses armor="14" defense="20">
       <defense name="invisible" chance="25" duration="30000">
           <attribute key="areaEffect" value="blueshimmer"/>
       </defense>


Any ideas?
 
The answer is right in front of you. needtarget="1", this means you need a target (1 being true, 0 being false) for the script to execute, gm/god do not have these limitations.
 
as i wrote, if removed you can hit anything with rune... even when there's nothing there.
 
as i wrote, if removed you can hit anything with rune... even when there's nothing there.
Well gm's and up have certain flags which ignore specific conditions which should be met normally on a player, off hand I really can't think of what those conditions are.
 
It could be a condition missing here; but i understood variant was one that specified invis targets;


creature, variant.
Lua:
function onCastSpell(creature, variant)
   return combat:execute(creature, variant)
end

unless i make creates use utana vid instead their original invis making it easy for players. Does that sound reasonable? or poor temp fix?
 
Back
Top