Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ New Critical Hits

New Critical Hits

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Txzeenath   USA  (54 posts)  Bio
Date Thu 24 Jun 2004 02:40 PM (UTC)
Message
Well.. I'm trying new critical strikes code.. but it goes in with nothing but simple warnings of:
fight.c:1015: warning: unused variable `obj'
fight.c:1014: warning: `dam' might be used uninitialized in this function

but when I fight.. none of the messages ever come up.. anyone have any ideas?






if ( prof_gsn != -1 )
learn_from_failure( ch, prof_gsn );
act( AT_PLAIN, "Your attack misses $N!", ch, NULL, victim, TO_CHAR );
damage( ch, victim, 0, dt );
tail_chain( );
return rNONE;
}
}
/* Critical strikes based off Equipment
*/


if ( diceroll >= 19 )
{
if ( get_eq_char(ch, WEAR_SHIELD ) && !get_eq_char(ch, WEAR_LEGS) )
{
act( AT_FIRE, "You critically hit $N in the legs!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n swings low and critically hits your legs!!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the legs!", ch, NULL, victim, TO_NOTVICT );
do_for( supermob, "$N cast 'energy drain' #" );
dam = 2 * dam;
}
else if ( get_eq_char(ch, WEAR_SHIELD) && ( get_eq_char(ch, WEAR_LEGS) )
{
act( AT_FIRE, "Your attack bounces off $n's shield!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n's attack bounces off your shield!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n's attack bounces off $n's shield!", ch, NULL, victim, TO_NOTVICT );
dam = dam - dam/3;
}
else if ( !get_eq_char(ch, WEAR_HEAD ) )
{
act( AT_FIRE, "You critically hit $N in the head!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the head!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critcally hits $N in the head!", ch, NULL, victim, TO_NOTVICT );
do_stun (ch, "");
do_for( supermob, "$N stun #" );
dam
= 3.6 * dam;
}
else if ( !get_eq_char(ch, WEAR_BODY ) )
{
act( AT_FIRE, "You critically hit $N in the chest!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the chest!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the chest!", ch, NULL, victim, TO_NOTVICT );
dam = 3 * dam;
}
else if ( !get_eq_char(ch, WEAR_WAIST ) )
{
act( AT_FIRE, "You critically hit $n across the waist!!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the waist!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the chest!", ch, NULL, victim, TO_NOTVICT );
dam = 2 * dam;
}
else if ( !get_eq_char(ch, WEAR_ARMS ) )
{
act( AT_FIRE, "You critically hit $N in the arm, fracturing it!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the arm, fracturing it!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the arm!", ch, NULL, victim, TO_NOTVICT );
do_for( supermob, "$N cast weaken #" );
dam = 2 * dam;
}
else if ( !get_eq_char(ch, WEAR_NECK_1 ) && !get_eq_char(ch, WEAR_NECK_2 ) )
{
act( AT_FIRE, "You critically hit $N in the neck!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the neck!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the neck!", ch, NULL, victim, TO_NOTVICT );
dam = 2.5 * dam;
}
else if ( !get_eq_char(ch, WEAR_NECK_1 ) && get_eq_char(ch, WEAR_NECK_2 ) )
{
act( AT_FIRE, "You critically hit $N in the neck!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the neck!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the neck!", ch, NULL, victim, TO_NOTVICT );
dam = 1.5 * dam;
}
else if ( !get_eq_char(ch, WEAR_LEGS ) )
{
act( AT_FIRE, "You critically hit $N in the legs!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n critically hits you in the legs!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n critically hits $N in the legs!", ch, NULL, victim, TO_NOTVICT );
do_for( supermob, "$N cast 'energy drain' #" );
dam = 2 * dam;
}
else if ( !get_eq_char(ch, WEAR_FEET ) )
{
act( AT_FIRE, "You strike down at $N's feet!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$n strikes your feet!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n hits $N's feet!", ch, NULL, victim, TO_NOTVICT );
do_for( supermob, "$N cast 'energy drain' #" );
dam = dam - 5;
}
else if ( !get_eq_char(victim, WEAR_WIELD ) && !get_eq_char(ch, WEAR_WIELD ) && !get_eq_char(victim, WEAR_HANDS ) )
{
act( AT_FIRE, "Your hands are injured by $N's weapon!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$N's hands are injured by your weapon!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$n's strike is stopped by $N's weapon!", ch, NULL, victim, TO_NOTVICT );
dam = 2 * dam;
}
else if ( !get_eq_char(victim, WEAR_WIELD ) && !get_eq_char(ch, WEAR_WIELD ) && get_eq_char(victim, WEAR_HANDS ) )
{
act( AT_FIRE, "Your gloves protect your hands from $N's weapon!", ch, NULL, victim, TO_CHAR );
act( AT_FIRE, "$N's gloves protect $S from your weapon!", ch, NULL, victim, TO_VICT );
act( AT_FIRE, "$N's hands are protected from $N's weapon!", ch, NULL, victim, TO_NOTVICT );
dam = dam + dam/3;
}
}

/*
* Bonuses.
*/
dam += GET_DAMROLL(ch);

if ( prof_bonus )
dam += prof_bonus / 4;

Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.

-Txzeenath

telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!

Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a)
Top

Posted by Txzeenath   USA  (54 posts)  Bio
Date Reply #1 on Thu 24 Jun 2004 03:55 PM (UTC)
Message
Well.. I got the strikes to appear work etc. with a diff code.. one thing tho.. I want it so when someone gets hit in the arm they have the spell/affect weaken applied to them


What would be the simplest way of doing this?

Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.

-Txzeenath

telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!

Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a)
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Fri 25 Jun 2004 05:07 PM (UTC)
Message
Look up what weaken's effect is, then look up how effects are applied (affect_modify and all), and then just call the function - it's actually pretty straightforward I believe.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,901 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.