Ejemplo n.º 1
0
 protected virtual void Start()
 {
     _anim    = gameObject.GetComponent <Animator>();
     Keys     = gameObject.GetComponent <GenericInput>();
     Stats    = gameObject.GetComponent <GenericStats>();
     Movement = gameObject.GetComponent <GenericMovement>();
 }
Ejemplo n.º 2
0
        public void Initialize()
        {
            if (this.myInitialized)
            {
                return;
            }

            this.mySpells = SpellBook.GenerateForPrisme();

            this.myFightStats = new GenericStats();
            this.myFightStats.AddBase(EffectEnum.AddForce, 1000 + 300 * Level);
            this.myFightStats.AddBase(EffectEnum.AddSagesse, 1000 + 300 * Level);
            this.myFightStats.AddBase(EffectEnum.AddIntelligence, 1000 + 300 * Level);
            this.myFightStats.AddBase(EffectEnum.AddChance, 1000 + 300 * Level);
            this.myFightStats.AddBase(EffectEnum.AddAgilite, 1000 + 300 * Level);
            this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentNeutre, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentFeu, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentEau, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentAir, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddReduceDamagePourcentTerre, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddEsquivePA, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddEsquivePM, 9 * Level);
            this.myFightStats.AddBase(EffectEnum.AddPA, 12);
            this.myFightStats.AddBase(EffectEnum.AddPM, 0);
            this.myFightStats.AddBase(EffectEnum.AddVitalite, 10000);

            this.myInitialized = true;
        }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     stats = new GenericStats("Blue", 1200, 150);
     Blue.addChild(blueTurnChecker);
     blueAttackBoss.addChild(blueMoveToBoss);
     blueAttackBoss.addChild(blueReturnHome);
     blueAttackBoss.addChild(blueTurnEnd);
     Blue.addChild(blueAttackBoss);
 }
Ejemplo n.º 4
0
        public GenericStats GenerateStats(bool Max = false)
        {
            var GeneratedStats = new GenericStats();

            if (StatsTemplate == string.Empty) // aucun stats
            {
                return(GeneratedStats);
            }

            // On initialise si c'est pas deja fait
            if (this.myRandomStats == null)
            {
                this.myRandomStats = new Dictionary <int, RandomJet>();

                foreach (var Effect in this.StatsTemplate.Split(','))
                {
                    var effectDatas  = Effect.Split('#');
                    var effectId     = int.Parse(effectDatas[0], System.Globalization.NumberStyles.HexNumber);
                    var effectMinJet = int.Parse(effectDatas[1], System.Globalization.NumberStyles.HexNumber);
                    var effectMaxJet = int.Parse(effectDatas[2], System.Globalization.NumberStyles.HexNumber);
                    if (IsWeaponEffect((EffectEnum)effectId))
                    {
                        int Min  = int.Parse(effectDatas[1], System.Globalization.NumberStyles.HexNumber);
                        int Maxx = int.Parse(effectDatas[2], System.Globalization.NumberStyles.HexNumber);

                        string Args  = Min + ";" + Maxx + ";-1;-1;0;" + effectDatas[4];
                        int    Value = 0;
                        if (effectDatas.Length > 4)
                        {
                            Value = int.Parse(effectDatas[4].Split('+')[1]);
                        }
                        try
                        {
                            GeneratedStats.AddWeaponEffect((EffectEnum)effectId, Min, Maxx, Args, Value);
                        }
                        catch (System.ArgumentException e1)
                        {
                            Logger.Error("Item " + ID + " has Double WeaponEffectID " + (EffectEnum)effectId);
                            continue;
                        }
                        continue;
                    }
                    this.myRandomStats.Add(effectId, new RandomJet(effectId, effectMinJet, effectMaxJet));
                }
            }

            // On recupere des jets au hasard
            foreach (var Effect in this.myRandomStats.Values)
            {
                //if (IsWeaponEffect((EffectEnum)Effect.EffectId))
                //  continue;

                GeneratedStats.AddItem((EffectEnum)Effect.EffectId, Max ? (Effect.Max == 0 ? Effect.Min : Effect.Max) : Effect.GetRandomJet());
            }

            return(GeneratedStats);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public GenericStats GetStatistics()
        {
            var statistics = new GenericStats();

            foreach (var effect in Template.RandomEffects)
            {
                statistics.AddEffect(effect.Type, effect.Random * Level);
            }
            return(statistics);
        }
Ejemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     stats = new GenericStats("Boss", 10000, 210);
     Boss.addChild(BossTurnCheker);
     BossAttackEnemy.addChild(BossTarget);
     BossAttackEnemy.addChild(BossMoveToEnemy);
     BossAttackEnemy.addChild(BossReturnHome);
     BossAttackEnemy.addChild(BossturnEnd);
     Boss.addChild(BossAttackEnemy);
 }
