27 Apr, 2015, capntroz wrote in the 1st comment:
Votes: 0
hello. im new to coding muds those I have some coding experience in other languages just nothing as complex. my issue is im working on circle 3.1 thats pretty much stock right now and im trying to add multi attack from the diku/circle snippets available here. when i pretty much do a copy paste i cant make from source because the GET_LEVEL isnt declared or defined somewhere i believe. i changed the every 24 levels for mob t0 every 7 i think but didnt work eitherway. i would like to have the mobs have multi attack but if i can get even the players to have it for now that would be cool too. any help to do either would be appreciated as im trying to teach myself how to do this and dont have anyone i can call on for help. the code from the snippet and directions are as follow.

07/31/2004
This is a snippet for multiple PC and Mob attacks. Its originally based
on a 100th level mud. This code can easily be changed to fit your needs.
This patch is for a 3.17 windows version mud modified by Jason Yarber.

Multiple attacks for mobs are based on the mobs level. Currently every 24
levels the mob has access to another attack.
1-23 One attack
24-47 two attacks
48-71 three attacks
72-95 four attacks
This can easily be changed.

Pc attacks are based on which classes and at what level you give the
attacks to in class.c.

Please be sure and give credit to Sudo and Roc for this modified version
of Multiple attacks. You can email us with any questions or to just say
you are using our version.
graywolf9653@hotmail.com
bsolis@splaudio.net


In spellparser.c ——————————————————————
at the end of spellparser.c

skillo(SKILL_BACKSTAB, "backstab");
skillo(SKILL_BASH, "bash");
skillo(SKILL_HIDE, "hide");
skillo(SKILL_KICK, "kick");
skillo(SKILL_PICK_LOCK, "pick lock");
skillo(SKILL_PUNCH, "punch");
skillo(SKILL_RESCUE, "rescue");
skillo(SKILL_SNEAK, "sneak");
skillo(SKILL_STEAL, "steal");
skillo(SKILL_TRACK, "track");
add:
skillo(SKILL_ATTACK2, "second attack"); /* second attack bs cjl */
skillo(SKILL_ATTACK3, "third attack"); /* third attack bs cjl */
skillo(SKILL_ATTACK4, "fourth attack"); /* fourth attack bs cjl */

In spells.h ———————————————————————-

after…

/* PLAYER SKILLS - Numbered from MAX_SPELLS+1 to MAX_SKILLS */
#define SKILL_RESCUE 137 /* Reserved Skill[] DO NOT CHANGE */
#define SKILL_SNEAK 138 /* Reserved Skill[] DO NOT CHANGE */
#define SKILL_STEAL 139 /* Reserved Skill[] DO NOT CHANGE */
#define SKILL_TRACK 140 /* Reserved Skill[] DO NOT CHANGE */
#define SKILL_FLY 141 /* Reserved Skill[] DO NOT CHANGE */

add…
#define SKILL_ATTACK2 142 /* second attack bs cjl */
#define SKILL_ATTACK3 143 /* third attack bs cjl */
#define SKILL_ATTACK4 144 /* fourth attack bs cjl */



In class.c ————————————————————————


add the skill to which ever classes you want to have 2nd, 3rd, or 4th attack
for instance…

/* WARRIORS */
spell_level(SKILL_KICK, CLASS_WARRIOR, 1);
spell_level(SKILL_RESCUE, CLASS_WARRIOR, 3);
spell_level(SKILL_TRACK, CLASS_WARRIOR, 9);
spell_level(SKILL_BASH, CLASS_WARRIOR, 12);
* spell_level(SKILL_ATTACK2, CLASS_WARRIOR, 20);
* spell_level(SKILL_ATTACK3, CLASS_WARRIOR, 50);
* spell_level(SKILL_ATTACK4, CLASS_WARRIOR, 80);




In fight.c ————————————————————————-
void perform_violence(void)
after……

if (GET_POS(ch) < POS_FIGHTING) {
send_to_char("You can't fight while sitting!!\r\n", ch);
continue;
}

if (!IS_NPC(ch)) {
add_wprof(ch);
/* Warriors and Human's learn twice as quick */
if (IS_HUMAN(ch) || IS_WARRIOR(ch))
add_wprof(ch);
}

hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

add…
//2nd attack**************************************************************** 2nd, 3rd, and 4th attack - bs cjl
//Mob multi attacks by level ************ NPC ATTACKS begin
if (IS_NPC(ch)) {
int level=GET_LEVEL(ch);
while (level>24)
{level-=24;

if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}

if (number(1,GET_LEVEL(ch)) < (GET_LEVEL(ch)/2))
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}
}

if (!IS_NPC(ch)) {

if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}
if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK2) / 2)) /* 50% chance to activate */
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}
//3rd attack*****************************************************************

if (!IS_NPC(ch)) {

if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}

if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK3) / 4)) /* 25% chance to activate */
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}
//4th attack*****************************************************************
if (!IS_NPC(ch)) {

if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}

if (number( 1, 101 ) < (GET_SKILL(ch, SKILL_ATTACK4) / 8)) /* 12.5% chance to activate */
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}

//end snippet here*****************************************************************
27 Apr, 2015, capntroz wrote in the 2nd comment:
Votes: 0
i dont want human or warriors to gain exp twice as quick either but will deal for now if i have to. and i currently have this as stock where it says i need to do anything in fight.c


if (GET_POS(ch) < POS_FIGHTING) {
send_to_char(ch, "You can't fight while sitting!!\r\n");
continue;
}

hit(ch, FIGHTING(ch), TYPE_UNDEFINED);


if (MOB_FLAGGED(ch, MOB_SPEC) && GET_MOB_SPEC(ch) && !MOB_FLAGGED(ch, MOB_NOTDEADYET)) {
char actbuf[MAX_INPUT_LENGTH] = "";
(GET_MOB_SPEC(ch)) (ch, ch, 0, actbuf);
}
}
}
28 Apr, 2015, tingonic wrote in the 3rd comment:
Votes: 0
Hi,

Can you post your compiler error? Might help make more sense of what's wrong.
28 Apr, 2015, capntroz wrote in the 4th comment:
Votes: 0
I fixed it! it was that whole GET_LEVEL thing. it was set as size_t and not a integer so it couldnt check my level/skill. woot 2 add ons complete. if i can add scan too look around. a zone list in game, make it so the fountain in town gives food too ill be a happy camper and will start personalizing it more. allready got my version of the shire 90% done i did from a "map" of it and about to completely redo the newbie area as my next building task. thanks again for offering to help. :biggrin:
0.0/4