Example #1
0
File: PC.cs Project: xxlio109/Saga
        public void OnHomePoint()
        {
            if (this.Char.stance != Global.STANCE.DIE || this.Char.HP != 0)
            {
                return;
            }
            if (this.Char.save_map == 0)
            {
                this.Char.save_map = 3;
                this.Char.save_x   = -4811.951f;
                this.Char.save_y   = 15936.05f;
                this.Char.save_z   = 3894f;
            }
            Map map;

            MapManager.Instance.GetMap(this.Char.save_map, out map);
            this.Char.stance = Global.STANCE.REBORN;
            Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
            p1.SetActorID(this.Char.id);
            p1.SetBattleState(false);
            p1.SetStance(Global.STANCE.REBORN);
            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();
            }
            this.Char.BattleStatus = new BattleStatus();
            this.Char.speed        = 500;
            Bonus.BonusHandler.Instance.CalcEquipBonus(this.Char);
            SkillHandler.CastPassivSkill(ref this.client.Char);
            this.client.SendBattleStatus();
            this.client.SendCharStatus(0);
            SkillHandler.SendAllStatusIcons(this.Char, this.Char);
            this.client.netIO.SendPacket(p1, client.SessionID);
        }
Example #2
0
        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);
        }
Example #3
0
 public void OnHomePoint()
 {
     if (this.Char.stance != Global.STANCE.DIE || this.Char.HP != 0) return;
     if (this.Char.save_map == 0)
     {
         this.Char.save_map = 3;
         this.Char.save_x = -4811.951f;
         this.Char.save_y = 15936.05f;
         this.Char.save_z = 3894f;
     }
     Map map;
     MapManager.Instance.GetMap(this.Char.save_map, out map);
     this.Char.stance = Global.STANCE.REBORN;
     Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
     p1.SetActorID(this.Char.id);
     p1.SetBattleState(false);
     p1.SetStance(Global.STANCE.REBORN);
     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();
     }
     this.Char.BattleStatus = new BattleStatus();
     this.Char.speed = 500;
     Bonus.BonusHandler.Instance.CalcEquipBonus(this.Char);
     SkillHandler.CastPassivSkill(ref this.client.Char);
     this.client.SendBattleStatus();
     this.client.SendCharStatus(0);
     SkillHandler.SendAllStatusIcons(this.Char, this.Char);
     this.client.netIO.SendPacket(p1, client.SessionID);
 }
Example #4
0
File: PC.cs Project: 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);
        }