当前位置: 首页>>代码示例>>C#>>正文


C# Character.getPosition方法代码示例

本文整理汇总了C#中Character.getPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Character.getPosition方法的具体用法?C# Character.getPosition怎么用?C# Character.getPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character的用法示例。


在下文中一共展示了Character.getPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: npcSpawn

 public byte[] npcSpawn(Character character)
 {
     OutPacket initNPCData = new OutPacket(615);
     initNPCData.WriteInt(615);
     initNPCData.WriteShort(0x04);
     initNPCData.WriteShort(0x04);
     initNPCData.WriteByte(0x01);
     initNPCData.WriteInt(character.getuID());
     initNPCData.WriteInt(character.getArea().getaID());
     initNPCData.WriteFloat(character.getPosition()[0]);
     initNPCData.WriteFloat(character.getPosition()[1]);
     initNPCData.WriteByte(3);
     initNPCData.WriteInt(this.uID);
     initNPCData.WriteInt();
     initNPCData.WritePaddedString(this.getName(), 16);
     initNPCData.Skip(18);
     initNPCData.WriteInt(this.getModule());
     initNPCData.Skip(10);
     initNPCData.WriteInt(this.getmID());
     initNPCData.Skip(16);
     initNPCData.WriteFloat(this.npcPosition[0]);
     initNPCData.WriteFloat(this.npcPosition[1]);
     initNPCData.Skip(502);
     initNPCData.WriteByte(0x22);
     initNPCData.WriteByte(0x08);
     return initNPCData.ToArray();
 }
开发者ID:cjs3187607,项目名称:brightmh,代码行数:27,代码来源:NPC.cs

示例2: warpToNearestTown

 public static void warpToNearestTown(Character chr)
 {
     Waypoint closestTown = TownCoordsCache.Instance.getClosestWaypointForMap(chr.getMap(), new Waypoint(chr.getPosition()[0], chr.getPosition()[1]));
     if(closestTown == null)
     {
         Area vvArea = WMap.Instance.getGrid(1).getAreaByRound(-1660, 2344);
         if(vvArea == null)
         {
             Logger.WriteLog(Logger.LogTypes.Error, "Pure warpToNearestTown error {0}|{1}|{2}", chr.getPosition()[0], chr.getPosition()[1], chr.getMap());
             StaticPackets.sendSystemMessageToClient(chr.getAccount().mClient, 1, "We're sorry, but an hard error has occured. Please report it to an admin.");
             chr.getAccount().mClient.Close();
             return;
         } setPlayerPosition(chr, -1660, 2344, 1);
     }
 }
开发者ID:cjs3187607,项目名称:brightmh,代码行数:15,代码来源:CharacterFunctions.cs

示例3: setPlayerPosition


//.........这里部分代码省略.........

            for(int i=0;i<120;i++) {
                if(chr.getCargo().getSeqSaved()[i] != -1 && chr.getCargo().getCargoSaved()[chr.getCargo().getSeqSaved()[i]] != null) {
                    op.WriteInt();
                    op.WriteByte((byte)(chr.getCargo().getSeqSaved()[i] / 100));
                    op.WriteByte((byte)(chr.getCargo().getSeqSaved()[i] % 100));
                    Item item = chr.getCargo().getCargoSaved()[chr.getCargo().getSeqSaved()[i]];
                    op.WriteInt(item.getItemID());
                    ItemData itemData = ItemDataCache.Instance.getItemData(item.getItemID());
                    if(itemData.getTimeToExpire() > 0) {

                    }
                    op.WriteShort(item.getQuantity());
                } else op.WriteZero(12);
            } // 38 - 1477

            op.Position = 1476;

            for(int i=0;i<chr.getCommunity().getFriendsList().Capacity;i++) {
                if(chr.getCommunity().getFriendsList().ElementAtOrDefault(i) != null) {
                    op.WritePaddedString(chr.getCommunity().getFriendsList()[i], 17);
                } else op.WriteZero(17);
            } // 1476 - 1934

            op.WriteRepeatedByte(0x58, 40);

            op.Position = 1986;

            for(int i = 0;i < chr.getCommunity().getIgnoresList().Capacity;i++) {
                if(chr.getCommunity().getIgnoresList().ElementAtOrDefault(i) != null) {
                    op.WritePaddedString(chr.getCommunity().getIgnoresList()[i], 17);
                } else op.WriteZero(17);
            } // 1987 - 2157

            op.WriteInt(363); // questsy
            op.WriteLong();
            op.WriteLong(138769276674441706);
            op.WriteLong(21692910);
            op.WriteShort();
            op.WriteShort(1);

            op.Position = 2248;

            for(byte i=0;i<240;i++) {
                if(chr.getInventory().getSeqSaved()[i] != -1 && chr.getInventory().getInvSaved()[chr.getInventory().getSeqSaved()[i]] != null) {
                    op.WriteShort();
                    op.WriteByte((byte)(chr.getInventory().getSeqSaved()[i] / 100));
                    op.WriteByte((byte)(chr.getInventory().getSeqSaved()[i] % 100));
                    Item item = chr.getInventory().getInvSaved()[chr.getInventory().getSeqSaved()[i]];
                    op.WriteInt(item.getItemID());
                    op.WriteInt(item.getQuantity());
                } else op.WriteZero(12);
            } // 2252 - 5133

            op.WriteLong(chr.getCoin());

            op.Position = 5140;

            for(byte i=0;i<21;i++) {
                if(chr.getSkillBar().getSkillBar().ContainsKey(i)) {
                    int barID = chr.getSkillBar().getSkillBar()[i];
                    if(barID > 200000000) op.WriteInt(1);
                    else if(barID > 511) { op.WriteInt(5); barID -= 512; }
                    else if(barID > 255) { op.WriteInt(6); barID -= 256; }
                    else {
                        SkillData skill = SkillDataCache.Instance.getSkill(chr.getSkills().getLearnedSkills().ElementAtOrDefault(barID));
                        if(skill == null) op.WriteInt(0);
                        else if(skill.getTypeSpecific() == 6) op.WriteInt(3);
                        else if(skill.getTypeSpecific() == 7) op.WriteInt(4);
                        else op.WriteInt(2);
                    }
                    op.WriteInt(barID);
                } else op.WriteZero(8);
            } // 5140 - 5299

            op.Position = 5320;

            for(int i = 0;i < 60;i++) {
                if(chr.getSkills().getLearnedSkills().Count > i && chr.getSkills().getLearnedSkills()[i] != 0) {
                    op.WriteInt(chr.getSkills().getLearnedSkills()[i]);
                    op.WriteInt(SkillDataCache.Instance.getSkill(chr.getSkills().getLearnedSkills()[i]).getSkillPoints());
                } else op.WriteLong();
            } // 5320 - 5799

            op.WriteFloat(chr.getPosition()[0]);
            op.WriteFloat(chr.getPosition()[1]);
            op.WriteInt(0x0c);
            op.WriteInt(140338688);
            op.WriteInt();
            op.WriteShort();
            op.WriteShort(10962);

            //s3c0nd p4ck3t
            op.WriteInt(16);
            op.WriteInt(7929861);
            op.WriteInt(chr.getuID());
            c.WriteRawPacket(op.ToArray());

            WMap.Instance.getGrid(chr.getMap()).sendTo3x3AreaSpawn(chr, chr.getArea());
        }
开发者ID:cjs3187607,项目名称:brightmh,代码行数:101,代码来源:CharacterFunctions.cs


注:本文中的Character.getPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。