wow nice! you keep popping out tons of useful little features =) Thanks a ton ! Will test tonight!
*edit
one little thing that would make it look cleaner is put a space between the name and value. i.e: To Hit: Low instead of To Hit:Low ... but that is just alittle suggestion =)
most had the spaces but i know what you mean x) i like them clean-cut like that too,
so i was reviewing it and im pretty sure gonna need pre-checks on Opening and Weapon type
BTW! the screenshot is from a normal style off valewalkers currently thats not handled with StyleHandler xP so the no spaces in it are alrdy coded in the SVN
- Code: Select all
[SpellHandlerAttribute("StyleHandler")]
public class StyleHandler : MasterlevelHandling
{
public override IList DelveInfo
{
get
{
GamePlayer player = Caster as GamePlayer;
Style style = SkillBase.GetStyleByID((int)m_spell.Value, player.CharacterClass.ID);
Style OpenStyle = SkillBase.GetStyleByID(style.OpeningRequirementValue, player.CharacterClass.ID);
ArrayList list = new ArrayList();
//Weapon Type
list.Add("Weapon Type: " + style.WeaponTypeRequirement);
//Opening
if ((int)style.OpeningRequirementType == 1 && (int)style.AttackResultRequirement == 5)
{
list.Add("Opening: You Evade");
}
if ((int)style.OpeningRequirementType == 1 && (int)style.AttackResultRequirement == 4)
{
list.Add("Opening: You Block");
}
if ((int)style.OpeningRequirementType == 1 && (int)style.AttackResultRequirement == 3)
{
list.Add("Opening: You Parry");
}
if ((int)style.OpeningRequirementType == 2)
{
list.Add("Opening: Positional(Back)");//Current SVN entry
}
if ((int)style.OpeningRequirementType == 2 && (int)style.AttackResultRequirement == 1)
{
list.Add("Opening: Positional(Side)");//Current SVN entry
}
if ((int)style.OpeningRequirementType == 2 && (int)style.AttackResultRequirement == 2)
{
list.Add("Opening: Positional(Front)");//Current SVN entry
}
if (style.OpeningRequirementValue == OpenStyle.ID && (int)style.AttackResultRequirement == 7)
{
list.Add("Opening Style: " + OpenStyle.Name);
}
if (style.OpeningRequirementValue == 0 && (int)style.OpeningRequirementType == 0 && (int)style.AttackResultRequirement == 0)
{
list.Add("Opening: Any");//Current SVN entry
}
//Followup Style ---Def. incorrect check
if (style.OpeningRequirementValue == OpenStyle.ID)
{
list.Add("Followup Style: " + style.Name);
}
//Fatigue Cost
if (style.EnduranceCost <= 5)
{
list.Add("Fatigue Cost: Very Low");
}
if (style.EnduranceCost > 5 && style.EnduranceCost <= 10)
{
list.Add("Fatigue Cost: Low");
}
if (style.EnduranceCost > 10 && style.EnduranceCost <= 20)
{
list.Add("Fatigue Cost: Medium");
}
if (style.EnduranceCost > 20)
{
list.Add("Fatigue Cost: High");
}
//Damage
if (style.GrowthRate == 0)
{
list.Add("Damage: No Bonus");
}
if (style.GrowthRate != 0)
{
list.Add("Damage: " + style.GrowthRate);
}
//To Hit
if (style.BonusToHit == 0)
{
list.Add("To Hit: No Bonus");
}
if (style.BonusToHit <= 5 && style.BonusToHit != 0)
{
list.Add("To Hit: Low Bonus");
}
if (style.BonusToHit > 5 && style.BonusToHit <= 10)
{
list.Add("To Hit: Medium Bonus");
}
if (style.BonusToHit > 10 && style.BonusToHit <= 15)
{
list.Add("To Hit: High Bonus");
}
if (style.BonusToHit > 15)
{
list.Add("To Hit: Very High Bonus");
}
//Defense
if (style.BonusToDefense <= -5 && style.BonusToDefense != 0)
{
list.Add("Defense: Low Penalty");
}
if (style.BonusToDefense > -5 && style.BonusToDefense <= -10)
{
list.Add("Defense: Medium Penalty");
}
if (style.BonusToDefense > -10 && style.BonusToDefense <= -15)
{
list.Add("Defense: High Penalty");
}
if (style.BonusToDefense > -15)
{
list.Add("Defense: Very High Penalty");
}
if (style.BonusToDefense == 0)
{
list.Add("Defense: No Bonus");
}
if (style.BonusToDefense <= 5 && style.BonusToDefense != 0)
{
list.Add("Defense: Low Bonus");
}
if (style.BonusToDefense > 5 && style.BonusToDefense <= 10)
{
list.Add("Defense: Medium Bonus");
}
if (style.BonusToDefense > 10 && style.BonusToDefense <= 15)
{
list.Add("Defense: High Bonus");
}
if (style.BonusToDefense > 15)
{
list.Add("Defense: Very High Bonus");
}
return list;
}
}
public StyleHandler(GameLiving caster, Spell spell, SpellLine line) : base(caster, spell, line) { }
}
so far i found these requirements using camelotherald and DB
Evade: OpeningRequirementType = 1, AttackResultRequirement = 5
Block: OpeningRequirementType = 1, AttackResultRequirement = 4
Parry: OpeningRequirementType = 1, AttackResultRequirement = 3
Behind: OpeningRequirementType = 2
Side: OpeningRequirementType = 2, OpeningRequirementValue = 1
Front: OpeningRequirementType = 2, OpeningRequirementValue = 2
think the onlying ones im missing is Target Blocks/Target Parries , dont think theres a target evades though...
EDIT: added alot more code in there i need some things checked like opening style and Pentaly checks in defense i dont no if i go opposite or position cause its a negative....can't test it lol but just let me know
EDIT 2: gonna need a second eye on Followup i know its incorrect, and still working on a method to get Opening Style: Any correctly, like
- Code: Select all
if (style.ID != OpenStyle.ID && style.OpeningRequirementValue == 0 && (int)style.OpeningRequirementType == 0 && (int)style.AttackResultRequirement == 0)
{
list.Add("Opening: Any");//Current SVN entry
}
EDIT 3: added this after the Defense check right under for the proc check
- Code: Select all
#region Style Proc
//Style Proc check
foreach (DBStyleXSpell proc in style.Procs)
{
// RR4: we added all the procs to the style, now it's time to check for class ID
if (proc.ClassID != 0 && proc.ClassID != player.CharacterClass.ID) continue;
Spell spell = SkillBase.GetSpellByID(proc.SpellID);
if (spell != null)
{
list.Add("Target Effect:");
list.Add(spell.Name);
list.Add("");
//SpellType
list.Add("Function: " + spell.SpellType);
list.Add("");
//Description
list.Add(spell.Description);
list.Add("");
//Damage
if (spell.Damage != 0)
{
list.Add("Damage: " + spell.Damage);
}
//Value
if (spell.Value != 0)
{
list.Add("Value: " + spell.Value);
}
//Target
list.Add("Target: " + spell.Target);
//Range
if (spell.Range != 0)
{
list.Add("Range: " + spell.Range);
}
//Radius
if (spell.Radius != 0)
{
list.Add("Radius: " + spell.Radius);
}
//Cost
if (spell.Power != 0)
{
list.Add("Power cost: " + Spell.Power.ToString("0;0'%'"));
}
//Duration
if (Spell.Duration >= ushort.MaxValue * 1000)
list.Add("Duration: Permanent.");
else if (Spell.Duration > 60000)
list.Add(string.Format("Duration: {0}:{1} min", Spell.Duration / 60000, (Spell.Duration % 60000 / 1000).ToString("00")));
else if (Spell.Duration != 0)
list.Add("Duration: " + (Spell.Duration / 1000).ToString("0' sec';'Permanent.';'Permanent.'"));
//Frequency
if (Spell.Frequency != 0)
{
list.Add("Frequency: " + (Spell.Frequency * 0.001).ToString("0.0"));
}
//Cast
if (Spell.CastTime < 0.1)
list.Add("Casting time: Instant");
else if (Spell.CastTime > 0)
list.Add("Casting time: " + (Spell.CastTime * 0.001).ToString("0.0## sec;-0.0## sec;'instant'"));
//DamageType
if (spell.DamageType != eDamageType.Natural)
{
list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "DelveInfo.Damage", GlobalConstants.DamageTypeToName(spell.DamageType)));
}
}
}
#endregion