A previous version of the ACK mega patch fixed (as far as I know) the touch macro feature, and allowed it to be triggered by either a ranged attack or melee attack, where previously only a melee attack would trigger it.
Another issue is that currently the touch macro will only be triggered when the attack actually does damage to the player. This means that if you have good armor, the touch macro will never fire, which may or may not be desirable depending on what you are trying to do.
Especially with a ranged attack, if you have a creature trying to cast a spell on the player using the touch macro, or if you are using the touch macro to implement some other event (like the player being captured), you don't necessarily want armor to be able to protect the player from it.
So, I am thinking about changing the behavior in the next patch to allow the touch macro to trigger whether or not damage is inflicted. This would also mean that the creature would not have a chance to 'miss' based on skill when triggering a touch macro.
The 'hit' message would still be displayed for attacks that do damage, followed by whatever message (if any) the touch macro displays.
For attacks that do not do damage, I would like to remove the 'miss' message if and only if a touch macro is triggered, so if a creature is set up with a damage=0 attack that is *only* meant for triggering a touch macro, there are no unneeded messages displayed.
Touch macro extensions
Moderators: Ice Cream Jonsey, joltcountry
- Tdarcos
- Posts: 9529
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: Touch macro extensions
Would it be possible for the macro to be told that the attack did or did not do damage, could the touch macro be given the option to decide if damage occurs, or whether a damage message is generated?rld wrote:For attacks that do not do damage, I would like to remove the 'miss' message if and only if a touch macro is triggered, so if a creature is set up with a damage=0 attack that is *only* meant for triggering a touch macro, there are no unneeded messages displayed.
Not that I will use these features, but someone might.
"Baby, I was afraid before
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
I'm not afraid, any more."
- Belinda Carlisle, Heaven Is A Place On Earth
-
- Posts: 223
- Joined: Sun Jan 25, 2009 2:17 am
- Location: Dallas, TX
Re: Touch macro extensions
Not a bad idea at all. I think I am going to handle it like this. There will be a variable flag (one of the unused bits in the Z variable) that allows a switch between 'old mode' and 'new mode' for handling attacks on the player.Tdarcos wrote:Would it be possible for the macro to be told that the attack did or did not do damage, could the touch macro be given the option to decide if damage occurs, or whether a damage message is generated?rld wrote:For attacks that do not do damage, I would like to remove the 'miss' message if and only if a touch macro is triggered, so if a creature is set up with a damage=0 attack that is *only* meant for triggering a touch macro, there are no unneeded messages displayed.
Not that I will use these features, but someone might.
The 'old mode' (existing) sequence goes like this.
Code: Select all
1. Calculate weapon damage
2. Reduce weapon damage according to armor
3. If damage > 0:
a. Play 'hit' sound effect
b. Message: <creature> HITS YOU FOR xxx DAMAGE!
c. If touch macro enabled, then:
i. Set var X to X location of attacking creature
ii. Set var Y to Y location of attacking creature
iii. Run touch macro
4. Else (if damage <= 0):
a. Play 'miss' sound effect
b. Message: <creature> ATTACKS YOU AND MISSES!
Code: Select all
1. Calculate weapon damage
2. If damage = 0 (missed attack), set damage = -1 and go to 5
3. Reduce weapon damage according to armor
4. If damage = 0 (blocked attack), set damage = -2
5. If touch macro is enabled:
a. Set V to damage
b. Set W to object number of weapon used
c. Set X,Y to attacker location
d. Call touch macro
e. Set damage to V
If damage > 0:
Play 'hit' sound
Message: <creature> HITS YOU FOR xxx DAMAGE!
Reduce HP by damage amount
If damage = 0:
No sound, no message
If damage = -1:
Play 'miss' sound
Message: <creature> ATTACKS YOU AND MISSES!
If damage = -2:
Play 'miss' sound
Message: <creature> BLOCKED BY YOUR ARMOR!
This allows the touch macro to print messages / perform actions as needed, and also allows it to change the amount of damage and/or the type of combat message that is printed.
If you want a weapon that doesn't actually damage the player (for example, a creature casting a spell or some other action at a distance), then use a weapon with damage=0, and have the touch macro set V to 0 (it will be -1 on macro entry). This will prevent any 'miss' message from being displayed, while allowing the touch macro to run and do whatever it needs to do.