Welcome to the Builder Academy

Question Adding Attack Types

More
01 May 2013 16:59 #2044 by Papaya Pete
I've been searching around for a little while, and I haven't found anything yet that explains how to add a new attack type. For instance, I wanted to add "cleave" and "chop." I'm sifting through the code to see if I can figure out how to do it, but if anyone has any pointers, they'd be much appreciated. :)

Please Log in or Create an account to join the conversation.

More
01 May 2013 18:17 - 01 May 2013 18:18 #2047 by Kewlb
Replied by Kewlb on topic Adding Attack Types

Papaya Pete wrote: I've been searching around for a little while, and I haven't found anything yet that explains how to add a new attack type. For instance, I wanted to add "cleave" and "chop." I'm sifting through the code to see if I can figure out how to do it, but if anyone has any pointers, they'd be much appreciated. :)

Code:
spells.h -------- weapon attack type section #define TYPE_PUNCH 313 #define TYPE_STAB 314 +#define TYPE_MYNEWTYPE 315 /** The total number of attack types */ -#define NUM_ATTACK_TYPES 15 +#define NUM_ATTACK_TYPES 16 fight.c ------- add new types to the end of: struct attack_hit_type attack_hit_text[] =
Last edit: 01 May 2013 18:18 by Kewlb.
The following user(s) said Thank You: Papaya Pete

Please Log in or Create an account to join the conversation.

More
01 May 2013 18:20 #2048 by Rumble
Replied by Rumble on topic Adding Attack Types
I don't think a tutorial exists for this. Just search/grep for cleave and copy the code accordingly and post your results. We can help with any problems you run into.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
01 May 2013 21:24 #2049 by rudeboyrave
Replied by rudeboyrave on topic Adding Attack Types
oh, by the way. the messages for the weapon attack types are located in lib/misc in the file "messages".

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
01 May 2013 22:20 #2052 by Papaya Pete
Replied by Papaya Pete on topic Adding Attack Types
Ah... spells.h. I checked a lot of other files, yet didn't check that one thoroughly! Good grief.

It looks like that was the missing bit. Compiles cleanly; I'll keep you guys posted if there's anything that doesn't seem to work right.

Please Log in or Create an account to join the conversation.

More
02 May 2013 03:15 #2061 by Kewlb
Replied by Kewlb on topic Adding Attack Types
What IDE are you using to develop? I am currently using Visual Studio 2012 and have been very impressed with the intellisense in it and ability to quickly find any bits of code and or replace things.

For example.. on this thing.. if you knew sting was an attack type you could just search for sting to get to the areas I pointed out. On your server you can also just grep for it, but that is case sensitive although there is an ignore case flag for grep.

Please Log in or Create an account to join the conversation.

Time to create page: 0.340 seconds