Wrong message being displayed
AvecPardon
12 Jun 2012, 21:54While testing out the revamped spell casting command, I noticed in the battle against my first miniboss that casting a spell four times in a row against it gave the death message for a guard. After that, the spell became ineffective against the miniboss. I have no idea why it's switching messages. I've changed the aliases and alternates to try and keep them separated, but it still displays the guard death message for an elite agent. It does the same when there are two enemies in the same area and then becomes ineffective on the other enemy, breaking timers connected to both mobs. I have no idea what's going on, I've been reading the code in notepad and i just can't see what happened.
Can someone take a look and figure this out? I've added in a 'teleport' command to take you to the hallway where the miniboss can be found in case you want to test it as well.
type 'yes'
enter name
type 'teleport'
examine locker room
use master card on locker room reader
go south
search large crate
that will summon the miniboss for fighting. The spells I'm having trouble with are Luna-Flare and Fireball, though any fixes will be applied to all spells just in case. Thanks for looking into this, anyone.
Can someone take a look and figure this out? I've added in a 'teleport' command to take you to the hallway where the miniboss can be found in case you want to test it as well.
type 'yes'
enter name
type 'teleport'
examine locker room
use master card on locker room reader
go south
search large crate
that will summon the miniboss for fighting. The spells I'm having trouble with are Luna-Flare and Fireball, though any fixes will be applied to all spells just in case. Thanks for looking into this, anyone.

Pertex
13 Jun 2012, 07:03Your cast2-command is buggy.
'object.enemy' is an boolean attribute which is true in your case. 'secguard.enemy' is boolean and it's true, too. So in this switch Quest always executes the secguard-case. I Think you want to do this:
switch (object.enemy) {
case (secguard.enemy) {
if (secguard.health>0) {
msg (" An intense burst of magic light erupts fr...")
secguard.health = secguard.health-40
player.mana = player.mana-20
}
'object.enemy' is an boolean attribute which is true in your case. 'secguard.enemy' is boolean and it's true, too. So in this switch Quest always executes the secguard-case. I Think you want to do this:
switch (object.name) {
case ("secguard") {
....
AvecPardon
14 Jun 2012, 22:20Augh, I was looking for something complicated that would need careful coding to be fixed and it turned out to be something so simple! XD Oh geez, I feel pretty embarrassed now. Thanks for pointing that out, it never entered my mind that it was an issue with my switch terms.
Thank you! ^-^
Thank you! ^-^