本文整理汇总了C#中eRealm类的典型用法代码示例。如果您正苦于以下问题:C# eRealm类的具体用法?C# eRealm怎么用?C# eRealm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
eRealm类属于命名空间,在下文中一共展示了eRealm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateNews
public static void CreateNews(string message, eRealm realm, eNewsType type, bool sendMessage)
{
if (sendMessage)
{
foreach (GameClient client in WorldMgr.GetAllClients())
{
if (client.Player == null)
continue;
if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
{
client.Out.SendMessage(message, eChatType.CT_System, eChatLoc.CL_SystemWindow);
}
}
}
if (ServerProperties.Properties.RECORD_NEWS)
{
DBNews news = new DBNews();
news.Type = (byte)type;
news.Realm = (byte)realm;
news.Text = message;
GameServer.Database.AddObject(news);
GameEventMgr.Notify(DatabaseEvent.NewsCreated, new NewsEventArgs(news));
}
}
示例2: getRealmString
public string getRealmString(eRealm Realm)
{
switch (Realm)
{
case eRealm.Albion: return " ALB";
case eRealm.Midgard: return " MID";
case eRealm.Hibernia: return " HIB";
default: return " NONE";
}
}
示例3: CheckGuild
/// <summary>
/// This method checks if a guild exists
/// if not, the guild is created with default values
/// </summary>
/// <param name="guildName">The guild name that is being checked</param>
private static void CheckGuild(eRealm currentRealm, string guildName)
{
if (!GuildMgr.DoesGuildExist(guildName))
{
Guild newguild = GuildMgr.CreateGuild(currentRealm, guildName);
newguild.Ranks[8].OcHear = true;
newguild.Motd = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Motd");
newguild.Omotd = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Omotd");
newguild.Ranks[8].Title = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE,"Guild.StartupGuild.Title");
}
}
示例4: OnKeepTaken
/// <summary>
/// when keep is taken it check if the realm which take gain the control of DF
/// </summary>
/// <param name="e"></param>
/// <param name="sender"></param>
/// <param name="arguments"></param>
public static void OnKeepTaken(DOLEvent e, object sender, EventArgs arguments)
{
KeepEventArgs args = arguments as KeepEventArgs;
eRealm realm = (eRealm) args.Keep.Realm ;
if (realm != DarknessFallOwner )
{
int currentDFOwnerTowerCount = GameServer.KeepManager.GetTowerCountByRealm(DarknessFallOwner);
int challengerOwnerTowerCount = GameServer.KeepManager.GetTowerCountByRealm(realm);
if (currentDFOwnerTowerCount < challengerOwnerTowerCount)
DarknessFallOwner = realm;
}
}
示例5: RealmHasBonus
/// <summary>
/// does a realm have the amount of keeps required for a certain bonus
/// </summary>
/// <param name="type">the type of bonus</param>
/// <param name="realm">the realm</param>
/// <returns>true if the realm has the required amount of keeps</returns>
public static bool RealmHasBonus(eKeepBonusType type, eRealm realm)
{
if (!ServerProperties.Properties.USE_LIVE_KEEP_BONUSES)
return false;
if (realm == eRealm.None)
return false;
int count = 0;
switch (realm)
{
case eRealm.Albion: count = albCount; break;
case eRealm.Midgard: count = midCount; break;
case eRealm.Hibernia: count = hibCount; break;
}
return count >= (int)type;
}
示例6: CheckDFOwner
/// <summary>
/// check if a realm have more keep at start
/// to know the DF owner
/// </summary>
private static void CheckDFOwner()
{
int albcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Albion);
int midcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Midgard);
int hibcount = GameServer.KeepManager.GetTowerCountByRealm(eRealm.Hibernia);
if (albcount > midcount && albcount > hibcount)
{
DarknessFallOwner = eRealm.Albion;
}
if (midcount > albcount && midcount > hibcount)
{
DarknessFallOwner = eRealm.Midgard;
}
if (hibcount > midcount && hibcount > albcount)
{
DarknessFallOwner = eRealm.Hibernia;
}
}
示例7: getRelics
/// <summary>
/// Returns an enumeration with all mounted Relics of an realm
/// </summary>
/// <param name="Realm"></param>
/// <returns></returns>
public static IEnumerable getRelics(eRealm Realm)
{
ArrayList realmRelics = new ArrayList();
lock (m_relics)
{
foreach (GameRelic relic in m_relics.Values)
{
if (relic.Realm == Realm && relic.IsMounted)
realmRelics.Add(relic);
}
}
return realmRelics;
}
示例8: BroadcastMessage
/// <summary>
/// Method to broadcast messages, if eRealm.None all can see,
/// else only the right realm can see
/// </summary>
/// <param name="message">The message</param>
/// <param name="realm">The realm</param>
public static void BroadcastMessage(string message, eRealm realm)
{
foreach (GameClient client in WorldMgr.GetAllClients())
{
if (client.Player == null)
continue;
if ((client.Account.PrivLevel != 1 || realm == eRealm.None) || client.Player.Realm == realm)
{
client.Out.SendMessage(message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
}
}
}
示例9: BroadcastRaize
/// <summary>
/// Sends a message to all players to notify them of the raize
/// </summary>
/// <param name="keep">The keep object</param>
/// <param name="realm">The raizing realm</param>
public static void BroadcastRaize(AbstractGameKeep keep, eRealm realm)
{
string message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastRaize.Razed", keep.Name, GlobalConstants.RealmToName(realm)));
BroadcastMessage(message, eRealm.None);
NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
}
示例10: Reset
/// <summary>
/// reset the realm when the lord have been killed
/// </summary>
/// <param name="realm"></param>
public virtual void Reset(eRealm realm)
{
LastAttackedByEnemyTick = 0;
StartCombatTick = 0;
Realm = realm;
PlayerMgr.BroadcastCapture(this);
Level = (byte)ServerProperties.Properties.STARTING_KEEP_LEVEL;
//if a guild holds the keep, we release it
if (Guild != null)
{
Release();
}
//we repair all keep components, but not if it is a tower and is raised
foreach (GameKeepComponent component in this.KeepComponents)
{
if (!component.IsRaized)
component.Repair(component.MaxHealth - component.Health);
foreach (GameKeepHookPoint hp in component.KeepHookPoints.Values)
{
if (hp.Object != null)
hp.Object.Die(null);
}
}
//change realm
foreach (GameClient client in WorldMgr.GetClientsOfRegion(this.CurrentRegion.ID))
{
client.Out.SendKeepComponentUpdate(this, false);
}
//we reset all doors
foreach(GameKeepDoor door in Doors.Values)
{
door.Reset(realm);
}
//we make sure all players are not in the air
ResetPlayersOfKeep();
//we reset the guards
foreach (GameKeepGuard guard in Guards.Values)
{
if (guard is GuardLord && guard.IsAlive )
{
this.TemplateManager.GetMethod("RefreshTemplate").Invoke(null, new object[] { guard });
}
else if (guard is GuardLord == false)
{
guard.Die(guard);
}
}
//we reset the banners
foreach (GameKeepBanner banner in Banners.Values)
{
banner.ChangeRealm();
}
//update guard level for every keep
if (!IsPortalKeep && ServerProperties.Properties.USE_KEEP_BALANCING)
GameServer.KeepManager.UpdateBaseLevels();
//update the counts of keeps for the bonuses
if (ServerProperties.Properties.USE_LIVE_KEEP_BONUSES)
KeepBonusMgr.UpdateCounts();
SaveIntoDatabase();
GameEventMgr.Notify(KeepEvent.KeepTaken, new KeepEventArgs(this));
}
示例11: GetRandomNPC
/// <summary>
/// Get a random npc from zone with given realms
/// </summary>
/// <param name="realms">The realms to get the NPC from</param>
/// <param name="maxLevel">The minimal level of the NPC</param>
/// <param name="minLevel">The maximum level of the NPC</param>
/// <returns>The NPC</returns>
public GameNPC GetRandomNPC(eRealm[] realms, int minLevel, int maxLevel)
{
List<GameNPC> npcs = GetNPCsOfZone(realms, minLevel, maxLevel, 0, 0, true);
GameNPC randomNPC = (npcs.Count == 0 ? null : npcs[0]);
return randomNPC;
}
示例12: GetRealmTowerBonusLevel
public virtual int GetRealmTowerBonusLevel(eRealm realm)
{
int tower = 28 - GetTowerCountByRealm(realm);
return (int)(tower * ServerProperties.Properties.TOWER_BALANCE_MULTIPLIER);
}
示例13: GetRelicBonusModifier
/// <summary>
/// Gets the bonus modifier for a realm/relictype.
/// </summary>
/// <param name="realm"></param>
/// <param name="type"></param>
/// <returns></returns>
public static double GetRelicBonusModifier(eRealm realm, eRelicType type)
{
double bonus = 0.0;
bool owningSelf = false;
//only playerrealms can get bonus
foreach (GameRelic rel in getRelics(realm, type))
{
if (rel.Realm == rel.OriginalRealm)
{
owningSelf = true;
}
else
{
bonus += ServerProperties.Properties.RELIC_OWNING_BONUS*0.01;
}
}
// Bonus apply only if owning original relic
if (owningSelf)
return bonus;
return 0.0;
}
示例14: GetKeepCountByRealm
/// <summary>
/// get keep count by realm
/// </summary>
/// <param name="realm"></param>
/// <returns></returns>
public virtual int GetKeepCountByRealm(eRealm realm)
{
int index = 0;
lock (m_keepList.SyncRoot)
{
foreach (AbstractGameKeep keep in m_keepList.Values)
{
if (m_frontierRegionsList.Contains(keep.Region) == false) continue;
if (((eRealm)keep.Realm == realm) && (keep is GameKeep))
index++;
}
}
return index;
}
示例15: GetRealmKeepBonusLevel
public virtual int GetRealmKeepBonusLevel(eRealm realm)
{
int keep = 7 - GetKeepCountByRealm(realm);
return (int)(keep * ServerProperties.Properties.KEEP_BALANCE_MULTIPLIER);
}