public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { PlayerMobile pm = (PlayerMobile)from; if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleMangarKey")) { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "This golden skull has an eerie glow.", from.NetState); } else if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleSilverSquare") && CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleSilverTriangle") && CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleSilverCircle")) { CharacterDatabase.SetBardsTaleQuest(from, "BardsTaleMangarKey"); from.SendSound(0x3D); from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "Placing the 3 silver shapes on the skull, the mouth opens to reveal a silver key.", from.NetState); } else { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "This golden skull has an eerie glow, and there seems to be 3 different shapes carved on it.", from.NetState); } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
internal void UpdateUserCharacter(UserCharacter userCharacter) { for (int i = 0; i < _userCharacters.Count; i++) { if (_userCharacters[i].Id == userCharacter.Id) { _userCharacters[i].CharacterCode = ""; for (int j = 0; j < _myCharacters.Count; j++) { if (_myCharacters[j].Id == _userCharacters[i].CharacterId) { _myCharacters[j].IsEnable = true; var characterHandler = FindObjectOfType(typeof(CharacterListHandler)) as CharacterListHandler; if (characterHandler != null) { characterHandler.SceneRefresh = true; } return; } } } } _userCharacters.Add(userCharacter); var characterDatabase = CharacterDatabase.Instance(); Character character = characterDatabase.GetCharacterById(userCharacter.CharacterId); _myCharacters.Add(character); }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } if (CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey")) { m_Giver.SayTo(m_Mobile, "Have you been meditating in the Catacombs?"); } else if (!(CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleMadGodName"))) { m_Giver.SayTo(m_Mobile, "Only a true disciple knows the name of the Mad God."); } else if (!(CharacterDatabase.GetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey"))) { if (!m_Mobile.HasGump(typeof(SpeechGump))) { CharacterDatabase.SetBardsTaleQuest(m_Mobile, "BardsTaleCatacombKey", true); m_Mobile.SendSound(0x3D); m_Mobile.SendGump(new SpeechGump("The Catacombs Below", SpeechFunctions.SpeechText(m_Giver.Name, m_Mobile.Name, "MadGodPriest"))); } } }
public void DoBasementDoor(Mobile m) { if (m is PlayerMobile) { Point3D p = new Point3D(4095, 3550, 40); if (DoorShop == "iron") { p = new Point3D(4075, 3562, 20); } else if (DoorShop == "cloth") { p = new Point3D(4100, 3534, 20); } else if (DoorShop == "wood") { p = new Point3D(4118, 3533, 20); } PlayerMobile pc = (PlayerMobile)m; CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); string sX = m.X.ToString(); string sY = m.Y.ToString(); string sZ = m.Z.ToString(); string sMap = Worlds.GetMyMapString(m.Map); string sZone = this.Name; DB.CharacterPublicDoor = sX + "#" + sY + "#" + sZ + "#" + sMap + "#" + sZone; PublicTeleport(m, p, Map.Sosaria, "the Basement", "enter"); } }
public async void OnResourceStart() { NAPI.Server.SetAutoRespawnAfterDeath(false); NAPI.Server.SetAutoSpawnOnConnect(false); //NAPI.Server.SetGlobalServerChat(false); //NAPI.Server.SetCommandErrorMessage(""); ServerUtilities.Initialise(); Database db = new Database(); Connection = db.Connection; GroupDatabase.InitializeTable(); GroupDatabase.InitializeGroups(); VehicleDatabase.InitializeTable(); PlayerDatabase.InitializeTable(); CharacterDatabase.InitializeTable(); await GroupDatabase.AddCommandsToGroup(Config.GROUP_NAME_ADMIN, Commands.AdminCommands.ToArray()); await GroupDatabase.AddCommandsToGroup(Config.GROUP_NAME_LEAD_ADMIN, Commands.OwnerCommands.ToArray()); await GroupDatabase.AddCommandsToGroup(Config.GROUP_NAME_OWNER, Commands.OwnerCommands.ToArray()); }
void SetUpGame() { GameRandom = new System.Random(); RealDate = new Date(); RealDate.Day = 1; RealDate.Month = 1; RealDate.Year = 1; FightManager = new FightManager(); ActivityManager = new ActivityManager(); CurrentLeagueFighterDatabase = new FighterDatabase(); TeamManager = new TeamManager(); BookingManager = new BookingManager(); PlayerManager = new PlayerManager(); CharacterDatabase = new CharacterDatabase(); WorldMethods.SetUpWorld(); GameObject.Find("FighterListContent").GetComponent <FighterListContent> ().SetUp(CurrentLeagueFighterDatabase.AllFighters); GameObject.Find("TeamListContent").GetComponent <TeamListContent> ().SetUp(TeamManager.TeamsInLeague); GameObject.Find("FightsPlannedListContent").GetComponent <FightPlanListContent> ().SetUp(BookingManager.Calendar); CharacterDatabase.SetUpCharacterDatabase(); //Check whether the ID assignment has occurred properly print("Total Characters: " + CharacterDatabase.AllCharacters.Count); print("Highest ID: " + CharacterDatabase.UsedIDs + " (Should be the same as Total Characters)"); OpinionManager = new Opinion(); }
private static void OnTogglePlayBarbaric(CommandEventArgs e) { Mobile m = e.Mobile; CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); if (DB != null) { if (DB.CharacterBarbaric == 1 && m.Female) { m.SendMessage(68, "You have enabled the barbaric play style with amazon fighter titles."); DB.CharacterBarbaric = 2; } else if (DB.CharacterBarbaric > 0) { m.SendMessage(38, "You have disabled the barbaric play style."); DB.CharacterBarbaric = 0; Server.Items.BarbaricSatchel.GetRidOf(m); } else { m.SendMessage(68, "You have enabled the barbaric play style."); DB.CharacterEvil = 0; DB.CharacterOriental = 0; DB.CharacterBarbaric = 1; Server.Items.BarbaricSatchel.GivePack(m); } } }
public override bool OnMoveOver(Mobile m) { Point3D coord = new Point3D(6730, 3315, 0); Map map = Map.Felucca; if (this.Map == Map.Felucca) { coord = new Point3D(2672, 3235, 0); map = Map.Trammel; } if (CharacterDatabase.GetKeys(m, "SkullGate")) { BaseCreature.TeleportPets(m, coord, map, false); m.MoveToWorld(coord, map); m.PlaySound(0x658); return(false); } else { Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); Effects.PlaySound(m.Location, m.Map, 0x229); m.ApplyPoison(m, Poison.Lethal); m.SendMessage("Not knowing the secret of the skull gate, you suffer the effects."); } return(true); }
private void SyncCurrentMap() { foreach (IEntity e in entities) { Destroy(e.Graphics.entity); } mapView.DrawMap(CurrentMap.tiles, (int)CurrentMap.mapSize.x, (int)CurrentMap.mapSize.y); foreach (NPCPrototype cd in currentMap.Characters) { entities.Add(CharacterDatabase.CreateCharacter(cd)); } TileMapPathfinder.SetMap(currentMap); List <Tile> path = TileMapPathfinder.Path(currentMap.GetTile((int)currentMap.mapSize.x / 2, (int)currentMap.mapSize.y / 2), currentMap.GetTile((int)UnityEngine.Random.Range(1, currentMap.mapSize.x - 1), (int)UnityEngine.Random.Range(1, currentMap.mapSize.y - 1))); foreach (Tile t in path) { t.TileType = TileType.Wall; mapView.RedrawTile(t); } }
private static void AddBackpack(Mobile m) { Container pack = m.Backpack; if (pack == null) { pack = new Backpack(); pack.Movable = false; m.AddItem(pack); } PackItem(new Dagger()); // WIZARD PackItem(new Gold(5000)); PackItem(new BreadLoaf(4)); PackItem(new Waterskin()); PackItem(new Torch()); PackItem(new LoreGuidetoAdventure()); PackItem(new SkillBall()); PackItem(new Bandage(100)); PackItem(new StatBall()); PackItem(new PetLeash()); PackItem(new InstantTameDeed()); CharacterDatabase MyDB = new CharacterDatabase(); MyDB.CharacterOwner = m; m.BankBox.DropItem(MyDB); }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { PlayerMobile pm = (PlayerMobile)from; if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleKylearanKey")) { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "This statue still has the eye you placed in it.", from.NetState); } else if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleSpectreEye") && !(CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleKylearanKey"))) { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You place the mysterious eye into the statue.", from.NetState); SpawnTarjan(from); this.Delete(); } else { from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "This statue seems to be missing an eye.", from.NetState); } } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
// File management static public void Create() { if (m_Instance == null) { m_Instance = new PlayerData(); //if we create the PlayerData, mean it's the very first call, so we use that to init the database //this allow to always init the database at the earlier we can, i.e. the start screen if started normally on device //or the Loadout screen if testing in editor CoroutineHandler.StartStaticCoroutine(CharacterDatabase.LoadDatabase()); CoroutineHandler.StartStaticCoroutine(ThemeDatabase.LoadDatabase()); } m_Instance.saveFile = Application.persistentDataPath + "/save.bin"; if (File.Exists(m_Instance.saveFile)) { // If we have a save, we read it. m_Instance.Read(); } else { // If not we create one with default data. NewSave(); } m_Instance.CheckMissionsCount(); }
public DataHandler(Queue <DataPacket> receiveQueue, Queue <DataPacket> sendQueue, object newReceiveLock, object newSendLock) { instance = this; receiveMsgs = receiveQueue; sendMsgs = sendQueue; receiveLock = newReceiveLock; sendLock = newSendLock; loginUser = new Dictionary <Socket, string>(); userState = new Dictionary <string, UserState>(); SetNotifier(); database = AccountDatabase.Instance; database.InitailizeDatabase(); monsterDatabase = MonsterDatabase.Instance; monsterDatabase.InitializeMonsterDatabase(); dungeonDatabase = DungeonDatabase.Instance; dungeonDatabase.InitializeDungeonDatabase(); monsterDatabase = MonsterDatabase.Instance; monsterDatabase.InitializeMonsterDatabase(); characterDatabase = CharacterDatabase.Instance; characterDatabase.InitializeCharacterDatabase(); roomManager = new RoomManager(); Thread handleThread = new Thread(new ThreadStart(DataHandle)); handleThread.Start(); //Thread logoutCheckThread = new Thread(new ThreadStart(CheckLogoutUser)); //logoutCheckThread.Start(); }
protected void AddEntities() { for (int i = 0; i < 30; i++) { Characters.Add(CharacterDatabase.GetRandomChar()); } }
protected override void OnAwake() { if (Database == null) { Database = new CharacterDatabase(); } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; int button = info.ButtonID; if (info.ButtonID == 1) { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(from); if (DB.CharacterMOTD == 1) { DB.CharacterMOTD = 0; } else { DB.CharacterMOTD = 1; } MOTD_Utility.SendGump(from, false, this.Index, m_Origin); from.PlaySound(0x4A); } else if (m_Origin > 0) { from.PlaySound(0x4A); from.SendGump(new Server.Engines.Help.HelpGump(from, 1)); } }
public static int GetPlaylistSetting(Mobile m, int nSetting) { PlayerMobile pm = (PlayerMobile)m; string sSetting = "0"; MusicPlaylistFunctions.InitializePlaylist(m); CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); string PlaylistSetting = DB.MusicPlaylist; string[] eachSetting = PlaylistSetting.Split('#'); int nLine = 1; foreach (string eachSettings in eachSetting) { if (nLine == nSetting) { sSetting = eachSettings; } nLine++; } int nValue = Convert.ToInt32(sSetting); return(nValue); }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "FishingQuest"); int nSucceed = FishingQuestFunctions.DidQuest(m_Mobile); if (nSucceed > 0) { FishingQuestFunctions.PayAdventurer(m_Mobile); } else if (myQuest.Length > 0) { if (!m_Mobile.HasGump(typeof(SpeechGump))) { m_Mobile.SendGump(new SpeechGump("Your Reputation Is At Stake", SpeechFunctions.SpeechText(m_Mobile.Name, m_Mobile.Name, "FishQuestBoardFail"))); } } else { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You are not currently on a quest.", m_Mobile.NetState); } }
void Awake() { _characterManager = Instance(); _characterDatabase = CharacterDatabase.Instance(); _itemDatabase = ItemDatabase.Instance(); _userDatabase = UserDatabase.Instance(); }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "FishingQuest"); int nAllowedForAnotherQuest = FishingQuestFunctions.QuestTimeNew(m_Mobile); int nServerQuestTimeAllowed = DifficultyLevel.GetTimeBetweenQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString(); if (CharacterDatabase.GetQuestState(m_Mobile, "FishingQuest")) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You are already on a quest. Return here when you are done.", m_Mobile.NetState); } else if (nWhenForAnotherQuest > 0) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "There are no quests at the moment. Check back in " + sAllowedForAnotherQuest + " minutes.", m_Mobile.NetState); } else { int nFame = m_Mobile.Fame * 2; nFame = Utility.RandomMinMax(0, nFame) + 2000; FishingQuestFunctions.FindTarget(m_Mobile, nFame); string TellQuest = FishingQuestFunctions.QuestStatus(m_Mobile) + "."; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, TellQuest, m_Mobile.NetState); } }
public static void ThiefTimeAllowed(Mobile m) { DateTime TimeFinished = DateTime.Now; string sFinished = Convert.ToString(TimeFinished); CharacterDatabase.SetQuestInfo(m, "ThiefQuest", sFinished); }
public static void HandlePlayerInfoRequest(WorldSession session, ClientPlayerInfoRequest request) { session.EnqueueEvent(new TaskGenericEvent <Character>(CharacterDatabase.GetCharacterById(request.Identity.CharacterId), character => { if (character == null) { throw new InvalidPacketValueException(); } session.EnqueueMessageEncrypted(new ServerPlayerInfoFullResponse { BaseData = new ServerPlayerInfoFullResponse.Base { ResultCode = 0, Identity = new TargetPlayerIdentity { RealmId = WorldServer.RealmId, CharacterId = character.Id }, Name = character.Name, Faction = (Faction)character.FactionId }, IsClassPathSet = true, Path = (Path)character.ActivePath, Class = (Class)character.Class, Level = character.Level, IsLastLoggedOnInDaysSet = false, LastLoggedInDays = -1f }); })); }
public async void SelectCharacter(Client client, object[] args) { uint characterId = (uint)(int)args[0]; CharacterData characterData = await CharacterDatabase.GetCharacterData(characterId); Vector3 position = characterData.GetPosition(); float heading = characterData.Heading.HasValue ? characterData.Heading.Value : 0; if (position == null) { GamePosition spawnPoint = ServerUtilities.GetRandomSpawnPoint(); position = spawnPoint.GetPosition(); heading = spawnPoint.GetHeading(); } client.SetData(CharacterData.CHARACTER_DATA_KEY, characterData); PlayerData playerData = client.GetData(PlayerData.PLAYER_DATA_KEY); GroupData highestRankedGroup = await GroupDatabase.GetPlayerHighestRankingGroup(playerData.Id); if (highestRankedGroup == null) { return; } if (characterData == null) { return; } ServerUtilities.SetPlayerNametag(client); ServerUtilities.SwitchPlayerPosition(client, position, heading); }
public static void ArtifactQuestTimeAllowed(Mobile m) { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); DateTime TimeFinished = DateTime.UtcNow; DB.ArtifactQuestTime = Convert.ToString(TimeFinished); }
public override void OnMovement(Mobile m, Point3D oldLocation) { if (m is PlayerMobile) { CharacterDatabase.SetBardsTaleQuest(m, this.Name); } }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "AssassinQuest"); int nSucceed = AssassinFunctions.DidAssassin(m_Mobile); if (nSucceed > 0) { AssassinFunctions.PayAssassin(m_Mobile, m_Giver); } else if (myQuest.Length > 0) { if (!m_Mobile.HasGump(typeof(SpeechGump))) { m_Mobile.SendGump(new SpeechGump("Failure Is Frowned Upon", SpeechFunctions.SpeechText(m_Giver.Name, m_Mobile.Name, "XardokFail"))); } } else { m_Giver.Say("Done? With what? I am not sure what things you speak of."); } }
public static void QuestTimeAllowed(Mobile m) { DateTime TimeFinished = DateTime.UtcNow; string sFinished = Convert.ToString(TimeFinished); CharacterDatabase.SetQuestInfo(m, "StandardQuest", sFinished); }
public override void OnDoubleClick(Mobile from) { if (!IsChildOf(from.Backpack)) { from.SendMessage("This must be in your backpack to use."); return; } else if (from.Hue == 0x47E) { CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(from); from.Hue = DB.CharHue; from.HairHue = DB.CharHairHue; from.FacialHairHue = DB.CharHairHue; from.SendMessage("Your body turns back to the colors of life."); } else if (from.Skills[SkillName.Necromancy].Base >= 100) { from.Hue = 0x47E; from.HairHue = 0x47E; from.FacialHairHue = 0x47E; from.SendMessage("Your body turns a ghostly white."); } else { from.SendMessage("You eat the skull dust, leaving your mouth dry."); from.Thirst = 0; } this.Delete(); from.AddToBackpack(new Jar()); }
public void DeleteCharacter(int accountId, int characterId) { var pData = Authentication.FindByAccountId(accountId); var close = false; // Somente é usado para enviar os personagens caso esteja online. var characters = new CharacterDatabase(pData); characters.Delete(characterId); if (pData != null) { // Carrega os personagens e envia somente se o jogador estiver conectado. if (pData.GameState == GameState.Characters && pData.Connected) { // Por ser usado await, o próprio método deve fechar a conexão com o banco. characters.SendCharactersAsync(); } else { close = true; } } else { close = true; } // Fecha o banco quando os personagens não são enviados. if (close) { characters.Close(); } }
public static void UpdateLootChoice(Mobile m, int nChange) { LootChoiceUpdates.InitializeLootChoice(m); CharacterDatabase DB = Server.Items.CharacterDatabase.GetDB(m); string LootChoiceSetting = DB.CharacterLoot; string[] eachSetting = LootChoiceSetting.Split('#'); int nLine = 1; string newSettings = ""; foreach (string eachSettings in eachSetting) { if (nLine == nChange) { string sChange = "0"; if (eachSettings == "0") { sChange = "1"; } newSettings = newSettings + sChange + "#"; } else if (nLine > 17) { } else { newSettings = newSettings + eachSettings + "#"; } nLine++; } DB.CharacterLoot = newSettings; }
void getPrefabs(CharacterDatabase a) { Transform root = a.transform; a.arm_lower_left_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/arm_lower_left.blend",typeof(GameObject)); a.arm_lower_right_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/arm_lower_right.blend",typeof(GameObject)); a.arm_upper_left_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/arm_upper_left.blend",typeof(GameObject)); a.arm_upper_right_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/arm_upper_right.blend",typeof(GameObject)); a.thight_left_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/thight_left.blend",typeof(GameObject)); a.thight_right_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/thight_right.blend",typeof(GameObject)); a.shin_left_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/shin_left.blend",typeof(GameObject)); a.shin_right_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/shin_right.blend",typeof(GameObject)); a.shoulder_left_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/shoulder_left.blend",typeof(GameObject)); a.shoulder_right_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/shoulder_right.blend",typeof(GameObject)); a.sword_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/swords.blend",typeof(GameObject)); a.shield_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/shields.blend",typeof(GameObject)); a.torso_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/torso.blend",typeof(GameObject)); a.head_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/heads.blend",typeof(GameObject)); a.helm_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/helmets.blend",typeof(GameObject)); a.stomage_database_root = (GameObject) AssetDatabase.LoadAssetAtPath("Assets/Resources/models/items/stomache.blend",typeof(GameObject)); a.initialize(); }