Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container:getItems() function and option stash moving items to supply stash and depot #169

Merged

Conversation

omeranha
Copy link
Contributor

@omeranha omeranha commented Dec 7, 2021

Description

Part of code by @nekiro (https://github.com/nekiro)
otland/forgottenserver#3160

container:getItems() function
New method which will return all container items, optional bool recursive to search in sub containers of container.
Usage:

local items = container:getItems(true)
for _, item in ipairs(items) do
	print(item:getName())
end

My part of code:

New stash option.
Stow an container to your Stash(or right click container->Stow Item), the stowable items go your stash, and non-stacked items go to the selected depot chest(default is 4, config.lua configurable).

  • New feature (non-breaking change which adds functionality)

@omeranha omeranha changed the title Container get items and stash moving Container get items function and stash moving Dec 7, 2021
@sonarcloud

This comment was marked as outdated.

@dudantas dudantas marked this pull request as draft December 7, 2021 02:36
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2022

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label Jan 7, 2022
@sonarcloud

This comment was marked as outdated.

@omeranha omeranha changed the title Container get items function and stash moving container:getItems() function and stash moving Feb 16, 2022
@dudantas dudantas marked this pull request as ready for review February 17, 2022 02:26
@majestyotbr
Copy link
Contributor

Tested:

  • Stowing stackable items.
  • Moving non-stackable items to selected depot.

@majestyotbr majestyotbr removed the Stale No activity label Feb 26, 2022
@majestyotbr majestyotbr changed the title container:getItems() function and stash moving Add container:getItems() function and option stash moving items to supply stash and depot Feb 26, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@omeranha omeranha merged commit 844530b into opentibiabr:master Feb 28, 2022
@omeranha omeranha deleted the container-getItems-and-stash-moving branch February 28, 2022 12:59
omeranha added a commit to opentibiabr/otservbr-global that referenced this pull request Mar 21, 2022
luan pushed a commit that referenced this pull request Jul 11, 2023
…pply stash and depot (#169)

Part of code by @nekiro (https://github.com/nekiro)
otland/forgottenserver#3160

container:getItems() function
New method which will return all container items, optional bool recursive to search in sub containers of container.
Usage:
```
local items = container:getItems(true)
for _, item in ipairs(items) do
	print(item:getName())
end
```

My part of code:
- New stash option.
- Stow an container to your Stash(or right click container->Stow Item), the stowable items go your stash, and non-stacked items go to the selected depot chest(default is 4, config.lua configurable).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants