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

@@ -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