PDA

View Full Version : Combat Fixes


James76
09-18-2008, 03:24 AM
I am resolved to fix combat, I hope everyone can accept these changes. I started by making the code more readable, by simply adding extra lines here and there so that the curly braces weren't compacting the code so much. Then I fixed all the signed/unsigned comparison warnings, then all the type conversions (int to float comparisons) using static_cast where applicable. Now there are no compile warnings. I replaced any "x++" with "++x" for example, because its actually faster and you only need the post-increment on something like "myarray[x++]" which increments x after reading from the array, or "myarray[++x]" which increments x before reading from the array. Its faster because the post-increment has to push the value to return on the stack before incrementing.

Also, I found some bugs in bonus damage where it essentially gets trimmed because of type conversions, as well as a huge bug in bonus damage (for example, monks get +20% damage output) but it wasn't applying correctly.. essentially because of faulty math. These things jump out at me, and had to be addressed. There was a problem with item damageshields not applying to combat unless you also had a spell damageshield on, which is now fixed. I am still working at getting the ripostes working per attack gracefully, I fixed it a few different ways but I'm not happy, I want proper messaging too. Also I'm going to get monk FD working properly since its in the same file, I had a look at it and it seems proper but obviously its not working.

This list of fixes will have to replace the entire ./zone/attack.cpp file, I've made too many adjustments to list as it is.

Expect future posts shortly... I'll eventually provide a link to the new file, with which you can do a diff or use whatever comb you like. I won't post it until I've tested it to my satisfaction, and I'm sure you'll all be happy with my testing.

AndMetal
09-18-2008, 03:34 AM
First of all, I want to say that it's awesome that you're taking on this large of a task. Imo, the attack code is nowhere near Live, but I personally think a lot of this has to do with random number generation. Live is random, but like you would think it should be. Emu seems to get randomly generated numbers close to each other, but still in waves (damn computers...) The best example I can show, which may just be a general issue in the code, is when lower level stuff can hit you, if it does hit you, they will hit near max damage almost every time, where on Live, if it does hit you, it will be for crap.

In any case, good luck working out the kinks :-)

James76
09-18-2008, 03:48 AM
Err, correction, FD isn't in attack.cpp, but I'll fix it anyway.

trevius
09-18-2008, 04:29 AM
Sounds great, James76! I am excited to test some of this out. And I am sure the monks will be happy to hear FD is fixed!

James76
09-18-2008, 05:26 AM
OK, I set FD so that it works all the time, temporarily, and the guy I tested it with is 65 vs poi common mobs.. It does work; the mob, if you let it get far enough away from you, will forget about you.. Seems to be at 60% chance, plus another variable, could be if there are 35 or more levels between you and it... Going to have to dig a little deeper... then I thought I would try a weapon that would be common for a 50-65 monk, a tarnished driveshaft... and he couldn't use it! So... for PEQ cavedude...

update items set classes=classes | 64 where id=24791;

Now he can use it. What a stab at an item he couldnt use... I am absolutely positive monks can use that, I remember with clarity way back in the day in Karnor's a guildy showing off his driveshaft... Ignore the pun...

OK, omw..

James76
09-18-2008, 07:00 AM
OK I'm drunk, and so is the code apparently... I had disabled the level check if the mob is 35+, and the chance NOT to have it add to Feign Memory.. Which is when the mob should still remember you. But it forgets. Maybe its backwards, which doesn't make sense. Once I had a ton of mobs without changing code and it did work, in poi (my choice zone for testing because of quick access to mobs).. But only once. Now it works all the time but they should be remembering you all the time. I'm gonna work on this before I post again..

So I set it so it always adds you to feign memory, and it always remembers, I guess that makes sense. 60% chance of remembering you, you could FD 10 times and it will still remember you. But it does work. I read that it should be 70% chance of forgetting, not 60% chance of remembering... Changing to 30% chance of remembering and testing...

Looks like its working. That mob forgot about me, twice. I would recommend changing ./zone/entity.cpp line 2715ish, <=60 to <=30. Maybe somebody wants this pushed to server rules? But it works, I only changed the % chance of remembering.

OK on to riposte.. and final post with link to attack.cpp....

trevius
09-18-2008, 07:02 AM
All items are pulled directly from what 13th floor gathers from collects. According to Allas, the item you are talking about isn't monk usable:

http://everquest.allakhazam.com/db/item.html?item=16999

paaco
09-18-2008, 01:32 PM
I think he may be correct about it being Monk useable at some point though. Seems like I remember a monk that had one on my server also. I haven't played live in w very long time though so...

Itchybottom
09-18-2008, 03:36 PM
I think he may be correct about it being Monk useable at some point though. Seems like I remember a monk that had one on my server also. I haven't played live in w very long time though so...

