I'm looking for a replacement magic book. That makes the magic explode when it dies instead of the usual fire effect.
Edited by Jambu, 02 May 2024 - 05:36 PM.
Posted 19 April 2024 - 08:21 AM
I'm looking for a replacement magic book. That makes the magic explode when it dies instead of the usual fire effect.
Edited by Jambu, 02 May 2024 - 05:36 PM.
Posted 23 April 2024 - 12:17 PM
lweapon script magicbookworstitem{ void run(int book_id = 32){ if (player->Item[book_id] == -1){ quit(); //Do nothing we don't got a book! } if (this->DeadState == 0){ //is the weapon about to die? lweapon boom = Create->LWeapon(LW_BOMBBLAST) boom->x = this->x boom->y = this->y } } }
I tried writing it myself. but i get an error
Posted 23 April 2024 - 09:41 PM
"player" should be "Player".
Posted 23 April 2024 - 10:06 PM
I got my first script to compile. I attached it to the weapon slot for the wand and magicbook (I'm not sure which one is correct) and the magic isn't exploding...
//causes magic to explode on death. lweapon script magicbookworstitem{ void run(int book_id = 32){ if (Player->Item[book_id] == -1){ Quit(); } lweapon boom = Screen->CreateLWeapon(LW_BOMBBLAST); boom->X = this->X; boom->Y = this->Y; } }
Posted 23 April 2024 - 10:44 PM
You probably want `unless(Player->Item[book_id])` instead of `if(Player->Item[book_id] == -1)`.
Also, uh, booleans generally will only be `true` or `false`, never `-1`.
Posted 24 April 2024 - 12:04 PM
Works now thanks for your help again you two.
My only missgiving is when it hits mirrors it explodes. Which is find in it's own way since the magic duplicated also explodes.
Edited by Jambu, 24 April 2024 - 12:06 PM.
0 members, 0 guests, 0 anonymous users