• 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.X+ [TFS 1.3] Summons Cannot Uses Spells From the Same Monster in XML File

Yan18

Member
Joined
Jun 14, 2014
Messages
104
Solutions
3
Reaction score
17
Hello people!

Is there a way for a summons cannot uses spells that the same monster (enemy) has in attack tag in xml file?

For example, the monster Magma Crawler has the attack:

Lua:
<attack name="magma crawler soulfire" interval="2000" chance="20" />

And I want that I summon him, the Magma Crawler cannot use that spell.

Is it possible?
 
Hi @Yan18, I did not understand very well what you want, can you give another example or give a better explanation?
I will gladly help you if I can understand you
Hey! I know this isn't my thread but I think what he's saying is that he wants to be able to summon the monster Magma Crawler, but the summon should not be able to use the spell "magma crawler soulfire"
 
I guess it's basically about adding a IF in the script
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
combat:setArea(createCombatArea(AREA_CIRCLE2X2))
function onCastSpell(creature, variant)
    local master = creature:getMaster()
    if master and master:isPlayer() then
        return false
    end
    
    for _, target in ipairs(combat:getTargets(creature, variant)) do
        creature:addDamageCondition(target, CONDITION_FIRE, DAMAGELIST_VARYING_PERIOD, 10, {8, 10}, 20)
    end
    return true
end
 
Hey! I know this isn't my thread but I think what he's saying is that he wants to be able to summon the monster Magma Crawler, but the summon should not be able to use the spell "magma crawler soulfire"
Hey bro, thanks for help 😃

It is almost what you said. I just got the Magma Crawler as example, but not necessarily need to be the Magma Crawler, can be any other monster. But thanks once again!!

I guess it's basically about adding a IF in the script
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT)
combat:setArea(createCombatArea(AREA_CIRCLE2X2))
function onCastSpell(creature, variant)
    local master = creature:getMaster()
    if master and master:isPlayer() then
        return false
    end
   
    for _, target in ipairs(combat:getTargets(creature, variant)) do
        creature:addDamageCondition(target, CONDITION_FIRE, DAMAGELIST_VARYING_PERIOD, 10, {8, 10}, 20)
    end
    return true
end

It is almost what the Terminology said.

I understood what do you did, but I don't want forbid a monster to use a spell and vice versa (summon). I want to handle when a monster can and cannot use a spell in specifics situations, like a player with a summon to have a storage for example. I want to know, if there is a way to add or remove a spell by specific monster in real time, maybe when player target a monster.

Did you understand me now?
 
Back
Top