Multiple attacks based on dex...

Posted by Mike Scherling on Wed 14 Jul 2004 10:52 AM — 3 posts, 13,659 views.

USA #0
/*
* NPC predetermined number of attacks -Thoric
*/
if (ch->IsNpc () && ch->numattacks > 0)
{
for (chance = 0; chance <= ch->numattacks; chance++)
{
retcode = one_hit (ch, victim, dt);
if (retcode != rNONE || ch->GetFightWho () != victim)
return retcode;
}
return retcode;
}
// GrimReApEr Custom Attack Script 50 dex per multi atack!!
//BEGIN
if (ch->GetDexterity () >= 50)
{
retcode = one_hit (ch, victim, dt);
if (retcode != rNONE || ch->GetFightWho () != victim)
return retcode;
}
if (ch->GetDexterity () >= 100)
{
retcode = one_hit (ch, victim, dt);
if (retcode != rNONE || ch->GetFightWho () != victim)
return retcode;
}

and on and on, here is a snippet for what a normal atack looks like.... This cutout is posted -below- my dex based multiple attacks in the actual Fight.c file

chance = ch->IsNpc () ? ch->GetLevel ()
: (int) ((ch->GetPcData ()->learned[gsn_second_attack]+dual_bonus)/1.5);
if (number_percent () < chance)
{
learn_from_success (ch, gsn_second_attack);
retcode = one_hit (ch, victim, dt);
if (retcode != rNONE || ch->GetFightWho () != victim)
return retcode;
}
else
learn_from_failure (ch, gsn_second_attack);





Use at will, but if your gonna use it, please keep my comments and give some credit to me.. thnxs

Amended on Wed 14 Jul 2004 08:26 PM by Mike Scherling
USA #1
Alright, I am really tired.. I admit that part


I put an else on, take all those suckers off, now I need to put a stop on each attack so it wont keep continuing...


at the moment when I set my dex to 20 I get this...


You scratch the chadoyn. -[358]-
You scratch the chadoyn. -[404]-
You scratch the chadoyn. -[264]-
You scratch the chadoyn. -[448]-
You scratch the chadoyn. -[244]-
You scratch the chadoyn. -[325]-
You scratch the chadoyn. -[491]-
You scratch the chadoyn. -[362]-
You graze the chadoyn. -[522]-
You scratch the chadoyn. -[289]-
You scratch the chadoyn. -[455]-
You scratch the chadoyn. -[361]-
You scratch the chadoyn. -[224]-
You scratch the chadoyn. -[256]-
You scratch the chadoyn. -[433]-
You scratch the chadoyn. -[348]-
You scratch the chadoyn. -[380]-
You scratch the chadoyn. -[302]-
You scratch the chadoyn. -[268]-
You scratch the chadoyn. -[298]-
You scratch the chadoyn. -[380]-
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.





But when I set my dex to 999 I get this...


You graze the chadoyn. -[225]-
You graze the chadoyn. -[376]-
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.
You dodge the chadoyn's attack.

Sooo I need to give these an ol switcheroo, I think it might be my greater than / less than signs *sigh*

Soooo, ill keep ya posted on whats going on.. darn thing -sigh-
Amended on Wed 14 Jul 2004 11:29 AM by Mike Scherling
USA #2
I fixed it... sorry If I keep rambling, but yeah, im gonna get to sleep, and ill be in tip top coding shape when i wake up -sigh-



started with 20 dex

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[333]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >mset self dex 50
Build: God: mset self dex 50

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[225]-
You brush the chadoyn. -[362]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[448]-
You brush the chadoyn. -[257]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >mset self dex 100
Build: God: mset self dex 100

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[276]-
You brush the chadoyn. -[224]-
You brush the chadoyn. -[487]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[345]-
You brush the chadoyn. -[217]-
You brush the chadoyn. -[365]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >mset self dex 999
Build: God: mset self dex 999

( HP: 9400/9400 )( FP: 8900/8900 ) >
You brush the chadoyn. -[239]-
You brush the chadoyn. -[262]-
You miss the chadoyn. -[0]-
You brush the chadoyn. -[502]-
You brush the chadoyn. -[388]-
You brush the chadoyn. -[289]-
You brush the chadoyn. -[242]-
You brush the chadoyn. -[451]-
You brush the chadoyn. -[243]-
You brush the chadoyn. -[365]-
You brush the chadoyn. -[339]-
You brush the chadoyn. -[416]-
You brush the chadoyn. -[479]-
You miss the chadoyn. -[0]-
You brush the chadoyn. -[288]-
You brush the chadoyn. -[234]-
You brush the chadoyn. -[340]-
You brush the chadoyn. -[440]-
You miss the chadoyn. -[0]-
You brush the chadoyn. -[218]-
You brush the chadoyn. -[413]-
You dodge the chadoyn's attack.

( HP: 9400/9400 )( FP: 8900/8900 ) >





WEEEEE! =)

P.S. this script also works for a monsters dex, so players arent going to be the only powerhouses =)