Esempio n. 1
0
File: PC.cs Progetto: 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);
        }
Esempio n. 2
0
 public void OnActorChangesState(Actor aActor, MapEventArgs args)
 {
     //send actorChangeState
     Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
     p1.SetActorID(aActor.id);
     p1.SetBattleState(aActor.state > 0);
     p1.SetStance(aActor.stance);
     if (args != null)
     {
         Map.SkillArgs arg = (Map.SkillArgs)args;
         p1.SetTargetActor(arg.targetActorID);
     }
     C.netIO.SendPacket(p1, C.SessionID);
 }
Esempio n. 3
0
        public void ProcessRRes(MapClient client, string playername)
        {
            MapClient target = MapClientManager.Instance.GetClient(playername);
            if (target != null && target.Char.stance == Global.STANCE.DIE)
            {
                target.Char.HP = target.Char.maxHP;
                target.Char.stance = Global.STANCE.REBORN;
                target.Char.state = 0;
                target.SendBattleStatus();
                target.SendCharStatus(0);

                Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
                p1.SetActorID(target.Char.id);
                p1.SetBattleState(false);
                p1.SetStance(Global.STANCE.REBORN);
                target.netIO.SendPacket(p1, target.SessionID);

                SagaMap.Map.SkillArgs arg = new Map.SkillArgs();
                target.map.TeleportActor(target.Char, target.Char.x, target.Char.y, target.Char.z);
                target.map.SendEventToAllActorsWhoCanSeeActor(Map.EVENT_TYPE.CHANGE_STATE, arg, target.Char, false);
            }
            else
            {
                client.SendMessage(_MasterName, "Player doesn't exist or isn't dead.");
            }
        }
Esempio n. 4
0
        public void ProcessRes(MapClient client, string args)
        {
            if (client.Char.stance == Global.STANCE.DIE)
            {
                client.Char.HP = client.Char.maxHP;
                client.Char.stance = Global.STANCE.REBORN;
                client.Char.state = 0;
                client.SendBattleStatus();
                client.SendCharStatus(0);

                Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
                p1.SetActorID(client.Char.id);
                p1.SetBattleState(false);
                p1.SetStance(Global.STANCE.REBORN);
                client.netIO.SendPacket(p1, client.SessionID);

                SagaMap.Map.SkillArgs arg = new Map.SkillArgs();
                client.map.SendEventToAllActorsWhoCanSeeActor(Map.EVENT_TYPE.CHANGE_STATE, arg, client.Char, false);
                client.map.TeleportActor(client.Char, client.Char.x, client.Char.y, client.Char.z);
            }
            else
            {
                client.SendMessage(_MasterName, "You aren't dead >:[");
            }
        }
Esempio n. 5
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);
 }
Esempio n. 6
0
 public void OnActorChangesState(Actor aActor, MapEventArgs args)
 {
     //send actorChangeState
     Packets.Server.ActorChangeState p1 = new SagaMap.Packets.Server.ActorChangeState();
     p1.SetActorID(aActor.id);
     p1.SetBattleState(aActor.state > 0);
     p1.SetStance(aActor.stance);
     if (args != null)
     {
         Map.SkillArgs arg = (Map.SkillArgs)args;
         p1.SetTargetActor(arg.targetActorID);
     }
     C.netIO.SendPacket(p1, C.SessionID);
 }