Exemplo n.º 1
0
        public bool BoostStats(CharacterGuild Player, char Stats)
        {
            if (Player.Can(GuildRightEnum.RIGHT_BOOST))
            {
                switch (Stats)
                {
                case 'p':     // Prospection.
                    if (this.Capital > 0)
                    {
                        if (this.myStats.GetTotal(EffectEnum.AddProspection) < 500)
                        {
                            this.myStats.AddBase(EffectEnum.AddProspection, 1);
                            this.Capital--;
                        }
                    }
                    break;

                case 'x':     // Sagesse.
                    if (this.Capital > 0)
                    {
                        if (this.myStats.GetTotal(EffectEnum.AddSagesse) < 400)
                        {
                            this.myStats.AddBase(EffectEnum.AddSagesse, 1);
                            this.Capital--;
                        }
                    }
                    break;

                case 'o':     // Pods
                    if (this.Capital > 0)
                    {
                        if (this.myStats.GetTotal(EffectEnum.AddPods) < 5000)
                        {
                            this.myStats.AddBase(EffectEnum.AddPods, 20);
                            this.Capital--;
                        }
                    }
                    break;

                case 'k':     // PerceptorCount.
                    if (this.Capital > 9)
                    {
                        if (this.PerceptorMaxCount < 50)
                        {
                            this.PerceptorMaxCount++;
                            this.Capital -= 10;
                        }
                    }
                    break;

                default:     // UNKNOW STATS ID
                    return(false);
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public void AddPlayer(CharacterGuild Player, GuildGradeEnum Grade)
        {
            this.CharactersGuildCache.Add(Player);

            Player.OnResetRights();

            Player.SetGuild(this, Grade);
        }
Exemplo n.º 3
0
        public void RemovePlayer(CharacterGuild Player)
        {
            this.CharactersGuildCache.Remove(Player);

            if (Player.GradeType == GuildGradeEnum.GRADE_BOSS)
            {
                if (this.CharactersGuildCache.Count == 0)
                {
                    GuildTable.TryDeleteGuild(this);

                    // TODO : Delete TaxCollector.
                }
                else
                {
                    CharacterGuild BestBoss = null;

                    // On recherche le second membre avec le meilleur grade ou alors le meilleur xp s'il y a des ex echo
                    foreach (var Member in this.CharactersGuildCache)
                    {
                        if (BestBoss == null ||
                            Member.Grade < BestBoss.Grade ||
                            BestBoss.GradeType == GuildGradeEnum.GRADE_ESSAI && Member.GradeType != GuildGradeEnum.GRADE_ESSAI ||
                            (Member.Grade == BestBoss.Grade && Member.Experience > BestBoss.Experience))
                        {
                            BestBoss = Member;
                        }
                    }

                    if (BestBoss != null)
                    {
                        // On lui change le grade
                        BestBoss.SetGrade(GuildGradeEnum.GRADE_BOSS);

                        // On actualise les droits.
                        BestBoss.SendGuildSettingsInfos();
                    }
                }
            }

            CharactersGuildTable.Delete(Player.ID);
        }
Exemplo n.º 4
0
        public bool BoostSpell(CharacterGuild Player, int SpellId)
        {
            if (Player.Can(GuildRightEnum.RIGHT_BOOST))
            {
                if (this.mySpells.HasSpell(SpellId))
                {
                    if (this.Capital > 4)
                    {
                        this.mySpells.LevelUpSepll(SpellId);

                        this.Capital -= 5;

                        this.PatternSpells.NeedToBeRefresh();

                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 5
0
 public void setCharacterGuild(CharacterGuild _guild)
 {
     CharacterGuildCache = _guild;
 }