Example #1
0
        public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount)
        {
            base.OnAfterKillingLiving(target, damageAmount, criticalAmount);
            if (target is Player)
            {
                this.m_player.OnKillingLiving(this.m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount);
                return;
            }
            int id = 0;

            if (target is SimpleBoss)
            {
                SimpleBoss simpleBoss = target as SimpleBoss;
                id = simpleBoss.NpcInfo.ID;
            }
            if (target is SimpleNpc)
            {
                SimpleNpc simpleNpc = target as SimpleNpc;
                id = simpleNpc.NpcInfo.ID;
            }
            this.m_player.OnKillingLiving(this.m_game, 2, id, target.IsLiving, damageAmount + criticalAmount);
        }
Example #2
0
 public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount)
 {
     base.OnAfterKillingLiving(target, damageAmount, criticalAmount);
     if (target is Player)//目标为玩家还是NPC
     {
         m_player.OnKillingLiving(m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount);
     }
     else
     {
         int targetId = 0;
         if (target is SimpleBoss)
         {
             SimpleBoss tempBoss = target as SimpleBoss;
             targetId = tempBoss.NpcInfo.ID;
         }
         if (target is SimpleNpc)
         {
             SimpleNpc tempNpc = target as SimpleNpc;
             targetId = tempNpc.NpcInfo.ID;
         }
         m_player.OnKillingLiving(m_game, 2, targetId, target.IsLiving, damageAmount + criticalAmount);
     }
 }
Example #3
0
 public override void OnAfterKillingLiving(Living target, int damageAmount, int criticalAmount, int delay)
 {
     base.OnAfterKillingLiving(target, damageAmount, criticalAmount, delay);
     if (target is Player)
     {
         this.m_player.OnKillingLiving(this.m_game, 1, target.Id, target.IsLiving, damageAmount + criticalAmount, this.PlayerDetail.IsArea);
         this.CalculatePlayerOffer(target as Player);
     }
     else
     {
         int targetId = 0;
         if (target is SimpleBoss)
         {
             SimpleBoss tempBoss = target as SimpleBoss;
             targetId = tempBoss.NpcInfo.ID;
         }
         if (target is SimpleNpc)
         {
             SimpleNpc tempNpc = target as SimpleNpc;
             targetId = tempNpc.NpcInfo.ID;
         }
         this.m_player.OnKillingLiving(this.m_game, 2, targetId, target.IsLiving, damageAmount + criticalAmount, false);
     }
 }
Example #4
0
        public static string GetOneChat(SimpleNpc Body)
        {
            int index = 0;
            string chat = "";

            switch (Body.NpcInfo.ID)
            {
                case 2001:
                case 2002:
                case 2004:
                case 2101:
                case 2102:
                case 2104:
                    index = random.Next(0, AntChat.Length);
                    chat = AntChat[index];
                    break;
                default:
                    index = random.Next(0, BoguChat.Length);
                    chat = BoguChat[index];
                    break;
            }

            return chat;
        }
Example #5
0
        public SimpleNpc CreateNpc(int npcId, int type)
        {
            NpcInfo npcInfo = NPCInfoMgr.GetNpcInfoById(npcId);
            SimpleNpc npc = new SimpleNpc(PhysicalId++, this, npcInfo, type);
            Point pos = GetPlayerPoint(mapPos, npcInfo.Camp);
            npc.Reset();

            npc.SetXY(pos);

            AddLiving(npc);

            npc.StartMoving();

            return npc;
        }
Example #6
0
        public SimpleNpc CreateNpc(int npcId, int x, int y, int type)
        {
            NpcInfo npcInfo = NPCInfoMgr.GetNpcInfoById(npcId);
            SimpleNpc npc = new SimpleNpc(PhysicalId++, this, npcInfo, type);
            npc.Reset();
            npc.SetXY(x, y);

            AddLiving(npc);

            npc.StartMoving();

            return npc;
        }