PDA

View Full Version : Adding a Item Shielding Cap Rule


LordKahel
03-07-2008, 07:12 AM
This will add a rule to cap Item Shielding to the amount needed . I think live capped it at 30. This is the default value.


In ruletypes.h add the bold line to the Character category


RULE_CATEGORY( Character )
RULE_INT ( Character, MaxLevel, 65 )
RULE_INT ( Character, DeathExpLossLevel, 10 )
RULE_INT ( Character, DeathItemLossLevel, 10 )
RULE_INT ( Character, CorpseDecayTimeMS, 10800000 )
RULE_BOOL( Character, LeaveCorpses, false )
RULE_BOOL( Character, LeaveNakedCorpses, false )
RULE_REAL( Character, ExpMultiplier, 1.0 )
RULE_INT ( Character, AutosaveIntervalS, 300 ) //0=disabled
RULE_INT ( Character, HPRegenMultiplier, 100)
RULE_INT ( Character, ManaRegenMultiplier, 100)
RULE_INT ( Character, EnduranceRegenMultiplier, 100)
RULE_INT ( Character, ConsumptionMultiplier, 100) //item's hunger restored = this value * item's food level, 100 = normal, 50 = people eat 2x as fast, 200 = people eat 2x as slow
RULE_BOOL( Character, HealOnLevel, false)
RULE_BOOL( Character, FeignKillsPet, false)
RULE_INT ( Character, ItemManaRegenCap, 15)
RULE_INT ( Character, ItemHealthRegenCap, 35)
RULE_INT ( Character, ItemShieldingCap, 30)
RULE_CATEGORY_END()



In attack.cpp change the following line from the void Mob::MeleeMitigation function

CHANGE

totalMit += (defender->spellbonuses.MeleeMitigation + defender->itembonuses.MeleeMitigation);


TO


int itemMit = (RuleI(Character, ItemShieldingCap) < defender->itembonuses.MeleeMitigation) ? RuleI(Character, ItemShieldingCap) : defender->itembonuses.MeleeMitigation ;
totalMit += (defender->spellbonuses.MeleeMitigation + itemMit);



This will prevent players from getting a shielding too high and reduce nearly all damage. It can now be capped like on live.

--
Pyronis / kahel
Dev - Jest 3 Server

LordKahel
03-08-2008, 09:00 AM
Here the code to add a cap to Item Avoidance bonus .


Add the blod line to ruletypes.h

RULE_INT ( Character, ItemManaRegenCap, 15)
RULE_INT ( Character, ItemHealthRegenCap, 35)
RULE_INT ( Character, ItemShieldingCap, 30)
RULE_INT ( Character, ItemAvoidanceCap, 100)
RULE_CATEGORY_END()


And in Mob::CheckHitChance in the file attack.cpp .

Change

bonus = defender->spellbonuses.AvoidMeleeChance + defender->itembonuses.AvoidMeleeChance;


TO


int itemAvoidance = (RuleI(Character,ItemAvoidanceCap) < defender->itembonuses.AvoidMeleeChance) ? RuleI(Character,ItemAvoidanceCap) : defender->itembonuses.AvoidMeleeChance;
bonus = defender->spellbonuses.AvoidMeleeChance + itemAvoidance;

trevius
03-08-2008, 07:12 PM
Nice work! I was hoping to see something like this soon. Hope it makes it into the next release :)

This and your lore aug fix would both be great things to see in a future update :D

Jibbatwinkers
03-09-2008, 06:07 AM
Awesome! I hope this goes in on the next patch as well. I have been looking for a way to cap my shielding and didn't really want to go through so many items to make sure players weren't mitigating too much damage. Awesome work!

gernblan
03-10-2008, 01:59 PM
We at Jest Server are trying to help out best we can.

We're also very lucky to have Pyronis on our development team.