EQ2Emulator Development forum.
Moderator: Team Members
-
Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Post
by Gangrenous » Thu Mar 23, 2017 7:43 am
So armor is working well, the bonus is accurate enough I am happy with it. It is now handled in code. Spells are not though. How so I get the stat for ...
Code: Select all
AddSpellBonus(Target, 200, PhysMitBonus) -- vs Physical Damage
Searching the source I see no reference for PhysMitBonus? In the calculations for mitigation, spell mitigation needs to be handled in.
Resident Dirty Hippy
-
Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Post
by Gangrenous » Thu Mar 23, 2017 7:58 am
So it looks like we are using the ITEM_STAT_VS_PHYSICAL bonus, if I am right?
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Post
by Jabantiz » Thu Mar 23, 2017 2:48 pm
PhysMitBonus should be the value to change the stat by, so it is likely a lua variable. 200 would be the stat id which is ITEM_STAT_VS_PHYSICAL.
-
Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Post
by Gangrenous » Fri Mar 24, 2017 6:13 am
Okay, pretty close here Jabantiz. I have the spell mitigation applying, it shows after the next server tic. It is calculated into the mitigation bonus and even makes a nice difference in combat. My issue is that something like Magi Shield is not removing the mitigation bonus when it is canceled. If I change a piece of armor, it does change it.
Resident Dirty Hippy
-
Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Post
by Gangrenous » Fri Mar 24, 2017 6:38 am
Okay, figured it out.
Jabantiz is this in any way bad coding?
Code: Select all
void Entity::RemoveSpellBonus(LuaSpell* spell){
MutexList<BonusValues*>::iterator itr = bonus_list.begin();
while(itr.Next()){
if(itr.value->luaspell == spell)
bonus_list.Remove(itr.value, true);
}
CalculateBonuses();
}
The way I see it, we need to calculate bonuses after the bonus is removed, there is no call other than maybe when you change items.
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Post
by Jabantiz » Fri Mar 24, 2017 3:47 pm
Do you have the remove function in the spell script and is that removing the spell bonus?
-
Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Post
by Gangrenous » Fri Mar 24, 2017 4:39 pm
Yes, but it was not removing it until I added CalculateBonuses() to the source.
Resident Dirty Hippy
Who is online
Users browsing this forum: No registered users and 0 guests