Example #1
0
        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
                });
            }));
        }
Example #2
0
    private void LoadMonsterProfile(string monsterInfo, Vector2 monsterLoc)
    {
        List <int> monsterData = monsterInfo.Split(',').Select(Int32.Parse).ToList();
        //monsterData[0]=CharacterId
        //monsterData[1]=Level
        Character character = _characterDatabase.GetCharacterById(monsterData[0]);
        var       monster   = _characterManager.GenerateMonster(character, monsterData[1]);

        //Set big Items in the profile
        _health.UpdateValues(monster.Health, monster.MaxHealth);
        _mana.gameObject.SetActive(false);
        _energy.gameObject.SetActive(false);
        _experience.gameObject.SetActive(false);
        _coin.gameObject.SetActive(false);
        _gem.gameObject.SetActive(false);
        _characterPic.image.sprite = character.GetSprite();
        _profilePic.gameObject.SetActive(false);
        _characterName.text = character.Name + " Level " + monster.Level;
        int i            = 0;
        var profileTexts = _profileStats.GetComponentsInChildren <TextMeshProUGUI>();

        profileTexts[i++].text = "Attack: " +
                                 character.AttackR + " (A " +
                                 monster.AbilityAttack + " /M " +
                                 monster.MagicAttack + " /P " +
                                 monster.PoisonAttack + ")";
        profileTexts[i++].text = "Defense: " +
                                 character.DefenseR + " (A " +
                                 monster.AbilityDefense + " /M " +
                                 monster.MagicDefense + " /P " +
                                 monster.PoisonDefense + ")";
        //Row1
        profileTexts[i++].text = "Attack Speed: " + " (" +
                                 monster.SpeedAttack + ") ";
        profileTexts[i++].text = "Defense Speed: " + " (" +
                                 monster.SpeedDefense + ") ";
        //Row2
        profileTexts[i++].text = "Move: " +
                                 character.Move + " (" +
                                 monster.Speed + ") ";
        profileTexts[i++].gameObject.SetActive(false);
        //Row3-6
        string[] settingStats = new string[] {
            "Intellect", "Agility",
            "Strength", "Stamina",
            "Crafting", "Researching",
            "Bravery", "Charming"
        };
        foreach (var stat in settingStats)
        {
            profileTexts[i++].gameObject.SetActive(false);
        }
        //Row7
        profileTexts[i++].gameObject.SetActive(false);
        profileTexts[i++].gameObject.SetActive(false);
        //Last Login
        profileTexts[i++].text = "Location: " + monsterLoc;
    }
Example #3
0
    internal string MyInfo()
    {
        CharacterDatabase characterDatabase = CharacterDatabase.Instance();

        try
        {
            var character = characterDatabase.GetCharacterById(CharacterId);
            return(Id + "-" + character.MyInfo() + " CharacterCode= " + CharacterCode);
        }
        catch (Exception e)
        {
            return("Empty");
        }
    }
Example #4
0
    private void SetRegionInsideStoryTypes()
    {
        List <int> regionInsideStories = _region.InsideStories.Split(',').Select(Int32.Parse).ToList();

        foreach (var inStory in _insideStories)
        {
            if (regionInsideStories.IndexOf(inStory.Id) != -1 && inStory.IsEnable)
            {
                _myInsideStories.Add(inStory);
                foreach (var actor in inStory.Actors)
                {
                    _insideMonsters.Add(_characterDatabase.GetCharacterById(actor.CharacterId));
                }
            }
        }
    }
Example #5
0
 internal void SetMyCharacter(int characterId)
 {
     MyCharacter = _characterDatabase.GetCharacterById(characterId);
     Debug.Log("CM-MyCharacter = " + MyCharacter.MyInfo());
 }