[Release][FULL]CharStatusInfoPacket

11/01/2011 23:52 Mr_PoP#31
Quote:
Originally Posted by shadowman123 View Post
dude i Tried To make the Equipped item that is Purified with Dragonsoul which incrase Critical Strike been Read And i failed..could u Gimme lil bit of explaination ? or Hints
well simply all u need is when you Equip/En-Equip item loop through all your equipment and increase your CriticalStrike as you do with your Attack/Defense etc the same way your getting ur attack etc use it to increase/get ur CriticalStrike.
11/02/2011 00:15 pro4never#32
ooh god it hurts :(...

Somewhere in your source you SHOULD have something to handle recalculating stats (called only when equipment or stats are changed!)


Inside this is where you should be doing your damn stat calculations...

eg

public void RecalculateAttack()
{
MinimumDamage = 0;
MaximumDamage = 0;
//etc... Set ALL stats to zero. We're doing a full recalculation

foreach(Item itm in Equipment.Values)//or however you manage your equipment. Personally I wrote an Equipment class but that's beside the pt
{
MinimumDamage += itm.Info.MinimumDamage;
//ETC

if(itm.CompositionData != null)
{
//Add all bonuses from the item being +'d!
}
if(itm.RefinerySoulData != null)
{
//Add all refinery and soul bonuses the item has to stats!
}
}
}


What you guys are showing in your get/set method is an infinite loop...

You're literally saying..

When X is assigned to (X = anything) set X = something for each item I have equipped. Not cool...