Ejemplo n.º 7
0
 public Statistics(ActiveTime reference)
 {
     Stats                       = new GenericStats();
     Stats.Activity              = new ActiveTime(reference);
     Stats.ActivityPerHour       = new TimePerHour();
     KeyboardStatistics          = new KeyboardStatistics(Stats.Activity, Stats.ActivityPerHour);
     MouseStatistics             = new MouseStatistics(Stats.Activity, Stats.ActivityPerHour, SystemParameters.VirtualScreenWidth / SystemParameters.VirtualScreenHeight);
     Stats.InterruptionsPerHour  = new CountPerHour();
     Stats.WindowSwitchesPerHour = new CountPerHour();
 }
Ejemplo n.º 8
0
        private void ParseStats()
        {
            this.myStats = new GenericStats(this);

            string[] StatsArray = this.Effects.Split(',');

            foreach (string StatsRow in StatsArray)
            {
                try
                {
                    string[]   Stats   = StatsRow.Split('#');
                    EffectEnum StatsId = (EffectEnum)HexToInt(Stats[0]);

                    if ((int)StatsId == 997 || (int)StatsId == 996)
                    {
                        this.myStats.AddSpecialEffect(StatsId, Stats[4]);

                        continue;
                    }

                    //Si stats avec Texte (Signature, apartenance, etc)
                    if (StatsId == EffectEnum.LivingType || (!Stats[3].Equals("") && !Stats[3].Equals("0")))
                    {
                        this.myStats.AddSpecialEffect(StatsId, Stats[3]);
                        continue;
                    }

                    string Jet = Stats[4];

                    if (ItemTemplateModel.IsWeaponEffect(StatsId))
                    {
                        int Min = int.Parse(Stats[1], System.Globalization.NumberStyles.HexNumber);
                        int Max = int.Parse(Stats[2], System.Globalization.NumberStyles.HexNumber);

                        string Args  = Min + ";" + Max + ";-1;-1;0;" + Jet;
                        int    Value = 0;
                        if (Stats.Length > 4)
                        {
                            Value = int.Parse(Stats[4].Split('+')[1]);
                        }

                        this.myStats.AddWeaponEffect(StatsId, Min, Max, Args, Value);
                    }
                    else
                    {
                        int value = HexToInt(Stats[1]);
                        this.myStats.AddItem(StatsId, value);
                    }
                }
                catch (Exception e)
                {
                }
            }
        }
Ejemplo n.º 9
0
	void Start () {
		_gm = GameManager.Instance;
		anim = GetComponent<Animator> ();
		stats = GetComponent<GenericStats> ();

		if (attacks == null || attacks.Length < 1) {
			attacks = new Attack[3];
			attacks [0] = ScriptableObject.CreateInstance ("Punch") as Punch;
			attacks [1] = ScriptableObject.CreateInstance ("Uppercut") as Uppercut;
			attacks [2] = ScriptableObject.CreateInstance ("Kick") as Kick;
		}
	}
Ejemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="monsterGrade"></param>
        /// <param name="invocator"></param>
        /// <param name="staticInvocation"></param>
        public MonsterEntity(long id, MonsterGradeDAO monsterGrade, AbstractFighter invocator = null, bool staticInvocation = false)
            : base(EntityTypeEnum.TYPE_MONSTER_FIGHTER, id, staticInvocation)
        {
            Grade = monsterGrade;

            Statistics = new GenericStats(monsterGrade);
            SpellBook  = SpellBookFactory.Instance.Create(this);

            RealLife  = MaxLife;
            SkinSize  = SkinSizeBase;
            Invocator = invocator;
        }
Ejemplo n.º 11
0
        public MonsterFighter(Monster monster, Fight fight, int nId)
            : base(FighterType.MONSTER, fight)
        {
            myMonster = monster;
            id        = nId;

            stats = new GenericStats();
            life  = monster.Life;
            stats.GetStat(StatEnum.Vitalite).Base = monster.Life;
            stats.GetStat(StatEnum.MaxPA).Base    = monster.MonsterLevel.AP;
            stats.GetStat(StatEnum.MaxPM).Base    = monster.MonsterLevel.MP;
        }
Ejemplo n.º 12
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        Keys              = gameObject.GetComponent <GenericInput>();
        Stats             = gameObject.GetComponent <GenericStats>();
        Anim              = gameObject.GetComponent <GenericAnimator>();
        _rb               = gameObject.GetComponent <Rigidbody>();
        ItemD             = gameObject.GetComponentInChildren <GrabDetector>();
        GlobalOrientation = GameObject.Find("GlobalOri").transform;

        Keys.ActivateGrav = true;
        Stats.Friction    = 1;
        Stats.GravScale   = 1;
    }
Ejemplo n.º 13
0
        protected void InitFighter(GenericStats StatsToMerge, long ActorId, int Skin, bool setLifeMax = true)
        {
            this.Stats = new GenericStats();
            this.Stats.Merge(StatsToMerge);

            this.ActorId  = ActorId;
            this.Skin     = Skin;
            this.SkinSize = 100;
            if (setLifeMax)
            {
                this.Life = MaxLife;
            }
        }
Ejemplo n.º 14
0
        public static GenericStats getMountStats(int color, int lvl)
        {
            GenericStats stats = new GenericStats();
            List <Couple <int, Double> > statsNbr = StatsByMount[color];

            if (statsNbr != null)
            {
                foreach (Couple <int, Double> stat in statsNbr)
                {
                    //if (0 > (int)(lvl / stat.second)) continue;
                    stats.AddItem((EffectEnum)stat.first, (int)(lvl / stat.second));
                }
            }
            return(stats);
        }
Ejemplo n.º 15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="effects"></param>
        private void AddStats(string effects)
        {
            var stats = new GenericStats();

            if (effects != string.Empty)
            {
                foreach (var effect in effects.Split(';'))
                {
                    var data     = effect.Split(',');
                    var effectId = int.Parse(data[0]);
                    var value    = int.Parse(data[1]);
                    stats.AddEffect((EffectEnum)effectId, value);
                }
            }
            m_statistics.Add(stats);
        }
Ejemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ItemDAO Create(int templateId, long ownerId, int quantity, GenericStats statistics, ItemSlotEnum slot = ItemSlotEnum.SLOT_INVENTORY)
        {
            var instance = new ItemDAO();

            instance.Id            = NextItemId;
            instance.OwnerId       = -1;
            instance.TemplateId    = templateId;
            instance.Quantity      = quantity;
            instance.Effects       = statistics.Serialize();
            instance.StringEffects = statistics.ToItemStats();
            instance.SlotId        = (int)slot;

            base.Created(instance);

            return(instance);
        }
Ejemplo n.º 17
0
 public Mount(int color)
 {
     ID           = DatabaseCache.nextMountId++;
     Color        = color;
     Level        = 1;
     Exp          = 0;
     Name         = "SansNom";
     Fatigue      = 0;
     Energy       = getMaxEnergie();
     Reproduction = 0;
     Maturite     = getMaxMatu();
     Serenite     = 0;
     myStats      = StaticMountTable.getMountStats(Color, Level);
     Ancestres    = ",,,,,,,,,,,,,";
     MountTable.Add(this);
     itemList = "";
 }
Ejemplo n.º 18
0
        /// <summary>
        ///
        /// </summary>
        public TaxCollectorEntity(GuildInstance guild, TaxCollectorDAO record)
            : base(EntityTypeEnum.TYPE_TAX_COLLECTOR, record.Id)
        {
            DatabaseRecord = record;
            Guild          = guild;

            MapId  = DatabaseRecord.MapId;
            CellId = DatabaseRecord.CellId;

            Defenders   = new List <GuildMember>();
            FarmedItems = new Dictionary <int, int>();

            Statistics = new GenericStats();
            Statistics.Merge(guild.Statistics.BaseStatistics);
            SpellBook = SpellBookFactory.Instance.Create(this);
            Storage   = new TaxCollectorInventory(this);
        }
