示例#1
0
文件: PC.cs 项目: Willyham/SagaRO2
        public void OnMapLoaded()
        {
            this.Char.invisble = false;
            this.client.map.OnActorVisibilityChange(this.Char);
            this.client.map.SendTimeWeatherToActor(this.Char);
            this.Char.e.OnMapLoaded();
            this.client.map.SendVisibleActorsToActor(this.Char);
            this.client.SendMaxInvSlots();
            this.client.SendInventoryList();
            this.client.SendEquipList();
            this.client.SendWeaponList();
            this.client.SendSkillList();
            //this.client.SendShortcutsList();
            this.client.SendZeny();
            Quest.QuestsManager.SendNavPoint(this.Char);
            if (!this.client.initialized)
            {
                this.client.SendQuestInfo();
                Scenario.SetCurrentScenario(this.Char, 2, this.Char.Scenario);
                Quest.QuestsManager.UpdateQuestItem(this.Char, true);
                if (Config.Instance.MessageOfTheDay != null)
                {
                    foreach (string i in Config.Instance.MessageOfTheDay)
                    {
                        this.client.SendMessage("Saga", i, SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE_RED);
                    }
                }
                this.client.CheckNewMail();
                this.client.initialized = true;
            }
            if (MapServer.ScriptManager.Scenario != null)
                MapServer.ScriptManager.Scenario.OnChangeMap(this.Char, Char.mapID);
            else
            {
                Logger.ShowDebug("MapServer.ScriptManager.Scenario==null, maybe scenario script is missing?", null);
            }

            if (this.Char.stance == Global.STANCE.DIE)
            {
                this.Char.stance = Global.STANCE.REBORN;
                this.client.map.SendEventToAllActorsWhoCanSeeActor(Map.EVENT_TYPE.CHANGE_STATE, null, this.Char, true);
            }
            if (this.Char.Tasks.ContainsKey("AutoSave") == false)
            {
                Tasks.AutoSave newtask = new SagaMap.Tasks.AutoSave(this.client);
                this.Char.Tasks.Add("AutoSave", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("RegenerationHP") == false)
            {
                Tasks.Regeneration newtask = new SagaMap.Tasks.Regeneration(this.client, 2, 0, 1000);
                this.Char.Tasks.Add("RegenerationHP", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("RegenerationSP") == false)
            {
                Tasks.Regeneration newtask = new SagaMap.Tasks.Regeneration(this.client, 0, 35, 4000);
                this.Char.Tasks.Add("RegenerationSP", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("LPReduction") == false)
            {
                Tasks.LPReduction newtask = new SagaMap.Tasks.LPReduction(this.client);
                this.Char.Tasks.Add("LPReduction", newtask);
                newtask.Activate();
            }
            Bonus.BonusHandler.Instance.CalcEquipBonus(this.Char);
            SkillHandler.CastPassivSkill(ref this.client.Char);
            SkillHandler.CalcHPSP(ref this.client.Char);
            this.client.SendBattleStatus();
            this.Char.LC = this.Char.maxLC;
            this.client.SendCharStatus(0);
            this.client.SendExtStats();
            SkillHandler.SendAllStatusIcons(this.Char, this.Char);
            //if (this.client.Party != null)
            //{
            //    this.client.Party.UpdateMemberInfo(this.client);
            //}
            //this.SendMessage("Saga", "Welcome to Saga!", Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE);
            Packets.Server.ShowMapInfo p = new SagaMap.Packets.Server.ShowMapInfo();
            p.SetMapInfo(this.Char.MapInfo);
            this.client.netIO.SendPacket(p, client.SessionID);
        }
示例#2
0
文件: PC.cs 项目: xxlio109/Saga
        public void OnMapLoaded()
        {
            this.Char.invisble = false;
            this.client.map.OnActorVisibilityChange(this.Char);
            this.client.map.SendTimeWeatherToActor(this.Char);
            this.Char.e.OnMapLoaded();
            this.client.map.SendVisibleActorsToActor(this.Char);
            this.client.SendMaxInvSlots();
            this.client.SendInventoryList();
            this.client.SendEquipList();
            this.client.SendWeaponList();
            this.client.SendSkillList();
            //this.client.SendShortcutsList();
            this.client.SendZeny();
            Quest.QuestsManager.SendNavPoint(this.Char);
            if (!this.client.initialized)
            {
                this.client.SendQuestInfo();
                Scenario.SetCurrentScenario(this.Char, 2, this.Char.Scenario);
                Quest.QuestsManager.UpdateQuestItem(this.Char, true);
                if (Config.Instance.MessageOfTheDay != null)
                {
                    foreach (string i in Config.Instance.MessageOfTheDay)
                    {
                        this.client.SendMessage("Saga", i, SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE_RED);
                    }
                }
                this.client.CheckNewMail();
                this.client.initialized = true;
            }
            if (MapServer.ScriptManager.Scenario != null)
            {
                MapServer.ScriptManager.Scenario.OnChangeMap(this.Char, Char.mapID);
            }
            else
            {
                Logger.ShowDebug("MapServer.ScriptManager.Scenario==null, maybe scenario script is missing?", null);
            }

            if (this.Char.stance == Global.STANCE.DIE)
            {
                this.Char.stance = Global.STANCE.REBORN;
                this.client.map.SendEventToAllActorsWhoCanSeeActor(Map.EVENT_TYPE.CHANGE_STATE, null, this.Char, true);
            }
            if (this.Char.Tasks.ContainsKey("AutoSave") == false)
            {
                Tasks.AutoSave newtask = new SagaMap.Tasks.AutoSave(this.client);
                this.Char.Tasks.Add("AutoSave", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("RegenerationHP") == false)
            {
                Tasks.Regeneration newtask = new SagaMap.Tasks.Regeneration(this.client, 2, 0, 1000);
                this.Char.Tasks.Add("RegenerationHP", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("RegenerationSP") == false)
            {
                Tasks.Regeneration newtask = new SagaMap.Tasks.Regeneration(this.client, 0, 35, 4000);
                this.Char.Tasks.Add("RegenerationSP", newtask);
                newtask.Activate();
            }
            if (this.Char.Tasks.ContainsKey("LPReduction") == false)
            {
                Tasks.LPReduction newtask = new SagaMap.Tasks.LPReduction(this.client);
                this.Char.Tasks.Add("LPReduction", newtask);
                newtask.Activate();
            }
            Bonus.BonusHandler.Instance.CalcEquipBonus(this.Char);
            SkillHandler.CastPassivSkill(ref this.client.Char);
            SkillHandler.CalcHPSP(ref this.client.Char);
            this.client.SendBattleStatus();
            this.Char.LC = this.Char.maxLC;
            this.client.SendCharStatus(0);
            this.client.SendExtStats();
            SkillHandler.SendAllStatusIcons(this.Char, this.Char);
            //if (this.client.Party != null)
            //{
            //    this.client.Party.UpdateMemberInfo(this.client);
            //}
            //this.SendMessage("Saga", "Welcome to Saga!", Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE);
            Packets.Server.ShowMapInfo p = new SagaMap.Packets.Server.ShowMapInfo();
            p.SetMapInfo(this.Char.MapInfo);
            this.client.netIO.SendPacket(p, client.SessionID);
        }