finish 7.92 items

This commit is contained in:
ErikasKontenis
2020-03-06 18:35:10 +02:00
parent 434daeb010
commit d920babe81
17 changed files with 151 additions and 27 deletions

View File

@@ -105,6 +105,7 @@
<action fromid="2952" toid="2965" script="misc/instruments.lua" />
<action itemid="3219" script="misc/instruments.lua" />
<action itemid="5786" script="misc/instruments.lua" />
<action itemid="6572" script="misc/instruments.lua" />
<!-- Strange Levers -->
<action fromid="2566" toid="2567" script="misc/strange_lever.lua" />
@@ -157,6 +158,9 @@
<action fromid="3309" toid="3329" script="misc/weapons.lua" />
<action fromid="3331" toid="3348" script="misc/weapons.lua" />
<action itemid="3208" script="misc/weapons.lua" />
<action itemid="6101" script="misc/weapons.lua" />
<action itemid="6527" script="misc/weapons.lua" />
<action itemid="6553" script="misc/weapons.lua" />
<action itemid="3059" script="misc/spellbook.lua" />
<action fromid="5792" toid="5797" script="misc/dice.lua" />
<action itemid="3114" script="misc/skull_candle.lua" />
@@ -165,11 +169,16 @@
<action itemid="5928" script="misc/catch_fish.lua" />
<action itemid="6279" script="misc/party_cake.lua" />
<action itemid="6387" script="misc/christmas_card.lua" />
<action itemid="6558" script="misc/concentrated_demonic_blood.lua" />
<action itemid="6561" script="misc/ceremonial_ankh.lua" />
<action itemid="6576" script="misc/fireworks_rocket.lua" />
<action itemid="6578" script="misc/party_hat.lua" />
<!-- Dolls -->
<action itemid="5080" script="misc/dolls.lua" />
<action itemid="5668" script="misc/dolls.lua" />
<action itemid="5791" script="misc/dolls.lua" />
<action itemid="6511" script="misc/dolls.lua" />
<!-- Keys -->
<action fromid="2967" toid="2973" script="misc/key.lua" />
@@ -310,6 +319,13 @@
<action itemid="6392" script="misc/food.lua" />
<action itemid="6393" script="misc/food.lua" />
<action itemid="6500" script="misc/food.lua" />
<action itemid="6541" script="misc/food.lua" />
<action itemid="6542" script="misc/food.lua" />
<action itemid="6543" script="misc/food.lua" />
<action itemid="6544" script="misc/food.lua" />
<action itemid="6545" script="misc/food.lua" />
<action itemid="6569" script="misc/food.lua" />
<action itemid="6574" script="misc/food.lua" />
<!-- Passthrough -->
<action fromid="2334" toid="2341" script="misc/doors.lua" />

View File

@@ -0,0 +1,18 @@
local blessings = {
{key = 101, value = 1, name = 'Wisdom of Solitude'},
{key = 102, value = 1, name = 'Spark of the Phoenix'},
{key = 103, value = 3, name = 'Fire of the Suns'},
{key = 104, value = 1, name = 'Spiritual Shielding'},
{key = 105, value = 1, name = 'Embrace of Tibia'}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local result, bless = 'Received blessings:'
for i = 1, #blessings do
bless = blessings[i]
result = (player:getStorageValue(bless.key) == bless.value) and result .. '\n' .. bless.name or result
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 20 > result:len() and 'No blessings received.' or result)
return true
end

View File

@@ -0,0 +1,5 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
item:getPosition():sendMagicEffect(CONST_ME_DRAWBLOOD)
item:transform(2874, math.random(10, 11))
return true
end

View File

@@ -18,6 +18,14 @@ local dolls = {
"Grooaaaaar*cough*",
"Aaa... CHOO!",
"You... will.... burn!!"
},
[6511] = {
"Ho ho ho",
"Jingle bells, jingle bells...",
"Have you been naughty?",
"Have you been nice?",
"Merry Christmas!",
"Can you stop squeezing me now... I'm starting to feel a little sick."
}
}
@@ -41,10 +49,23 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey)
elseif random == 5 then
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -1, -1, CONST_ME_EXPLOSIONHIT)
end
if configManager.getNumber(configKeys.CLIENT_VERSION) >= 790 then
item:transform(6566)
item:decay()
end
elseif item.itemid == 5668 then
fromPosition:sendMagicEffect(CONST_ME_MAGIC_RED)
item:transform(item.itemid + 1)
item:decay()
elseif item.itemid == 5080 then
if configManager.getNumber(configKeys.CLIENT_VERSION) >= 790 then
item:transform(6568)
item:decay()
end
elseif item.itemid == 6511 then
item:transform(6567)
item:decay()
end
sound = sound:gsub('|PLAYERNAME|', player:getName())

View File

@@ -0,0 +1,17 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if fromPosition.x ~= CONTAINER_POSITION then
fromPosition:sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
else
local pos = player:getPosition()
pos:sendMagicEffect(CONST_ME_HITBYFIRE)
pos:sendMagicEffect(CONST_ME_EXPLOSIONAREA)
player:say("Ouch! Rather place it on the ground next time.", TALKTYPE_MONSTER_SAY)
if (player:getHealth() > 10) then
player:addHealth(-10)
end
end
item:remove()
return true
end

View File

@@ -46,6 +46,13 @@ local foods = {
[6392] = "Mmmm.", -- valentine's cake
[6393] = "Mmmm.", -- cream cake
[6500] = "Mmmm.", -- gingerbreadman
[6541] = "Gulp.", -- coloured egg
[6542] = "Gulp.", -- coloured egg
[6543] = "Gulp.", -- coloured egg
[6544] = "Gulp.", -- coloured egg
[6545] = "Gulp.", -- coloured egg
[6569] = "Mmmm.", -- candy
[6574] = "Mmmm.", -- bar of chocolate
}
function onUse(player, item, fromPosition, target, toPosition)

View File

@@ -17,6 +17,11 @@ function onUse(player, item, fromPosition, target, toPosition)
else
item:getPosition():sendMagicEffect(CONST_ME_SOUND_YELLOW)
end
elseif item:getId() == 6572 then
item:getPosition():sendMagicEffect(CONST_ME_SOUND_GREEN)
item:getPosition():sendMonsterSay("TOOOOOOT")
item:transform(6573)
item:decay()
end
return true

View File

@@ -0,0 +1,9 @@
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local slot = player:getSlotItem(CONST_SLOT_HEAD)
if slot and item.uid == slot.uid then
player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
return true
end
return false
end