Gerold Fisher writes, "I wanted to give fighters a percentage chance to double the amount of damage they did per hit. This is how i did it, really simple i know, but i never claimed to be the world's greatest coder." fight.c: in int damage: /* if players know enhanced damage, give chance to double damage */ if (GET_SKILL(ch, SKILL_ENHANCE_DAM)) { percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_ENHANCE_DAM); dam *= 2; ** i simply stuck this under the check for aff_sanctuary ** also, make sure you add a } right before dam = MAX(MIN(dam, 100), 0); after that you simply set it up as you would any other skill, adding a define in spells.h and of course in the array in spell_parser.c etc. etc. etc. I know there isn't much to this code, but perhaps it will give someone what they are looking for. Cain anywhere.wolfpaw.net << Making staffs/wands usable in all eq positions [by Michael Gallagher] | Reply | View as text | Flattened | Help on adding room sectors [by Vestrial] >>
|
|
|
This is ugly:P by Jerry Fisher (cainers@wolfpaw.net) on Tuesday, July 17th @ 11:54:34 AM http://anywhere.wolfpaw.net |
If anyone actually used this in the last year and a half i would like to apologize. It is simply hideous. I would instead suggest you do something like this: in damage: if (GET_SKILL(ch, SKILL_ENHANCE_DAM) && number(1, 101) GET_SKILL(ch,SKILL_ENHANCE_DAM)) dam *= 2; then of course you would define the skill in spells.h etc etc etc. Again, sorry for how sloppy and just plain wrong this code was to begin with. I really had no clue what i was doing at the time. |
[ Reply to this comment ] |
|