Skip to content

Moubootaur Legends Magic Core

Jesusaves requested to merge jesusalva/evolsrc:jesusalva/magic into master

This ports Moubootaur Legends Magic Core to The Mana World under @Micksha 's request.

Skills are not included; Only core functions.

What is MSP?

Magic Skill Points. Can be obtained by increasing MAGIC_LVL variable.

Which in ML is raised by the Mana Stone, but this is not the case in TMW.

A few other ways to obtain MSP are coded in.

How to reset skills learnt this way?

Not yet implemented, but you could do the reverse logic from learn_magic().

Testing: Use Case

Talk to Audsbel. He'll offer you the Monster Identify skill. It'll cost 0 MSP and 5000 GP.

Scripting: Main Functions and their Usage

              RegisterMagic(MSP, Skill, MaxLv, Item, Amount,
                            Class, Cost, {PreReq, PostReq})

Registers SKILL (a skill_db constant), requiring MSP MSP, which can be leveled until MaxLv (Set MaxLv to 1 if you will use skill_tree to level skills up). It'll cost Amount Item, cost Cost Esperins, and will be added to Class (a Magic School Constant) array for easier sorting.

It'll have PreReq as pre-requisite and can be evolved to PostReq (the later is optional, I've added it for more complex scripts in future)

Use this only in npc/config/magic.txt

learn_skill(SKILL)

Will offer player the SKILL (a skill_db constant). Handles automatically menus, MSP, item and GP costs, and whatelse.

It returns false if you could not learn the skill.

ShowAbizit()

Shows magic control, see also abizit(). If you cast with "false" it'll not open a dialog box.

The Magic Control is gained by casting a skill which was not previously cast.

transcheck(it1, am1, {i2, am2}, {it3, am3}...)

A handy function I've used a lot. Stands for "Transmutation Check". It checks if you have all items and deletes them. Returns true upon success, false if not all items. Nothing else is done.

getskillname(skill)

Needs to be implemented server-plugin-side, temporary hack included.

Edited by Jesusaves

Merge request reports