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

getPoison and setPoison #48

Open
marcusx2 opened this issue Nov 16, 2020 · 1 comment
Open

getPoison and setPoison #48

marcusx2 opened this issue Nov 16, 2020 · 1 comment

Comments

@marcusx2
Copy link

Hi, I want to make a new sse mod, and I decided to use this lib. Basically I want to be able to poison arrows instead of bows using this lib. Is there an easy way to use this lib to get a poison from the inventory, then apply it to any object, including arrows(equipped arrows specifically)? Or is it only possible to poison weapons and it wouldn't work on arrows? Thank you for your time!

@max-su-2019
Copy link
Contributor

That may help you to get all the poision items from your inventory:

		RE::BSTArray<RE::AlchemyItem*> poision_arr;

		auto playerref = RE::PlayerCharacter::GetSingleton();

		auto inv = playerref->GetInventory();

		for (auto& item : inv) 
		{
			auto thisitem = item.first;

			if (thisitem->formType.get() == RE::FormType::AlchemyItem);
			{
				auto Alc = thisitem->As<RE::AlchemyItem>();

				if (Alc && Alc->IsPoison())
					poision_arr.push_back(Alc);
			}
		}

alandtse referenced this issue in alandtse/CommonLibVR Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants