The Dink Network

Reply to Re: Small question on magic.

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 15th 2007, 01:22 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
It's usually best to check first whether or not the player actually has space left in his inventory for this. (This is not necessary if this is the only magic in the game probably)

If you want to do it do it like this:

int &freemag = free_magic();
if (&freemag < 1)
{
say("There's no room in my inventory!",1);
}
if (&freemag > 0)
{
add_magic("<put spellscript here>",<sequence>,<frame> );
}

(sequence 437, frame 1 will give the graphic of a fireball in your inventory, but other graphics can also be used...)

<EDIT> And if you're looking for a script, try the source of the original game. You could make a spell do whatever you want, so giving one probably isn't very useful as there are enough available in the original game for a start.