False (http://lucy.allakhazam.com/itemhistory.html?id=24791)

ChaosSlayer
09-18-2008, 03:44 PM
I remember this item back from my times in PoI.

I do not recall if it ever monk useable and then nerfed or otherwise
but, Looking at its stats, the item does not strike me as soemthing that was "too uber" so monks would had to be removed from list of useable classes (even back them) to prevent disbalance

Logic sugests it prabobly was never monk useable

also note that it only has casters and priest as useable classes: no palys or warriors, or bst or sk - clearly was never ment to be a melee item

steve
09-18-2008, 05:11 PM
There was a problem with item damageshields not applying to combat unless you also had a spell damageshield on, which is now fixed.
I have items on live with a damage shield mod and they do not apply unless you have an actual DS on you. If you do, then the item mod DS stacks on top of the spell. Maybe it was done that way on purpose to emulate Live more accurately?

James76
09-18-2008, 05:16 PM
It was in 2001 or 2002 on Tunare. If it was, it was probably before the "Initial Entry" that is listed on LUCY. It was a long time before frogloks were available. It was within the first month of the release of PoP. Maybe now its unusable, but he did have it equipped and I remember we did drool a little.

James76
09-18-2008, 05:57 PM
I have items on live with a damage shield mod and they do not apply unless you have an actual DS on you. If you do, then the item mod DS stacks on top of the spell. Maybe it was done that way on purpose to emulate Live more accurately?

Seems you are correct, I found a post on allakhazam (http://everquest.allakhazam.com/db/item.html?item=13340;page=1;howmany=50#m1058718026 41253) that describes that its a Damage Shield Modifier, intended to augment a spell DS. But this was in 2004.. It just seems like a bug since the item is described as having a damage shield.

No worries, this was a one-liner in the code, the whole file is still getting replaced.

bleh9
09-18-2008, 07:46 PM
I replaced any "x++" with "++x" for example, because its actually faster and you only need the post-increment on something like "myarray[x++]" which increments x after reading from the array, or "myarray[++x]" which increments x before reading from the array. Its faster because the post-increment has to push the value to return on the stack before incrementing.
Maybe I'm missing something, but myarray[x++] isn't the same as myarray[++x]. Also, ++x and x++ often optimized the same.

James76
09-18-2008, 07:52 PM
Maybe I'm missing something, but myarray[x++] isn't the same as myarray[++x]. Also, ++x and x++ often compile to the same thing.

I said that you don't need x++ UNLESS you're using it on a line such as "myarray[...]" where it actually matters, where more than one segment is processed before the rest of the statement. I even defined what post-increment and pre-increment means. Why am I defending myself?

And assuming it will compile to the same thing is incorrect, it will only do so if the specific optimization flag is set on the gcc execution. Assuming anything is poor code, its always better to implement as intended.

James76
09-21-2008, 06:49 AM
OK, the attack.cpp file replacement is ready. Just subtle changes throughout. The major change is damage bonus.... That monks get +20%, and at level 50 (and every five levels) you gain +15% damage. It looked like that's what was intended in the original source, but the math was screwing it up.

:) Here is it. (http://downloads.jaystonian.com/attack.zip) :)

- Test the ripostes if you like, the discipline is Furious for warriors, at level 56.

- Combat damage significantly increased.. both for you and against you.. Lets see if its still balanced? Solo-raids should become more difficult.

I still have my database mobs ATK and Accuracy set to my last stated update based on level. I'd like people to test that and let me know if the code's defaults should be more on par with that, or find better generic values.. Maybe raid mobs should get 2x the values? You get the idea.

Enjoy the ripostes! They can trigger now on every attack instead of every hit.

James76
09-24-2008, 09:09 AM
Anybody bring this in to their builds?

renoofturks1
09-24-2008, 09:30 AM
I am hoping to test it tonight.

James76
10-07-2008, 02:26 PM
These combat fixes were so important to the emulator, but they appear to be overlooked? There should also be an additional change, a riposte should beat an "automatic hit", since I recall a duel I had between my warrior and a ranger, he triggered auto hits, and I wielded the slowest 2H with the highest damage I found at that time, activated auto-riposte, and he died in seconds. So, is this still getting looked at? Is anybody using this? Seems like changes are like trying to move mountains. I'm just trying to shake things up and make everything better.

Andrew80k
10-07-2008, 02:44 PM
I totally missed this. I will add it to my server tonight and start playing with it.

trevius
10-07-2008, 04:52 PM
James, I think part of the problem might be that you changed that file so much and have very limited comments in it that doing a diff against the current version of the file shows almost nothing matches up. This makes it nearly impossible for anyone to have any idea of what is going on other than reading your code line by line and figuring out what it does the hard way.

Also, there have been many combat changes starting around the time that you released this file. Many of them have been looked at very closely and everyone had input into the resulting final code. The recent changes to the damage bonus code are quite amazing. And there have been quite a few others. With the complete reformat of the file from it's original state, it would make adding these new changes a very involved process.

It would be best if you could simply post the changes you made individually the way that KLS asked for in the code submissions sticky like this:

In attack.cpp, change this:
somecode

to this:
somenewcode

or

In attack.cpp, remove this line:
somelineofcode

and replace it with this:
somenewlineofcode

Then we can see exactly what you are changing and easily evaluate if your changes are a good improvement.

I realize that it is hard to post it in that format when there are many changes, but it shouldn't take nearly as long as it took to write the actual code.

The main problem here is that everyone on the project has limited time to invest in it. We do have many new people with the ability to update the code that were added recently, so we can definitely get changes moving much quicker than ever. But I think asking anyone to completely evaluate the entire attack.cpp to many compare and find what has been changed is asking alot and would require quite a bit of time.

Not that it actually means anything, but I see that your join date is Sep 2008. I almost have to assume that you have been either involved or following this project for quite some time even though your account is new. This is because for someone to join for the first time and within a few days to rewrite one of the core components of the entire EQEmu code, is nearly impossible. If you have been involved in the project before, it wouldn't hurt to know who you were. Due to the amount of time it would take to evaluate your changes in the code, having some kind of reputation would certainly escalate the chance of one of the capable people to actually check it out. Currently, the only people I would trust completely to rewrite attack.cpp would be KLS and Derision.

Replacing an entire file makes it hard to track down and resolve the cause of problems/bugs if any are found. Putting your file in and testing it out is definitely an option, but I don't see any way this could be put into the official source download until the entire thing was evaluated. Which is why I think if it is possible, you should try to post your changes to it line by line. The problem with us trying to diff your file against the official one is that you reformatted the entire file moving brackets around, changing tabs into spaces, and other reformatting. I don't think cleaning up a file format is bad, but it isn't something you really want to do at the same time you are doing other changes. I would try to get the changes done first, then maybe take the official file and not change anything in it other than the format and resubmit that. By doing both at the same time, it just makes reading the diff a pretty involved process instead of just seeing clearly what code was changed.

I am sorry if any of this offended you in any way, as it wasn't meant to. I hope you can understand my perception of why your submission hasn't had very much attention. Some of the other mods and devs may have different reasons, but this is just my take on it. With all of the normal code submissions that have been made lately and some that each of the devs/mods have been working on themselves, it is hard to find the time needed to devote to evaluating your file changes. But, I am positive that if you posted them the normal way, they would definitely get reviewed and if they were found to be an improvement of fix, they would get added ASAP.

Most importantly, I hope you aren't upset by me saying any of this. I certainly don't speak for the entire team. And we definitely don't mean to scare off talented, helpful and productive coders. Please be patient with us, and if possible, try to keep code submissions in the standard format so we can quickly and easily review the code and then test it. But, always feel free to post if you have any concerns or if you think your code is being ignored or may have been forgotten about. We really appreciate any and all code submissions as does the rest of the community when they get to reap the benefits of it :D

KLS
10-07-2008, 05:37 PM
Yeah basically Trev hit it. If I diff the file against the current attack.cpp and every line comes back, which it does in this case, it's basically impossible to review.

With the riposte thing, it's not so much that we're not taking it into account it's that avoid and check hit is backwards and no one has taken the time to fix it. So I think you have the right idea but maybe the wrong approach from what I saw.

If we could get something where we could actually see what changes are made it would certainly help.

trevius
10-07-2008, 06:23 PM
I would even say to maybe try posting a couple of your major changes first in 1 post and then maybe start a new thread for all of the minor stuff. That should keep it from being too overwhelming and the major stuff would get quick attention.

James76
10-08-2008, 03:20 PM
Alrighty, I've made two lists of changes, one for the combat fixes, and one for the generic type warnings and general use of code. The file link I posted above included all of them, I don't believe I missed anything although I may have, and you will notice them when you compile. That is, you shouldn't get any warnings anymore when you execute 'make' for the zone executable, if all other ".o" files were already made except attack.o. To anyone who doesn't already know, after you "make zone", delete attack.o, and run make again -- that is what I'm talking about. My posted file link also included a uniform formatting scheme, making the file 500% more readable. Some of the code in the original file had skewed blocks which made tracing slightly difficult. One of the companies I worked for had issued to us a uniform coding methodology document which I've been applying ever since, which made all projects readable by everyone so there wasn't ever any confusion. You will also notice that the new variables I create include a type-hint in its name, which was also part of that referred document.

To address Trevius' statement about being a relatively new member, I had been following this project for some time, though I haven't put my mind towards applying changes. It wasn't until I basically quit all MMO's and I remembered this old project, and I came back to see how far it came, and started up my own server for development. I have been coding C++ specifically for about 20 years, and I have a knack for code that allows me to just jump in on any project, because its clearer to me than reading english. This project only uses perhaps 20-30% of the potential of C++, according to Strustrup's own definitive language guide. It can get 1000% more confusing when you see all that is possible, and even then its readable to me with no issues at all. I have always had this gift, if you would like to call it that, ever since I started coding when I was 6 years old on an IBM XT in BASIC. I knew how to code before learning how to read, I don't know how or why, its just always been natural. Maybe I learned how to read by using those "learn to program BASIC" manuals with those type-them-in starter programs. But for certain, I understood math functions like ABS(), exponents, and BEDMAS when they were teaching the other kids Addition. When I was 7 I traced the source code of a learning game called Lemonade Stand, to remove the ABS() from an input line when you buy your components, during a class break on a Commodore PET, so that you could buy & sell like it was a free market. My teacher was most definitely NOT impressed when I showed I could make millions, because she saw it like an act of destroying school property, even though the change was not permanent in any way.... But I digress.

All these changes refer to an unedited attack.cpp from build 1129. I'll give the line number (or range) with a colon, and the required change. Sometimes I'll include an unchanged first line of a multi-line modification.

You may want to work from the bottom-up, so as not to become confused by line-number skewing, and preferably from the very bottom of this entire post.

Ok, the riposte fix, and some combat math fixes are as follows:

342:
if (damage >= 0 && CanThisClassRiposte() && !other->BehindMob(this, other->GetX(), other->GetY()))


956-969:
int nBonus = 0;
int nLevel = GetLevel();

if(GetClass() == MONK)
nBonus += 20;
if(nLevel > 50)
nBonus += 15 * ((nLevel - 45)/5);

float fBonus = 1.0f + static_cast<float>(nBonus)/100.0f;
min_hit = static_cast<int>(static_cast<float>(min_hit) * fBonus);
max_hit = static_cast<int>(static_cast<float>(max_hit) * fBonus);


978:
min_hit = static_cast<int>(static_cast<float>(min_hit) * static_cast<float>(100 + itembonuses.MinDamageModifier + spellbonuses.MinDamageModifier) / 100.0f);


995:
other->AddToHateList(this, 0);
other->AvoidDamage(this, damage);


1526:
damage = 0; //miss
other->AvoidDamage(this, damage);




OK, now for the type warning fixes, as well as the "++" or "--" modifications. These type fixes are not some sort of psychotic application of static_cast, it was only applied to replace the older "C" type-cast ing of (int) with static_cast(int), or because the math led me to believe (with careful analysis) a cast may or should be required. You will notice I did not type-cast everything, which would be a mark of insanity, because the compiler -will- apply casts when risk of loss of information is nil, without warning. For example, an int to a float is no risk, and no casting required.


LINE 174 & 175:
chancetohit += static_cast<int>(145.0f * static_cast<float>(level_difference) / 100.0f);
chancetohit -= static_cast<int>(static_cast<float>(defender->GetAGI()) * 0.015f);

347:
bonus += 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetDEX())/200.0f;

364:
bonus = 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetDEX())/200.0f;

