Curb
Active Member
- Joined
- Sep 7, 2014
- Messages
- 82
- Solutions
- 5
- Reaction score
- 34
TFS 1.4.2
I have two deer scripts, one defined in XML and the other in Revscript, that are identical in terms of settings. However, the deer.xml flees as expected, while deer.lua does not.
deer.lua:
deer.xml:
I have two deer scripts, one defined in XML and the other in Revscript, that are identical in terms of settings. However, the deer.xml flees as expected, while deer.lua does not.
deer.lua:
Lua:
local mType = Game.createMonsterType("Deer")
local monster = {}
monster.description = "a deer"
monster.experience = 0
monster.speed = 196
monster.manaCost = 260
monster.health = 25
monster.maxHealth = monster.health
monster.race = "blood"
monster.corpse = 5970
monster.outfit = {
lookType = 31
}
monster.targetchange = {
interval = 4000,
chance = 20
}
monster.flags = {
summonable = true,
attackable = true,
hostile = false,
illusionable = true,
convinceable = true,
pushable = true,
canpushitems = false,
canpushcreatures = false,
targetdistance = 1,
staticattack = 90,
runonhealth = 25,
canwalkonenergy = false,
canwalkonfire = false,
canwalkonpoison = false,
}
monster.attacks = {
{name = "melee", interval = 2000, min = 0, max = -1}
}
monster.defenses = {
armor = 2,
defense = 2
}
monster.loot = {
{itemName = "meat", countMax = 4, chance = 80000},
{itemName = "ham", countMax = 2, chance = 50000},
{itemId = 11214, chance = 1150} -- antlers
}
mType:register(monster)
deer.xml:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Deer" nameDescription="a deer" race="blood" experience="0" speed="196" manacost="260">
<health now="25" max="25" />
<look type="31" corpse="5970" />
<targetchange interval="4000" chance="20" />
<flags>
<flag summonable="1" />
<flag attackable="1" />
<flag hostile="0" />
<flag illusionable="1" />
<flag convinceable="1" />
<flag pushable="1" />
<flag canpushitems="0" />
<flag canpushcreatures="0" />
<flag targetdistance="1" />
<flag staticattack="90" />
<flag runonhealth="25" />
<flag canwalkonenergy="0" />
<flag canwalkonfire="0" />
<flag canwalkonpoison="0" />
</flags>
<attacks>
<attack name="melee" interval="2000" min="0" max="-1" />
</attacks>
<defenses armor="2" defense="2" />
<loot>
<item name="meat" countmax="4" chance="80000" />
<item name="ham" countmax="2" chance="50000" />
<item id="11214" chance="1150" /><!-- antlers -->
</loot>
</monster>
Last edited: