Пример #1
0
		static string DelveStyle(GameClient clt, int id)
        {
            var style = SkillBase.GetStyleByID(id, clt.Player.CharacterClass.ID);

            var dw = new DelveWriter()
                .Begin("Style").Value("Index", id);
            
            if (style != null) {
                // Not implemented:
                // (Style (FollowupStyle "Sapphire Slash")(LevelBonus "2")(OpeningDamage "16")(Skill "1")(Expires "1343375647"))
                // (Style (Fingerprint "1746652963")(FollowupStyle "Thigh Cut")(Hidden "1")OpeningDamage "55")(Skill "118")(SpecialNumber "1511")(SpecialType "1")(Expires "1342381240"))

            	dw
            		.Value("Name", style.Name)
            		.Value("Icon", style.Icon)
            		.Value("Level", style.Level)
            		.Value("Fatigue", style.EnduranceCost)
            		//.Value("SpecialType", (int)style.SpecialType, style.SpecialType != 0)
					//.Value("SpecialNumber", GetSpecialNumber(style), GetSpecialNumber(style)!=0)
            		.Value("DefensiveMod", style.BonusToDefense, style.BonusToDefense != 0)
            		.Value("AttackMod", style.BonusToHit, style.BonusToHit != 0)
            		.Value("OpeningType", (int)style.OpeningRequirementType)
					.Value("OpeningNumber", style.OpeningRequirementValue, style.OpeningRequirementType == Style.eOpening.Positional)
					//.Value("OpeningResult",GetOpeningResult(style,clt),GetOpeningResult(style,clt)>0)
					//.Value("OpeningStyle",GetOpeningStyle(style),(Style.eAttackResult)GetOpeningResult(style,clt) == Style.eAttackResult.Style)
            		.Value("Weapon", style.GetRequiredWeaponName(), style.WeaponTypeRequirement > 0)
            		.Value("Hidden", "1",style.StealthRequirement)
            		//.Value("TwoHandedIcon", 10, style.TwoHandAnimation > 0)
					//.Value("Skill",43)
					.Value("OpeningDamage",style.GrowthRate*100,style.GrowthRate>0)
					//.Value("SpecialValue", GetSpecialValue(style),GetSpecialValue(style)!=0)
					//.Value("FollowupStyle",style.DelveFollowUpStyles,!string.IsNullOrEmpty(style.DelveFollowUpStyles))
            		;
            }
            else {
                dw.Value("Name", "(not found)");
            }
            return dw.End().ToString();
        }
Пример #2
0
		/*
		public static int GetSpecialNumber(Style style)
		{
			if (style.SpecialType == Style.eSpecialType.Effect)
			{
				Spell spell = SkillBase.GetSpellById(style.SpecialValue);
				if (spell != null)
					return spell.ClientEffect;
			}
			return 0;
		}

		public static int GetSpecialValue(Style style)
		{
			switch(style.SpecialType)
			{
				case Style.eSpecialType.ExtendedRange:
					return 128; // Extended Range für Reaver style
				case Style.eSpecialType.Taunt:
					return style.SpecialValue;
			}
			return 0;
		}*/

		
		/*public static int GetOpeningResult(Style style,GameClient clt)
		{
			switch(StyleProcessor.ResolveAttackResult(style,clt.Player.PlayerCharacter.Class))
			{
				case GameLiving.eAttackResult.Any:
					return (int)Style.eAttackResult.Any;
				case GameLiving.eAttackResult.Missed:
					return (int) Style.eAttackResult.Miss;
				case GameLiving.eAttackResult.Parried:
					return (int)Style.eAttackResult.Parry;
				case GameLiving.eAttackResult.Evaded:
					return (int)Style.eAttackResult.Evade;
				case GameLiving.eAttackResult.Blocked:
					return (int)Style.eAttackResult.Block;
				case GameLiving.eAttackResult.Fumbled:
					return (int)Style.eAttackResult.Fumble;
				case GameLiving.eAttackResult.HitStyle:
					return (int)Style.eAttackResult.Style;
				case GameLiving.eAttackResult.HitUnstyled:
					return (int)Style.eAttackResult.Hit;
			}
			return 0;
		}*/
		/*
		public static string GetOpeningStyle(Style style)
		{
			if (style.OpeningRequirementValue > 0)
			{
				Style style2 = SkillBase.GetStyleByID(style.OpeningRequirementValue);
				if (style2!=null)
					return style2.Name;
				return "";
			}
			return "";
		}*/

		#endregion

		/// <summary>
		/// Delve the realm abilities for v1.110+ clients
		/// </summary>
		/// <param name="clt"></param>
		/// <param name="id"></param>
		/// <returns></returns>
        static string DelveRealmAbility(GameClient clt, int id) {
            var dw = new DelveWriter().Begin("RealmAbility").Value("Index", id);
            var ra = clt.Player.GetNonTrainableSkillList().Cast<Skill>().Where(sk => sk.ID == id).FirstOrDefault() as RealmAbility;
            if (ra != null)
            {
                ra.AddDelve(dw);
            }
            else dw.Value("Name", "(not found)");
            return dw.ToString();
        }
Пример #3
0
        /** General info @ v1.110:
         *  - Examples can be found at http://dl.dropbox.com/u/48908369/delve.txt
         *  - 'Expires' can be left out
         *  - No idea what 'Fingerprint' does
         **/

        static string DelveAbility(GameClient clt, int id) { /* or skill */
            Skill s = clt.Player.GetNonTrainableSkillList().Cast<Skill>().Where(sk => sk.ID == id).FirstOrDefault();
            var dw = new DelveWriter().Begin(s is Ability ? "Ability" : "Skill").Value("Index", id);
            if (s != null) {
                dw.Value("Name", s.Name);
            }
            else dw.Value("Name", "(not found)");
            return dw.ToString();
        }