Reply to Bad potion script? --RESOLVED--
If you don't have an account, just leave the password field blank.
I'm having trouble with a potion that you can't pick up until after defeating a boss on the screen. I'm not sure if the problem is with the boss's script or the potions script, though, but for some reason it won't do anything when I talk to pick up the potion from a shelf.
Boss script
Potion script:
Boss script
void main(void)
{
screenlock(1);
say("That made no sense, AND just sounds WRONG!!", 1);
//Said because the boss's script doesnt activate until after a dialogue script
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 2);
sp_exp(¤t_sprite, 500);
sp_timing(¤t_sprite, 20);
sp_hitpoints(¤t_sprite, 120);
sp_touch_damage(¤t_sprite, 6);
sp_defense(¤t_sprite, 1);
preload_seq(651);
preload_seq(653);
preload_seq(661);
preload_seq(663);
sp_base_attack(¤t_sprite, -1);
sp_base_walk(¤t_sprite,690);
sp_base_death(¤t_sprite, 700);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
}
void touch(void)
{
//slurp noise
playsound(38, 18050, 6000, 0, 0);
}
void hit(void)
{
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound (scream)
playsound(53, 22050, 0, 0, 0);
}
void die(void)
{
if (get_sprite_with_this_brain(9, ¤t_sprite) == 0)
{
screenlock(0);
playsound(53, 22050, 0, 0, 0);
playmidi("3.mid");
}
//TALK LINE, LETS GRAB THE POTION
&story = 2;
say_stop("THAT was a pain... Let's get that potion.", 1);
&sign = 2;
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
external("emake","small");
}Potion script:
void talk(void)
{
sp_seq(¤t_sprite, 55);
sp_brain(¤t_sprite, 6);
if (&sign == 1)
{
say_stop("I'm a little too busy to grab this now!", 1);
}
if (&sign == 2)
{
freeze(1);
say_stop("Now I've got the potion, I can...", 1);
wait(200);
say_stop("Hey, there's some kind of flame spell back there!", 1);
&magic += 3;
//Give the player a modified Rabidwolf9's firespin magic
add_magic("item-fspn",437, 6);
Playsound(10,22050,0,0,0);
&sign = 3;
&story = 3;
sp_brain_parm(¤t_sprite, 3);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
int &hold = sp_editor_num(¤t_sprite);
if (&hold != 0)
editor_type(&hold, 1);
sp_notouch(¤t_sprite, 1);
sp_nohit(¤t_sprite, 1);
sp_hard(¤t_sprite, 1);
draw_hard_sprite(¤t_sprite);
sp_active(¤t_sprite, 0);
unfreeze(1);
say_stop("Sweet! Now, to get this potion back.", 1):
}
}






