public static void IncreaseLevelByOne(Character character, bool PlayEffect) { if (character == null) { return; } // increase level & update stats character.Stats.level += 1; Update(character, CharacterConstants.StatisticType.Level); // play effect if needed if (PlayEffect) { CharacterBuffs.ShowRemoteUserEffect(character, CharacterConstants.UserEffect.LevelUp); } }
public static void LevelUP(Character character, bool playEffect) { if (character == null) { return; } // increase level IncreaseLevelByOne(character, playEffect); // generate randomized HP && MP bonus AdjustHPOnLevelUP(character); AdjustMPOnLevelUP(character); // gain stats // TODO: edge cases when overlevling job adv GainAPOnLeveLUP(character); GainSPOnLeveLUP(character); // play effect if needed if (playEffect) { CharacterBuffs.ShowRemoteUserEffect(character, CharacterConstants.UserEffect.LevelUp); } }
public void Complete(Quest quest, int selection) { foreach (KeyValuePair<int, short> item in quest.PostRequiredItems) { Parent.Items.RemoveItemFromInventoryByID(item.Key, item.Value); } Parent.Stats.Experience += quest.ExperienceReward[1]; using (Packet oPacket = new Packet(ServerOperationCode.Message)) { oPacket .WriteByte((byte)ServerConstants.MessageType.IncreaseEXP) .WriteBool(true) .WriteInt(quest.ExperienceReward[1]) .WriteBool(true) .WriteInt() // NOTE: Monster Book bonus. .WriteShort() // NOTE: Unknown. .WriteInt() // NOTE: Wedding bonus. .WriteByte() // NOTE: Party bonus. .WriteInt() // NOTE: Party bonus. .WriteInt() // NOTE: Equip bonus. .WriteInt() // NOTE: Internet Cafe bonus. .WriteInt() // NOTE: Rainbow Week bonus. .WriteByte(); // NOTE: Unknown. Parent.Client.Send(oPacket); } Parent.Stats.Fame += (short)quest.FameReward[1]; // TODO: Fame gain packet in chat. Parent.Stats.Meso += quest.MesoReward[1] * WvsGame.MesoRate; // TODO: Meso gain packet in chat. foreach (KeyValuePair<Skill, CharacterConstants.Job> skill in quest.PostSkillRewards) { if (Parent.Jobs.Job == skill.Value) { Parent.Skills.Add(skill.Key); // TODO: Skill update packet. } } // TODO: Pet rewards. if (selection != -1) // NOTE: Selective reward. { //if (selection == -1) // NOTE: Randomized reward. //{ // KeyValuePair<int, short> item = quest.PostItemRewards.ElementAt(Constants.Random.Next(0, quest.PostItemRewards.Count)); // Parent.Items.Add(new Item(item.Key, item.Value)); // using (Packet oPacket = new Packet(ServerOperationCode.Effect)) // { // oPacket // .WriteByte((byte)UserEffect.Quest) // .WriteByte(1) // .WriteInt(item.Key) // .WriteInt(item.Value); // Parent.Client.Send(oPacket); // } //} //else //{ // // TODO: Selective reward based on selection. //} } else { foreach (KeyValuePair<int, short> item in quest.PostItemRewards) { if (item.Value > 0) { Parent.Items.AddItemToInventory(new Item(item.Key, item.Value)); } else if (item.Value < 0) { Parent.Items.RemoveItemFromInventoryByID(item.Key, Math.Abs(item.Value)); } using (Packet oPacket = new Packet(ServerOperationCode.Effect)) { oPacket .WriteByte((byte)CharacterConstants.UserEffect.Quest) .WriteByte(1) .WriteInt(item.Key) .WriteInt(item.Value); Parent.Client.Send(oPacket); } } } Update(quest.MapleID, QuestConstants.QuestStatus.Complete); Delete(quest.MapleID); Completed.Add(quest.MapleID, DateTime.UtcNow); CharacterBuffs.ShowLocalUserEffect(Parent, CharacterConstants.UserEffect.QuestComplete); CharacterBuffs.ShowRemoteUserEffect(Parent, CharacterConstants.UserEffect.QuestComplete, true); }