示例#1
0
        private void Create(Character c, CInPacket p)
        {
            if (c.Stats.nLevel < 10)
            {
                c.SendPacket(CPacket.CPartyMan.Party_Error(PartyOps.PartyRes_CreateNewParty_Beginner));
                return;
            }

            if (GetParty(c) is null)
            {
                var party = new Party
                {
                    PartyID   = PartyIDs.NextValue(),
                    dwOwnerId = c.dwId
                };

                party.Add(new PartyMember(c.dwId));
                Add(party);
                party[c.dwId].Update();

                c.SendPacket(CPacket.CPartyMan.CreateNewParty_Done(party));
            }
            else
            {
                c.SendPacket(CPacket.CPartyMan.Party_Error(PartyOps.PartyRes_JoinParty_AlreadyJoined));
            }
        }
示例#2
0
        public static readonly Dictionary <int, Party> Invites = new Dictionary <int, Party>(); //invitee -> party

        public static void CreateParty(Character leader)
        {
            if (leader == null)
            {
                return;
            }

            if (leader.Job == 0)
            {
                _log.Warn($"Cannot create party because the leader would be a beginner. Leader {leader.ID}");
                leader.SendPacket(PartyPacket.PartyError(PartyFunction.CREATE_NEW_BEGINNER_DISALLOWED));
                return;
            }

            if (leader.PartyID != 0)
            {
                _log.Warn($"Cannot create party because the leader is already in a party. Leader {leader.ID}");
                leader.SendPacket(PartyPacket.PartyError(PartyFunction.CREATE_NEW_ALREADY_JOINED));
                return;
            }

            PartyMember ldr = new PartyMember(leader.ID, leader.Name, true);
            int         id  = IdGenerator.NextValue();
            Party       pty = new Party(id, ldr);

            _log.Info($"Created party {id} with leader {leader.ID}");

            Parties.Add(pty.partyId, pty);
            leader.PartyID = pty.partyId;
            leader.SendPacket(PartyPacket.PartyCreated(leader.ID, pty.partyId));
        }
示例#3
0
 public Mist(int pSkillID, byte pSkillLevel, Map pField, int pOwnerID, int pDisplayTime, int pX1, int pY1, int pX2, int pY2)
 {
     SkillID    = pSkillID;
     SkillLevel = pSkillLevel;
     Field      = pField;
     OwnerID    = pOwnerID;
     LT_X       = pX1;
     LT_Y       = pY1;
     RB_X       = pX2;
     RB_Y       = pY2;
     Time       = MasterThread.CurrentTime + pDisplayTime;
     SpawnID    = LoopingID.NextValue();
 }
示例#4
0
 protected override void InsertItem(int index, CUIMessenger item)
 {
     item.UID = MessengerUID.NextValue();
     base.InsertItem(index, item);
 }