Skip to content

Commit

Permalink
perf: wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Dec 15, 2024
1 parent 147c823 commit ca1a429
Show file tree
Hide file tree
Showing 8 changed files with 367 additions and 175 deletions.
4 changes: 1 addition & 3 deletions data/scripts/actions/items/wheel_scrolls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ function scroll.onUse(player, item, fromPosition, target, toPosition, isHotkey)
end

local scrollData = promotionScrolls[item:getId()]
local scrollKV = player:kv():scoped("wheel-of-destiny"):scoped("scrolls")
if scrollKV:get(scrollData.name) then
if not player:wheelUnlockScroll(scrollData.name) then
player:sendTextMessage(MESSAGE_LOOK, "You have already deciphered this scroll.")
return true
end

scrollKV:set(scrollData.name, true)
player:sendTextMessage(MESSAGE_LOOK, "You have gained " .. scrollData.points .. " promotion points for the Wheel of Destiny by deciphering the " .. scrollData.itemName .. ".")
item:remove(1)
return true
Expand Down
23 changes: 23 additions & 0 deletions data/scripts/talkactions/god/set_icon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local icon = TalkAction("/guild")

function icon.onSay(player, words, param)
-- create log
logCommand(player, words, param)

local split = param:split(",")
local category = split[1]

Check warning on line 8 in data/scripts/talkactions/god/set_icon.lua

View workflow job for this annotation

GitHub Actions / luacheck

[luacheck] data/scripts/talkactions/god/set_icon.lua#L8

unused variable 'category'
Raw output
data/scripts/talkactions/god/set_icon.lua:8:8: unused variable 'category'
local icon = split[2]

Check warning on line 9 in data/scripts/talkactions/god/set_icon.lua

View workflow job for this annotation

GitHub Actions / luacheck

[luacheck] data/scripts/talkactions/god/set_icon.lua#L9

unused variable 'icon'
Raw output
data/scripts/talkactions/god/set_icon.lua:9:8: unused variable 'icon'

Check warning on line 9 in data/scripts/talkactions/god/set_icon.lua

View workflow job for this annotation

GitHub Actions / luacheck

[luacheck] data/scripts/talkactions/god/set_icon.lua#L9

shadowing upvalue 'icon' on line 1
Raw output
data/scripts/talkactions/god/set_icon.lua:9:8: shadowing upvalue 'icon' on line 1

local guild = player:getGuild()
local guildId = tonumber(param)
local otherGuild = Guild(guildId)
otherGuild:addEnemy(player:getGuild():getId())
guild:addEnemy(guildId)
guild:updateEmblems()
otherGuild:updateEmblems()
return true
end

icon:separator(" ")
icon:groupType("normal")
icon:register()
Loading

0 comments on commit ca1a429

Please sign in to comment.