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

fully moved item desc to Lua #3869

Merged
merged 16 commits into from
Mar 12, 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: 0 additions & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ minimumLevelToSendPrivate = 1
premiumToSendPrivate = false
forceMonsterTypesOnLoad = true
cleanProtectionZones = false
luaItemDesc = false
showPlayerLogInConsole = true

-- VIP and Depot limits
Expand Down
4 changes: 2 additions & 2 deletions data/events/scripts/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function Player:onLookInTrade(partner, item, distance)
self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end

function Player:onLookInShop(itemType, count, description)
local description = "You see " .. description
function Player:onLookInShop(itemType, count)
local description = "You see "
if EventCallback.onLookInShop then
description = EventCallback.onLookInShop(self, itemType, count, description)
end
Expand Down
25 changes: 13 additions & 12 deletions data/items/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@
<attribute key="absorbPercentFire" value="8" />
<attribute key="showattributes" value="1" />
</item>
<item id="2202" article="a" name="stealth ring (invisibility)">
<item id="2202" article="a" name="stealth ring">
<attribute key="weight" value="100" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2478,7 +2478,7 @@
<attribute key="invisible" value="1" />
<attribute key="showattributes" value="1" />
</item>
<item id="2203" article="a" name="power ring (fist fighting +6)">
<item id="2203" article="a" name="power ring">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2487,7 +2487,7 @@
<attribute key="duration" value="1800" />
<attribute key="showduration" value="1" />
</item>
<item id="2204" article="an" name="energy ring (magic shield)">
<item id="2204" article="an" name="energy ring">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2497,7 +2497,7 @@
<attribute key="manashield" value="1" />
<attribute key="showattributes" value="1" />
</item>
<item id="2205" article="a" name="life ring (faster regeneration)">
<item id="2205" article="a" name="life ring">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand Down Expand Up @@ -2541,7 +2541,7 @@
<attribute key="stopduration" value="1" />
<attribute key="showduration" value="1" />
</item>
<item id="2210" article="a" name="sword ring (sword fighting +4)">
<item id="2210" article="a" name="sword ring">
<attribute key="weight" value="90" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2550,7 +2550,7 @@
<attribute key="duration" value="1800" />
<attribute key="showduration" value="1" />
</item>
<item id="2211" article="an" name="axe ring (axe fighting +4)">
<item id="2211" article="an" name="axe ring">
<attribute key="weight" value="90" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2559,7 +2559,7 @@
<attribute key="duration" value="1800" />
<attribute key="showduration" value="1" />
</item>
<item id="2212" article="a" name="club ring (club fighting +4)">
<item id="2212" article="a" name="club ring">
<attribute key="weight" value="90" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2582,7 +2582,7 @@
<attribute key="stopduration" value="1" />
<attribute key="showduration" value="1" />
</item>
<item id="2215" article="a" name="dwarven ring (hard drinking)">
<item id="2215" article="a" name="dwarven ring">
<attribute key="weight" value="110" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand All @@ -2592,7 +2592,7 @@
<attribute key="showduration" value="1" />
<attribute key="showattributes" value="1" />
</item>
<item id="2216" article="a" name="ring of healing (faster regeneration)">
<item id="2216" article="a" name="ring of healing">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand Down Expand Up @@ -4470,7 +4470,7 @@
<item fromid="2638" toid="2639" article="a" name="tic-tac-toe token">
<attribute key="weight" value="500" />
</item>
<item id="2640" article="a" name="pair of soft boots (faster regeneration)">
<item id="2640" article="a" name="pair of soft boots">
<attribute key="weight" value="800" />
<attribute key="slotType" value="feet" />
<attribute key="decayTo" value="10021" />
Expand Down Expand Up @@ -4696,6 +4696,7 @@
</item>
<item id="2692" name="flour">
<attribute key="weight" value="100" />
<attribute key="showcount" value="0" />
</item>
<item id="2693" article="a" name="lump of dough" plural="lumps of dough">
<attribute key="weight" value="100" />
Expand Down Expand Up @@ -36988,7 +36989,7 @@
<attribute key="showduration" value="1" />
<attribute key="transformDeEquipTo" value="26198" />
</item>
<item id="26183" article="a" name="collar of green plasma (faster regeneration)">
<item id="26183" article="a" name="collar of green plasma">
<attribute key="weight" value="500" />
<attribute key="slotType" value="necklace" />
<attribute key="decayTo" value="0" />
Expand Down Expand Up @@ -37037,7 +37038,7 @@
<attribute key="stopduration" value="1" />
<attribute key="showduration" value="1" />
</item>
<item id="26188" name="ring of green plasma (faster regeneration)">
<item id="26188" name="ring of green plasma">
<attribute key="weight" value="90" />
<attribute key="slotType" value="ring" />
<attribute key="decayTo" value="0" />
Expand Down
23 changes: 17 additions & 6 deletions data/lib/compat/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1501,12 +1501,12 @@ end

do
local specialSkills = {
[SPECIALSKILL_CRITICALHITCHANCE] = 'critical hit chance',
[SPECIALSKILL_CRITICALHITAMOUNT] = 'critical extra damage',
[SPECIALSKILL_LIFELEECHCHANCE] = 'hitpoints leech chance',
[SPECIALSKILL_LIFELEECHAMOUNT] = 'hitpoints leech amount',
[SPECIALSKILL_MANALEECHCHANCE] = 'manapoints leech chance',
[SPECIALSKILL_MANALEECHAMOUNT] = 'manapoints leech amount'
[SPECIALSKILL_CRITICALHITCHANCE] = 'critical hit chance', -- format: x%
[SPECIALSKILL_CRITICALHITAMOUNT] = 'critical extra damage', -- format: +y%
[SPECIALSKILL_LIFELEECHCHANCE] = 'life leech chance',
[SPECIALSKILL_LIFELEECHAMOUNT] = 'life leech amount',
[SPECIALSKILL_MANALEECHCHANCE] = 'mana leech chance',
[SPECIALSKILL_MANALEECHAMOUNT] = 'mana leech amount',
}

function getSpecialSkillName(specialSkill)
Expand All @@ -1527,6 +1527,17 @@ do
end
end

do
local mounts = {}
for _, mountData in pairs(Game.getMounts()) do
mounts[mountData.clientId] = mountData.name
end

function getMountNameByLookType(lookType)
return mounts[lookType]
end
end

function indexToCombatType(idx)
return bit.lshift(1, idx)
end
Expand Down
Loading