本文整理汇总了C#中DOL.GS.Keeps.AbstractGameKeep类的典型用法代码示例。如果您正苦于以下问题:C# AbstractGameKeep类的具体用法?C# AbstractGameKeep怎么用?C# AbstractGameKeep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractGameKeep类属于DOL.GS.Keeps命名空间,在下文中一共展示了AbstractGameKeep类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BroadcastCapture
/// <summary>
/// Sends a message to all players to notify them of the keep capture
/// </summary>
/// <param name="keep">The keep object</param>
public static void BroadcastCapture(AbstractGameKeep keep)
{
string message = "";
if (keep.Realm != eRealm.None)
{
message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.Captured", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
}
else
{
message = string.Format(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "PlayerManager.BroadcastCapture.CapturedR0", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name));
}
/*
switch (GameServer.Instance.Configuration.ServerType)
{
case eGameServerType.GST_Normal:
{
message = string.Format("The forces of {0} have captured {1}!", GlobalConstants.RealmToName((eRealm)keep.Realm), keep.Name);
break;
}
case eGameServerType.GST_PvP:
{
string defeatersStr = "";
message = string.Format("The forces of {0} have defeated the defenders of {1}!", defeatersStr, keep.Name);
break;
}
}*/
BroadcastMessage(message, eRealm.None);
NewsMgr.CreateNews(message, keep.Realm, eNewsType.RvRGlobal, false);
}
示例2: SendLevelChangeMessage
public static void SendLevelChangeMessage(AbstractGameKeep keep)
{
string message = "Your guild's keep " + keep.Name + " is now level " + keep.Level;
if (keep.Level != ServerProperties.Properties.MAX_KEEP_LEVEL)
message += ", it is on the way to level " + ServerProperties.Properties.MAX_KEEP_LEVEL.ToString();
SendMessageToGuild(message, keep.Guild);
}
示例3: SendKeepRemove
public override void SendKeepRemove(AbstractGameKeep keep)
{
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepRemove));
pak.WriteShort((ushort)keep.KeepID);
SendTCP(pak);
}
示例4: ScoutMission
public ScoutMission(object owner)
: base(owner)
{
eRealm realm = 0;
if (owner is Group)
realm = (owner as Group).Leader.Realm;
else if (owner is GamePlayer)
realm = (owner as GamePlayer).Realm;
ArrayList list = new ArrayList();
ICollection<AbstractGameKeep> keeps;
if (owner is Group)
keeps = GameServer.KeepManager.GetKeepsOfRegion((owner as Group).Leader.CurrentRegionID);
else if (owner is GamePlayer)
keeps = GameServer.KeepManager.GetKeepsOfRegion((owner as GamePlayer).CurrentRegionID);
else keeps = new List<AbstractGameKeep>();
foreach (AbstractGameKeep keep in keeps)
{
if (keep.IsPortalKeep)
continue;
if (keep.Realm != realm)
list.Add(keep);
}
if (list.Count > 0)
m_keep = list[Util.Random(list.Count - 1)] as AbstractGameKeep;
GameEventMgr.AddHandler(AreaEvent.PlayerEnter, new DOLEventHandler(Notify));
GameEventMgr.AddHandler(KeepEvent.KeepTaken, new DOLEventHandler(Notify));
}
示例5: SendChangeLevelTimeMessage
public static void SendChangeLevelTimeMessage(AbstractGameKeep keep)
{
string message;
string changeleveltext = "";
int nextlevel = 0;
byte maxlevel = (byte)ServerProperties.Properties.MAX_KEEP_LEVEL;
if (keep.Level < maxlevel)
{
changeleveltext = "upgrade";
nextlevel = keep.Level + 1;
}
else if (keep.Level > maxlevel)
{
changeleveltext = "downgrade";
nextlevel = keep.Level - 1;
}
else
{
return;
}
message = "Your guild is starting to " + changeleveltext + " its area " + keep.Name + " to level 10.";
TimeSpan time = keep.ChangeLevelTimeRemaining;
message += " It will take ";
if (time.Hours > 0)
message += time.Hours + " hour(s) ";
if (time.Minutes > 0)
message += time.Minutes + " minute(s) ";
else message += time.Seconds + " second(s)";
message += " to reach the next level.";
SendMessageToGuild(message, keep.Guild);
}
示例6: SendKeepRealmUpdate
public override void SendKeepRealmUpdate(AbstractGameKeep keep)
{
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepRealmUpdate));
pak.WriteShort((ushort)keep.KeepID);
pak.WriteByte((byte)keep.Realm);
pak.WriteByte((byte)keep.Level);
SendTCP(pak);
}
示例7: SendKeepInfo
public override void SendKeepInfo(AbstractGameKeep keep)
{
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.KeepInfo));
pak.WriteShort((ushort)keep.KeepID);
pak.WriteShort(0);//zone id not sure
pak.WriteInt((uint)keep.X);
pak.WriteInt((uint)keep.Y);
pak.WriteShort((ushort)keep.Heading);
pak.WriteByte((byte)keep.Realm);
pak.WriteByte((byte)keep.Level);//level(not sure)
pak.WriteShort(0);//unk
pak.WriteByte(0x57);//model= 5-8Bit =lvl 1-4bit = Keep Type //uncertain
pak.WriteByte(0xB7);//unk
SendTCP(pak);
}
示例8: LoadFromDatabase
/// <summary>
/// load component from db object
/// </summary>
public virtual void LoadFromDatabase(DBKeepComponent component, AbstractGameKeep keep)
{
Region myregion = WorldMgr.GetRegion((ushort)keep.Region);
if (myregion == null)
return;
this.Keep = keep;
//this.DBKeepComponent = component;
base.LoadFromDatabase(component);
//this x and y is for get object in radius
double angle = keep.Heading * ((Math.PI * 2) / 360); // angle*2pi/360;
X = (int)(keep.X + ((sbyte)component.X * 148 * Math.Cos(angle) + (sbyte)component.Y * 148 * Math.Sin(angle)));
Y = (int)(keep.Y - ((sbyte)component.Y * 148 * Math.Cos(angle) - (sbyte)component.X * 148 * Math.Sin(angle)));
this.Z = keep.Z;
// and this one for packet sent
this.ComponentX = component.X;
this.ComponentY = component.Y;
this.ComponentHeading = (ushort)component.Heading;
//need check to be sure for heading
angle = (component.Heading * 90 + keep.Heading);
if (angle > 360) angle -= 360;
this.Heading = (ushort)(angle / 0.08789);
this.Name = keep.Name;
this.Model = INVISIBLE_MODEL;
this.Skin = component.Skin;
m_oldMaxHealth = MaxHealth;
this.Health = MaxHealth;
// this.Health = component.Health;
this.m_oldHealthPercent = this.HealthPercent;
this.CurrentRegion = myregion;
this.ID = component.ID;
this.SaveInDB = false;
this.IsRaized = false;
LoadPositions();
this.AddToWorld();
FillPositions();
this.RepairedHealth = this.MaxHealth;
m_CreateInfo = component.CreateInfo;
StartHealthRegeneration();
}
示例9: RegisterKeep
public virtual void RegisterKeep(int keepID, AbstractGameKeep keep)
{
m_keepList.Add(keepID, keep);
log.Info("Registered Keep: " + keep.Name);
}
示例10: KeepEventArgs
public KeepEventArgs(AbstractGameKeep keep, eRealm realm)
{
this.m_keep = keep;
this.m_realm = realm;
}
示例11: GetRealmPointsForKeep
/// <summary>
/// Realm points a keep is worth when captured
/// </summary>
/// <param name="keep"></param>
/// <returns></returns>
public virtual int GetRealmPointsForKeep(AbstractGameKeep keep)
{
int value = 0;
if (keep is GameKeep)
{
value = Math.Max(50, ServerProperties.Properties.KEEP_RP_BASE + ((keep.BaseLevel - 50) * ServerProperties.Properties.KEEP_RP_MULTIPLIER));
}
else
{
value = Math.Max(5, ServerProperties.Properties.TOWER_RP_BASE + ((keep.BaseLevel - 50) * ServerProperties.Properties.TOWER_RP_MULTIPLIER));
}
value += ((keep.Level - ServerProperties.Properties.STARTING_KEEP_LEVEL) * ServerProperties.Properties.UPGRADE_MULTIPLIER);
return Math.Max(5, value);
}
示例12: 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);
}
示例13: SendKeepRealmUpdate
public virtual void SendKeepRealmUpdate(AbstractGameKeep keep)
{
}
示例14: CalcCY
public int CalcCY(GamePlayer player, AbstractGameKeep myKeep, double angle)
{
if (Math.Abs(Math.Sin(angle)) < 0.0001)
{
return (myKeep.Y - player.Y) / 148;
}
else
{
int cx = (int)((148 * Math.Sin(angle) * myKeep.X - 148 * Math.Sin(angle) * player.X + player.Y - myKeep.Y)
/ (148 * Math.Sin(angle) - 148 * 148 * 2 * Math.Sin(angle) * Math.Cos(angle)));
return (int)((myKeep.Y - player.Y + 148 * Math.Sin(angle) * cx) / (148 * Math.Cos(angle)));
}
}
示例15: IsAllowedToInteract
/// <summary>
/// Method to tell us if a player can interact with the lord to do certain tasks
/// </summary>
/// <param name="player">The player object</param>
/// <param name="keep">The area object</param>
/// <param name="type">The type of interaction</param>
/// <returns></returns>
public static bool IsAllowedToInteract(GamePlayer player, AbstractGameKeep keep, eInteractType type)
{
if (player.Client.Account.PrivLevel > 1)
return true;
if (player.Realm != keep.Realm)
return false;
if (player.Guild == null)
return false;
if (keep.InCombat)
{
log.DebugFormat("KEEPWARNING: {0} attempted to {1} {2} while in combat.", player.Name, type, keep.Name);
return false;
}
switch (type)
{
case eInteractType.Claim:
{
if (keep.Guild != null)
return false;
foreach (AbstractGameKeep k in GameServer.KeepManager.GetAllKeeps())
{
if (k.Guild == player.Guild)
return false;
}
if (player.Group == null)
return false;
if (player.Group.Leader != player)
return false;
if (player.Group.MemberCount < ServerProperties.Properties.CLAIM_NUM)
return false;
if (!player.GuildRank.Claim)
return false;
break;
}
case eInteractType.Release:
{
if (keep.Guild == null)
return false;
if (keep.Guild != player.Guild)
return false;
if (!player.GuildRank.Claim)
return false;
break;
}
case eInteractType.ChangeLevel:
{
if (keep.Guild == null)
return false;
if (keep.Guild != player.Guild)
return false;
if (!player.GuildRank.Claim)
return false;
break;
}
}
return true;
}