예제 #1
0
 public static bool FilterSendOpCode(SendOps sendOp)
 {
     switch (sendOp)
     {
     case SendOps.LP_UserMove:
     case SendOps.LP_MobCtrlAck:
     case SendOps.LP_MobMove:
     case SendOps.LP_UserEmotion:
         return(true);
     }
     return(false);
 }
예제 #2
0
 public COutPacket(SendOps OpCode) : this()
 {
     Encode2((short)OpCode);
 }
 public Packet(SendOps opcode) : this((ushort)opcode) { }
예제 #4
0
 public OutPacket(SendOps operationCode) : this((short)operationCode)
 {
 }
예제 #5
0
 public Packet(SendOps opcode) : this((ushort)opcode)
 {
 }
예제 #6
0
        public void EncodeAttackInfo(Character c, COutPacket p, byte nSLV, byte nLevel, SendOps nType)
        {
            p.Encode1((byte)(nDamagePerMob | 16 * nMobCount));
            p.Encode1(nLevel);             // m_nLevel

            if (nSkillID > 0)
            {
                p.Encode1(nSLV);
                p.Encode4(nSkillID);
            }
            else
            {
                p.Encode1(0);
            }

            //nPassiveSLV = 0;
            //if (nSkillID == (__int16*)3211006
            //  && (v13 = CInPacket::Decode1(v4), v14 = v13, (nPassiveSLV = v13) != 0)
            //  && (v15 = CInPacket::Decode4(v4)) != 0)
            //{
            //    v16 = CSkillInfo::GetSkill(TSingleton < CSkillInfo >::ms_pInstance, v15);
            //    LODWORD(pPassiveSkill) = v16;
            //    if (v16)
            //    {
            //        if (v14 <= 1)
            //            v14 = 1;
            //        v17 = SKILLENTRY::GetMaxLevel(v16);
            //        nPassiveSLV = v14;
            //        if (v14 >= v17)
            //            nPassiveSLV = v17;
            //    }
            //}
            //else
            //{
            //    LODWORD(pPassiveSkill) = 0;
            //}

            if (nSkillID == (int)Skills.SNIPER_STRAFE)
            {
                p.Encode1(0);
                p.Encode4(0);
            }

            p.Encode1(nOption);             //bSerialAttack = CInPacket::Decode1(v4) & 0x20;
            p.Encode2(nActionAndDir);       //its a short now ???

            //bLeft = ((unsigned int)tByte2 >> 15) & 1;
            //nAction = tByte2 & 0x7FFF;

            if (nAction <= 0x110)
            {
                p.Encode1(nActionSpeed);
                p.Encode1(nMastery);
                p.Encode4(nBulletItemID);

                for (int i = 0; i < nMobCount; i++)
                {
                    var info = aAttackInfo[i];

                    p.Encode4(info.dwMobID);
                    p.Encode1(info.nHitAction);                     // (byte)(nType != SendOps.LP_UserShootAttack ? 0xFF : 0x07));  //hitAction?

                    for (int j = 0; j < nDamagePerMob; j++)
                    {
                        p.Encode1(info.abCritical[j] != 0);
                        p.Encode4(info.aDamage[j]);
                    }
                }
            }

            if (nType == SendOps.LP_UserShootAttack)
            {
                p.Encode4(0);
                //ptBallStart.x = (signed __int16)CInPacket::Decode2(v4);
                //ptBallStart.y = (signed __int16)CInPacket::Decode2(v4);
            }

            switch (nSkillID)
            {
            case 2121001:
            case 2221001:
            case 2321001:
            case 22121000:
            case 22151001:
                p.Encode4(tKeyDown);
                break;

            case 33101007:
            {
                if (c.m_dwSwallowMobID <= 0)
                {
                    c.m_dwSwallowMobID = 0;                                     // mob dwid, not mob template id
                }
                p.Encode4(c.m_dwSwallowMobID);
                break;
            }
            }
        }