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: GameObject:AddLoot() #52

Merged
merged 1 commit into from
Jul 6, 2022
Merged

feat: GameObject:AddLoot() #52

merged 1 commit into from
Jul 6, 2022

Conversation

55Honey
Copy link
Member

@55Honey 55Honey commented Jul 6, 2022

Adds a new method to gameobjects, which allows spawning loot at runtime in an empty container.
Co-authored by @r-o-b-o-t-o

Tested with:

##Copy of the Arena Chest with 0 loot
INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES ('510001', '3', '259', 'Treasure Chest', '', '', '', '1', '1599', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '', '', '0');
local function OnCommand( event, player, command, chatHandler )
    if command == 'test' and player then
        local go = player:SummonGameObject( 510001, player:GetX(), player:GetY(), player:GetZ(), player:GetO(), 30 )
        if go then
            go:AddLoot(13463,8,23054,1)          --8 Dreamfoil and 1 Gressil
        end
    end
end

RegisterPlayerEvent( 42, OnCommand, 0 )

@55Honey 55Honey merged commit 301ffc7 into master Jul 6, 2022
@r-o-b-o-t-o r-o-b-o-t-o deleted the AddLoot branch July 6, 2022 14:08
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.

3 participants