public CharacterData GetCharacter(uint TypeID) { var Character = ItemCharacter.GetChar(TypeID, 1); if (!(Character == null)) { return(Character); } return(null); }
public uint GetCharTypeID() { var CharInfo = ItemCharacter.GetChar(CharacterIndex, 0); if (!(CharInfo == null)) { return(CharInfo.TypeID); } return(0); }
public uint GetCutinIndex() { var CharInfo = ItemCharacter.GetChar(CharacterIndex, 0); if (!(CharInfo == null)) { return(CharInfo.CutinIndex); } return(0); }
public PlayerCharacterData GetCharacter(uint TypeID) { PlayerCharacterData Character; Character = ItemCharacter.GetChar(TypeID, CharType.bTypeID); if (!(Character == null)) { return(Character); } return(null); }
public bool SetCharIndex(uint CharID) { var Char = ItemCharacter.GetChar(CharID, 0); if (Char == null) { return(false); } CharacterIndex = CharID; return(true); }
public uint GetCutinIndex() { PlayerCharacterData CharInfo; CharInfo = ItemCharacter.GetChar(CharacterIndex, CharType.bIndex); if (!(CharInfo == null)) { return(CharInfo.FCutinIndex); } return(0); }
public override uint GetCharTypeID() { PlayerCharacterData CharInfo; CharInfo = ItemCharacter.GetChar(CharacterIndex, CharType.bIndex); if (!(CharInfo == null)) { return(CharInfo.TypeID); } return(0); }
public bool SetCharIndex(uint CharID) { PlayerCharacterData Char; Char = ItemCharacter.GetChar(CharID, CharType.bIndex); if (Char == null) { return(false); } CharacterIndex = CharID; return(true); }
// poster public bool SetCutInIndex(uint CharIndex, uint CutinIndex) { if (CutinIndex == 0) { return(true); } var Item = ItemWarehouse.GetItem(CutinIndex, 0); var CharType = ItemCharacter.GetChar(CharIndex, 0); if (Item == null) { return(false); } if (CharType == null) { return(false); } CharType.CutinIndex = Item.ItemIndex; ItemCharacter.UpdateCharacter(CharType); return(true); }
// poster public override bool SetCutInIndex(uint CharIndex, uint CutinIndex) { if (CutinIndex == 0) { return(true); } var Item = ItemWarehouse.GetItem(CutinIndex, TGET_ITEM.gcIndex); var CharType = ItemCharacter.GetChar(CharIndex, Defines.CharType.bIndex); if (Item == null) { return(false); } if (CharType == null) { return(false); } CharType.FCutinIndex = Item.ItemIndex; ItemCharacter.UpdateCharacter(CharType); return(true); }
public AddItemData AddItem(AddItem ItemAddItemData) { Object WareHouseData; AddItemData Result; Result = new AddItemData() { Status = false }; if (UID == 0) { return(Result); } switch (ItemAddItemData.ItemIffId.GetItemGroup()) { case IffGroupFlag.ITEM_TYPE_CHARACTER: { WareHouseData = ItemCharacter.GetChar(ItemAddItemData.ItemIffId, 1); if (WareHouseData == null) { return(AddItemToDB(ItemAddItemData)); } else if (!(WareHouseData != null)) { Result.Status = true; Result.ItemIndex = ((CharacterData)(WareHouseData)).Index; Result.ItemTypeID = ((CharacterData)(WareHouseData)).TypeID; Result.ItemOldQty = 1; Result.ItemNewQty = 1; Result.ItemUCCKey = string.Empty; Result.ItemFlag = 0; Result.ItemEndDate = null; if (ItemAddItemData.Transaction) { ItemTransaction.AddChar(2, (CharacterData)WareHouseData); } } } break; case IffGroupFlag.ITEM_TYPE_HAIR_STYLE: { var IffHair = IFFEntry.GetIff.GetByHairColor(ItemAddItemData.ItemIffId); var character = ItemCharacter.GetCharByType((byte)IffHair.CharType); if (character != null) { character.HairColour = IffHair.HairColor; character.Update(character); Result.Status = true; Result.ItemIndex = character.Index; Result.ItemTypeID = ItemAddItemData.ItemIffId; Result.ItemOldQty = 0; Result.ItemNewQty = 1; Result.ItemUCCKey = null; Result.ItemFlag = 0; Result.ItemEndDate = null; } } break; case IffGroupFlag.ITEM_TYPE_PART: { return(AddItemToDB(ItemAddItemData)); } case IffGroupFlag.ITEM_TYPE_CLUB: { return(AddItemToDB(ItemAddItemData)); } case IffGroupFlag.ITEM_TYPE_AUX: case IffGroupFlag.ITEM_TYPE_BALL: case IffGroupFlag.ITEM_TYPE_USE: { WareHouseData = ItemWarehouse.GetItem(ItemAddItemData.ItemIffId, 1); if (WareHouseData != null) { Result.Status = true; Result.ItemIndex = ((WarehouseData)(WareHouseData)).ItemIndex; Result.ItemTypeID = ((WarehouseData)(WareHouseData)).ItemTypeID; Result.ItemOldQty = ((WarehouseData)(WareHouseData)).ItemC0; Result.ItemNewQty = ((WarehouseData)(WareHouseData)).ItemC0 + ItemAddItemData.Quantity; Result.ItemUCCKey = ((WarehouseData)(WareHouseData)).ItemUCCUnique; Result.ItemFlag = (byte)((WarehouseData)(WareHouseData)).ItemFlag; Result.ItemEndDate = null; //Add ((WarehouseData)(WareHouseData)).AddQuantity(ItemAddItemData.Quantity); if (ItemAddItemData.Transaction) { ItemTransaction.AddItem(0x02, (WarehouseData)WareHouseData, ItemAddItemData.Quantity); } } else if (WareHouseData == null) { return(AddItemToDB(ItemAddItemData)); } } break; case IffGroupFlag.ITEM_TYPE_CADDIE: { return(AddItemToDB(ItemAddItemData)); } case IffGroupFlag.ITEM_TYPE_CADDIE_ITEM: { WareHouseData = ItemCaddie.GetCaddieBySkinId(ItemAddItemData.ItemIffId); if (!(WareHouseData == null)) { ((CaddieData)(WareHouseData)).Update(); ((CaddieData)(WareHouseData)).UpdateCaddieSkin(ItemAddItemData.ItemIffId, ItemAddItemData.Day); Result.Status = true; Result.ItemIndex = ((CaddieData)(WareHouseData)).CaddieIdx; Result.ItemTypeID = ((CaddieData)(WareHouseData)).CaddieSkin; Result.ItemOldQty = 1; Result.ItemNewQty = 1; Result.ItemUCCKey = string.Empty; Result.ItemFlag = 0; Result.ItemEndDate = DateTime.Now.AddDays(ItemAddItemData.Day); } } break; case IffGroupFlag.ITEM_TYPE_SKIN: { return(AddItemToDB(ItemAddItemData)); } case IffGroupFlag.ITEM_TYPE_MASCOT: { WareHouseData = ItemMascot.GetMascotByTypeId(ItemAddItemData.ItemIffId); if (WareHouseData != null) { ((MascotData)(WareHouseData)).AddDay(ItemAddItemData.Day); Result.Status = true; Result.ItemIndex = ((MascotData)(WareHouseData)).MascotIndex; Result.ItemTypeID = ((MascotData)(WareHouseData)).MascotTypeID; Result.ItemOldQty = 1; Result.ItemNewQty = 1; Result.ItemUCCKey = ""; Result.ItemFlag = 0; Result.ItemEndDate = ((MascotData)(WareHouseData)).MascotEndDate; } else if (WareHouseData == null) { return(AddItemToDB(ItemAddItemData)); } } break; case IffGroupFlag.ITEM_TYPE_CARD: { WareHouseData = ItemCard.GetCard(ItemAddItemData.ItemIffId, 1); if (WareHouseData == null) { AddItemToDB(ItemAddItemData); } else if (WareHouseData != null) { Result.Status = true; Result.ItemIndex = ((CardData)(WareHouseData)).CardIndex; Result.ItemTypeID = ((CardData)(WareHouseData)).CardTypeID; Result.ItemOldQty = ((CardData)(WareHouseData)).CardQuantity; Result.ItemNewQty = ((CardData)(WareHouseData)).CardQuantity + ItemAddItemData.Quantity; Result.ItemUCCKey = string.Empty; Result.ItemFlag = 0; Result.ItemEndDate = null; ((CardData)(WareHouseData)).AddQuantity(ItemAddItemData.Quantity); if (ItemAddItemData.Transaction) { ItemTransaction.AddCard(0x02, (CardData)WareHouseData, ItemAddItemData.Quantity); } } } break; } return(Result); }