383:
bonus = static_cast<float>(defender->spellbonuses.ParryChance + defender->itembonuses.ParryChance) / 100.0f;

385:
bonus += 2.0f + static_cast<float>(skill)/35.0 + static_cast<float>(GetDEX())/200.0f;

405:
bonus = static_cast<float>(defender->spellbonuses.DodgeChance + defender->itembonuses.DodgeChance) / 100.0f;

407:
bonus += 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetAGI())/200.0f;

477:
uint32 intervalsAllowed = 20;

517:
acfail = static_cast<int>(atof(tmp) * 100.0f);

532:
acrandom = static_cast<int>((atof(tmp)+1.0f) * 100.0f);

537:
damage -= static_cast<int>(GetAC() * acreduction/100.0f);

633:
if(weapon_item->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){

650:
if(weapon_item->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){

706:
for(int x = 0; x < 5; ++x){

738:
for(int x = 0; x < 5; ++x){

767:
dmg += static_cast<int>(eledmg * against->ResistSpell(weapon_item->GetItem()->ElemDmgType, 0, this) / 100);

771:
for(int x = 0; x < 5; ++x){

775:
dmg += static_cast<int>(weapon_item->GetAugment(x)->GetItem()->ElemDmgAmt * against->ResistSpell(weapon_item->GetAugment(x)->GetItem()->ElemDmgType, 0, this) / 100);

783:
if(weapon_item->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){

801:
for(int x = 0; x < 5; ++x){

803:
if(weapon_item->GetAugment(x)->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){

822:
if(weapon_item->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){

840:
for(int x = 0; x < 5; ++x){

922:
//int8 otherlevel = other->GetLevel() ? other->GetLevel() : 1; //unused

932:
weapon_damage = static_cast<int>(static_cast<float>(weapon_damage) * (100.0f+static_cast<float>(bonus) / 100.0f));

1473:
if(weapon->BaneDmgBody == static_cast<uint32>(other->GetBodyType())){

1482:
eleBane += static_cast<int16>(weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100);

1724:
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i){

1766:
for(int i=0;i<6;++i) { // Doesnt work right, needs work

2099:
for (int i = 0; i < MAX_PROCS; ++i)

2495-2498:
ProcBonus += static_cast<float>(itembonuses.ProcChance + spellbonuses.ProcChance) / 1000.0f;
ProcChance = 0.05f + static_cast<float>(mydex) / 9000.0f;
ProcBonus += (ProcChance * static_cast<float>(AABonus)) / 100.0f;

2532:
for(r = 0; r < MAX_AUGMENT_SLOTS; ++r) {

2542:
ProcChance *= (100.0f+static_cast<float>(aug->ProcRate))/100.0f;

2568:
float WPC = ProcChance*(100.0f+static_cast<float>(weapon->ProcRate))/100.0f;

2594:
//float procmod = static_cast<float>(GetDEX()) / 100.0f + ProcBonus*100.0f; //did somebody think about this??? //unused

2607:
int chance = static_cast<int>(ProcChance + static_cast<float>(SpellProcs[i].chance));

2831:
for(int bs = 0; bs < BUFF_COUNT; ++bs){

2838:
--buffs[bs].numhits;


Please don't read into any of my statements as though I'm being snide or crass, I'm not using any emotion, and I did not have any hurt feelings by your remarks. I understand making change can be difficult without proper source control in a fully trusted environment. A project such as this would not exist if it were up to one person alone, so this is expected. But please accept all of my changes, I've given every line in the original attack.cpp great thought.

James76
10-08-2008, 03:31 PM
I just noticed I use variable nLevel once, when it was intended to replace all further uses of GetLevel(), before I created the math statement to apply bonus damage for increments of 5 levels at 50+. Before it was calling GetLevel() 4 or 5 times. It was too late for me to edit the post, so maybe include that little tweak when implementing. That is, replace all further uses (only one more exists in that method) of GetLevel() with nLevel.

trevius
10-09-2008, 04:24 AM
I am glad you weren't upset with my post :)

I do think that making the code format uniform and cleaning up any compile warnings is awesome. But, if/when you ever decide to do it again, please only do it without making other changes so we know what to expect and what to look for. Making code changes and format changes at the same time makes it too hard to tell what is happening. Probably waiting until the next official release to reformat any files would be a good idea, so we don't have to try to fit the new code changes since the last update in retro-actively. The quicker we can get a new reformat in after a new release, the better.

And on your note about the GetLevel adjustment, are you saying that this code:

int nBonus = 0;
int nLevel = GetLevel();

if(GetClass() == MONK)
nBonus += 20;
if(GetLevel() > 50)
nBonus += 15 * ((nLevel - 45)/5);

Should actually be changed to this:

int nBonus = 0;
int nLevel = GetLevel();

if(GetClass() == MONK)
nBonus += 20;
if(nLevel > 50)
nBonus += 15 * ((nLevel - 45)/5);

and no other changes? Or am I misunderstanding what you are saying?

I can edit that change into your post if I know exactly what you wanted set.

Then we can officially test out the code and get it added :)

James76
10-09-2008, 01:49 PM
and no other changes?

Yep, you got it.

trevius
10-14-2008, 07:35 AM
Tried to add some of this code to my source tonight and am unable to tell if I need to add in parts of code, replace part, or remove parts.

If you can post something like:

After this:

SomeCode

Add this:

SomeMoreCode

or

Remove this:

SomeCode

And replace it with this:

SomeNewCode

That would make it ALOT easier to get this code added and tested. Sorry about all of the extra work to break it down, but it is still hard to add it in without knowing exactly what is needing to be removed, added, or replaced.

James76
10-14-2008, 12:19 PM
Well, I figured if I posted 80 or 100 blocks of one-liner code fields, it would look much more confusing than some simple one-line changes, ... All it takes is to look at the source code, find the line, and change it.

The "riposte and combat math" fixes part, let me eludicate......

342: CHANGE THE LINE

956-969: CHANGE LINES 956-969 WITH THE FOLLOWING

978: CHANGE THE LINE

995: YOU WILL SEE AddToHateList(), insert AvoidDamage() below.

1526: YOU WILL SEE damage=0, insert AvoidDamage() below.

The rest of the changes are simply changes.. I've been holding back any further work until this gets integrated, if this is such a problem maybe I should just wait for CVS access and merge changes myself, if CaveDude EVER gets back to me... This is starting to turn into some kind of joke.

James76
10-14-2008, 12:40 PM
Actually, this is clearly becoming too difficult, some simple changes that all it takes is to look at the source code and apply some logic. I could hand this to any of my co-workers, and they have never looked at the source code before, and they wouldn't have any problems I can guarantee you. If they did then they shouldn't have a job as a programmer. So I'm just going to step out of this, no hard feelings, I'm just tired of people passing themselves off as programmers when they aren't, and then I have to justify any little change when I could pass the list of changes to somebody like my project manager and he'd just nod at each line understandingly. An actual team of developers would be flying through changes and code, and instead I feel like any little thing that gets done is always "working against the grain" so-to-speak. I could continue on this path but my foresight is telling me I'm just going to have a lot more of this than necessary, and its just starting to be a complete waste of my time. :x

So_1337
10-14-2008, 01:18 PM
Well, that's the problem, actually. Most of the people here aren't programmers, but they're damn sure doing their best. Add to that the fact that only a handful of people (and up until recently, only two or three people who were active) had any sort of access to the SVN and the ability to commit code, and you wind up with a very slow process.

However, it's now gotten to the point where there is a SVN with many hands working with it at a time. This creates its own issues, as you can imagine, but that's for another post =P The point, though, is that it's only been recent that things have broken open like this in such a way that fixes are really flowing. For those that don't have access (such as yourself, currently), it still requires someone like KLS taking the time to piece through it and putting it in, and she has been severely short on free time lately, if her posts are any indication.

It's very obvious that you have incredible talent, and I'm sorry that the wheels of the project grind so slowly from your perspective. At the same time, though, I've seen more progress in the week and a half that things have moved over to the community SVN (http://code.google.com/p/projecteqemu/updates/list) than I've seen in a long time. This is the point where it seems that things are finally humming along here.

Everyone contributes of their own free time, and what little of it they can spare. Most of the people here aren't professionals, but most of them do a damn fine job of acting it. Just give a little more patience, if you can. As has been explained, though your fixes are simple to you, they interact with a very large portion of the emulator, one that people are hesitant to tweak without a lot of testing. This isn't any sort of apprehension on their part towards you, just towards the fact that there are so many irons in the fire at the moment.

I'm no one special here, no moderator or anything like that, so don't take my word as gospel. I just know from seeing your contributions that you are quality, and it'd be a shame to see you leave because things haven't moved as fast as you're used to.

Thanks for reading, and for your work.

erde
10-14-2008, 02:19 PM
i have applied it to the latest svn. i hope i did everything well.
here is the diff => attack.diff (http://codejunk.de/attack.diff.zip)

Please have a look and check this for errors!!

erde
10-14-2008, 02:25 PM
Compiles without errors on Linux, but i dont have the time to check this in game :(

leslamarch
10-14-2008, 03:08 PM
Compiles without errors on Linux, but i dont have the time to check this in game :(

Compiles fine in VS2008 also, I did some *limited testing and seems alright so far.

*limited = just a short test is all i had time for :grin:

trevius
10-14-2008, 05:26 PM
James76, you are 100% right that most people that can currently do code updates are by no means professional coders. The only ones that I would consider professionals are KLS and Derision. But one thing we do all have in common is that we know the emulator very well and have been involved with it for a while and hand selected to be allowed to update the source code. We have to understand that updates to the SVN effect everyone that uses it, so not only do we have to make sure that any code that gets added works, we also have to be sure that it is an improvement and that it follows the direction that the emulator is going for.

I am probably the least code savvy of all of the people with SVN access lol. I only started looking at the source a few months back and have been learning code purely by examples in the source. So, please don't judge the team by my replies :) I was only asking more of you because no one else was running with the code and getting it put in.

I realize that your current submission has been hanging around much longer than it should have been, and I apologize for that. As it was mentioned by So_1337, the new SVN was added which opens up the possibility for constant updates. Since it has been added, there have been multiple updates every day, which is just awesome! It also shows that everyone on the team has been very busy getting code updates from other people or themselves added in. But, it also means that just posting line numbers and not replace with or add below or some kind of diff makes adding any code submissions more work than they should be. Even I could probably read through your code and eventually figure out what is going on and what needs to go where, but my time is limited. I am running the latest SVN code and that is what I am adding code into, so line numbers are not as useful to me. It would probably have been much easier to figure out what goes where if I was also using 1129 code to reference where it was supposed to be added, but that is just 1 more extra step.

For me, adding in code is like playing Suduko. Sure, I can figure out where everything goes on my own by looking at what is around it, but it is SO much quicker/easier if I have all of the answers right in front of me :P

KLS has asked that code submissions are made in 1 of 2 formats to make it easier/quicker on her, which also means easier/quicker on the rest of us now. Anything not done in this format will almost always take considerably longer to be looked at and added to the source.
http://www.eqemulator.net/forums/showthread.php?t=26351

I will go through this diff that erde posted and try to get it added on my server and tested most likely tonight:

Index: attack.cpp
================================================== =================
--- attack.cpp (Revision 95)
+++ attack.cpp (Arbeitskopie)
@@ -171,8 +171,8 @@
sint32 level_difference = attacker_level - defender_level;
if(level_difference < -20) level_difference = -20;
if(level_difference > 20) level_difference = 20;
- chancetohit += (145 * level_difference / 100);
- chancetohit -= ((float)defender->GetAGI() * 0.015);
+ chancetohit += static_cast<int>(145.0f * static_cast<float>(level_difference) / 100.0f);
+ chancetohit -= static_cast<int>(static_cast<float>(defender->GetAGI()) * 0.015f);

#ifdef EQBOTS

@@ -417,7 +417,7 @@
/////////////////////////////////////////////////////////
// riposte
/////////////////////////////////////////////////////////
- if (damage > 0 && CanThisClassRiposte() && !other->BehindMob(this, other->GetX(), other->GetY()))
+ if (damage >= 0 && CanThisClassRiposte() && !other->BehindMob(this, other->GetX(), other->GetY()))
{
skill = GetSkill(RIPOSTE);
if (IsClient()) {
@@ -427,7 +427,7 @@

if (!ghit) { //if they are not using a garunteed hit discipline
bonus = (defender->spellbonuses.RiposteChance + defender->itembonuses.RiposteChance);
- bonus += 2.0 + skill/35.0 + (GetDEX()/200);
+ bonus += 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetDEX())/200.0f;
RollTable[0] = bonus;
}
}
@@ -444,7 +444,7 @@
}

if (!ghit) { //if they are not using a garunteed hit discipline
- bonus = 2.0 + skill/35.0 + (GetDEX()/200);
+ bonus = 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetDEX())/200.0f;
RollTable[1] = RollTable[0] + bonus;
}
}
@@ -463,9 +463,9 @@
this->CastToClient()->CheckIncreaseSkill(PARRY, -10);
}

- bonus = (defender->spellbonuses.ParryChance + defender->itembonuses.ParryChance) / 100.0f;
+ bonus = static_cast<float>(defender->spellbonuses.ParryChance + defender->itembonuses.ParryChance) / 100.0f;
if (!ghit) { //if they are not using a garunteed hit discipline
- bonus += 2.0 + skill/35.0 + (GetDEX()/200);
+ bonus += 2.0f + static_cast<float>(skill)/35.0 + static_cast<float>(GetDEX())/200.0f;
RollTable[2] = RollTable[1] + bonus;
}
}
@@ -485,9 +485,9 @@
this->CastToClient()->CheckIncreaseSkill(DODGE, -10);
}

- bonus = (defender->spellbonuses.DodgeChance + defender->itembonuses.DodgeChance) / 100.0f;
+ bonus = static_cast<float>(defender->spellbonuses.DodgeChance + defender->itembonuses.DodgeChance) / 100.0f;
if (!ghit) { //if they are not using a garunteed hit discipline
- bonus += 2.0 + skill/35.0 + (GetAGI()/200);
+ bonus += 2.0f + static_cast<float>(skill)/35.0f + static_cast<float>(GetAGI())/200.0f;
RollTable[3] = RollTable[2] + bonus;
}
}
@@ -602,7 +602,7 @@

//Add these to rules eventually
//double the clients intervals to make their damage output look right, move to rule eventually too
- int intervalsAllowed = 20;
+ uint32 intervalsAllowed = 20;
if(defender->IsClient())
intervalsAllowed *= 2;

@@ -642,7 +642,7 @@
char tmp[10];

if (database.GetVariable("ACfail", tmp, 9)) {
- acfail = (int) (atof(tmp) * 100);
+ acfail = static_cast<int>(atof(tmp) * 100.0f);
if (acfail>100) acfail=100;
}

@@ -657,12 +657,12 @@

if (database.GetVariable("ACrandom", tmp, 9))
{
- acrandom = (int) ((atof(tmp)+1) * 100);
+ acrandom = static_cast<int>((atof(tmp)+1.0f) * 100.0f);
if (acrandom>10100) acrandom=10100;
}

if (acreduction>0) {
- damage -= (int) (GetAC() * acreduction/100.0f);
+ damage -= static_cast<int>(GetAC() * acreduction/100.0f);
}
if (acrandom>0) {
damage -= (myac * MakeRandomInt(0, acrandom) / 10000);
@@ -758,7 +758,7 @@

if(against->SpecAttacks[IMMUNE_MELEE_EXCEPT_BANE]){
if(weapon_item){
- if(weapon_item->BaneDmgBody == against->GetBodyType()){
+ if(weapon_item->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){
banedmg += weapon_item->BaneDmgAmt;
}

@@ -775,7 +775,7 @@
}
else{
if(weapon_item){
- if(weapon_item->BaneDmgBody == against->GetBodyType()){
+ if(weapon_item->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){
banedmg += weapon_item->BaneDmgAmt;
}

@@ -831,7 +831,7 @@
dmg = weapon_item->GetItem()->Damage;
}

- for(int x = 0; x < 5; x++){
+ for(int x = 0; x < 5; ++x){
if(weapon_item->GetAugment(x) && weapon_item->GetAugment(x)->GetItem()){
dmg += weapon_item->GetAugment(x)->GetItem()->Damage;
}
@@ -863,7 +863,7 @@
dmg = weapon_item->GetItem()->Damage;
}

- for(int x = 0; x < 5; x++){
+ for(int x = 0; x < 5; ++x){
if(weapon_item->GetAugment(x) && weapon_item->GetAugment(x)->GetItem()){
dmg += weapon_item->GetAugment(x)->GetItem()->Damage;
}
@@ -892,15 +892,15 @@
}

if(eledmg)
- dmg += (eledmg * against->ResistSpell(weapon_item->GetItem()->ElemDmgType, 0, this) / 100);
+ dmg += static_cast<int>(eledmg * against->ResistSpell(weapon_item->GetItem()->ElemDmgType, 0, this) / 100);
}

if(weapon_item){
- for(int x = 0; x < 5; x++){
+ for(int x = 0; x < 5; ++x){
if(weapon_item->GetAugment(x) && weapon_item->GetAugment(x)->GetItem()){
eledmg += weapon_item->GetAugment(x)->GetItem()->ElemDmgAmt;
if(weapon_item->GetAugment(x)->GetItem()->ElemDmgAmt)
- dmg += (weapon_item->GetAugment(x)->GetItem()->ElemDmgAmt * against->ResistSpell(weapon_item->GetAugment(x)->GetItem()->ElemDmgType, 0, this) / 100);
+ dmg += static_cast<int>(weapon_item->GetAugment(x)->GetItem()->ElemDmgAmt * against->ResistSpell(weapon_item->GetAugment(x)->GetItem()->ElemDmgType, 0, this) / 100);
}
}
}
@@ -908,7 +908,7 @@

if(against->SpecAttacks[IMMUNE_MELEE_EXCEPT_BANE]){
if(weapon_item && weapon_item->GetItem()){
- if(weapon_item->GetItem()->BaneDmgBody == against->GetBodyType()){
+ if(weapon_item->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){
if(IsClient() && GetLevel() < weapon_item->GetItem()->RecLevel){
banedmg += CastToClient()->CalcRecommendedLevelBonus(GetLevel(), weapon_item->GetItem()->RecLevel, weapon_item->GetItem()->BaneDmgAmt);
}
@@ -926,9 +926,9 @@
}
}

- for(int x = 0; x < 5; x++){
+ for(int x = 0; x < 5; ++x){
if(weapon_item->GetAugment(x) && weapon_item->GetAugment(x)->GetItem()){
- if(weapon_item->GetAugment(x)->GetItem()->BaneDmgBody == against->GetBodyType()){
+ if(weapon_item->GetAugment(x)->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){
banedmg += weapon_item->GetAugment(x)->GetItem()->BaneDmgAmt;
}

@@ -947,7 +947,7 @@
}
else{
if(weapon_item && weapon_item->GetItem()){
- if(weapon_item->GetItem()->BaneDmgBody == against->GetBodyType()){
+ if(weapon_item->GetItem()->BaneDmgBody == static_cast<uint32>(against->GetBodyType())){
if(IsClient() && GetLevel() < weapon_item->GetItem()->RecLevel){
banedmg += CastToClient()->CalcRecommendedLevelBonus(GetLevel(), weapon_item->GetItem()->RecLevel, weapon_item->GetItem()->BaneDmgAmt);
}
@@ -965,7 +965,7 @@
}
}

- for(int x = 0; x < 5; x++){
+ for(int x = 0; x < 5; ++x){
if(weapon_item->GetAugment(x) && weapon_item->GetAugment(x)->GetItem()){
if(weapon_item->GetAugment(x)->GetItem()->BaneDmgBody == against->GetBodyType()){
banedmg += weapon_item->GetAugment(x)->GetItem()->BaneDmgAmt;
@@ -1047,7 +1047,7 @@
/// Now figure out damage
int damage = 0;
int8 mylevel = GetLevel() ? GetLevel() : 1;
- int8 otherlevel = other->GetLevel() ? other->GetLevel() : 1;
+ //int8 otherlevel = other->GetLevel() ? other->GetLevel() : 1; //unused
int weapon_damage = GetWeaponDamage(other, weapon);

//if weapon damage > 0 then we know we can hit the target with this weapon
@@ -1057,7 +1057,7 @@
//Berserker Berserk damage bonus
if(berserk && GetClass() == BERSERKER){
int bonus = 3 + GetLevel()/10; //unverified
- weapon_damage = weapon_damage * (100+bonus) / 100;
+ weapon_damage = static_cast<int>(static_cast<float>(weapon_damage) * (100.0f+static_cast<float>(bonus) / 100.0f));
mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage);
}

@@ -1081,21 +1081,18 @@

//monks are supposed to be a step ahead of other classes in
//toe to toe combat, small bonuses for hitting key levels too
- int bonus = 0;
+ int nBonus = 0;
+ int nLevel = GetLevel();
+
if(GetClass() == MONK)
- bonus += 20;
- if(GetLevel() > 50)
- bonus += 15;
- if(GetLevel() >= 55)
- bonus += 15;
- if(GetLevel() >= 60)
- bonus += 15;
- if(GetLevel() >= 65)
- bonus += 15;
-
- min_hit += (min_hit * bonus / 100);
- max_hit += (max_hit * bonus / 100);
+ nBonus += 20;
+ if(nLevel > 50)
+ nBonus += 15 * ((nLevel - 45)/5);

+ float fBonus = 1.0f + static_cast<float>(nBonus)/100.0f;
+ min_hit = static_cast<int>(static_cast<float>(min_hit) * fBonus);
+ max_hit = static_cast<int>(static_cast<float>(max_hit) * fBonus);
+
// ************************************************** *************
// *** Calculate the damage bonus, if applicable, for this hit ***
// ************************************************** *************
@@ -1120,7 +1117,7 @@
}
#endif

- min_hit = min_hit * (100 + itembonuses.MinDamageModifier + spellbonuses.MinDamageModifier) / 100;
+ min_hit = static_cast<int>(static_cast<float>(min_hit) * static_cast<float>(100 + itembonuses.MinDamageModifier + spellbonuses.MinDamageModifier) / 100.0f);

if (Hand==14) {
if(GetAA(aaSinisterStrikes)) {
@@ -1146,6 +1143,7 @@
mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0.");
damage = 0;
other->AddToHateList(this, 0);
+ other->AvoidDamage(this, damage);
} else { //we hit, try to avoid it
other->AvoidDamage(this, damage);
other->MeleeMitigation(this, damage, min_hit);
@@ -1932,7 +1930,7 @@
//if NPCs can't inheriently hit the target we don't add bane/magic dmg which isn't exactly the same as PCs
int16 eleBane = 0;
if(weapon){
- if(weapon->BaneDmgBody == other->GetBodyType()){
+ if(weapon->BaneDmgBody == static_cast<uint32>(other->GetBodyType())){
eleBane += weapon->BaneDmgAmt;
}

@@ -1941,7 +1939,7 @@
}

if(weapon->ElemDmgAmt){
- eleBane += (weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100);
+ eleBane += static_cast<int16>(weapon->ElemDmgAmt * other->ResistSpell(weapon->ElemDmgType, 0, this) / 100);
}
}

@@ -1985,7 +1983,8 @@
other->AddToHateList(this, hate);
} else {
if(!other->CheckHitChance(this, skillinuse, Hand)) {
- damage = 0; //miss
+ damage = 0; //miss
+ other->AvoidDamage(this, damage);
} else { //hit, check for damage avoidance
other->AvoidDamage(this, damage);
other->MeleeMitigation(this, damage, min_dmg+eleBane);
@@ -2240,7 +2239,7 @@

/* Send the EVENT_KILLED_MERIT event and update kill tasks
* for all group members */
- for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
+ for (int i = 0; i < MAX_GROUP_MEMBERS; ++i) {
if (kg->members[i] != NULL && kg->members[i]->IsClient()) { // If Group Member is Client
Client *c = kg->members[i]->CastToClient();
parse->Event(EVENT_KILLED_MERIT, GetNPCTypeID(), "killed", this, c);
@@ -2306,7 +2305,7 @@
if(killer->IsGrouped()) {
Group* group = entity_list.GetGroupByClient(killer->CastToClient());
if(group != 0) {
- for(int i=0;i<6;i++) { // Doesnt work right, needs work
+ for(int i=0;i<6;++i) { // Doesnt work right, needs work
if(group->members[i] != NULL) {
corpse->AllowMobLoot(group->members[i],i);
}
@@ -3195,7 +3194,7 @@

bool Mob::HasProcs() const
{
- for (int i = 0; i < MAX_PROCS; i++)
+ for (int i = 0; i < MAX_PROCS; ++i)
if (PermaProcs[i].spellID != SPELL_UNKNOWN || SpellProcs[i].spellID != SPELL_UNKNOWN)
return true;
return false;
@@ -3685,7 +3684,6 @@
break;
}
}
-
#ifdef EQBOTS

// Bot AA WeaponAffinity
@@ -3709,12 +3707,10 @@

#endif //EQBOTS

+ ProcBonus += static_cast<float>(itembonuses.ProcChance + spellbonuses.ProcChance) / 1000.0f;
+ ProcChance = 0.05f + static_cast<float>(mydex) / 9000.0f;
+ ProcBonus += (ProcChance * static_cast<float>(AABonus)) / 100.0f; ProcChance += ProcBonus;

- ProcBonus += float(itembonuses.ProcChance + spellbonuses.ProcChance) / 1000.0f;
-
- ProcChance = 0.05f + float(mydex) / 9000.0f;
- ProcBonus += (ProcChance * AABonus) / 100;
- ProcChance += ProcBonus;
mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
return ProcChance;
}
@@ -3747,7 +3743,7 @@

//do augment procs
int r;
- for(r = 0; r < MAX_AUGMENT_SLOTS; r++) {
+ for(r = 0; r < MAX_AUGMENT_SLOTS; ++r) {
const ItemInst* aug_i = weapon_g->GetAugment(r);
if(!aug_i)
continue;
@@ -3757,7 +3753,7 @@

if (IsValidSpell(aug->Proc.Effect)
&& (aug->Proc.Type == ET_CombatProc)) {
- ProcChance = ProcChance*(100+aug->ProcRate)/100;
+ ProcChance *= (100.0f+static_cast<float>(aug->ProcRate))/100.0f;
if (MakeRandomFloat(0, 1) < ProcChance) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
if(aug->Proc.Level > ourlevel) {
Mob * own = GetOwner();
@@ -3783,7 +3779,7 @@
//give weapon a chance to proc first.
if(weapon != NULL) {
if (IsValidSpell(weapon->Proc.Effect) && (weapon->Proc.Type == ET_CombatProc)) {
- float WPC = ProcChance*(100+weapon->ProcRate)/100;
+ float WPC = ProcChance*(100.0f+static_cast<float>(weapon->ProcRate))/100.0f;
if (MakeRandomFloat(0, 1) <= WPC) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
if(weapon->Proc.Level > ourlevel) {
mlog(COMBAT__PROCS, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level);
@@ -3809,7 +3805,7 @@
}

//now try our proc arrays
- float procmod = float(GetDEX()) / 100.0f + ProcBonus*100.0; //did somebody think about this???
+// float procmod = float(GetDEX()) / 100.0f + ProcBonus*100.0; //did somebody think about this???
//AndMetal: aren't we doing this in GetProcChances?

uint32 i;
@@ -3823,7 +3819,7 @@
}
}
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
- int chance = ProcChance + SpellProcs[i].chance;
+ int chance = static_cast<int>(ProcChance + static_cast<float>(SpellProcs[i].chance));
if(MakeRandomInt(0, 100) < chance) {
mlog(COMBAT__PROCS, "Spell proc %d procing spell %d (%d percent chance)", i, SpellProcs[i].spellID, chance);
ExecWeaponProc(SpellProcs[i].spellID, on);
@@ -4269,14 +4265,14 @@
}

//Rogue sneak attack disciplines make use of this, they are active for one hit
- for(int bs = 0; bs < BUFF_COUNT; bs++){
+ for(int bs = 0; bs < BUFF_COUNT; ++bs){
if(buffs[bs].numhits > 0 && IsDiscipline(buffs[bs].spellid)){
if(skill == spells[buffs[bs].spellid].skill){
if(buffs[bs].numhits == 1){
BuffFadeBySlot(bs, true);
}
else{
- buffs[bs].numhits--;
+ --buffs[bs].numhits;
}
}
}

I know that doing code submissions in forums isn't really the best possible way to do it, but we can't just allow SVN update access for everyone. And, at least it still allows anyone who wants to share their work with the community for the benefit of all. It takes lots of patience and consistency to be considered for the emulator team. I am sure that with your skill, if you were able to remain patient and consistent with code submissions or helping around the forums in other ways, you would eventually be able to get SVN access. There are other factors as well, like attitude, trustworthiness, and other key factors, but the emu team does recognize deserving members. Sometimes things move slower than they should, but we are working on that!

Remember that everyone here is here voluntarily and we do our best with the time that is allowed. All in all, I think this community is by far better than any other I have seen. And, even though things may have gotten a little slower over the past year or 2 due to a large portion of the team leaving and not being replaced, we have made leaps and bounds in recent months. Many new team members have been added and some older team members have had their access upgraded to increase the rate of progress. And, the new SVN is just awesome and should make a huge impact on the project overall.

If you really do plan to give up so early, then that is your decision. But, I do think we can clear up any issues you may have with the current system.

James76
10-14-2008, 11:04 PM
I appreciate the positive responses as well as positive attitudes. I must apologize for my last message, I'm home sick with the flu and every little thing is bothering me, its strange how it all adds up to grumpiness and general discomfort. I still want to push out more changes, the two 'key' fixes (no pun intended) will be coming soon, I've pseudo-coded it in a list.. But I also have much bigger changes headed your way, though I haven't dug-in to tell if they're database issues or code bugs. My list is growing, and at some point I'm going to overwhelm the forum a little, which would make me sit on my hands in frustration some more. I have my mind bent on solving the pathing problem eventually, I have thought of several ways of doing that.

Again accept my apologies, no hard feelings, I'm sick and irritable ATM. The furthest I got was shutting down my linux server. I can't guarantee how much time I can dedicate, I may be starting training in January to be a Navy officer, just awaiting some more go-aheads..

James76
10-15-2008, 06:11 PM
In case anybody is taking a serious interest in C++, I recommend a book for you, The C++ Programming Language (http://www.amazon.com/C-Programming-Language-Special-3rd/dp/0201700735/ref=sr_1_1?ie=UTF8&s=books&qid=1224107607&sr=1-1) written by Stroustrup himself. You can have a "look inside" by following this link (http://www.amazon.com/gp/reader/0201700735/ref=sib_dp_pt#reader-link). You can probably find a torrent of it. Another book worth having is The C++ Standard Template Library, aka STL, which is highly useful because of templates in C++, which is one of the facets most people skip or have trouble with when jumping into C++ from another language. Templates essentially allow type-less classes, functions, methods, and containers.. You can even apply algorithms to them with "magical" ease. But just remember, there is never any magic, everything is somewhere.

The problem I had when I started learning to program when I was young, was that I didn't have anyone to go to for help when I had a bug, so I had to solve everything on my own.. Given enough time, I could eventually solve any problem. But since I'm here, I'd be glad to answer anybody's questions so they could use me as a valuable resource if they're taking programming in school or are stuck on something. Not having help was a big pain in the butt, but I learned patience and perseverance in the process..

Also many books contained errors which made learning difficult... Many programming books I found have errors, as well as many calculus books... The latter is probably worse... lots of hand-wringing!

trevius
10-15-2008, 06:49 PM
I was able to get your monk H2H code in, but I haven't been able to get any of your other stuff tested yet. Part of the problem is that I am making some adjustments to how ProcChance and chancetohit work for certain things. So, some of your submission overlaps with what I am working on. Though, it looks like your stuff for ProcChance is just for formatting it correctly and not actually effecting the calculation equations. But, I like to do 1 thing at a time to reduce possible issues.

I am still trying to figure out the best way to get this stuff chanced in the source. Unless all of the code that was missing on the diff was already added to the SVN, It looks like even the diff that erde posted still doesn't have alot of the code that James76 posted. It is a definite starting place, though.

I hate to ask it, but;

James76, if you get a chance, is there anyway you could download the latest SVN and add in your changes to it and post a diff for them? You should be able to use something like examdiff or whatever, but I imagine with your coding experience, you probably know very well about how to do a diff, lol :P

Unless one of the other people with SVN access wants to add in what you have already submitted, then they can probably save you from having to do that diff. But, if it is going to be me adding it, I will need that diff or it will take me too much time to be worth it. I have a house, wife, kid, 2 forums to handle, a pretty popular emu server, and of course my own code changes and content to work on, so time is important to me. Not that I am any busier than most of the dev/mod team, because I know we all have stuff to keep us busy lol.

If anyone else from the team wants to try to get these added, feel free! It will stop any further time from being used up on this code change. Hopefully once we get this in, any further updates from James76 will move much quicker and smoother. Proper submission process will help that alot.

erde
10-16-2008, 04:17 AM
I added all changes from that post (http://www.eqemulator.net/forums/showpost.php?p=158008&postcount=24). Can you tell me what i have missed?

trevius
10-16-2008, 07:57 AM
Oops, sorry! I must have not copied and paste the whole thing into the post for some reason. I edited my other post so it has the full diff in it.

erde
10-16-2008, 11:00 AM
No problem ;) Today i have checked the diff and it seems everything is in.
But i dont have enough time at the moment and i made it in hurry. So i could have overlooked some parts ;)