Magic? BUT HOW?
Have you got any idea how can i make spells i look into a spells script but that's a chaos! PLease
October 4th 2012, 11:11 AM

shevek


You will need to create a magic item. This item should be added to the inventory when Dink should be able to cast it. To do this, you use add_magic. This function needs an image (for showing in the inventory) and a script. This script is called when the user tries to cast the magic. What happens then is up to your imagination and coding skills (or code copying skills
).
Check out the source of dink or some dmods for examples.

Check out the source of dink or some dmods for examples.
Okay but what's that magic_level or somethig like it i chaged it and the spell was not working.

October 5th 2012, 07:04 PM

shevek


Magic has a cost, in the variable &magic_cost (this should be set when the magic is armed). If &magic_level is lower than that cost, Dink will be unable to cast it.
&magic_level automatically gets increased. The increase is faster if &magic is higher. If Dink has 0 magic, &magic_level does not increase, and the magic level will never be charged up, so he will never be able to actually cast anything.
In other words, to cast magic, dink must have the magic (from a script which did add_magic); it must be armed (from the inventory screen, or with arm_magic), &magic must be larger than 0, and (usually by waiting) &magic_level must be equal to &magic_cost.
That's mostly true anyway.
He can cast if &magic is 0, if &magic_level is equal to &magic_cost. But only once, as the magic level will not recharge.
&magic_level automatically gets increased. The increase is faster if &magic is higher. If Dink has 0 magic, &magic_level does not increase, and the magic level will never be charged up, so he will never be able to actually cast anything.
In other words, to cast magic, dink must have the magic (from a script which did add_magic); it must be armed (from the inventory screen, or with arm_magic), &magic must be larger than 0, and (usually by waiting) &magic_level must be equal to &magic_cost.
That's mostly true anyway.