Ejemplo n.º 19
0
        public void Initialize()
        {
            if (myInitialized)
            {
                return;
            }

            Items = new List <ItemTemplateModel>();

            foreach (String str in StringItems.Split(','))
            {
                try
                {
                    Items.Add(ItemTemplateTable.GetTemplate(int.Parse(str)));
                }
                catch (NullReferenceException e) { Logger.Error("Item " + str + " Introuvable dans la panoplie " + ID); }
                catch (FormatException e) { Logger.Error("Echoue lors de la convertion de l'item " + str); }
            }

            Stats = new List <GenericStats>();
            foreach (String str in StringBonus.Split(';'))
            {
                var stats = new GenericStats();

                foreach (String str2 in str.Split(','))
                {
                    try
                    {
                        String[] infos = str2.Split(':');
                        if (infos.Length < 2)
                        {
                            continue;
                        }
                        stats.AddItem((EffectEnum)int.Parse(infos[0], NumberStyles.Number, CultureInfo.InvariantCulture), int.Parse(infos[1], NumberStyles.Number, CultureInfo.InvariantCulture));
                    }
                    catch (FormatException e) { Logger.Error(str2.Split(':')[0] + "|" + str2.Split(':')[1] + ""); }
                }
                Stats.Add(stats);
            }
            myInitialized = true;
        }
Ejemplo n.º 20
0
        public Character()
        {
            Zaaps = new List <int>();

            Stats           = new GenericStats(this);
            ItemsInventary  = new InventaryItems(this);
            SpellsInventary = new InventarySpells(this);
            Faction         = new CharacterFaction(this);
            Jobs            = new CharacterJobs(this);

            Channels = new CharacterChannels(this);
            Friends  = new CharacterFriends(this);
            Enemies  = new CharacterEnemies(this);

            Energy             = 10000;
            IsConnected        = false;
            IsDeletedCharacter = false;

            quotaRecruitment = 0;
            quotaTrade       = 0;
        }
Ejemplo n.º 21
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public GenericStats GenerateStats(bool max = false)
        {
            var generatedStats = new GenericStats();

            foreach (var effect in RandomEffects)
            {
                if (Usable || IsWeaponEffect(effect.Type))
                {
                    generatedStats.AddEffect(effect.Type, effect.Minimum, effect.Maximum);
                }
                else if (effect.Type == EffectEnum.AddBoost)
                {
                    generatedStats.AddEffect(effect.Type, 0, 0, max ? effect.Maximum : effect.Random);
                }
                else
                {
                    generatedStats.AddEffect(effect.Type, max ? effect.Maximum : effect.Random);
                }
            }
            return(generatedStats);
        }
Ejemplo n.º 22
0
        public void Intialize()
        {
            if (myIntialized)
            {
                return;
            }

            myStats = StaticMountTable.getMountStats(Color, Level);
            foreach (String str in itemList.Split(';'))
            {
                try
                {
                    if (String.IsNullOrEmpty(str))
                    {
                        continue;
                    }
                    long idd;
                    if (!long.TryParse(str, out idd))
                    {
                        continue;
                    }
                    InventoryItemModel obj = InventoryItemTable.getItem(idd);
                    if (obj != null)
                    {
                        Items.Add(obj);
                    }
                    else
                    {
                        obj = InventoryItemTable.Load(idd);
                        if (obj != null)
                        {
                            Items.Add(obj);
                        }
                    }
                }
                catch (Exception e) { continue; }
            }

            myIntialized = true;
        }
