View Single Post
Re: mIRC: Battle Script v1
No problem, Ishi

Finishers:

In order to do this, we will be modifying a line or two of the existing code:

/attack {
/set -e %hit $read(hit.txt)
/dec -e %health %hit
if (%health <= 0) {
%health = DEAD!
/timer1 1 5 /kick # %enemy DEAD!
}
/me $read(weapons.txt) %enemy - %hit dmg ~ total HP: %health
}
// End Battle Script

Now, what we need to do is code a "finisher move", meaning the killing move on a person. To do so, we will load a finisher move from a separate file called "finisher.txt". You should make that now, the same as weapons.txt, but with moves that would kill some one (for example: decaps or summoning dragons). Now for the code modifications. Replace /attack with:
/attack {
/set -e %hit $read(hit.txt)
/dec -e %health %hit
if (%health <= 0) {
%health = 4Dead! Train harder and come back!
/timer1 1 5 /kick # %enemy %health
}
if (%health <= 0) /me $read(finishers.txt, p) %enemy health
else /me $read(weapons.txt, p) enemy - $hit dmg ~ total HP: %health

}

Now before you say the attack, the code first finds your health after attack. If it is less than or equal to 0, you are dead, so it reads from "finishers.txt", if otherwise (else) you read the normal attack! Simple as that.