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

Monster XML tags

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,249
Solutions
71
Reaction score
628
Location
Hell
GitHub
idontreallywolf
Where can I find a list of xml tags for monsters?

example: "flags","health","attacks","loot"..
I've currently found these (but there's probably more):
summons, immunities, voices, loot, elements, defenses, attack, flags, look, strategy, targetChange, health


Ok, otland pepes. I have been reading trough monsters.cpp to compile a list of xml tags and attributes used.
What currently confuses me is the usage of deserializeSpell() function because I have no idea which attributes belong to attack or defense

In the snippet below you can clearly see that the main tag <defenses> has two attributes: defense & armor. But if you look into the part where it iterates over <defense> nodes you can see that it is calling deserializeSpell() function to continue the process..

C++:
else if(!xmlStrcmp(p->name, (const xmlChar*)"attacks"))
        {
            xmlNodePtr tmpNode = p->children;
            while(tmpNode)
            {
                if(!xmlStrcmp(tmpNode->name, (const xmlChar*)"attack"))
                {
                    spellBlock_t sb;
                    if(deserializeSpell(tmpNode, sb, monsterName))
                        mType->spellAttackList.push_back(sb);
                    else
                        SHOW_XML_WARNING("Cant load spell");
                }

                tmpNode = tmpNode->next;
            }
        }
        else if(!xmlStrcmp(p->name, (const xmlChar*)"defenses"))
        {
            if(readXMLInteger(p, "defense", intValue))
                mType->defense = intValue;

            if(readXMLInteger(p, "armor", intValue))
                mType->armor = intValue;

            xmlNodePtr tmpNode = p->children;
            while(tmpNode)
            {
                if(!xmlStrcmp(tmpNode->name, (const xmlChar*)"defense"))
                {
                    spellBlock_t sb;
                    if(deserializeSpell(tmpNode, sb, monsterName))
                        mType->spellDefenseList.push_back(sb);
                    else
                        SHOW_XML_WARNING("Cant load spell");
                }

                tmpNode = tmpNode->next;
            }
        }

iu



TFS: 0.4 3777
 
Last edited:
if I recall right that's what the monster does (spells) when he's on the run, like warlocks (if they're still like I recall them from back in the days)
healing spells and other buffs are also considered defenses.
 
sorry to big to post here. have you looked at the definition of the method deserializeSpell to understand how it works?

I have looked trough that function more than once. Can't find anything which denotes whether an attribute belongs to attack or defense
 
I have looked trough that function more than once. Can't find anything which denotes whether an attribute belongs to attack or defense
If both nested control structures (if/else) are calling the deserializeSpell method then that means it belongs to both attack & defense.
 
Back
Top