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

Corrected guid implementation of item package in 51074a0 #143

Merged
merged 4 commits into from Dec 16, 2014

Conversation

cydh
Copy link
Contributor

@cydh cydh commented Nov 30, 2014

  • GUID
    • guid field in official PackageItem.lua supposed to make item will be separated even item is stackable item.
    • Currently guid usage is using item Unique ID that generated when item with GUID flag is appear from package.
    • Some item containers in official PackageItem.lua are also separated, not stacked when player obtain it. Example when using atcommand "@item Xmas_Bless". For current implementation, the items are flagged in item_flag.txt (db folder) with flag 4.
    • isNamed field in item group is replaced by GUID and move the isNamed as new additional field. See doc/item_group.txt or db/re/item_package.txt.
    • Added core.h config ENABLE_ITEM_GUID (b92b8ff)
      • Enabled by default to take effect of guid function.
      • When it's disabled, guid function will be ignored as suggestion to disable this 'weird. official feature.
      • NOTE: If this feature is disabled "in the middle" of your game, the separated is still separated in inventory, storage, or guild storage until player move the item to/from storage/inventory to restack them.
  • NPC:
    • Enabled npc/re/other/item_merge.txt and it's now usable.
  • Script Command:
    • Added mergeitem to merge separated items in player's inventory. See doc/script_commands.txt.
  • Misc:
    • Changed how to broadcast the item that obtained from package with flag isAnnounced to intif_broadcast, so it will be announced to all connected map-servers.
    • Added some items that flagged as 'item group container' in db/re/item_flag.txt

Signed-off-by: Cydh Ramdh house.bad@gmail.com

* GUID
  - `guid` field in official PackageItem.lua supposed to make item will be separated even item is stackable item.
  - Currently `guid` usage is using item Unique ID that generated when item with GUID flag is appear from package.
  - Some item containers in official PackageItem.lua are also separated, not stacked when player obtain it. Example when using atcommand "@item Xmas_Bless". For current implementation, the items are flagged in item_flag.txt (db folder) with flag 4.
  - `isNamed` field in item group is replaced by `GUID` and move the `isNamed` as new additional field. See doc/item_group.txt or db/re/item_package.txt.
* NPC:
  - Enabled npc/re/other/item_merge.txt and it's now usable.
* Script Command:
  - Added `mergeitem` to merge separated items in player's inventory. See doc/script_commands.txt.
* Misc:
  - Changed how to broadcast the item that obtained from package with flag `isAnnounced` to intif_broadcast, so it will be announced to all connected map-servers.
  - Added some items that flagged as 'item group container' in db/re/item_flag.txt

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
StringBuf_Printf(&command, "%citem %d 1", atcommand_symbol, id->nameid);
else
StringBuf_Printf(&command, "%citem %d 20", atcommand_symbol, id->nameid);
}
Copy link
Contributor

@icxbb-xx icxbb-xx Nov 30, 2014

Choose a reason for hiding this comment

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

when @item [nameid] 1 <- generate different uid
when @item [nameid] 10 <- generate same uid

ex. @item 12915 1 & @item 12915 10

Copy link
Contributor Author

@cydh cydh Nov 30, 2014

Choose a reason for hiding this comment

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

yes is it, will be 1 & 10 in ur inventory.
in official, /item Xmas_Bless twice, it will be 1 & 1

besides, if u see item package with guid and it gives 10x (example 10x Battle Manual), it will be stacked 10 & 10, and even same item id but in other package the value given is 5, it will be 10 & 10 & 5.

Copy link
Contributor

@icxbb-xx icxbb-xx Nov 30, 2014

Choose a reason for hiding this comment

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

Oh, ok sir :) great

* Enabled by default to take effect of `guid` function.
* When it's disabled, `guid` function will be ignored as suggestion to disable this 'weird. official feature.
* NOTE: If this feature is disabled "in the middle" of your game, the separated is still separated in inventory, storage, or guild storage until player move the item to/from storage/inventory to restack them.

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>

Merge item!!!!!!!!!

If no item_id ot "item name", it will merges all possible items that exist in player's inventory.
Copy link
Contributor

@aleos89 aleos89 Dec 4, 2014

Choose a reason for hiding this comment

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

This command will merge all items with the given item ID or name that is flagged as GUID item type (flag 4) in the item_flag database.

Copy link
Contributor Author

@cydh cydh Dec 5, 2014

Choose a reason for hiding this comment

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

lol, actually I wanted to push this only "Merge item!!!!!!!!!"

eh, I saw typo. ot -> or

Copy link
Contributor Author

@cydh cydh Dec 5, 2014

Choose a reason for hiding this comment

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

This command will merge all separated-stackable-items with the given item ID or name.
If no item ID or name, it will merges all possible items that exist in player's inventory.

just the 1st line or both?

Copy link
Contributor

@aleos89 aleos89 Dec 5, 2014

Choose a reason for hiding this comment

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

:P Up to you.

Copy link
Contributor Author

@cydh cydh Dec 6, 2014

Choose a reason for hiding this comment

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

let see. xD

@aleos89
Copy link
Contributor

@aleos89 aleos89 commented Dec 4, 2014

Other than my one comment for the documentation, the rest worked very well. Apply, apply, apply!

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
@cydh
Copy link
Contributor Author

@cydh cydh commented Dec 6, 2014

wtf typo

Doc update for 'ermgeitem'

mergeitem

* Changed wrong flag value, 6 -> 4
* Added UID check in pc_cart_additem()
* Generate GUID moved to pc_additem() for item with flag.guid
* Added card comparison in 'mergeitem' to avoid merge CARD0_* items with non-CARD0_*

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
cydh added a commit that referenced this issue Dec 16, 2014
@cydh cydh merged commit 7295bdc into master Dec 16, 2014
1 check passed
@cydh cydh deleted the feature/separated_item_guid branch Dec 17, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants