89 lines
3.8 KiB
C#
89 lines
3.8 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
using System.Text.Json;
|
|
using static ClientToGameReq.Types;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace GameServer
|
|
{
|
|
public class QuestCostume : QuestBase
|
|
{
|
|
ClothInfo changedClothInfo = new();
|
|
public QuestCostume(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, ClothInfo cloth) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
|
{
|
|
Log.getLogger().debug($"QuestCostume Constructor Call", JsonConvert.SerializeObject(cloth));
|
|
changedClothInfo = cloth.Clone();
|
|
}
|
|
|
|
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
|
{
|
|
/*
|
|
cloth_avatar = 5;
|
|
cloth_headwear = 6;
|
|
cloth_mask = 7;
|
|
cloth_bag = 8;
|
|
cloth_shoes = 9;
|
|
cloth_outer = 10;
|
|
cloth_tops = 11;
|
|
cloth_bottoms = 12;
|
|
cloth_gloves = 13;
|
|
cloth_earrings = 14;
|
|
cloth_neckless = 15;
|
|
cloth_socks = 16;
|
|
*/
|
|
if (events.EventCondition1.Equals(ClothSlotType.Avatar.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothAvatar) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Headwear.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothHeadwear) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Mask.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothMask) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Bag.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothBag) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Shoes.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothShoes) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Outer.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothOuter) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Tops.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothTops) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Bottoms.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothBottoms) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Gloves.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothGloves) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Earrings.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothEarrings) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Neckless.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothNeckless) return true;
|
|
}
|
|
else if (events.EventCondition1.Equals(ClothSlotType.Socks.ToString().ToUpper()))
|
|
{
|
|
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothSocks) return true;
|
|
}
|
|
|
|
Log.getLogger().error($"{events.EventCondition1} does Not Match");
|
|
return false;
|
|
|
|
}
|
|
}
|
|
}
|