|
1. trouble with a multiple attack snipplet
|
|
Sun Oct 26, 2003 [1:52 AM]
|
Sno99
prattgary@hotmail.com
member since: Oct 25, 2003
|
Reply
|
|
I am running circle bpl22, I added in 2nd and 3rd attacks, when I tried to compile fight.c, I got this error:
fight.c(1024) : fatal error C1004: unexpected end of file found
the end of fight.c looks like this,
if (!IS_NPC(ch)) { if (rand_number( 1, 100 ) < GET_SKILL(ch, SKILL_ATTACK2) / 2) /* 50% chance to activate */ hit(ch, FIGHTING(ch), TYPE_UNDEFINED); } if (!IS_NPC(ch)) { if (rand_number( 1, 100 ) < GET_SKILL(ch, SKILL_ATTACK3) / 4) /* 25% chance to activate*/ hit(ch, FIGHTING(ch), TYPE_UNDEFINED); }
I can't seem to find the problem, any help or hints would be appreciated., thnx again Sno99
(Comment added by Sno99 on Sun Oct 26 3:55:24 2003)
oops put this in the wrong forum, moving it to advanced coding, srry
(Comment added by Sno99 on Sun Oct 26 5:58:39 2003)
Ok I added the lines you gave me, to add the checks. I recompiled and even when a character has second attack or third attack practiced up, it "never" hits more than once a round, any ideas?
|
|
|
|
|
2. RE: trouble with a multiple attack snipplet
|
|
Sun Oct 26, 2003 [3:16 AM]
|
welcor
Email not supplied
member since: Mar 9, 2000
|
In Reply To
Reply
|
Actually this _is_ the correct forum. Here's a shot on an answer: Make sure your brackets line up. Just adding those if's to the end of the file isn't going to cut it. If your fight.c really ends with those lines, you need to go back to a backup (you have on, don't you ?) and add the checks in the correct place. As a side note, you'll probably experience crashes from the code you've shown here. You should make a small change:
if (!IS_NPC(ch)) {
if (FIGHTING(ch)) /* might have been killed by first attack */
if (rand_number( 1, 100 ) < GET_SKILL(ch, SKILL_ATTACK2) / 2) /* 50% chance to activate */
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
if (FIGHTING(ch)) /* might have been killed by 1st or 2nd attack */
if (rand_number( 1, 100 ) < GET_SKILL(ch, SKILL_ATTACK3) / 4) /* 25% chance to activate*/
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}
Add this in perform_violence(), after the first call to hit(). Welcor
|
|
|
|
|