The Dink Network

Reply to Bad potion script? --RESOLVED--

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:
 
 
December 30th 2009, 04:58 PM
pq_knight.gif
ExDeathEvn
Peasant He/Him New Zealand rumble
"Skinny Legend" 
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
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(&current_sprite, 9);
sp_speed(&current_sprite, 2);
sp_exp(&current_sprite, 500);
sp_timing(&current_sprite, 20);
sp_hitpoints(&current_sprite, 120);
sp_touch_damage(&current_sprite, 6);
sp_defense(&current_sprite, 1);
preload_seq(651);
preload_seq(653);
preload_seq(661);
preload_seq(663);
sp_base_attack(&current_sprite, -1);
sp_base_walk(&current_sprite,690);
sp_base_death(&current_sprite, 700);
                              
if (random(2,1) == 1)
 {
 sp_target(&current_sprite, 1);
 }
}

void touch(void)
{
//slurp noise

 playsound(38, 18050, 6000, 0, 0);

}

void hit(void)
{
sp_target(&current_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, &current_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(&current_sprite);
  if (&hold != 0)
  editor_type(&hold, 1);
  &save_x = sp_x(&current_sprite, -1);
  &save_y = sp_y(&current_sprite, -1);
  external("emake","small");

}


Potion script:
void talk(void)
{
 sp_seq(&current_sprite, 55);
 sp_brain(&current_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(&current_sprite, 3);
  sp_brain(&current_sprite, 12);
  sp_touch_damage(&current_sprite, 0);
  sp_timing(&current_sprite, 0);
  int &hold = sp_editor_num(&current_sprite);
  if (&hold != 0)
  editor_type(&hold, 1);
  sp_notouch(&current_sprite, 1);
  sp_nohit(&current_sprite, 1);
  sp_hard(&current_sprite, 1);
  draw_hard_sprite(&current_sprite);
  sp_active(&current_sprite, 0); 
  unfreeze(1);
  say_stop("Sweet! Now, to get this potion back.", 1):
 }
}