Codex NG
Recurrent Flamer
- Joined
- Jul 24, 2015
- Messages
- 2,994
- Solutions
- 12
- Reaction score
- 1,657
I got a request from someone ( I won't mention who ) They wanted to update their monsters based on certain criteria.
So lets say you wanted to add new attacks, spells, loot etc to specific creatures based on certain characteristics, like their immunities, elements, loot etc..
It is by no means a perfect script but it is definitely a good start, there is 2 modes, preview and production
by setting commit to false you will see the preview mode.
Something like this
When commit is set to true then you enter the production mode and the changes are committed to the file.
So lets say you wanted to add new attacks, spells, loot etc to specific creatures based on certain characteristics, like their immunities, elements, loot etc..
It is by no means a perfect script but it is definitely a good start, there is 2 modes, preview and production
by setting commit to false you will see the preview mode.
Something like this
Code:
>lua -e "io.stdout:setvbuf 'no'" "Mparser.lua"
data/monster/Blobs/essence of darkness.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Blobs/floor blob.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Bonelords/eye of the seven.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Bosses/countess sorrow.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Bosses/spider queen.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Dreamhaunters/bad dream.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Ghosts/ghost.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Ghosts/phantasm summon.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Ghosts/phantasm.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Ghosts/tarnished spirit.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Ghosts/tormented ghost.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Misc/Misc Mounts/Incredibly Old Witch.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Misc/Misc Mounts/modified gnarlhound.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Pharaohs/dipthrah.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Pirates/pirate ghost.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Sorcerers/yalahari.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/deathslicer.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/flamethrower.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/hive pore.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/lavahole.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/magic pillar.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/magicthrower.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/plaguethrower.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
data/monster/Traps/shredderthrower.xml physical immunity <loot> <item id="5911" chance="530" /><!-- red piece of cloth -->
>Exit code: 0
When commit is set to true then you enter the production mode and the changes are committed to the file.
Code:
>lua -e "io.stdout:setvbuf 'no'" "Mparser.lua"
data/monster/Blobs/essence of darkness.xml updated...
data/monster/Blobs/floor blob.xml updated...
data/monster/Bonelords/eye of the seven.xml updated...
data/monster/Bosses/countess sorrow.xml updated...
data/monster/Bosses/spider queen.xml updated...
data/monster/Dreamhaunters/bad dream.xml updated...
data/monster/Ghosts/ghost.xml updated...
data/monster/Ghosts/phantasm summon.xml updated...
data/monster/Ghosts/phantasm.xml updated...
data/monster/Ghosts/tarnished spirit.xml updated...
data/monster/Ghosts/tormented ghost.xml updated...
data/monster/Misc/Misc Mounts/Incredibly Old Witch.xml updated...
data/monster/Misc/Misc Mounts/modified gnarlhound.xml updated...
data/monster/Pharaohs/dipthrah.xml updated...
data/monster/Pirates/pirate ghost.xml updated...
data/monster/Sorcerers/yalahari.xml updated...
data/monster/Traps/deathslicer.xml updated...
data/monster/Traps/flamethrower.xml updated...
data/monster/Traps/hive pore.xml updated...
data/monster/Traps/lavahole.xml updated...
data/monster/Traps/magic pillar.xml updated...
data/monster/Traps/magicthrower.xml updated...
data/monster/Traps/plaguethrower.xml updated...
data/monster/Traps/shredderthrower.xml updated...
>Exit code: 0