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

RevScripts TFS 1.4.2 - Defense Monter

lazarus321

Member
Joined
May 8, 2017
Messages
222
Reaction score
23
Hi, How could I acquire the monster's defense in a spell?

On the example below I took it from the dragon xml

monster.defenses = {
defense = 30,
armor = 25,
mitigation = 0.99,
{ name = "combat", interval = 2000, chance = 15, type = COMBAT_HEALING, minDamage = 40, maxDamage = 70, effect = CONST_ME_MAGIC_BLUE, target = false },
}
 
Note that this doesn't get the creatures current armor & defense value, bur rather the base armor & defense values from xml file.
LUA:
local defense = 0
local armor = 0

if creature:isMonster() then
    defense = creature:getType():defense()
    armor = creature:getType():armor()
end
 

Similar threads

V
  • Question Question
Replies
1
Views
85
Replies
4
Views
322
Back
Top