本文整理汇总了C#中WCell.RealmServer.Entities.GameObject.CanInteractWith方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.CanInteractWith方法的具体用法?C# GameObject.CanInteractWith怎么用?C# GameObject.CanInteractWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.GameObject
的用法示例。
在下文中一共展示了GameObject.CanInteractWith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WithdrawMoney
public void WithdrawMoney(Character withdrawer, GameObject bank, uint withdrawl)
{
if (withdrawl == 0) return;
if (!bank.CanInteractWith(withdrawer)) return;
if (withdrawer.Guild == null || withdrawer.GuildMember == null) return;
if (withdrawer.Guild != Guild) return;
if (Guild.Money < withdrawl) return;
var member = withdrawer.GuildMember;
if (!member.HasRight(GuildPrivileges.WITHDRAW_GOLD) ||
member.HasRight(GuildPrivileges.WITHDRAW_GOLD_LOCK))
{
return;
}
if (member.BankMoneyWithdrawlAllowance < withdrawl)
{
return;
}
Guild.Money -= withdrawl;
withdrawer.Money += withdrawl;
member.BankMoneyWithdrawlAllowance -= withdrawl;
BankLog.LogEvent(GuildBankLogEntryType.WithdrawMoney, withdrawer, withdrawl, null, 0, null);
GuildHandler.SendMemberRemainingDailyWithdrawlAllowance(withdrawer, member.BankMoneyWithdrawlAllowance);
GuildHandler.SendGuildBankTabNames(withdrawer, bank);
GuildHandler.SendGuildBankTabContents(withdrawer, bank, 0);
GuildHandler.SendGuildBankMoneyUpdate(withdrawer, bank);
}
示例2: DepositMoney
public void DepositMoney(Character depositer, GameObject bank, uint deposit)
{
if (deposit == 0) return;
if (!bank.CanInteractWith(depositer)) return;
if (depositer.Guild == null || depositer.GuildMember == null) return;
if (depositer.Guild != Guild) return;
if (depositer.Money < deposit) return;
Guild.Money += deposit;
depositer.Money -= deposit;
BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
GuildHandler.SendGuildBankTabNames(depositer, bank);
GuildHandler.SendGuildBankTabContents(depositer, bank, 0);
GuildHandler.SendGuildBankMoneyUpdate(depositer, bank);
}
示例3: DoBankChecks
private bool DoBankChecks(Character chr, GameObject bank)
{
if (chr == null) return false;
if (bank == null) return false;
if (!bank.CanInteractWith(chr)) return false;
return true;
}
示例4: GetBankTabContent
public static void GetBankTabContent(Character chr, GameObject bank, byte tabId)
{
if (bank == null) return;
if (chr.Guild == null || chr.GuildMember == null) return;
if (!bank.CanInteractWith(chr)) return;
var bankTab = chr.Guild.Bank[tabId];
if (bankTab == null) return;
if (!chr.GuildMember.HasBankTabRight(tabId, GuildBankTabPrivileges.ViewTab)) return;
SendMemberRemainingDailyWithdrawlAllowance(chr, chr.GuildMember.BankMoneyWithdrawlAllowance);
SendGuildBankTabContents(chr, bank, tabId);
}
示例5: SendGuildBankList
private static void SendGuildBankList(Character chr, GameObject bank, byte tabId, bool hasTabNames, bool hasItemInfo)
{
if (bank == null) return;
if (chr.Guild == null || chr.GuildMember == null) return;
if (!bank.CanInteractWith(chr)) return;
var guild = chr.Guild;
var gBank = guild.Bank;
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GUILD_BANK_LIST))
{
packet.Write(guild.Money);
packet.Write(tabId);
packet.Write(chr.GuildMember.Rank.BankTabRights[tabId].WithdrawlAllowance);
packet.Write(hasTabNames);
if (hasTabNames)
{
if (tabId == 0)
{
packet.Write((byte)guild.PurchasedBankTabCount);
for (var i = 0; i < guild.PurchasedBankTabCount; ++i)
{
packet.Write(gBank[i].Name);
packet.Write(gBank[i].Icon);
}
}
}
packet.Write(hasItemInfo);
if (!hasItemInfo)
{
chr.Client.Send(packet);
return;
}
var bankTab = gBank[tabId];
for (var slot = 0; slot < GuildMgr.MAX_BANK_TAB_SLOTS; ++slot)
{
var item = (slot < bankTab.ItemRecords.Count) ? bankTab.ItemRecords[slot] : null;
packet.Write((byte)slot);
if (item == null)
{
packet.Write((uint)0);
continue;
}
packet.Write(item.EntryId);
var randPropId = item.RandomProperty;
packet.Write(randPropId);
if (randPropId > 0)
{
packet.Write(item.RandomSuffix);
}
packet.Write(item.Amount);
packet.Write((uint)0);
packet.Write((byte)0);
if (item.EnchantIds == null)
{
packet.Write((byte)0);
continue;
}
var count = 0;
var list = new int[3];
for (var i = 0; i < 3; ++i)
{
if (item.EnchantIds[i] == 0) continue;
count++;
list[i] = item.EnchantIds[i];
}
packet.Write((byte)count);
for (var i = 0; i < 3; ++i)
{
if (list[i] == 0) continue;
packet.Write((byte)i);
packet.Write(list[i]);
}
}
chr.Client.Send(packet);
}
}