Ejemplo n.º 23
0
        public static void ProcessBoostStatsRequest(WorldClient Client, string Packet)
        {
            int StatsId = 0, capital = 1;

            if (!int.TryParse(Packet.Substring(2, 2), out StatsId))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            var EffectType = EffectEnum.None;

            if (!CharacterHandler.BOOST_ID_TO_STATS.TryGetValue(StatsId, out EffectType))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            var Character = Client.Character;

            var StatsValue = Character.GetStats().GetEffect(EffectType).Base;
            var BoostValue = StatsId == 11 && (ClassEnum)Character.Classe == ClassEnum.CLASS_SACRIEUR ? 2 : 1;

            if (Settings.AppSettings.GetBoolElement("Extra.ElbustCore"))
            {
                try
                {
                    capital = int.Parse(Packet.Split(';')[1]);
                    int quantite = 0;
                    if (capital > Client.Character.CaractPoint)
                    {
                        capital = Client.Character.CaractPoint;
                    }
                    while (capital >= quantite)
                    {
                        StatsValue = Character.GetStats().GetEffect(EffectType).Base;
                        quantite   = GenericStats.GetRequiredStatsPoint((ClassEnum)Character.Classe, StatsId, StatsValue);
                        if (capital >= quantite)
                        {
                            lock (Client.BoostStatsSync)
                            {
                                switch (EffectType)
                                {
                                case EffectEnum.AddForce:
                                    Character.Strength += BoostValue;
                                    break;

                                case EffectEnum.AddVitalite:
                                    Character.Vitality += BoostValue;
                                    Character.Life     += BoostValue; // on boost la life
                                    break;

                                case EffectEnum.AddSagesse:
                                    Character.Wisdom += BoostValue;
                                    break;

                                case EffectEnum.AddIntelligence:
                                    Character.Intell += BoostValue;
                                    break;

                                case EffectEnum.AddChance:
                                    Character.Chance += BoostValue;
                                    break;

                                case EffectEnum.AddAgilite:
                                    Character.Agility += BoostValue;
                                    break;
                                }
                                Character.GetStats().AddBase(EffectType, BoostValue);
                                Character.CaractPoint -= quantite;
                                capital -= quantite;
                            }
                        }
                    }
                    Client.Send(new AccountStatsMessage(Client.Character));
                    return;
                }
                catch (Exception e)
                {
                }
            }

            var RequiredStatsPoints = GenericStats.GetRequiredStatsPoint((ClassEnum)Character.Classe, StatsId, StatsValue);

            if (Character.CaractPoint < RequiredStatsPoints)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }


            lock (Client.BoostStatsSync)
            {
                switch (EffectType)
                {
                case EffectEnum.AddForce:
                    Character.Strength += BoostValue;
                    break;

                case EffectEnum.AddVitalite:
                    Character.Vitality += BoostValue;
                    Character.Life     += BoostValue; // on boost la life
                    break;

                case EffectEnum.AddSagesse:
                    Character.Wisdom += BoostValue;
                    break;

                case EffectEnum.AddIntelligence:
                    Character.Intell += BoostValue;
                    break;

                case EffectEnum.AddChance:
                    Character.Chance += BoostValue;
                    break;

                case EffectEnum.AddAgilite:
                    Character.Agility += BoostValue;
                    break;
                }

                Character.GetStats().AddBase(EffectType, BoostValue);
                Character.CaractPoint -= RequiredStatsPoints;
            }

            Client.Send(new AccountStatsMessage(Client.Character));
        }
Ejemplo n.º 24
0
 public void ClearStats()
 {
     this.myStats = new GenericStats();
 }
