bojangles2872
Member
What I am trying to do is make it so when a player does a critical hit I want the damage modifier to pick up on the players critical damage attribute ( had to create a new attribute list because AosAttribute list was full so it is named CustomAttributes ). What I am not sure of is how do I get the code to point back at the attackers current critical damage bonus.
[article]
// crit chance = 20%
int critChanceBonus = CustomAttributes.GetValue(attacker, CustomAttribute.CritChance);
if (critChanceBonus > 20)
critChanceBonus = 20;
//crit damage bonus 200%
int critDamageBonus = CustomAttributes.GetValue(attacker, CustomAttribute.CritDamage);
if (critDamageBonus > 200)
critDamageBonus = 200;
int baseCritDamage = 0;
//critChanceBonus += attacker.Luck / 100;
//critical hit attack bonus here
int baseCritChance = 0;
if (baseCritChance + critChanceBonus > Utility.Random(100) && attacker.Combatant != null && damage > 0)
{
attacker.SendMessage("You made a critical strike!");
critDamageBonus = ?????
}
[/article]
[article]
// crit chance = 20%
int critChanceBonus = CustomAttributes.GetValue(attacker, CustomAttribute.CritChance);
if (critChanceBonus > 20)
critChanceBonus = 20;
//crit damage bonus 200%
int critDamageBonus = CustomAttributes.GetValue(attacker, CustomAttribute.CritDamage);
if (critDamageBonus > 200)
critDamageBonus = 200;
int baseCritDamage = 0;
//critChanceBonus += attacker.Luck / 100;
//critical hit attack bonus here
int baseCritChance = 0;
if (baseCritChance + critChanceBonus > Utility.Random(100) && attacker.Combatant != null && damage > 0)
{
attacker.SendMessage("You made a critical strike!");
critDamageBonus = ?????
}
[/article]