public void RemoveRelic(GameRelic relic) { m_mountedRelic = null; if (relic.CurrentCarrier != null) { string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameRelicPad.RemoveRelic.Removed", relic.CurrentCarrier.Name, GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name, Name); foreach (GameClient cl in WorldMgr.GetAllPlayingClients()) { if (cl.Player.ObjectState != eObjectState.Active) { continue; } cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow); } NewsMgr.CreateNews(message, relic.CurrentCarrier.Realm, eNewsType.RvRGlobal, false); Notify(RelicPadEvent.RelicStolen, this, new RelicPadEventArgs(relic.CurrentCarrier, relic)); } }
/// <summary> /// 用户上线处理 /// </summary> /// <param name="packet"></param> protected void HandleUserOnline(GSPacketIn packet) { int count = packet.ReadInt(); for (int i = 0; i < count; i++) { int playerid = packet.ReadInt(); int consortiaID = packet.ReadInt(); LoginMgr.ClearLoginPlayer(playerid); GamePlayer player = WorldMgr.GetPlayerById(playerid); if (player != null) { GameServer.log.Error("Player hang in server!!!"); player.Out.SendKitoff(LanguageMgr.GetTranslation("Game.Server.LoginNext")); player.Client.Disconnect(); } WorldMgr.OnPlayerOnline(playerid, consortiaID); } }
public override void StartAttack(GameObject attackTarget) { base.StartAttack(attackTarget); foreach (GamePlayer player in GetPlayersInRadius(WorldMgr.SAY_DISTANCE)) { if (player != null) { switch (Realm) { case eRealm.Albion: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Albion.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break; case eRealm.Midgard: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Midgard.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break; case eRealm.Hibernia: player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameGuard.Hibernia.StartAttackSay"), eChatType.CT_System, eChatLoc.CL_SystemWindow); break; } } } }
public static void JoinChatGroup(GamePlayer player, byte response) { ChatGroup mychatgroup = (ChatGroup)player.TempProperties.getProperty <object>(JOIN_CHATGROUP_PROPERTY, null); if (mychatgroup == null) { return; } lock (mychatgroup) { if (mychatgroup.Members.Count < 1) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Players.Chatgroup.NoChatGroup"), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (response == 0x01) { mychatgroup.AddPlayer(player, false); } player.TempProperties.removeProperty(JOIN_CHATGROUP_PROPERTY); } }
public override void Perform(DOLEvent e, object sender, EventArgs args) { GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); InventoryItem inventoryItem = GameInventoryItem.Create(P as ItemTemplate); if (Q == null) { if (!player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, inventoryItem)) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Behaviour.GiveItemAction.GiveButInventFull", inventoryItem.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow); } else { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Behaviour.GiveItemAction.YouReceiveItem", inventoryItem.GetName(0, false)), eChatType.CT_Loot, eChatLoc.CL_SystemWindow); InventoryLogging.LogInventoryAction(Q, player, eInventoryActionType.Quest, inventoryItem.Template, inventoryItem.Count); } } else { player.ReceiveItem(Q, inventoryItem); } }
private static void CheckBgLevelCapForPlayerAndMoveIfNecessary(GamePlayer player) { if (player.Client.Account.PrivLevel == 1 && player.CurrentRegion.IsRvR && player.CurrentRegionID != 163) { ICollection <AbstractGameKeep> list = GameServer.KeepManager.GetKeepsOfRegion(player.CurrentRegionID); foreach (AbstractGameKeep k in list) { if (k.BaseLevel >= 50) { continue; } if (player.Level > k.BaseLevel) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "PlayerInitRequestHandler.LevelCap"), eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow); player.MoveTo((ushort)player.BindRegion, player.BindXpos, player.BindYpos, player.BindZpos, (ushort)player.BindHeading); break; } } } }
public override void OnPrepareNewGame() { base.OnPrepareNewGame(); m_kingMoive = Game.Createlayer(0, 0, "kingmoive", "game.asset.living.BossBgAsset", "out", 1, 1, 0); m_kingFront = Game.Createlayer(720, 495, "font", "game.asset.living.boguoKingAsset", "out", 1, 1, 0); m_king = Game.CreateBoss(m_state, 888, 590, -1, 0); m_king.FallFrom(888, 690, "fall", 0, 2, 1000); m_king.SetRelateDemagemRect(-21, -87, 72, 59); m_king.AddDelay(10); m_king.Say(LanguageMgr.GetTranslation("GameServerScript.AI.Messions.CHM1176.msg2"), 0, 3000); m_kingMoive.PlayMovie("in", 9000, 0); m_kingFront.PlayMovie("in", 9000, 0); m_kingMoive.PlayMovie("out", 13000, 0); m_kingFront.PlayMovie("out", 13400, 0); turn = Game.TurnIndex; //设置本关卡为Boss关卡,关卡胜利后,玩家可以翻一张牌 Game.CanTakeCard = 1; }
public int HandlePacket(GameClient client, Game.Base.Packets.GSPacketIn packet) { if (Managers.AwardMgr.AddDailyAward(client.Player) == true) { using (PlayerBussiness db = new PlayerBussiness()) { if (db.UpdatePlayerLastAward(client.Player.PlayerCharacter.ID) == true) { client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Success")); } else { client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Fail")); } } } else { client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("GameUserDailyAward.Fail1")); } return(2); }
protected void HealerDialogResponse(GamePlayer player, byte response) { if (!this.IsWithinRadius(player, WorldMgr.INTERACT_DISTANCE)) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Healer.HealerDialogResponse.Text1", GetName(0, false, player.Client.Account.Language, this)), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (response != 0x01) //declined { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Healer.HealerDialogResponse.Text2"), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } long cost = player.TempProperties.getProperty <long>(COST_BY_PTS); player.TempProperties.removeProperty(COST_BY_PTS); int restorePoints = (int)Math.Min(player.TotalConstitutionLostAtDeath, player.GetCurrentMoney() / cost); if (restorePoints < 1) { restorePoints = 1; // at least one } long totalCost = restorePoints * cost; if (player.RemoveMoney(totalCost)) { InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, totalCost); player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Healer.HealerDialogResponse.Text3", this.Name, Money.GetString(totalCost)), eChatType.CT_System, eChatLoc.CL_SystemWindow); player.TotalConstitutionLostAtDeath -= restorePoints; player.Out.SendCharStatsUpdate(); } else { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Healer.HealerDialogResponse.Text4", Money.GetString(totalCost), restorePoints), eChatType.CT_System, eChatLoc.CL_SystemWindow); } return; }
public void OnCommand(GameClient client, string[] args) { if (ServerProperties.Properties.DISABLE_APPEALSYSTEM) { AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.SystemDisabled")); return; } bool HasPendingAppeal = client.Player.TempProperties.getProperty <bool>("HasPendingAppeal"); if (HasPendingAppeal) { AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.AlreadyActiveAppeal", client.Player.Name)); return; } if (args.Length < 5) { AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.NeedMoreDetail")); return; } //strip these words if they are the first word in the appeal text switch (args[1].ToLower()) { case "harassment": case "naming": case "other": case "conduct": case "stuck": case "emergency": { args[1] = ""; break; } } string message = string.Join(" ", args, 1, args.Length - 1); GamePlayer p = client.Player as GamePlayer; AppealMgr.CreateAppeal(p, (int)AppealMgr.eSeverity.Critical, "Open", message); return; }
/// <summary> /// Talk to trainer /// </summary> /// <param name="source"></param> /// <param name="text"></param> /// <returns></returns> public override bool WhisperReceive(GameLiving source, string text) { if (!base.WhisperReceive(source, text)) { return(false); } if (!(source is GamePlayer player)) { return(false); } string lowerCase = text.ToLower(); if (lowerCase == LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceiveCase.Text1")) { // promote player to other class if (CanPromotePlayer(player)) { PromotePlayer(player, (int)eCharacterClass.Valkyrie, LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceive.Text1"), null); } } else if ((player.Inventory.GetFirstItemByID(WeaponId1, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) == null) && (player.Inventory.GetFirstItemByID(WeaponId2, eInventorySlot.FirstBackpack, eInventorySlot.LastBackpack) == null)) { if (lowerCase == LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceiveCase.Text2")) { player.ReceiveItem(this, WeaponId1); player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceive.Text2"), eChatType.CT_Say, eChatLoc.CL_PopupWindow); } else if (lowerCase == LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceiveCase.Text3")) { player.ReceiveItem(this, WeaponId2); player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "ValkyrieTrainer.WhisperReceive.Text2"), eChatType.CT_Say, eChatLoc.CL_PopupWindow); } } return(true); }
public void HandlePacket(GameClient client, GSPacketIn packet) { if (client.Player == null) { return; } int code = packet.ReadByte(); if (code != 0) { log.Warn($"bonuses button: code is other than zero ({code})"); } new RegionTimerAction <GamePlayer>( client.Player, p => p.Out.SendCustomTextWindow( LanguageMgr.GetTranslation(client.Account.Language, "PlayerBonusesListRequestHandler.HandlePacket.Bonuses"), client.Player.GetBonuses().ToList() ) ).Start(1); }
private static void MakeGuildLot(GamePlayer player, byte response) { // user responded no/decline if (response != 0x01) { return; } var playerHouse = GetHouse(GetHouseNumberByPlayer(player)); var playerGuild = player.Guild; // double check and make sure this guild isn't null if (playerGuild == null) { return; } // adjust the house to be under guild control playerHouse.DatabaseItem.OwnerID = playerGuild.GuildID; playerHouse.DatabaseItem.Name = playerGuild.Name; playerHouse.DatabaseItem.GuildHouse = true; playerHouse.DatabaseItem.GuildName = playerGuild.Name; // adjust guild to reflect their new guild house player.Guild.GuildHouseNumber = playerHouse.HouseNumber; // notify guild members of the guild house acquisition player.Guild.SendMessageToGuildMembers( LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Player.Housing.GuildNowOwns", player.Guild.Name, player.Name), eChatType.CT_Guild, eChatLoc.CL_SystemWindow); // save the guild and broadcast updates player.Guild.SaveIntoDatabase(); player.Guild.UpdateGuildWindow(); // save the house and broadcast updates playerHouse.SaveIntoDatabase(); playerHouse.SendUpdate(); }
public void OnCommand(GameClient client, string[] args) { if (client.Player.TempProperties.getProperty <string>(GamePlayer.AFK_MESSAGE) != null && args.Length == 1) { client.Player.TempProperties.removeProperty(GamePlayer.AFK_MESSAGE); client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Afk.Off"), eChatType.CT_System, eChatLoc.CL_SystemWindow); } else { if (args.Length > 1) { string message = string.Join(" ", args, 1, args.Length - 1); client.Player.TempProperties.setProperty(GamePlayer.AFK_MESSAGE, message); } else { client.Player.TempProperties.setProperty(GamePlayer.AFK_MESSAGE, string.Empty); } client.Out.SendMessage(LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Afk.On"), eChatType.CT_System, eChatLoc.CL_SystemWindow); } }
/// <summary> /// Called when player tries to begin crafting an item /// </summary> public virtual void CraftItem(GamePlayer player, DBCraftedItem recipe, ItemTemplate itemToCraft, IList <DBCraftedXItem> rawMaterials) { if (!CanPlayerStartToCraftItem(player, recipe, itemToCraft, rawMaterials)) { return; } if (player.IsCrafting) { StopCraftingCurrentItem(player, itemToCraft); return; } int craftingTime = GetCraftingTime(player, recipe, rawMaterials); player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CraftItem.BeginWork", itemToCraft.Name, CalculateChanceToMakeItem(player, recipe).ToString()), eChatType.CT_Missed, eChatLoc.CL_SystemWindow); player.Out.SendTimerWindow(LanguageMgr.GetTranslation(player.Client.Account.Language, "AbstractCraftingSkill.CraftItem.CurrentlyMaking", itemToCraft.Name), craftingTime); player.Stealth(false); StartCraftingTimerAndSetCallBackMethod(player, recipe, rawMaterials, craftingTime); }
/// <summary> /// Called when a player sells something /// </summary> /// <param name="player">Player making the sale</param> /// <param name="item">The InventoryItem to be sold</param> /// <returns>true if selling is allowed, false if it should be prevented</returns> public virtual void OnPlayerSell(GamePlayer player, InventoryItem item) { if (item == null || player == null) { return; } if (!item.IsDropable) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameMerchant.OnPlayerSell.CantBeSold"), eChatType.CT_Merchant, eChatLoc.CL_SystemWindow); return; } if (!this.IsWithinRadius(player, GS.ServerProperties.Properties.WORLD_PICKUP_DISTANCE)) // tested { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameMerchant.OnPlayerSell.TooFarAway", GetName(0, true)), eChatType.CT_Merchant, eChatLoc.CL_SystemWindow); return; } long itemValue = OnPlayerAppraise(player, item, true); if (itemValue == 0) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameMerchant.OnPlayerSell.IsntInterested", GetName(0, true), item.GetName(0, false)), eChatType.CT_Merchant, eChatLoc.CL_SystemWindow); return; } if (player.Inventory.RemoveItem(item)) { string message = LanguageMgr.GetTranslation(player.Client.Account.Language, "GameMerchant.OnPlayerSell.GivesYou", GetName(0, true), Money.GetString(itemValue), item.GetName(0, false)); player.AddMoney(itemValue, message, eChatType.CT_Merchant, eChatLoc.CL_SystemWindow); InventoryLogging.LogInventoryAction(player, this, eInventoryActionType.Merchant, item.Template, item.Count); InventoryLogging.LogInventoryAction(this, player, eInventoryActionType.Merchant, itemValue); return; } else { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GameMerchant.OnPlayerSell.CantBeSold"), eChatType.CT_Merchant, eChatLoc.CL_SystemWindow); } }
public override void AddEffectsInfo(IList <string> list) { // TODO Translate if (ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING) { list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info1")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info2")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info3")); list.Add(string.Empty); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info4")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info5")); } else { list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info1")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info2")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info3")); list.Add(string.Empty); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info4")); list.Add(LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "ConcentrationAbility.AddEffectsInfo.Info5")); } }
public virtual bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg) { if (!this.NoTakeDamage && this is SimpleNpc) { return(false); } bool result = false; if (!this.IsFrost && this.m_blood > 0) { if (source != this || source.Team == this.Team) { this.OnBeforeTakedDamage(source, ref damageAmount, ref criticalAmount); } this.m_blood -= damageAmount + criticalAmount; if (this.EffectTrigger && this is Player) { this.Game.SendMessage((this as Player).PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success2", new object[0]), LanguageMgr.GetTranslation("PlayerEquipEffect.Success3", new object[] { (this as Player).PlayerDetail.PlayerCharacter.NickName }), 3); } if (this.m_syncAtTime) { this.m_game.SendGameUpdateHealth(this, 6, damageAmount + criticalAmount); } this.OnAfterTakedDamage(source, damageAmount, criticalAmount); if (this.m_blood <= 0) { this.Die(); } Player arg_F3_0 = this as Player; result = true; } this.EffectList.StopEffect(typeof(IceFronzeEffect)); this.EffectList.StopEffect(typeof(HideEffect)); this.EffectList.StopEffect(typeof(NoHoleEffect)); return(result); }
public void OnCommand(GameClient client, string[] args) { if (client == null || client.Player == null) { return; } if (IsSpammingCommand(client.Player, "Debug")) { return; } // extra check to disallow all but server GM's if (client.Account.PrivLevel < 2) { return; } if (args.Length < 2) { DisplaySyntax(client); return; } if (args[1].ToLower().Equals("on")) { client.Player.TempProperties.setProperty(GamePlayer.DEBUG_MODE_PROPERTY, true); client.Player.IsAllowedToFly = true; client.Out.SendDebugMode(true); DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Debug.ModeON")); } else if (args[1].ToLower().Equals("off")) { client.Player.TempProperties.removeProperty(GamePlayer.DEBUG_MODE_PROPERTY); client.Out.SendDebugMode(false); client.Player.IsAllowedToFly = false; DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "GMCommands.Debug.ModeOFF")); } }
public int HandlePacket(GameClient client, GSPacketIn packet) { if (client.Player.PlayerCharacter.ConsortiaID == 0) { return(0); } int id = client.Player.PlayerCharacter.ConsortiaID; string consortiaName = client.Player.PlayerCharacter.ConsortiaName; bool result = false; string msg = "ConsortiaDisbandHandler.Failed"; using (ConsortiaBussiness db = new ConsortiaBussiness()) { if (db.DeleteConsortia(client.Player.PlayerCharacter.ConsortiaID, client.Player.PlayerCharacter.ID, ref msg)) { result = true; msg = "ConsortiaDisbandHandler.Success1"; client.Player.ClearConsortia(); GameServer.Instance.LoginServer.SendConsortiaDelete(id); } } string temp = LanguageMgr.GetTranslation(msg); if (msg == "ConsortiaDisbandHandler.Success1") { temp += consortiaName + LanguageMgr.GetTranslation("ConsortiaDisbandHandler.Success2"); } packet.WriteBoolean(result); packet.WriteInt(client.Player.PlayerCharacter.ID); packet.WriteString(temp); client.Out.SendTCP(packet); return(0); }
public override void Stop() { base.Stop(); m_owner.Model = m_originalModel; double m_amountPercent = m_amount / m_owner.GetModified(eProperty.MaxHealth); int playerHealthPercent = m_owner.HealthPercent; m_owner.BaseBuffBonusCategory[(int)eProperty.MaxHealth] -= m_amount; if (m_owner.IsAlive) { m_owner.Health = (int)Math.Max(1, 0.01 * m_owner.MaxHealth * playerHealthPercent); } if (m_owner is GamePlayer) { (m_owner as GamePlayer).Out.SendUpdatePlayer(); // there is no animation on end of the effect (m_owner as GamePlayer).Out.SendMessage(LanguageMgr.GetTranslation((m_owner as GamePlayer).Client, "Effects.StagEffect.YourHuntsSpiritEnds"), eChatType.CT_YouHit, eChatLoc.CL_SystemWindow); } }
public int HandlePacket(GameClient client, GSPacketIn packet) { PlayerInventory caddyBag = client.Player.CaddyBag; int num = 1; int num2 = 0; int num3 = 0; string text = ""; for (int i = 0; i < caddyBag.Capalility; i++) { ItemInfo itemAt = caddyBag.GetItemAt(i); if (itemAt != null) { if (itemAt.Template.ReclaimType == 1) { num2 += num * itemAt.Template.ReclaimValue; text += LanguageMgr.GetTranslation("ItemReclaimHandler.Success2", new object[] { num2 }); } if (itemAt.Template.ReclaimType == 2) { num3 += num * itemAt.Template.ReclaimValue; text += LanguageMgr.GetTranslation("ItemReclaimHandler.Success1", new object[] { num3 }); } caddyBag.RemoveItem(itemAt); } } client.Player.BeginChanges(); client.Player.AddGold(num2); client.Player.AddGiftToken(num3); client.Player.CommitChanges(); client.Out.SendMessage(eMessageType.Normal, text); return(1); }
public override Player RemovePlayer(IGamePlayer gp, bool IsKick) { Player player = base.RemovePlayer(gp, IsKick); if (player != null && player.IsLiving && GameState != eGameState.Loading) { gp.RemoveGP(gp.PlayerCharacter.Grade * 12); string msg = null; string msg1 = null; if (RoomType == eRoomType.Match) { if (GameType == eGameType.Guild) { msg = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg6", gp.PlayerCharacter.Grade * 12, 15); gp.RemoveOffer(15); msg1 = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg7", gp.PlayerCharacter.NickName, gp.PlayerCharacter.Grade * 12, 15); } else if (GameType == eGameType.Free) { msg = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg6", gp.PlayerCharacter.Grade * 12, 5); gp.RemoveOffer(5); msg1 = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg7", gp.PlayerCharacter.NickName, gp.PlayerCharacter.Grade * 12, 5); } } else { msg = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg4", gp.PlayerCharacter.Grade * 12); msg1 = LanguageMgr.GetTranslation("AbstractPacketLib.SendGamePlayerLeave.Msg5", gp.PlayerCharacter.NickName, gp.PlayerCharacter.Grade * 12); } SendMessage(gp, msg, msg1, 3); if (GetSameTeam() == true) { CurrentLiving.StopAttacking(); CheckState(0); } } return(player); }
public void OnCommand(GameClient client, string[] args) { const string BROAD_TICK = "Broad_Tick"; if (args.Length < 2) { DisplayMessage(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Broadcast.NoText")); return; } if (client.Player.IsMuted) { client.Player.Out.SendMessage("You have been muted. You cannot broadcast.", eChatType.CT_Staff, eChatLoc.CL_SystemWindow); return; } string message = string.Join(" ", args, 1, args.Length - 1); long BroadTick = client.Player.TempProperties.getProperty <long>(BROAD_TICK); if (BroadTick > 0 && BroadTick - client.Player.CurrentRegion.Time <= 0) { client.Player.TempProperties.removeProperty(BROAD_TICK); } long changeTime = client.Player.CurrentRegion.Time - BroadTick; if (changeTime < 800 && BroadTick > 0) { client.Player.Out.SendMessage("Slow down! Think before you say each word!", eChatType.CT_System, eChatLoc.CL_SystemWindow); client.Player.TempProperties.setProperty(BROAD_TICK, client.Player.CurrentRegion.Time); return; } Broadcast(client.Player, message); client.Player.TempProperties.setProperty(BROAD_TICK, client.Player.CurrentRegion.Time); }
public void OnCommand(GameClient client, string[] args) { if (ServerProperties.Properties.DISABLE_APPEALSYSTEM) { AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.SystemDisabled")); return; } if (args.Length < 5) { AppealMgr.MessageToClient(client, LanguageMgr.GetTranslation(client.Account.Language, "Scripts.Players.Appeal.NeedMoreDetail")); return; } // send over the info to the /report command args[1] = string.Empty; // strip these words if they are the first word in the bugreport text switch (args[2].ToLower()) { case "harassment": case "naming": case "other": case "conduct": case "stuck": case "emergency": { args[2] = string.Empty; break; } } ReportCommandHandler report = new ReportCommandHandler(); report.OnCommand(client, args); AppealMgr.MessageToAllStaff(client.Player.Name + " submitted a bug report."); return; }
public static void PlayerEnter(DOLEvent e, object sender, EventArgs args) { GamePlayer player = sender as GamePlayer; if (player == null) { return; } if (player.Client.Account.PrivLevel > (uint)ePrivLevel.Player) { StaffList.Add(player); IList <DBAppeal> Appeals = GetAllAppeals(); if (Appeals.Count > 0) { player.Out.SendMessage("[Appeals]: " + "There are " + Appeals.Count + " appeals in the queue! Use /gmappeal to work the appeals queue.", eChatType.CT_Important, eChatLoc.CL_ChatWindow); } } //Check if there is an existing appeal belonging to this player. DBAppeal appeal = GetAppealByAccountName(player.Client.Account.Name); if (appeal == null) { player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Players.Appeal.LoginMessage"), eChatType.CT_System, eChatLoc.CL_SystemWindow); return; } if (appeal.Name != player.Name) { //players account has an appeal but it dosn't belong to this player, let's change it. appeal.Name = player.Name; appeal.Dirty = true; GameServer.Database.SaveObject(appeal); } player.Out.SendMessage("[Appeals]: " + LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Players.Appeal.YouHavePendingAppeal"), eChatType.CT_Important, eChatLoc.CL_ChatWindow); player.TempProperties.setProperty("HasPendingAppeal", true); NotifyStaff(); }
public int HandlePacket(GameClient client, GSPacketIn packet) { int result; if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked) { client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("Bag.Locked", new object[0])); result = 0; } else { eBageType bagType = (eBageType)packet.ReadByte(); int place = packet.ReadInt(); string newNickName = packet.ReadString(); string message = ""; ItemInfo info = client.Player.GetItemAt(bagType, place); if (info != null) { if (info.TemplateID == 11994) { string oldNickName = client.Player.PlayerCharacter.NickName; string userName = client.Player.PlayerCharacter.UserName; using (PlayerBussiness db = new PlayerBussiness()) { if (db.RenameByCard(userName, oldNickName, newNickName, ref message)) { client.Player.OnUsingItem(info.TemplateID); client.Player.RemoveItem(info, eItemRemoveType.Use); packet.WriteString(LanguageMgr.GetTranslation("Tank.Request.RenameNick.Success", new object[0])); client.Out.SendTCP(packet); } } } } result = 0; } return(result); }
/// <summary> /// Get Spot Description Checking Any Area with Description or Zone Description and Try Translating it /// </summary> /// <param name="reg"></param> /// <param name="client"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <returns></returns> public static string GetTranslatedSpotDescription(this Region reg, GameClient client, float x, float y, float z) { if (reg != null) { var area = reg.GetAreasOfSpot(x, y, z).OfType <AbstractArea>().FirstOrDefault(a => a.DisplayMessage); // Try Translate Area First if (area != null) { var lng = LanguageMgr.GetTranslation(client, area) as DBLanguageArea; if (lng != null && !Util.IsEmpty(lng.ScreenDescription)) { return(lng.ScreenDescription); } return(area.Description); } var zone = reg.GetZone(x, y); // Try Translate Zone if (zone != null) { var lng = LanguageMgr.GetTranslation(client, zone) as DBLanguageZone; if (lng != null) { return(lng.ScreenDescription); } return(zone.Description); } return(reg.Description); } return(string.Empty); }
public void MoveFromStore(GameClient client, PlayerInventory storeBag, ItemInfo item, int toSlot, PlayerInventory bag, int count) { if (client.Player != null && item != null && storeBag != null && bag != null && item.Template.BagType == (eBageType)bag.BagType) { if (toSlot < bag.BeginSlot || toSlot > bag.Capalility) { if (bag.StackItemToAnother(item)) { storeBag.RemoveItem(item, eItemRemoveType.Stack); return; } string key = string.Format("temp_place_{0}", item.ItemID); if (client.Player.TempProperties.ContainsKey(key)) { toSlot = (int)storeBag.Player.TempProperties[key]; storeBag.Player.TempProperties.Remove(key); } else { toSlot = bag.FindFirstEmptySlot(); } } if (bag.StackItemToAnother(item) || bag.AddItemTo(item, toSlot)) { storeBag.TakeOutItem(item); return; } toSlot = bag.FindFirstEmptySlot(); if (bag.AddItemTo(item, toSlot)) { storeBag.TakeOutItem(item); return; } storeBag.TakeOutItem(item); client.Player.SendItemToMail(item, LanguageMgr.GetTranslation("UserChangeItemPlaceHandler.full", new object[0]), LanguageMgr.GetTranslation("UserChangeItemPlaceHandler.full", new object[0]), eMailType.ItemOverdue); client.Player.Out.SendMailResponse(client.Player.PlayerCharacter.ID, eMailRespose.Receiver); } }
public int HandlePacket(GameClient client, GSPacketIn packet) { int id = packet.ReadInt(); bool result = false; int tempID = 0; int state = 0; string msg = "ConsortiaApplyAllyPassHandler.Failed"; using (ConsortiaBussiness db = new ConsortiaBussiness()) { if (db.PassConsortiaApplyAlly(id, client.Player.PlayerCharacter.ID, client.Player.PlayerCharacter.ConsortiaID, ref tempID, ref state, ref msg)) { msg = "ConsortiaApplyAllyPassHandler.Success"; result = true; GameServer.Instance.LoginServer.SendConsortiaAlly(client.Player.PlayerCharacter.ConsortiaID, tempID, state); } } packet.WriteBoolean(result); packet.WriteString(LanguageMgr.GetTranslation(msg)); client.Out.SendTCP(packet); return(0); }