boss seems to screw up engine
the boss idea was a simple yet hopefully effective method a boss that changes shape on random after a randomly chosen time period. also wanted him to have the highest HP in game so you'd most likely see all forms alteast once also making the toughest in game(and he's that hidden dungeon boss)
but a few moments after facing him in combat spells no longer can be cast and his walking animation stops even the item interface can't be opened. dunno what it causes but only this guy has it all other bosses work as they are supposed to.
but a few moments after facing him in combat spells no longer can be cast and his walking animation stops even the item interface can't be opened. dunno what it causes but only this guy has it all other bosses work as they are supposed to.
//Echo The ancient one of sund(shapeshifting boss) void main (void) { int &fsave_x; int &kcrap; int &fsave_y; int &resist; int &mcounter; int &mtarget; screenlock(1); sp_brain(¤t_sprite, 9); sp_timing(¤t_sprite, 66); sp_speed(¤t_sprite, 1); sp_nohit(¤t_sprite, 0); sp_exp(¤t_sprite, 10000); //initial form Dinksp_base_walk(¤t_sprite, 70); sp_touch_damage(¤t_sprite, 15); sp_hitpoints(¤t_sprite, 3000); sp_defense(¤t_sprite, &bossdef); preload_seq(361); preload_seq(363); preload_seq(367); preload_seq(369); preload_Seq(70); preload_Seq(166); set_callback_random("trans",500,2000); } void trans (void) { //here he chooses his form and plays the apropiote "Echo" int &what = random (1,5); if (&what == 1) { //speedy pillbug form &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 130); sp_speed(¤t_sprite, 3); playsound(30, 17050, 4000, ¤t_sprite, 0); } if (&what == 2) { //spell casting dragon &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 200); sp_speed(¤t_sprite, 1); playsound(46, 17050, 4000, ¤t_sprite, 0); } if(&what == 3) { //Small, annoying and speedy slimer &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 690); sp_speed(¤t_sprite, 2); laysound(38, 38050, 6000, 1, 0); } if (&what == 4) { //tanky stone giant &bossdef = &strength; &bossdef -= 5; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 820); sp_speed(¤t_sprite, 1); playsound(28, 28050,0,¤t_sprite, 0); } if (&what == 5) { //Dink
&bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 10); sp_speed(¤t_sprite, 1); } set_callback_random("trans",500,2000); return; } void attack (void) { if(&what == 2) { playsound(47, 22050,0,0,0); &kcrap = sp_target(¤t_sprite, -1); &fsave_x = sp_x(&kcrap, -1); &fsave_y = sp_y(&kcrap, -1); &mcounter = random(5000,3000); sp_attack_wait(¤t_sprite, &mcounter); &resist = random(60, 1); //if NPC, turn off resist option if (&kcrap != 1) &resist = 100000; if (&resist > &magic) { say("`4<Casts harm>", ¤t_sprite); playsound(31, 12050,0,0, 0); hurt(&kcrap, 20); &fsave_y -= 29; int &spark = create_sprite(&fsave_x, &fsave_y, 7, 70, 1); sp_seq(&spark, 70); sp_que(&spark, -70); sp_speed(&spark, 5); return; } playsound(31, 44050,0,0, 0); &fsave_y -= 29; int &spark = create_sprite(&fsave_x, &fsave_y, 7, 166, 1); sp_seq(&spark, 166); sp_que(&spark, -70); say("Magic resisted.", &kcrap); } return; } void die (void) { playsound(43, 22050,0,0,0); int &reward = create_sprite(300,100,0,428,2); sp_script(&reward,"rewardsta"); int &hold = sp_editor_num(¤t_sprite); if (&hold != 0) editor_type(&hold, 6); &save_x = sp_x(¤t_sprite, -1); &save_y = sp_y(¤t_sprite, -1); external("emake","boss"); }
ok i fixed it and was surprisingly simple i messed up order of the random chooser and forgot the power f the wait command
it is surprising how such oversights can make a script screw up and well after figuring that out and saw how it properly transformed now I could test him properly to find other missing parts unlike the old script which didn't clear memory with the wait command it is bugs like those that remind just how important the wait command is and well glad i figured it out before someone pointed out even if i wouldn't mind if anyone did. well he's nearly finished now and some bugs i dunno how t fix is after hitting echo he moves around in dinks idle animation and not the given sword-less walk animation and i dunno the best way to make individual forms change their attack animations and or methods when transformed. well so here is the 90% completed script.
still to add but i know how is the different sounds while transformed(a simple matter of checking transform form counter

//Echo The ancient one of sund(shapeshifting boss) void main (void) { int &fsave_x; int &kcrap; int &fsave_y; int &resist; int &mcounter; int &mtarget; int &what = 5; screenlock(1); sp_brain(¤t_sprite, 9); sp_timing(¤t_sprite, 66); sp_speed(¤t_sprite, 1); sp_nohit(¤t_sprite, 0); sp_exp(¤t_sprite, 10000); //initial form Dinksp_base_walk(¤t_sprite, 70); sp_touch_damage(¤t_sprite, 15); sp_hitpoints(¤t_sprite, 3000); sp_defense(¤t_sprite, &bossdef); preload_seq(361); preload_seq(363); preload_seq(367); preload_seq(369); preload_Seq(70); preload_Seq(166); set_callback_random("trans",2000,10000) } void trans (void) { //here he chooses his form and plays the apropiote "Echo" wait(1); &what = random (5,1); if (&what == 1) { //speedy pillbug form &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 130); sp_speed(¤t_sprite, 3); playsound(30, 17050, 4000, ¤t_sprite, 0); } if (&what == 2) { //spell casting dragon &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 200); sp_speed(¤t_sprite, 1); playsound(46, 17050, 4000, ¤t_sprite, 0); } if(&what == 3) { //Small, annoying and speedy slimer &bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 690); sp_speed(¤t_sprite, 2); laysound(38, 38050, 6000, 1, 0); } if (&what == 4) { //tanky stone giant &bossdef = &strength; &bossdef -= 5; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 820); sp_speed(¤t_sprite, 1); playsound(28, 28050,0,¤t_sprite, 0); } if (&what == 5) { //Dink
&bossdef = &strength; &bossdef -= 20; sp_defense(¤t_sprite, &bossdef); sp_base_walk(¤t_sprite, 10); sp_speed(¤t_sprite, 1); } set_callback_random("trans",2000,10000) return; } void attack (void) { if(&what == 2) { playsound(47, 22050,0,0,0); &kcrap = sp_target(¤t_sprite, -1); &fsave_x = sp_x(&kcrap, -1); &fsave_y = sp_y(&kcrap, -1); &mcounter = random(5000,3000); sp_attack_wait(¤t_sprite, &mcounter); &resist = random(60, 1); //if NPC, turn off resist option if (&kcrap != 1) &resist = 100000; if (&resist > &magic) { say("`4<Casts harm>", ¤t_sprite); playsound(31, 12050,0,0, 0); hurt(&kcrap, 20); &fsave_y -= 29; int &spark = create_sprite(&fsave_x, &fsave_y, 7, 70, 1); sp_seq(&spark, 70); sp_que(&spark, -70); sp_speed(&spark, 5); return; } playsound(31, 44050,0,0, 0); &fsave_y -= 29; int &spark = create_sprite(&fsave_x, &fsave_y, 7, 166, 1); sp_seq(&spark, 166); sp_que(&spark, -70); say("Magic resisted.", &kcrap); } set_callback_random("trans",2000,10000) return; } void die (void) { playsound(43, 22050,0,0,0); int &reward = create_sprite(300,100,0,428,2); sp_script(&reward,"rewardsta"); int &hold = sp_editor_num(¤t_sprite); if (&hold != 0) editor_type(&hold, 6); &save_x = sp_x(¤t_sprite, -1); &save_y = sp_y(¤t_sprite, -1); external("emake","boss"); }
still to add but i know how is the different sounds while transformed(a simple matter of checking transform form counter
