• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved problem adding attack to monster

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
hii, im trying to put a spell into a monster, but it gives me an error, also i don't know quite well how to add spells, here is my monster

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="God of the Forest" nameDescription="GOD of the Forest" race="undead" experience="390000" speed="2090" manacost="0">
	<health now="500000" max="500000"/>
	<look type="285" corpse="8933"/>
	<targetchange interval="1" chance="50"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="0"/>
		<flag canpushitems="1"/>
		<flag staticattack="80"/>
		<flag lightlevel="0"/>
		<flag lightcolor="0"/>
		<flag targetdistance="1"/>
		<flag runonhealth="1"/>
	</flags>
	<attacks>
                <attack name="melee" interval="500" chance="1" min="-5000" max="-6000"/>
                <attack name="Hells Core" interval="500" chance="1" min="-5000" max="-6000"/>
		</attack>
		<attack name="earth" interval="20" chance="10" length="6" spread="0" min="2000" max="-4000">
			<attribute key="areaEffect" value="smallplants"/>
		</attack>
		<attack name="physical" interval="2000" chance="9" target="0" radius="4" min="0" max="-240">
			<attribute key="areaEffect" value="poff"/>
		</attack>
	</attacks>
	<elements>
		<element deathPercent="20"/>
		<element icePercent="20"/>
		<element physicalPercent="20"/>
		<element holyPercent="20"/>
		<element firePercent="-25"/>
	</elements>
	<immunities>
		<immunity paralyze="1"/>
		<immunity invisible="1"/>
		<immunity earth="1"/>
		<immunity energy="1"/>
	</immunities>
	<loot>
		<item id="2148" countmax="114" chance="100000"/><!-- gold coin -->
		<item id="1294" countmax="9" chance="9000"/><!-- small stone -->
		<item id="2436" chance="3000"/><!-- plate armor -->
	</loot>
</monster>

this is the spell i added and got the error

LUA:
<attack name="Hells Core" interval="500" chance="1" min="-5000" max="-6000"/>

and this is the error

XML:
[30/07/2013 01:01:34] [Warning - Monsters::loadMonster] Cannot load monster (GOD of the forest) file (data/monster/Edited/GOD of the forest.xml).
[30/07/2013 01:01:34] Line: 32, Info: Extra content at the end of the document

plzz guys help me :( and teach me plz how to add spells and if it's possible how to edit the areaeffects
 
Hi Thorn,

You have already closed the attack tag, no need to do it twice ;)

Change:
LUA:
<attack name="Hells Core" interval="500" chance="1" min="-5000" max="-6000"/>
</attack>

to

LUA:
<attack name="Hells Core" interval="500" chance="1" min="-5000" max="-6000"/>

See the '/' before the '>' at the end of the line? It closes the tag. Having an extra '</attack>' confused it. This also means that you could, instead, just remove the '/' before the '>' and leave the '</attack>' in place. Unnecessary but it would work.

Cheers,
Yodot.
 
oooh thanks man! and also, how do i add spells to monsters? because that hells core it's copied from another monster, and i would like to add more, and the areaeffect thing confuse me :S plzz

- - - Updated - - -

Nevermind i got the solution, thanks man :D problem solved
 
Back
Top