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

npctalk: add u_sell_item effect #27471

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Jan 6, 2019

Summary

SUMMARY: Infrastructure "npctalk: add u_sell_item effect"

Purpose of change

Partially addresses #27397
Add an effect that removes an item from the player's inventory and adds it to the NPC's inventory.

Describe the solution

Basically the reverse of u_buy_item: find an item in the player's inventory, remove it, and add it to the NPC's inventory.

Describe alternatives you've considered

I couldn't figure out how to handle containers.

@mlangsdorf mlangsdorf added <Enhancement / Feature> New features, or enhancements on existing NPC / Factions NPCs, AI, Speech, Factions, Ownership Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones [C++] Changes (can be) made in C++. Previously named `Code` labels Jan 6, 2019
@mlangsdorf
Copy link
Contributor Author

jenkins rebuild

doc/NPCs.md Outdated
@@ -533,6 +533,10 @@ Your character or the NPC will gain the trait.
### u_buy_item: item_string, (optional cost: cost_num, optional count: count_num, optional container: container_string)
The NPC will give your character the item or count_num copies of the item, contained in container, and will remove `cost_num` from your character's cash if specified. If cost isn't present, the NPC gives your character the item at no charge.

### u_buy_item: item_string, (optional cost: cost_num, optional count: count_num)
Your character will give the NPC the item or count_num copies of the item, and will remove `cost_num` from your character's cash if specified. If cost isn't present, the your character gives the NPC the item at no charge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Your character will give the NPC the item or count_num copies of the item, and will remove `cost_num` from your character's cash if specified. If cost isn't present, the your character gives the NPC the item at no charge.
Your character will give the NPC the item or `count_num` copies of the item, and will remove `cost_num` from your character's cash if specified. If cost isn't present, the your character gives the NPC the item at no charge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks for the review.

Add an effect that removes an item from the player's inventory and
adds it to the NPC's inventory.
@ZhilkinSerg ZhilkinSerg merged commit ca30a6a into CleverRaven:master Jan 7, 2019
@mlangsdorf mlangsdorf deleted the u_sell_item branch January 7, 2019 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants