コード例 #1
0
ファイル: GuildCommands.cs プロジェクト: remixod/netServer
			Guild CreateGuild(CmdTrigger<RealmServerCmdArgs> trigger, string name, CharacterRecord record)
			{
				var guild = new Guild(record, name);

				trigger.Reply("Guild created");

				return guild;
			}
コード例 #2
0
 public static GuildEventLogEntry[] FindAll(Guild guild)
 {
     return(FindAllByProperty("m_GuildId", (int)guild.Id));
 }
コード例 #3
0
        public void SwapItemsManualBankToBank(Character chr, GameObject bankObj, byte fromBankTabId, byte fromTabSlot,
                                              byte toBankTabId, byte toTabSlot, uint itemEntryId, byte amount)
        {
            if (!CheckBankObj(chr, bankObj))
            {
                return;
            }
            GuildMember guildMember = chr.GuildMember;

            if (guildMember == null)
            {
                return;
            }
            GuildRank rank = guildMember.Rank;

            if (rank == null)
            {
                return;
            }
            GuildBankTab intoTab1 = this[fromBankTabId];

            if (intoTab1 == null)
            {
                return;
            }
            GuildBankTab intoTab2 = this[toBankTabId];

            if (intoTab2 == null || fromTabSlot >= 98 || toTabSlot >= 98)
            {
                return;
            }
            GuildBankTabRights[] bankTabRights = rank.BankTabRights;
            if (!bankTabRights[fromBankTabId].Privileges.HasFlag(GuildBankTabPrivileges.ViewTab) ||
                bankTabRights[fromBankTabId].WithdrawlAllowance <= 0U || !bankTabRights[toBankTabId]
                .Privileges.HasFlag(GuildBankTabPrivileges.DepositItem))
            {
                return;
            }
            ItemRecord itemRecord1 = intoTab1[fromTabSlot];

            if (itemRecord1 == null || (int)itemRecord1.EntryId != (int)itemEntryId ||
                itemRecord1.Amount < amount)
            {
                return;
            }
            if (amount == 0)
            {
                amount = (byte)itemRecord1.Amount;
            }
            bool flag = fromBankTabId == toBankTabId;

            if (flag)
            {
                if (fromTabSlot == toTabSlot)
                {
                    return;
                }
                ItemRecord itemRecord2 = intoTab2.StoreItemInSlot(itemRecord1, amount, toTabSlot, true);
                intoTab1[fromTabSlot] = itemRecord2;
            }
            else
            {
                if (intoTab2.CheckStoreItemInSlot(itemRecord1, amount, toTabSlot, true))
                {
                    ItemRecord itemRecord2 = intoTab2.StoreItemInSlot(itemRecord1, amount, toTabSlot, true);
                    intoTab1[fromTabSlot] = itemRecord2;
                }
                else
                {
                    if (!bankTabRights[fromBankTabId].Privileges
                        .HasFlag(GuildBankTabPrivileges.DepositItem) ||
                        bankTabRights[toBankTabId].WithdrawlAllowance <= 0U)
                    {
                        return;
                    }
                    ItemRecord itemRecord2 = intoTab2.StoreItemInSlot(itemRecord1, amount, toTabSlot, true);
                    intoTab1[fromTabSlot] = itemRecord2;
                    if (itemRecord2 != itemRecord1)
                    {
                        --bankTabRights[toTabSlot].WithdrawlAllowance;
                        --bankTabRights[fromBankTabId].WithdrawlAllowance;
                        BankLog.LogEvent(GuildBankLogEntryType.MoveItem, chr, itemRecord1, amount, intoTab2);
                        BankLog.LogEvent(GuildBankLogEntryType.MoveItem, chr, itemRecord2, intoTab1);
                        Guild.SendGuildBankTabContentUpdateToAll(fromBankTabId, fromTabSlot);
                        Guild.SendGuildBankTabContentUpdateToAll(toBankTabId, toTabSlot);
                        return;
                    }
                }

                --bankTabRights[fromBankTabId].WithdrawlAllowance;
            }

            BankLog.LogEvent(GuildBankLogEntryType.MoveItem, chr, itemRecord1, amount, intoTab2);
            Guild.SendGuildBankTabContentUpdateToAll(fromBankTabId, fromTabSlot,
                                                     flag ? toTabSlot : -1);
        }