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

Added Player.addAllMounts and Player.addAllAddons #3893

Merged
merged 2 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/lib/compat/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ function doPlayerRemOutfit(cid, lookType, addons)
end
end
doPlayerRemoveOutfit = doPlayerRemOutfit
function doPlayerAddAddons(cid, addon) local p = Player(cid) return p and p:addAddonToAllOutfits(addon) or false end
function canPlayerWearOutfit(cid, lookType, addons) local p = Player(cid) return p and p:hasOutfit(lookType, addons) or false end
function doPlayerAddMount(cid, mountId) local p = Player(cid) return p and p:addMount(mountId) or false end
function doPlayerRemoveMount(cid, mountId) local p = Player(cid) return p and p:removeMount(mountId) or false end
Expand Down
16 changes: 16 additions & 0 deletions data/lib/core/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,19 @@ end
function Player.getTotalMoney(self)
return self:getMoney() + self:getBankBalance()
end

function Player.addAddonToAllOutfits(self, addon)
for sex = 0, 1 do
local outfits = Game.getOutfits(sex)
for outfit = 1, #outfits do
self:addOutfitAddon(outfits[outfit].lookType, addon)
end
end
end

function Player.addAllMounts(self)
local mounts = Game.getMounts()
for mount = 1, #mounts do
self:addMount(mounts[mount].id)
end
end