Ejemplo n.º 25
0
        private static void ProcessExchangeMountParkRequest(WorldClient Client, string Packet)
        {
            MountPark MP = Client.Character.inMountPark;

            if (MP != null)
            {
                char c = Packet[2];
                Packet = Packet.Substring(3);
                int guid = -1;
                try
                {
                    guid = int.Parse(Packet);
                }
                catch (Exception e)
                {
                };
                switch (c)
                {
                case 'C':    //Parcho => Etable (Stocker)
                    if (guid == -1 || !Client.Character.InventoryCache.hasItemGuid(guid))
                    {
                        return;
                    }
                    InventoryItemModel obj = Client.Character.InventoryCache.GetItem(guid);

                    //on prend la DD demandée
                    int   DDid = -1;
                    Mount DD   = null;
                    if (obj.GetStats().HasEffect(EffectEnum.MountOwner))
                    {
                        DDid = obj.GetStats().GetEffect(EffectEnum.MountOwner).Items;
                        DD   = MountTable.getMount(DDid);
                    }
                    //FIXME mettre return au if pour ne pas créer des nouvelles dindes
                    if (DD == null)
                    {
                        int color = StaticMountTable.getMountColorByParchoTemplate(obj.TemplateID);
                        if (color < 1)
                        {
                            return;
                        }
                        DD = new Mount(color);
                    }
                    DD.Intialize();

                    //On enleve l'Item du Monde et du Perso
                    Client.Character.InventoryCache.remove(guid);
                    InventoryItemTable.removeItem(guid);
                    //on ajoute la dinde a l'étable
                    Client.Account.Data.Mounts.Add(DD.ID, DD);
                    Client.Account.Data.Save();

                    //On envoie les Packet
                    Client.Send(new ObjectRemoveMessage(obj.ID));
                    Client.Send(new ExchangeEndMessage('+', DD.parse()));
                    break;

                case 'c':    //Etable => Parcho(Echanger)
                    Mount DD1 = MountTable.getMount(guid);
                    //S'il n'a pas la dinde
                    if (!Client.Account.Data.Mounts.ContainsKey(DD1.ID) || DD1 == null)
                    {
                        return;
                    }
                    //on retire la dinde de l'étable
                    Client.Account.Data.Mounts.Remove(DD1.ID);

                    GenericStats Stat = new GenericStats();
                    Stat.AddItem(EffectEnum.MountOwner, DD1.ID);
                    Stat.AddSpecialEffect(EffectEnum.MountOwnerName, Client.Character.Name);
                    Stat.AddSpecialEffect(EffectEnum.MountName, DD1.Name);

                    var item = InventoryItemTable.TryCreateItem(StaticMountTable.getMountScroll(DD1.get_color()).ID, Client.Character, 1, -1, Stat.ToItemStats());

                    Client.Send(new ExchangeEndMessage('-', DD1.ID + ""));
                    Stat = null;
                    break;

                case 'g':    //Equiper
                    Mount DD3 = MountTable.getMount(guid);
                    //S'il n'a pas la dinde
                    if (DD3 == null || !Client.Account.Data.Mounts.ContainsKey(DD3.ID) || Client.Character.Mount != null)
                    {
                        return;
                    }
                    DD3.Intialize();
                    Client.Account.Data.Mounts.Remove(DD3.ID);
                    Client.Account.Data.Save();
                    Client.Character.Mount = DD3;

                    //Packets
                    Client.Send(new CharacterRideEventMessage("+", DD3));
                    Client.Send(new ExchangeEndMessage('-', DD3.ID + ""));
                    Client.Send(new CharacterMountXpGive(Client.Character.MountXPGive));
                    break;

                case 'p':    //Equipé => Stocker
                    //Si c'est la dinde équipé
                    if (Client.Character.Mount != null ? Client.Character.Mount.ID == guid : false)
                    {
                        //Si le perso est sur la monture on le fait descendre
                        if (Client.Character.isOnMount())
                        {
                            Client.Character.toogleOnMount();
                        }
                        //Si ca n'a pas réussie, on s'arrete là (Items dans le sac ?)
                        if (Client.Character.isOnMount())
                        {
                            return;
                        }

                        Mount DD2 = Client.Character.Mount;
                        DD2.Intialize();
                        Client.Account.Data.Mounts.Add(DD2.ID, DD2);
                        Client.Account.Data.Save();
                        Client.Character.Mount = null;

                        //Packets
                        Client.Send(new ExchangeEndMessage('+', DD2.parse()));
                        Client.Send(new CharacterRideEventMessage("-", null));
                        Client.Send(new CharacterMountXpGive(Client.Character.MountXPGive));
                    }
                    else    //Sinon...
                    {
                    }
                    break;
                }
            }
            else
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }
        }
Ejemplo n.º 26
0
 // Start is called before the first frame update
 protected virtual void Start()
 {
     GenericMov  = gameObject.GetComponent <GenericMovement>();
     Stats       = gameObject.GetComponent <GenericStats>();
     checkGround = true;
 }
Ejemplo n.º 27
0
 // Start is called before the first frame update
 protected override void Start()
 {
     Playerkeys = gameObject.GetComponent <GenericStats>();
     base.Start();
 }
Ejemplo n.º 28
0
    private void Awake()
    {
        stats = new GenericStats(Random.Range(1, 3), Random.Range(1, 3));

        healthKeeper = (HealthKeeper)FindObjectOfType <HealthKeeper>();
    }
