本文整理汇总了C#中GamePlayer类的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer类的具体用法?C# GamePlayer怎么用?C# GamePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GamePlayer类属于命名空间,在下文中一共展示了GamePlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches.
if (player.CharacterClass.ID == (int) TrainedClass)
{
player.Out.SendMessage(this.Name + " says, \"Training makes for a strong, healthy Hero! Keep up the good work, " + player.Name + "!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"You wish to follow the [Path of Affinity] and walk as a Valewalker?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例2: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches.
if (player.CharacterClass.ID == (int)TrainedClass)
{
OfferTraining(player);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"You have come to seek admittance into the [Temple of Arawn] to worship the old god that your ancestors worshipped?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例3: SetPlayerLooking
/// <summary>
/// Adds a player to the looking for group list
/// </summary>
/// <param name="member">player to add to the list</param>
public static void SetPlayerLooking(GamePlayer member)
{
if (member.LookingForGroup == false && m_lfgPlayers.AddIfNotExists(member, true))
{
member.LookingForGroup = true;
}
}
示例4: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches
if (player.CharacterClass.ID == (int) TrainedClass)
{
// player can be promoted
if (player.Level>=5)
{
player.Out.SendMessage(this.Name + " says, \"You must now seek your training elsewhere. Which path would you like to follow? [Bard], [Druid] or [Warden]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
}
else
{
OfferTraining(player);
}
// ask for basic equipment if player doesnt own it
if (player.Inventory.GetFirstItemByID(PRACTICE_WEAPON_ID, eInventorySlot.MinEquipable, eInventorySlot.LastBackpack) == null)
{
player.Out.SendMessage(this.Name + " says, \"Do you require a [practice weapon]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
}
if (player.Inventory.GetFirstItemByID(PRACTICE_SHIELD_ID, eInventorySlot.MinEquipable, eInventorySlot.LastBackpack) == null)
{
player.Out.SendMessage(this.Name + " says, \"Do you require a [training shield]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
}
}
else
{
CheckChampionTraining(player);
}
return true;
}
示例5: OnDestinationPicked
/// <summary>
/// Player has picked a destination.
/// </summary>
/// <param name="player"></param>
/// <param name="destination"></param>
protected override void OnDestinationPicked(GamePlayer player, Teleport destination)
{
// Not porting to where we already are.
List<String> playerAreaList = new List<String>();
foreach (AbstractArea area in player.CurrentAreas)
playerAreaList.Add(area.Description);
if (playerAreaList.Contains(destination.TeleportID))
return;
switch (destination.TeleportID.ToLower())
{
case "aegirhamn":
break;
case "bjarken":
break;
case "hagall":
break;
case "knarr":
break;
default:
return;
}
SayTo(player, "Have a safe journey!");
base.OnDestinationPicked(player, destination);
}
示例6: OnLevelUp
public override void OnLevelUp(GamePlayer player)
{
base.OnLevelUp(player);
player.AddSpecialization(SkillBase.GetSpecialization(Specs.Shields));
player.AddSpecialization(SkillBase.GetSpecialization(Specs.Stormcalling));
player.AddSpellLine(SkillBase.GetSpellLine("Stormcalling"));
if (player.Level >= 10)
{
player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 1));
}
if (player.Level >= 12)
{
player.AddAbility(SkillBase.GetAbility(Abilities.Shield, ShieldLevel.Large));
player.AddAbility(SkillBase.GetAbility(Abilities.MidArmor, ArmorLevel.Chain));
}
if (player.Level >= 15)
{
player.AddAbility(SkillBase.GetAbility(Abilities.Intercept));
player.AddAbility(SkillBase.GetAbility(Abilities.Tireless));
}
if (player.Level >= 20)
{
player.AddAbility(SkillBase.GetAbility(Abilities.Protect, 2));
}
}
示例7: UseSkillAction
/// <summary>
/// Constructs a new UseSkillAction
/// </summary>
/// <param name="actionSource">The action source</param>
/// <param name="flagSpeedData">The skill type</param>
/// <param name="index">The skill index</param>
/// <param name="type">The skill type</param>
public UseSkillAction(GamePlayer actionSource, int flagSpeedData, int index, int type)
: base(actionSource)
{
m_flagSpeedData = flagSpeedData;
m_index = index;
m_type = type;
}
示例8: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches.
if (player.CharacterClass.ID == (int) TrainedClass)
{
player.Out.SendMessage(this.Name + " says, \"Do you wish to learn some more, " + player.Name + "? Step up and receive your training!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"" + player.Name + ", do you choose the Path of Affinity, and life as a [Vampiir]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例9: Interact
/// <summary>
/// Interact with the NPC.
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player) || player == null)
return false;
if (GlobalConstants.IsExpansionEnabled((int)eClientExpansion.DarknessRising))
{
if (player.CurrentRegion.Expansion == (int)eClientExpansion.DarknessRising)
{
SayTo(player, "Do you wish to [exit]?");
}
else
{
SayTo(player, "Do you require an audience with the [King]?");
}
return true;
}
else
{
String reply = "I am afraid, but the King is busy right now.";
if (player.Inventory.CountItemTemplate("Personal_Bind_Recall_Stone", eInventorySlot.Min_Inv, eInventorySlot.Max_Inv) == 0)
reply += " If you're only here to get your Personal Bind Recall Stone then I'll see what I can [do].";
SayTo(player, reply);
return false;
}
}
示例10: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches.
if (player.CharacterClass.ID == (int) TrainedClass)
{
player.Out.SendMessage(this.Name + " says, \"I shall impart all that I know, young Druid.\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"Do you wish to walk the Path of Harmony and learn the ways of the [Druid]?\"", eChatType.CT_System, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例11: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches.
if (player.CharacterClass.ID == (int)TrainedClass)
{
OfferTraining(player);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"You have come far to find us! Is it your wish to [join the Guild of Shadows] and become our dagger of the night? An Infiltrator!\"", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例12: Interact
/// <summary>
/// Interact with trainer
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;
// check if class matches
if (player.CharacterClass.ID == (int)TrainedClass)
{
OfferTraining(player);
}
else
{
// perhaps player can be promoted
if (CanPromotePlayer(player))
{
player.Out.SendMessage(this.Name + " says, \"Do you desire to [join the Temple of the Iron Fist] and fight for the glorious realm of Albion?\"", eChatType.CT_Say, eChatLoc.CL_PopupWindow);
if (!player.IsLevelRespecUsed)
{
OfferRespecialize(player);
}
}
else
{
CheckChampionTraining(player);
}
}
return true;
}
示例13: IsValid
public override bool IsValid(GamePlayer player)
{
BusinessLocation bl = player.Locations[Location];
LocationStorage ls = bl.Storage;
ItemQuantity iq = ls.GetItem(Item);
int q;
if (iq == null)
{
q = 0;
}
else
{
q = iq.StoredQuantity;
}
switch (ComparisonType)
{
case ComparisonEnum.Equal:
return q == Quantity;
case ComparisonEnum.GreaterThan:
return q > Quantity;
case ComparisonEnum.GreaterThanOrEqual:
return q >= Quantity;
case ComparisonEnum.LessThan:
return q < Quantity;
case ComparisonEnum.LessThanOrEqual:
return q <= Quantity;
case ComparisonEnum.NotEqual:
return q != Quantity;
}
return false;
}
示例14: Interact
/// <summary>
/// Interacting with the djinn resets the timer.
/// </summary>
/// <param name="player"></param>
/// <returns></returns>
public override bool Interact(GamePlayer player)
{
lock (m_syncObject)
m_timer.Restart();
return base.Interact(player);
}
示例15: IsAllowedToCombine
/// <summary>
/// This function is called when player accept the combine
/// </summary>
/// <param name="player"></param>
/// <param name="item"></param>
public override bool IsAllowedToCombine(GamePlayer player, InventoryItem item)
{
if (!base.IsAllowedToCombine(player, item))
return false;
if (((InventoryItem)player.TradeWindow.TradeItems[0]).Object_Type !=
(int)eObjectType.AlchemyTincture)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.AlchemyTinctures"), PacketHandler.eChatType.CT_System,
PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
if (player.TradeWindow.ItemsCount > 1)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.OneTincture"), PacketHandler.eChatType.CT_System,
PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
if (item.ProcSpellID != 0 || item.SpellID != 0)
{
player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language,
"Alchemy.IsAllowedToCombine.AlreadyImbued", item.Name),
PacketHandler.eChatType.CT_System, PacketHandler.eChatLoc.CL_SystemWindow);
return false;
}
return true;
}