void APlayerCharacter::Equip(TSubclassOf<ABaseEquips> EquipType) { if (Equipped != NULL) { Unequip(); } FActorSpawnParameters SpawnParameters; SpawnParameters.Owner = this; Equipped = GetWorld()->SpawnActor<ABaseEquips>(EquipType, FVector::ZeroVector, FRotator::ZeroRotator, SpawnParameters); Equipped->AttachRootComponentTo(GetMesh(), "BN_RPalm_01"); }
LPITEM CItem::RemoveFromCharacter() { if (!m_pOwner) { sys_err("Item::RemoveFromCharacter owner null"); return (this); } LPCHARACTER pOwner = m_pOwner; if (m_bEquipped) // ÀåÂøµÇ¾ú´Â°¡? { Unequip(); //pOwner->UpdatePacket(); SetWindow(RESERVED_WINDOW); Save(); return (this); } else { if (GetWindow() != SAFEBOX && GetWindow() != MALL) { if (IsDragonSoul()) { if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) sys_err("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM"); else pOwner->SetItem(TItemPos(m_bWindow, m_wCell), NULL); } else { TItemPos cell(INVENTORY, m_wCell); if (false == cell.IsDefaultInventoryPosition() && false == cell.IsBeltInventoryPosition()) // ¾Æ´Ï¸é ¼ÒÁöÇ°¿¡? sys_err("CItem::RemoveFromCharacter: Invalid Item Position"); else { pOwner->SetItem(cell, NULL); } } } m_pOwner = NULL; m_wCell = 0; SetWindow(RESERVED_WINDOW); Save(); return (this); } }
int InventoryManager::Drop(bool *keys) { int find = 0; for (int i = 65; i < 91; i++) //a - w { if (keys[i] == true) { Unequip(i - 65); if (DropItem(i - 65)) { ShowInventory(-1); mState = eDisplay; } keys[i] = false; } } return 1; }
void Player::Drop(const String& item) { int item_comprovant = INVALID; int j = ITEM_VEC; if (num_items >= bag_capacity) { printf("The bag is full\n"); return; } item_comprovant = Item_verification(item); if (item_comprovant == INVALID) { printf("Thats a invalid item\n"); return; } if (list.first != nullptr) { Dlist<Entity*>::Node* mylist = list.first; for (; mylist != nullptr; mylist = mylist->next) { if (mylist->data->name == item) { Unequip(item); printf("You dropped %s\n", mylist->data->name.c_str()); place->list.push_back(mylist->data); list.erase(mylist); num_items--; return; } } } printf("You dont have that item in your inventary or It's equipped\n"); return; }
void APlayerCharacter::EquipSlot1() //Nothing Equipped { EquippedIndex = 1; Unequip(); }