Ejemplo n.º 29
0
 public void levelUp()
 {
     Level++;
     myStats = StaticMountTable.getMountStats(Color, Level);
 }
Ejemplo n.º 30
0
        private void Initialize()
        {
            this.myStats = new GenericStats(this);
            for (int i = 1; i < 16; i++)
            {
                var Item = this.InventoryCache.GetItemInSlot((ItemSlotEnum)i);

                if (Item != null)
                {
                    this.myStats.Merge(Item.GetStats());
                    this.Life += Item.GetStats().GetTotal(EffectEnum.AddVitalite);
                }
            }
            if (this.ZaapString != null)
            {
                foreach (String str in ZaapString.Split(','))
                {
                    short zaap;
                    if (!short.TryParse(str, out zaap))
                    {
                        continue;
                    }
                    try
                    {
                        Zaaps.Add(zaap);
                    }
                    catch (Exception e)
                    {
                        Logger.Error(e);
                    }
                }
            }
            else
            {
                if (Settings.AppSettings.GetBoolElement("World.AllZaap"))
                {
                    foreach (short map in ZaapTable.Cache.Keys)
                    {
                        this.Zaaps.Add(map);
                    }
                }
            }

            if (this.MountID != -1)
            {
                Mount = MountTable.getMount(this.MountID);
                if (Mount != null)
                {
                    Mount.Intialize();
                }
            }

            if (this.SpellString == null || this.SpellString == "")
            {
                this.mySpells = SpellBook.GenerateForBreed((ClassEnum)this.Classe);
                for (int i = 1; i < Client.GetCharacter().Level; i++)
                {
                    this.mySpells.GenerateLevelUpSpell((ClassEnum)Client.GetCharacter().Classe, i);
                }
                Client.Send(new BasicNoOperationMessage());
                Client.Send(new SpellsListMessage(Client.Character));
            }
            else
            {
                this.mySpells = SpellBook.FromDatabase(this.SpellString);
            }

            if (LifePer <= 0)
            {
                LifePer = 1;
            }

            Life = (MaxLife * LifePer / 100);
            if (Life == 0)
            {
                Life = 1;
            }
            _exPdv = Life;

            this.myInitialized = true;
        }
Ejemplo n.º 31
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="character"></param>
        /// <param name="message"></param>
        private void BoostStats(CharacterEntity character, string message)
        {
            var statId = 0;

            if (!int.TryParse(message.Substring(2), out statId))
            {
                character.SafeDispatch(WorldMessage.BASIC_NO_OPERATION());
                return;
            }

            if (!m_statById.ContainsKey(statId))
            {
                character.SafeDispatch(WorldMessage.BASIC_NO_OPERATION());
                return;
            }

            character.AddMessage(() =>
            {
                var effect        = m_statById[statId];
                var actualValue   = character.Statistics.GetEffect(effect).Base;
                var boostValue    = statId == 11 && character.Breed == CharacterBreedEnum.BREED_SACRIEUR ? 2 : 1;
                var requiredPoint = GenericStats.GetRequiredStatsPoint(character.Breed, statId, actualValue);

                if (character.CaractPoint < requiredPoint)
                {
                    character.Dispatch(WorldMessage.BASIC_NO_OPERATION());
                    return;
                }

                character.CaractPoint -= requiredPoint;

                switch (effect)
                {
                case EffectEnum.AddStrength:
                    character.DatabaseRecord.Strength += boostValue;
                    break;

                case EffectEnum.AddVitality:
                    character.DatabaseRecord.Vitality += boostValue;
                    break;

                case EffectEnum.AddWisdom:
                    character.DatabaseRecord.Wisdom += boostValue;
                    break;

                case EffectEnum.AddIntelligence:
                    character.DatabaseRecord.Intelligence += boostValue;
                    break;

                case EffectEnum.AddAgility:
                    character.DatabaseRecord.Agility += boostValue;
                    break;

                case EffectEnum.AddChance:
                    character.DatabaseRecord.Chance += boostValue;
                    break;
                }

                character.Statistics.AddBase(effect, boostValue);
                character.Dispatch(WorldMessage.ACCOUNT_STATS(character));
            });
        }