本文整理汇总了C#中WCell.RealmServer.Quests.QuestTemplate.CalcRewardXp方法的典型用法代码示例。如果您正苦于以下问题:C# QuestTemplate.CalcRewardXp方法的具体用法?C# QuestTemplate.CalcRewardXp怎么用?C# QuestTemplate.CalcRewardXp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Quests.QuestTemplate
的用法示例。
在下文中一共展示了QuestTemplate.CalcRewardXp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendComplete
/// <summary>
/// Sends the quest giver quest complete.
/// </summary>
/// <param name="qt">The quest id.</param>
/// <param name="chr">The client.</param>
public static void SendComplete(QuestTemplate qt, Character chr)
{
using (var pckt = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTGIVER_QUEST_COMPLETE))
{
pckt.Write(qt.Id);
if (chr.Level >= RealmServerConfiguration.MaxCharacterLevel)
{
pckt.Write(0u);
pckt.Write(qt.MoneyAtMaxLevel);
}
else
{
pckt.Write(qt.CalcRewardXp(chr));
pckt.Write(qt.RewMoney);
}
pckt.Write(qt.CalcRewardHonor(chr));
pckt.Write(qt.RewardTalents);
pckt.Write(0); // since 3.3: Arena reward
chr.Client.Send(pckt);
/*if (chr.Level >= LevelMgr.MaxCharacterLevel)
{
pckt.Write(qt.MoneyAtMaxLevel);
}
else
{
pckt.Write(qt.RewMoney);
}
pckt.Write((uint)0); // unknown value
pckt.Write(qt.RewardItems.Length);
foreach (var reward in qt.RewardItems)
{
pckt.Write(reward.ItemId);
pckt.Write(reward.Amount);
}*/
}
}
示例2: SendDetails
/// <summary>
/// Sends the quest giver quest detail.
/// </summary>
/// <param name="questGiver">The qg.</param>
/// <param name="qt">The quest id.</param>
/// <param name="chr">The client.</param>
/// <param name="acceptable">if set to <c>true</c> [acceptable].</param>
public static void SendDetails(IEntity questGiver, QuestTemplate qt, Character chr, bool acceptable)
{
var locale = chr.Locale;
using (var pckt = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTGIVER_QUEST_DETAILS))
{
pckt.Write(questGiver != null ? questGiver.EntityId : EntityId.Zero);
pckt.Write(EntityId.Zero); // unknown, wotlk, quest sharing?
pckt.Write(qt.Id);
pckt.WriteCString(qt.Titles.Localize(locale));
pckt.WriteCString(qt.Details.Localize(locale));
pckt.WriteCString(qt.Instructions.Localize(locale));
pckt.Write((byte)(acceptable ? 1 : 0)); // doesn't work
pckt.WriteUInt((uint)qt.Flags);
pckt.WriteUInt(qt.SuggestedPlayers);
pckt.Write((byte)0); // probably some pvp flag
if (qt.Flags.HasFlag(QuestFlags.HiddenRewards))
{
pckt.WriteUInt(0u); // choice items length
pckt.WriteUInt(0u); // reward items length
pckt.WriteUInt(0u); // money
pckt.WriteUInt(0u); // xp
}
else
{
pckt.Write(qt.RewardChoiceItems.Length);
for (uint i = 0; i < qt.RewardChoiceItems.Length; i++)
{
pckt.Write((uint)qt.RewardChoiceItems[i].ItemId);
pckt.Write(qt.RewardChoiceItems[i].Amount);
var template = qt.RewardChoiceItems[i].Template;
if (template != null)
{
pckt.Write(template.DisplayId);
}
else
{
pckt.Write(0);
}
}
pckt.Write(qt.RewardItems.Length);
for (uint i = 0; i < qt.RewardItems.Length; i++)
{
pckt.Write((uint)qt.RewardItems[i].ItemId);
pckt.Write(qt.RewardItems[i].Amount);
var template = qt.RewardItems[i].Template;
if (template != null)
{
pckt.Write(template.DisplayId);
}
else
{
pckt.Write(0);
}
}
if (chr.Level >= RealmServerConfiguration.MaxCharacterLevel)
{
pckt.Write(qt.MoneyAtMaxLevel);
}
else
{
pckt.Write(qt.RewMoney);
}
pckt.Write(qt.CalcRewardXp(chr)); // since 3.3
}
pckt.Write(qt.RewHonorAddition);
pckt.Write(qt.RewHonorMultiplier); // since 3.3
if (qt.RewSpell > 0)
{
pckt.Write((uint)qt.RewSpell);
}
else
{
pckt.Write((uint)qt.RewSpellCast);
}
pckt.Write((uint)qt.CastSpell);
pckt.Write((uint)qt.RewardTitleId); // since 2.4.0
pckt.Write(qt.RewardTalents);
// #### since 3.3
pckt.Write(0); // bonus arena points
pckt.Write(0);
for (uint i = 0; i < QuestConstants.MaxReputations; ++i)
{
//.........这里部分代码省略.........
示例3: SendQuestGiverOfferReward
/// <summary>
/// Offers the reward of the given Quest to the given Character.
/// When replying the Quest will be complete.
/// </summary>
/// <param name="questGiver">The qg.</param>
/// <param name="qt">The quest id.</param>
/// <param name="chr">The client.</param>
public static void SendQuestGiverOfferReward(IEntity questGiver, QuestTemplate qt, Character chr)
{
//if (questGiver.QuestHolderInfo != null)
//var list = qg.QuestHolderInfo.QuestEnds;
//if (list != null && list.Contains(qt))
var locale = chr.Locale;
using (var pckt = new RealmPacketOut(RealmServerOpCode.SMSG_QUESTGIVER_OFFER_REWARD))
{
pckt.Write(questGiver.EntityId);
pckt.WriteUInt(qt.Id);
pckt.WriteCString(qt.Titles.Localize(locale));
pckt.WriteCString(qt.OfferRewardTexts.Localize(locale));
pckt.WriteByte((byte)(qt.FollowupQuestId > 0 ? 1 : 0));
pckt.WriteUInt((uint)qt.Flags);
pckt.WriteUInt(qt.SuggestedPlayers); // Suggested Group Num
pckt.Write(qt.OfferRewardEmotes.Length);
for (uint i = 0; i < qt.OfferRewardEmotes.Length; i++)
{
pckt.Write(qt.OfferRewardEmotes[i].Delay);
pckt.Write((uint)qt.OfferRewardEmotes[i].Type);
}
pckt.Write(qt.RewardChoiceItems.Length);
for (var i = 0; i < qt.RewardChoiceItems.Length; i++)
{
pckt.Write((uint)qt.RewardChoiceItems[i].ItemId);
pckt.Write(qt.RewardChoiceItems[i].Amount);
var template = qt.RewardChoiceItems[i].Template;
if (template != null)
{
pckt.Write(template.DisplayId);
}
else
{
pckt.Write(0);
}
}
pckt.Write(qt.RewardItems.Length);
for (var i = 0; i < qt.RewardItems.Length; i++)
{
pckt.Write((uint)qt.RewardItems[i].ItemId);
pckt.Write(qt.RewardItems[i].Amount);
var template = qt.RewardItems[i].Template;
if (template != null)
{
pckt.WriteUInt(template.DisplayId);
}
else
{
pckt.Write(0);
}
}
if (chr.Level >= RealmServerConfiguration.MaxCharacterLevel)
{
pckt.Write(qt.MoneyAtMaxLevel);
}
else
{
pckt.Write(qt.RewMoney);
}
pckt.Write(qt.CalcRewardXp(chr));
pckt.Write(qt.CalcRewardHonor(chr)); // honor points
pckt.Write(qt.RewHonorMultiplier); // since 3.3
pckt.Write((uint)0x08); // unused by client
if (qt.RewSpell > 0)
{
pckt.Write((uint)qt.RewSpell);
}
else
{
pckt.Write((uint)qt.RewSpellCast);
}
pckt.Write((uint)qt.CastSpell);
pckt.Write((uint)qt.RewardTitleId);
pckt.Write(qt.RewardTalents); // reward talents
pckt.Write(0); // since 3.3
pckt.Write(0); // since 3.3
// #### since 3.3
for (uint i = 0; i < QuestConstants.MaxReputations; i++)
pckt.Write((uint)qt.RewardReputations[i].Faction);
for (uint i = 0; i < QuestConstants.MaxReputations; i++)
pckt.Write(qt.RewardReputations[i].ValueId);
for (uint i = 0; i < QuestConstants.MaxReputations; i++)
pckt.Write(qt.RewardReputations[i].Value);
//.........这里部分代码省略.........
示例4: SendQuestQueryResponse
/// <summary>
/// Sends the quest query response.
/// </summary>
/// <param name="qt">The quest id.</param>
/// <param name="chr">The client.</param>
public static void SendQuestQueryResponse(QuestTemplate qt, Character chr)
{
var locale = chr.Client.Info.Locale;
using (var pckt = new RealmPacketOut(RealmServerOpCode.SMSG_QUEST_QUERY_RESPONSE))
{
pckt.Write(qt.Id);
pckt.Write((uint)qt.IsActive);
pckt.Write(qt.Level);
pckt.Write(qt.MinLevel); // since 3.3
pckt.Write(qt.Category); // questsort
pckt.Write((uint)qt.QuestType);
pckt.Write(qt.SuggestedPlayers);
pckt.Write((uint)qt.ObjectiveMinReputation.ReputationIndex);
pckt.Write(qt.ObjectiveMinReputation.Value);
pckt.Write((uint)qt.ObjectiveMaxReputation.ReputationIndex);
pckt.Write(qt.ObjectiveMaxReputation.Value); // (#10)
pckt.Write(qt.FollowupQuestId);
pckt.Write(qt.CalcRewardXp(chr)); // since 3.3
if (qt.Flags.HasFlag(QuestFlags.HiddenRewards))
{
pckt.Write(0);
}
else
{
pckt.Write(qt.RewMoney);
}
pckt.Write(qt.MoneyAtMaxLevel);
pckt.Write((uint)qt.CastSpell);
if (qt.RewSpell > 0)
{
pckt.Write((uint)qt.RewSpell);
}
else
{
pckt.Write((uint)qt.RewSpellCast);
}
pckt.Write(qt.RewHonorAddition);
pckt.WriteFloat(qt.RewHonorMultiplier); // since 3.3
pckt.Write((uint)qt.SrcItemId);
pckt.Write((uint)qt.Flags);
pckt.Write((uint)qt.RewardTitleId);
pckt.Write(qt.PlayersSlain);
pckt.Write(qt.RewardTalents);// NEW 3.0.2 RewardTalentCount (#21)
pckt.Write(0); // since 3.3: bonus arena points
pckt.Write(0); // since 3.3
int i;
if (qt.Flags.HasFlag(QuestFlags.HiddenRewards))
{
for (i = 0; i < QuestConstants.MaxRewardItems; ++i)
{
pckt.WriteUInt(0u);
pckt.WriteUInt(0u);
}
for (i = 0; i < QuestConstants.MaxRewardChoiceItems; ++i)
{
pckt.WriteUInt(0u);
pckt.WriteUInt(0u);
}
}
else
{
for (i = 0; i < QuestConstants.MaxRewardItems; i++)
{
if (i < qt.RewardItems.Length)
{
pckt.Write((uint)qt.RewardItems[i].ItemId);
pckt.Write(qt.RewardItems[i].Amount);
}
else
{
pckt.WriteUInt(0u);
pckt.WriteUInt(0u);
}
}
for (i = 0; i < QuestConstants.MaxRewardChoiceItems; i++)
{
if (i < qt.RewardChoiceItems.Length)
{
pckt.Write((uint)qt.RewardChoiceItems[i].ItemId);
pckt.Write(qt.RewardChoiceItems[i].Amount);
}
else
{
pckt.WriteUInt(0u);
pckt.WriteUInt(0u);
}
}
}
// #### since 3.3
//.........这里部分代码省略.........