can i get some Conquer_v2 Help.

02/01/2011 05:40 taylor2846#1
ok i am trying to code the (accuracy system, miss system) what ever you want to call it how would i go about adding this system to the Source.
and what data to you use to calculate your chance of hitting/missing the target?
:handsdown:
02/01/2011 07:28 pro4never#2
Depends how you want to code it.

Personally I'm working in other stats to the calculation so I do something like...

double Chancetohit = 90;
Chancetohit -= Attacked.Dodge /2;
if(Attacker.ActiveEffects.ContainsKey(Superman))
Chancetohit = 99;
elseif(Attacker.ActiveEffects.ContainsKey(Cyclone) )
Chancetohit = 99;
Chancetohit -= Attacked.Agi / 10;
Chanceothit += Attacker.agi / 10;

return ChanceSuccess(Chancetohit);


Then in your attack code where you are targeting a player run a accuracy check. if it fails then do not continue with attack code.


personally I added in agi cause it gives people who don't just stack all points in vit a bit of a benefit yet not a great one. Say a ninja has 100 more agi than me with my lowly blade... That gives them an extra 10 percent chance to melee me and a 10 percent chance to dodge my melees (not counting wep skills here). To me I'd say that's useful seeing as they are losing out on a thousand or more hp.
02/01/2011 10:55 12tails#3
i maked that one:

Code:
        #region Boolean's
        public static bool Miss(int Percent)
        {
            if (Percent >= 100)
                return false;

            return Game.Calculations.ChanceSuccess(Percent, 100);
        }

        public static bool Miss(Entity Attacker, Entity Attacked)
        {
            if (Attacked.EntityFlag == EntityFlag.Player)
            {
                if (Attacked.ClientStats.Dodge > 0)
                {
                    Random Rand = new Random();
                    int Dodge = Attacked.ClientStats.Dodge;
                    int HitRate = (Attacker.Agility + Attacker.ClientStats.Agility);

                    if (Attacker.Buffers.Contains(Enums.SkillIDs.Accuracy))
                        HitRate = (int)(HitRate * Attacker.Buffers.Get(Enums.SkillIDs.Accuracy).Value);
                    if (Attacker.Buffers.Contains(Enums.SkillIDs.StarOfAccuracy))
                        HitRate = (int)(HitRate * Attacker.Buffers.Get(Enums.SkillIDs.StarOfAccuracy).Value);
                    if (Attacked.Buffers.Contains(Enums.SkillIDs.Dodge))
                        Dodge = (int)(Dodge * Attacked.Buffers.Get(Enums.SkillIDs.Dodge).Value);

                    return Calc_HitChance(HitRate, Dodge) < Rand.Next(100);
                }
            }

            return false;
        }
        #endregion
        #region Calculation's
        public static int Calc_HitChance(int hitrate, int dodge)
        {
            Random Rand = new Random();
            return Rand.Next(hitrate, 100 + hitrate - (dodge));
        }
        #endregion
maybe help's you....
02/02/2011 02:39 taylor2846#4
thanks you guys.
can magic miss?

and i like that agi ideal. but i was thanking conquer already did that but now i see they did not lmao i guess that is why my rb trojan always got pked so easy because i used alot of agi thanking it would help me doge atks lmao.

is it possible to have 0 agi in conquer because if so i need to add a check before i / the agi because you will get errors if you / bye 0 if i am not mistaken?
02/02/2011 10:29 Kiyono#5
Quote:
Originally Posted by taylor2846 View Post
thanks you guys.
can magic miss?

and i like that agi ideal. but i was thanking conquer already did that but now i see they did not lmao i guess that is why my rb trojan always got pked so easy because i used alot of agi thanking it would help me doge atks lmao.

is it possible to have 0 agi in conquer because if so i need to add a check before i / the agi because you will get errors if you / bye 0 if i am not mistaken?
Certain magic can miss, for example the pure fire skill.
02/03/2011 01:03 taylor2846#6
hay pro4never please take a look at my AccuracyCheck code and tell me if you no any ways to improve it.

its not 100% done i just kinda got the base of the code still need to add the if player have a Accuracy skill stuff
and what is the def between Accuracy(Xp Skill) and Accuracy(water tao skill)?
Code:
public static bool AccuracyCheck(IBaseEntity AttackerEntity, IBaseEntity OpponentEntity)
        {
            double ChanceToHit = 90;
            ChanceToHit -= OpponentEntity.Dodge / 2;
            if (AttackerEntity.EntityFlag == EntityFlag.Player)
            {
                GameClient Attacker = null;
                Attacker = AttackerEntity.Owner as GameClient;
                if ((Attacker.Entity.StatusFlag & StatusFlag.Superman) != StatusFlag.Superman)
                {
                    ChanceToHit = 99;
                }
                else if ((Attacker.Entity.StatusFlag & StatusFlag.Cyclone) != StatusFlag.Cyclone)
                {
                    ChanceToHit = 99;
                }
                ChanceToHit += Attacker.Stats.Agility / 10;
            }
            else if (AttackerEntity.EntityFlag == EntityFlag.Monster || AttackerEntity.EntityFlag == EntityFlag.Pet)
            {
                Monster Attacker = null;
                Attacker = AttackerEntity.Owner as Monster;
            }
            if (OpponentEntity.EntityFlag == EntityFlag.Player)
            {
                GameClient Opponent = null;
                Opponent = OpponentEntity.Owner as GameClient;
                ChanceToHit -= Opponent.Stats.Agility / 10;
            }
            if (Kernel.ChanceSuccess(ChanceToHit))
                return true;
            else
                return false;
        }
and the content of my ChanceSuccess is
Code:
return ((double)Random.Next(1, 1000000)) / 10000 >= 100 - Chance;
Thank you