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

feat: add PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM and roll methods #119

Merged
merged 3 commits into from
Apr 7, 2023

Conversation

r-o-b-o-t-o
Copy link
Member

PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM  =     56,       // (event, player, item, count, voteType, roll)
  • Adds Roll methods:
    • Roll:GetItemGUID
    • Roll:GetItemId
    • Roll:GetItemRandomPropId
    • Roll:GetItemRandomSuffix
    • Roll:GetItemCount
    • Roll:GetPlayerVote
    • Roll:GetPlayerVoteGUIDs
    • Roll:GetTotalPlayersRolling
    • Roll:GetTotalNeed
    • Roll:GetTotalGreed
    • Roll:GetTotalPass
    • Roll:GetItemSlot
    • Roll:GetRollVoteMask

Example Lua snippet:

local PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM = 56

RegisterPlayerEvent(PLAYER_EVENT_ON_GROUP_ROLL_REWARD_ITEM, function(event, player, item, count, voteType, roll)
	local voteTypes = {}
	voteTypes[0] = "PASS"
	voteTypes[1] = "NEED"
	voteTypes[2] = "GREED"
	voteTypes[3] = "DISENCHANT"
	voteTypes[4] = "NOT_EMITTED_YET"
	voteTypes[5] = "INVALID"

	print(player:GetName() .. " won " .. item:GetName() .. " (x" .. count .. ") with " .. voteTypes[voteType] .. " (" .. voteType .. ")")

	for _, guid in pairs(roll:GetPlayerVoteGUIDs()) do
		local v = roll:GetPlayerVote(guid)
		print("Player GUID: ", guid, "voted: ", voteTypes[v] .. " (" .. v .. ")")
	end

	print("ItemGUID:", roll:GetItemGUID())
	print("ItemId:", roll:GetItemId())
	print("ItemRandomPropId:", roll:GetItemRandomPropId())
	print("ItemRandomSuffix:", roll:GetItemRandomSuffix())
	print("ItemCount:", roll:GetItemCount())
	print("TotalPlayersRolling:", roll:GetTotalPlayersRolling())
	print("TotalNeed:", roll:GetTotalNeed())
	print("TotalGreed:", roll:GetTotalGreed())
	print("TotalPass:", roll:GetTotalPass())
	print("ItemSlot:", roll:GetItemSlot())
	print("RollVoteMask:", roll:GetRollVoteMask())
end)

@r-o-b-o-t-o r-o-b-o-t-o merged commit a689c04 into master Apr 7, 2023
@r-o-b-o-t-o r-o-b-o-t-o deleted the feat/on-group-roll-reward-item branch April 7, 2023 18:59
@GoMateoGo
Copy link

@r-o-b-o-t-o
Visit #140

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.

Feature request: expose OnGroupRollRewardItem player event
2 participants