Wisling / tibiaauto

Tibia Auto is made to excel in the automation of various aspects of the playing the MMORPG Tibia
31 stars 17 forks source link

[enhancement] Maintainable and extendable Spell Caster #64

Open denisdifazio opened 8 years ago

denisdifazio commented 8 years ago

TA could have a new Spell Caster manager which would read a .xml containing all spells from the game separated by classes and inside each class it would be separated by Healing, Strike or AOE like:

<knight>
   <healing>
      <spell name="" cooldown="" manaCost="" />
   </healing>
   <aoe>
   </aoe>
   <strike>
   </strike>
</knight>
<paladin>
</paladin>
<druid>
</druid>
<sorcerer>
</sorcerer>

After reading the .xml, the manager could generate the GUI at runtime. This way, if a spell is added to the game or it has its cooldown/mana cost updated, the user could just edit the .xml

Javieracost commented 8 years ago

This would be nice, but i think it'd be better (mostly because of the simpler syntax) to use JSON over XML to store the data. Case in point, the example code in JSON would be something like:

{
    "knight": {
        "healing": {
            "spell": {
                "name": "",
                "cooldown": null,
                "manaCost": null
            }
        }
    }
}

But i guess the hard part is actually the logic to use the given configuration

denisdifazio commented 8 years ago

Oh awesome! I suggested xml because of its usage in the whole project. Yes, the logic would be a little tough, specially freeing these dynamically created components