PDA

View Full Version : Various GoD AA Code Changes


seveianrex
10-23-2008, 06:39 PM
{zone/effects.cpp}
@152
locate:

chance += GetAA(aaFuryofMagicMastery2) * 2; //just in case

and replace with

chance += GetAA(aaFuryofMagicMastery2) * 2;


(anal retentive, maybe, but I don't want it getting removed in future because the comment makes it sound iffy)

{zone/aggro.cpp}
@1184
locate:

switch (GetAA(aaSpellCastingSubtlety))
{
case 1:
AggroAmount = AggroAmount * 95 / 100;
break;
case 2:
AggroAmount = AggroAmount * 90 / 100;
break;
case 3:
AggroAmount = AggroAmount * 80 / 100;
break;
}


add after:

switch (GetAA(aaSpellCastingSubtlety2))
{
case 1:
AggroAmount = AggroAmount * 95 / 100;
break;
case 2:
AggroAmount = AggroAmount * 90 / 100;
break;
case 3:
AggroAmount = AggroAmount * 80 / 100;
break;
}


{zone/special_attacks.cpp}

line 30, locate:

int Mob::GetKickDamage() const {
int multiple=(GetLevel()*100/5);
multiple += 100;
int dmg=(
(
(GetSkill(KICK) + GetSTR() + GetLevel())*100 / 9000
) * multiple
)
+ 600; //Set a base of 6 damage, 1 seemed too low at the sub level 30 level.
if(GetClass() == WARRIOR || GetClass() == WARRIORGM
||GetClass() == BERSERKER || GetClass() == BERSERKERGM) {
dmg*=12/10;//small increase for warriors
}

dmg /= 100;
return(dmg);
}


REPLACE with

int Mob::GetKickDamage() const {
int multiple=(GetLevel()*100/5);
multiple += 100;
int dmg=(
(
(GetSkill(KICK) + GetSTR() + GetLevel())*100 / 9000
) * multiple
)
+ 600; //Set a base of 6 damage, 1 seemed too low at the sub level 30 level.
if(GetClass() == WARRIOR || GetClass() == WARRIORGM
||GetClass() == BERSERKER || GetClass() == BERSERKERGM) {
dmg*=12/10;//small increase for warriors
}
dmg /= 100;

switch (GetAA(aaStrengthenedStrike))
{
case 1:
dmg *= 1.05;
break;
case 2:
dmg *= 1.15;
break;
case 3:
dmg *= 1.30;
break;
}

return(dmg);
}


line 48, locate:

int Mob::GetBashDamage() const {
int multiple=(GetLevel()*100/5);
multiple += 100;

//this is complete shite
int dmg=(
(
((GetSkill(BASH) + GetSTR())*100 + GetLevel()*100/2) / 10000
) * multiple
)
+ 600; //Set a base of 6 damage, 1 seemed too low at the sub level 30 level.
dmg /= 100;
return(dmg);
}


REPLACE with

int Mob::GetBashDamage() const {
int multiple=(GetLevel()*100/5);
multiple += 100;

//this is complete shite
int dmg=(
(
((GetSkill(BASH) + GetSTR())*100 + GetLevel()*100/2) / 10000
) * multiple
)
+ 600; //Set a base of 6 damage, 1 seemed too low at the sub level 30 level.
dmg /= 100;

switch (GetAA(aaStrengthenedStrike))
{
case 1:
dmg *= 1.05;
break;
case 2:
dmg *= 1.15;
break;
case 3:
dmg *= 1.30;
break;
}

switch (GetAA(aaViciousSmash))
{
case 1:
dmg *= 1.05;
break;
case 2:
dmg *= 1.15;
break;
case 3:
dmg *= 1.30;
break;
}

return(dmg);
}


{zone/pets.cpp}

@ 204 locate:
[code]
//TODO: think about regen (engaged vs. not engaged)


and add before:

switch (GetAA(aaElementalDurability))
{
case 1:
npc_type->max_hp *= 1.02;
npc_type->cur_hp = npc_type->max_hp;
break;
case 2:
npc_type->max_hp *= 1.05;
npc_type->cur_hp = npc_type->max_hp;
break;
case 3:
npc_type->max_hp *= 1.10;
npc_type->cur_hp = npc_type->max_hp;
break;
}

seveianrex
10-24-2008, 08:03 PM
This can be unsticked, I committed the changes.

AndMetal
10-25-2008, 12:40 AM
{zone/effects.cpp}

chance += GetAA(aaFuryofMagicMastery2) * 2; //just in case

and replace with

chance += GetAA(aaFuryofMagicMastery2) * 2;


(anal retentive, maybe, but I don't want it getting removed in future because the comment makes it sound iffy)


If I remember correctly, I put that comment in there because we currently utilize aaFuryofMagicMastery2 (640) vs aaFuryofMagicMastery (770), because that's what's in the database:

mysql> SELECT skill_id, name, type FROM altadv_vars WHERE name LIKE "%Fury of Magic%"; +----------+--------------------------------+------+
| skill_id | name | type |
+----------+--------------------------------+------+
| 637 | Fury of Magic | 5 |
| 640 | Fury of Magic Mastery | 5 |
| 924 | Advanced Fury of Magic Mastery | 6 |
| 1107 | Fury of Magic | 7 |
+----------+--------------------------------+------+
4 rows in set (0.00 sec)


So, until it's updated in the db **looks in cavedude's general direction**, we really don't need it, but I put it there assuming it would be added eventually, and then we wouldn't have to add it into the code :D

trevius
10-25-2008, 06:44 AM
seveianrex, don't forget to update the changelog.txt file when you commit changes. You have to edit it manually every time. It helps keep track of what has been changed :)

Also, if you post any updates that require SQL changes, make sure you create a .sql file and put it in the /utils/sql/svn directory in the same format as the current ones. For all of the AAs you added, I don't see them in the altadv_vars table yet, so they won't be available in game until they are added there. Unfortunately, I think there is a major issue with adding AAs to that table that causes the prereq_skill fields to get messed up. I didn't understand what was going on at first when I added some AAs, but apparently, the prereq_skill number is actually the line number in the table in order. So, if you add one to the table, it throws off all prereqs that are higher than the one at the line you added. This seems like a really horrible way for this table to work. I am going to see if there is a better way to do it. Maybe we can get it changed so that making a change there doesn't mess everything else up. It would certainly make adding non-existing AAs MUCH easier.

So, basically, you probably don't want to update that table yet until the code for prereqs is adjusted/fixed. Unless you know of a good way to have it increment all prereqs higher than that line. Like, if the AA you add is on line number 100, anything over 99 in the prereq field would need to be incremented by 1. I am trying to figure that out to correct an issue with the AAs I added. Until then, it might be best to just have those lines for the new AAs I added removed from the table. Hopefully I can find a good answer soon! Still trying to figure out what to do about it until then...

cavedude
10-25-2008, 11:52 AM
I already warned him about the changelog. ;)

As for the DB data, he already submitted that data which is now in the PEQ database. Normally, I don't like cramming PEQ down people's throats as I think we should have a choice (that's how I got this job, really) But in this case, due to the nature of the AA tables I think it would be best if the AA changes all get merged into PEQ and released as full table dumps.

If you guys want, after I get more AAs in today I can dump the AA tables and add them to the SVN under utils/sql. I'll keep that updated.

seveianrex
10-25-2008, 04:27 PM
I already warned him about the changelog. ;)

As for the DB data, he already submitted that data which is now in the PEQ database. Normally, I don't like cramming PEQ down people's throats as I think we should have a choice (that's how I got this job, really) But in this case, due to the nature of the AA tables I think it would be best if the AA changes all get merged into PEQ and released as full table dumps.

If you guys want, after I get more AAs in today I can dump the AA tables and add them to the SVN under utils/sql. I'll keep that updated.


Sorry for the confusion guys.

In the meantime before Cavedude gets the dump posted, anybody seeking the SQL for all these GoD AA's which I've posted, you can find them HERE:

http://www.projecteq.net/phpBB2/viewtopic.php?t=5856
http://www.projecteq.net/phpBB2/viewtopic.php?t=5870
http://www.projecteq.net/phpBB2/viewtopic.php?t=5876
http://www.projecteq.net/phpBB2/viewtopic.php?t=5879
http://www.projecteq.net/phpBB2/viewtopic.php?t=5878


Also, I got the changelog thing figured out. DIdn't realize we were supposed to edit the text file. I got it now :)

seveianrex
10-25-2008, 04:32 PM
seveianrex, don't forget to update the changelog.txt file when you commit changes. You have to edit it manually every time. It helps keep track of what has been changed :)

Also, if you post any updates that require SQL changes, make sure you create a .sql file and put it in the /utils/sql/svn directory in the same format as the current ones. For all of the AAs you added, I don't see them in the altadv_vars table yet, so they won't be available in game until they are added there. Unfortunately, I think there is a major issue with adding AAs to that table that causes the prereq_skill fields to get messed up. I didn't understand what was going on at first when I added some AAs, but apparently, the prereq_skill number is actually the line number in the table in order. So, if you add one to the table, it throws off all prereqs that are higher than the one at the line you added. This seems like a really horrible way for this table to work. I am going to see if there is a better way to do it. Maybe we can get it changed so that making a change there doesn't mess everything else up. It would certainly make adding non-existing AAs MUCH easier.

So, basically, you probably don't want to update that table yet until the code for prereqs is adjusted/fixed. Unless you know of a good way to have it increment all prereqs higher than that line. Like, if the AA you add is on line number 100, anything over 99 in the prereq field would need to be incremented by 1. I am trying to figure that out to correct an issue with the AAs I added. Until then, it might be best to just have those lines for the new AAs I added removed from the table. Hopefully I can find a good answer soon! Still trying to figure out what to do about it until then...

Trev, the pre-req thing is a definite issue. I honestly cannot even imagine what was going through somebody's mind when they thought that using the INDEX instead of the ID of the AA would be a good idea for the prerequisite skill......... but I wasn't there.

However. I have not had any issues with pre-requisite skill indexes changing since posting the updated GoD aa's to PEQ's DB. I have a feeling the reason is because it doesn't ORDER BY the skill ID. Meaning, the newest records get appended to the END of the list even if the skillid is in between existing ones. Therefore, the index doesn't change. Atleast it hasn't on my end.

cavedude
10-25-2008, 06:28 PM
That's the problem with using MySQL line numbers to identify data instead of IDs, they will change. If you insert new lines on the fly, it will just tack them on the end. But, the next time the server lists the data, it will in this case order by skill_id. A simple test:

Clear the index:

SET @line = 0;

Then, output the line numbers in reference to skill_id:

SELECT @line := @line + 1, skill_id FROM altadv_vars;

Maybe need to put a limit on, I did. Insert new AAs. Run the above query again, they *should* be tacked on the end. Clear the index with the first query, and then run the second query again. You'll notice, they will all be ordered by the skill_id again.

trevius
10-25-2008, 06:53 PM
No, that is most likely because GoD is later, so the skill_id will be higher. And, in my table, nothing has a prereq over index number 230ish. Anything near the bottom won't be an issue for now. It definitely orders by skill_id. I did some testing last night and was 100% accurate with it.

cavedude
10-25-2008, 07:08 PM
We inserted AAs with spell_ids in the 800s and they are causing problems.

Yes, they count by spell_id eventually, but as I said above it will not take place immediately. Newly inserted queries will be tacked onto the end until whatever you are using reorders the data. Run those queries, and you'll see what I mean.

Not sure why this post was necessary, I was agreeing with you guys and I felt my post was pretty clear :P

trevius
10-25-2008, 11:29 PM
Sorry lol. I had mine written before you posted yours, but I didn't hit the submit button for a while because I had to AFK. If I had seen yours before, I wouldn't have posted. Mine was meant to reply to seveianrex's last post :P