Commit graph

3 commits

Author SHA1 Message Date
Ranieri Althoff
25df9cfd38
Move spells to scripts folder (#4755)
* Move runes to dedicated folder
* Redirect old XML and lib folder to new location
* Drop unused custom spells
2024-09-20 00:13:59 +02:00
Mario Tettei
04a7dd0e90 optimizations / bugfix on Spell (#2639)
* optimizations on Spell
- cooldown and groupCooldown are now correctly working
- vocation supports several vocation strings now
ex: :vocation("sorcerer;true", "master sorcerer") will show "sorcerer" in description
2019-08-16 17:57:36 +02:00
Mario Tettei
6c8e85b90c Revscriptsys Spells (#2584)
* Spell handling through lua

- Basics are done, but this is still wip

* work on reload for spell

- just a few tiny changes

* spell __newindex function

- this include __newindex for spell
- Spell does now return Userdata instead of tabledata

* added Spell Functions

- It includes all necessary Spell functions now

* made use of dynamic_cast

- There is still a cleanup todo, there are still several const_cast which I need to switch over
- applied createFunctions for Spell

* added a few safety checks

- cleaned up some functions
- changed const_cast to dynamic_cast
- exclusive InstantSpell & RuneSpell functions will not crash the server if not used appropriate

* erased duplicate

- erased duplicated g_spells->clear(true);

* enabled strings on Spell creation

- now you can use Spell("rune") & Spell("instant") aswell

* shortened down luaSpellGroup

- created stringToSpellGroup(), so I could get rid of repetitive stuff.

* combined charges and hasCharges

- if we set a rune :charges(1) or higher it'll automaticly mean that it should use charges aswell.
However if we don't set :charges or :charges(0) it means the rune is infinite.

* Final Spell handling

- changed so Spells are getting pushed as Spell now and not as InstantSpell or RuneSpell
- corrected the methods :allowFarUse :blockWalls and :checkFloor
- corrected RuneSpell* Spells::getRuneSpell(uint32_t id) it now can be accessed by either runeId or spellId
- corrected InstantSpell* Spells::getInstantSpellById(uint32_t spellId) it now returns the correct InstantSpell

* compiler error fix

* little update

- removed switch since it's just SPELL_INSTANT and SPELL_RUNE anyway
- changed RuneSpell* Spells::getRuneSpell(uint32_t id)
so it doesn't try to re initialize it again

* Spells #example.lua

- added Spells #example.lua

* safety move

- moved those 2 variables inside the if statements for safety.
2019-05-26 21:16:33 +02:00