The Dink Network

Reply to A bit of scripting help needed!

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:
 
 
April 16th 2007, 08:56 AM
pq_skull.gif
dinkme
Peasant He/Him India
 
Ok, I have come across yet another problem. I will try to explain is as briefly as possible. Now I made a script which summons creatures taking a lot of ideas from rabidwolf9's Summon Spell. Now if this summoned creature kills an enemy how do you add experience to Dink's pocket. I have tried using the method rabid used in his file but with no success. Using a local variable, say:

int &mtarget = get_sprite_with_this_brain(9, &current_sprite);
int &ehp
int &my_exp;

&ehp = sp_hitpoints(&mtarget, -1);
&my_exp = sp_exp(&mtarget, - 1);

Now in the atack sommand of the summoned creature's script I use:

void attack(void)
{
int &mcounter;
playsound(31, 18050,0,&current_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(&current_sprite, &mcounter);

if (&enemy_ehp == 0)
{
add_exp(&my_exp, 1);
&my_exp = 0;
&mtarget = 0;
}
}

Someone please help me by pointing out where exactly I am committing the huge blunder!