First commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
local config = {
|
||||
[6087] = {storage = 1053, text = 'first', effect = CONST_ME_SOUND_GREEN},
|
||||
[6088] = {storage = 1054, text = 'second', effect = CONST_ME_SOUND_RED},
|
||||
[6089] = {storage = 1055, text = 'third', effect = CONST_ME_SOUND_YELLOW},
|
||||
[6090] = {storage = 1056, text = 'fourth', effect = CONST_ME_SOUND_BLUE}
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local playerPosition = player:getPosition()
|
||||
local useItem = config[item.itemid]
|
||||
if player:getStorageValue(useItem.storage) ~= 1 then
|
||||
player:setStorageValue(useItem.storage, 1)
|
||||
player:say("You have learned the ".. useItem.text .." part of a hymn.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
|
||||
playerPosition:sendMagicEffect(useItem.effect)
|
||||
item:remove(1)
|
||||
else
|
||||
player:say("You already know the ".. useItem.text .." verse of the hymn.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,18 @@
|
||||
local storages = {1053, 1054, 1055, 1056}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local playerPosition = player:getPosition()
|
||||
|
||||
for i = 1, #storages do
|
||||
if player:getStorageValue(storages[i]) ~= 1 then
|
||||
player:say("You have not learned all the verses of the hymn.", TALKTYPE_MONSTER_SAY, false, 0, toPosition)
|
||||
playerPosition:sendMagicEffect(CONST_ME_POFF)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
player:teleportTo(Position(32402, 32794, 9))
|
||||
player:say("You have sucessfully played the secret hymn of the cult.", TALKTYPE_MONSTER_SAY)
|
||||
Game.sendMagicEffect({x = 32402, y = 32794, z = 9}, CONST_ME_SOUND_PURPLE)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,28 @@
|
||||
local maps = {
|
||||
[17528] = "You have successfully read plan A.",
|
||||
[17529] = "You have successfully read plan B.",
|
||||
[17530] = "You have successfully read plan C."
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local mapActionId = item:getActionId()
|
||||
local map = maps[mapActionId]
|
||||
if not map then
|
||||
return false
|
||||
end
|
||||
|
||||
local playerPosition = player:getPosition()
|
||||
if player:getStorageValue(17520) < 8 then
|
||||
player:say("You shouldn't touch these maps because someone might see you.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
|
||||
return true
|
||||
end
|
||||
|
||||
if player:getStorageValue(mapActionId) ~= 1 then
|
||||
player:say(map, TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
|
||||
player:setStorageValue(mapActionId, 1)
|
||||
else
|
||||
player:say("You have already read this map.", TALKTYPE_MONSTER_SAY, false, 0, playerPosition)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,10 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if player:getStorageValue(17526) < os.time() then
|
||||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a tortoise egg from Nargor.")
|
||||
player:setStorageValue(17526, os.time() + 24 * 60 * 60) -- 24 hour
|
||||
player:addItem(6125,1)
|
||||
else
|
||||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You shoud not take any more today.")
|
||||
end
|
||||
return true
|
||||
end
|
51
app/SabrehavenServer/data/actions/scripts/misc/baking.lua
Normal file
51
app/SabrehavenServer/data/actions/scripts/misc/baking.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local ovens = {
|
||||
2535, 2537, 2539, 2541, 3510, 6355, 6357, 6359, 6361
|
||||
}
|
||||
|
||||
local milestone = {
|
||||
1943, 1944, 1945, 1946
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if item:getId() == 3603 then
|
||||
if (target:getId() == 2524 or target:getId() == 2873) and target:getFluidType() == FLUID_WATER then
|
||||
target:transform(target:getId(), FLUID_NONE)
|
||||
local parent = item:getParent()
|
||||
if parent:isContainer() or parent:isPlayer() then
|
||||
parent:addItem(3604, 1):decay()
|
||||
else
|
||||
Game.createItem(3604, 1, item:getPosition()):decay()
|
||||
end
|
||||
item:remove(1)
|
||||
return true
|
||||
end
|
||||
elseif item:getId() == 3604 then
|
||||
if table.contains(ovens, target:getId()) then
|
||||
Game.createItem(3600, 1, target:getPosition())
|
||||
item:remove(1)
|
||||
return true
|
||||
end
|
||||
elseif item:getId() == 6276 then
|
||||
if table.contains(ovens, target:getId()) then
|
||||
Game.createItem(6277, 1, target:getPosition())
|
||||
item:remove(1)
|
||||
return true
|
||||
end
|
||||
elseif item:getId() == 3605 then
|
||||
if table.contains(milestone, target:getId()) then
|
||||
local parent = item:getParent()
|
||||
if parent:isContainer() or parent:isPlayer() then
|
||||
parent:addItem(3603, 1):decay()
|
||||
else
|
||||
Game.createItem(3603, 1, item:getPosition()):decay()
|
||||
end
|
||||
item:remove(1)
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if math.random(1, 100) <= 1 and math.random(1, 100) <= 10 then
|
||||
item:transform(2975, 0)
|
||||
item:decay()
|
||||
else
|
||||
item:getPosition():sendMagicEffect(22)
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:transform(3700, 1)
|
||||
item:decay()
|
||||
Game.createItem(3588, 3, fromPosition)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,30 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 3874 and player:getStorageValue(305) == 1 then
|
||||
item:transform(4868, 1)
|
||||
target:getPosition():sendMagicEffect(10)
|
||||
return true
|
||||
elseif target:getId() == 3885 and player:getStorageValue(305) == 3 then
|
||||
item:transform(4870, 1)
|
||||
target:getPosition():sendMagicEffect(10)
|
||||
return true
|
||||
elseif target:getId() == 3878 and player:getStorageValue(305) == 5 then
|
||||
item:transform(4869, 1)
|
||||
target:getPosition():sendMagicEffect(10)
|
||||
return true
|
||||
elseif target:getId() == 5658 and player:getStorageValue(17535) == 1 then
|
||||
if player:getStorageValue(17536) < os.time() then
|
||||
item:transform(5937, 1)
|
||||
target:getPosition():sendMagicEffect(10)
|
||||
player:setStorageValue(17536, os.time() + 20 * 60 * 60) -- 20 hour
|
||||
return true
|
||||
else
|
||||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You just collected a fragile griffinclaw. At least wait for the rest of the plant to recover a bit before gathering more.")
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,28 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 4992 and player:getStorageValue(304) == 1 then
|
||||
target:getPosition():sendMagicEffect(17)
|
||||
item:transform(4865, 1)
|
||||
item:decay()
|
||||
target:remove()
|
||||
elseif target:getId() == 4993 and player:getStorageValue(304) == 3 then
|
||||
target:getPosition():sendMagicEffect(17)
|
||||
item:transform(4866, 1)
|
||||
item:decay()
|
||||
target:remove()
|
||||
elseif target:getId() == 4991 and player:getStorageValue(304) == 5 then
|
||||
target:getPosition():sendMagicEffect(17)
|
||||
item:transform(4864, 1)
|
||||
item:decay()
|
||||
target:remove()
|
||||
elseif target:getId() == 5013 and player:getStorageValue(304) == 5 then
|
||||
target:getPosition():sendMagicEffect(17)
|
||||
item:transform(5089, 1)
|
||||
item:decay()
|
||||
target:remove()
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,16 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if target.itemid ~= 5553 then
|
||||
return false
|
||||
end
|
||||
|
||||
if math.random(2) ~= 1 then
|
||||
player:say("The golden fish escaped.", TALKTYPE_MONSTER_SAY)
|
||||
return true
|
||||
end
|
||||
|
||||
player:say("You catch a golden fish in the bowl.", TALKTYPE_MONSTER_SAY)
|
||||
item:transform(5929)
|
||||
target:remove()
|
||||
toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,12 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 5662 and Game.isItemThere({x = 33024, y = 32672, z = 6}, 5662) then
|
||||
item:transform(5939, 1)
|
||||
target:getPosition():sendMagicEffect(2)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -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
|
@@ -0,0 +1,35 @@
|
||||
local config = {
|
||||
[3031] = {changeTo = 3035},
|
||||
[3035] = {changeBack = 3031, changeTo = 3043},
|
||||
[3043] = {changeBack = 3035}
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local ring = player:getSlotItem(CONST_SLOT_RING)
|
||||
if ring == nil or ring:getId() ~= 3007 then
|
||||
return false
|
||||
end
|
||||
|
||||
local ringCharges = ring:getAttribute(ITEM_ATTRIBUTE_CHARGES)
|
||||
local coin = config[item:getId()]
|
||||
if coin.changeTo and item.type == 100 then
|
||||
item:remove()
|
||||
player:addItem(coin.changeTo, 1)
|
||||
if ringCharges > 1 then
|
||||
ring:setAttribute(ITEM_ATTRIBUTE_CHARGES,(ringCharges-1))
|
||||
else
|
||||
ring:remove(1)
|
||||
end
|
||||
elseif coin.changeBack then
|
||||
item:remove(1)
|
||||
player:addItem(coin.changeBack, 100)
|
||||
if ringCharges > 1 then
|
||||
ring:setAttribute(ITEM_ATTRIBUTE_CHARGES,(ringCharges-1))
|
||||
else
|
||||
ring:remove(1)
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
115
app/SabrehavenServer/data/actions/scripts/misc/chests.lua
Normal file
115
app/SabrehavenServer/data/actions/scripts/misc/chests.lua
Normal file
@@ -0,0 +1,115 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local chestQuestNumber = item:getAttribute(ITEM_ATTRIBUTE_CHESTQUESTNUMBER)
|
||||
|
||||
if chestQuestNumber == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
if player:getStorageValue(chestQuestNumber) > 0 then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "The " .. item:getName() .. " is empty.")
|
||||
return true
|
||||
end
|
||||
|
||||
local playerCapacity = player:getFreeCapacity()
|
||||
|
||||
if item:getSize() <= 0 then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "The chest is empty. This is a bug, report it to a gamemaster.")
|
||||
return true
|
||||
end
|
||||
|
||||
local reward = item:getItem(0)
|
||||
local stackable = reward:getType():isStackable()
|
||||
local rewardName = reward:getName()
|
||||
local rewardWeight = reward:getWeight()
|
||||
|
||||
if stackable then
|
||||
if reward:getCount() > 1 then
|
||||
rewardName = reward:getCount() .. " " .. reward:getPluralName()
|
||||
else
|
||||
rewardName = reward:getName()
|
||||
end
|
||||
end
|
||||
|
||||
if reward:getArticle():len() > 0 and reward:getCount() <= 1 then
|
||||
rewardName = reward:getArticle() .. " " .. rewardName
|
||||
end
|
||||
|
||||
if rewardWeight > playerCapacity and not getPlayerFlagValue(player, layerFlag_HasInfiniteCapacity) then
|
||||
local term = "it is"
|
||||
if stackable and reward:getCount() > 1 then
|
||||
term = "they are"
|
||||
end
|
||||
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, string.format("You have found %s. Weighing %d.%02d oz %s too heavy.", rewardName, rewardWeight / 100, rewardWeight % 100, term))
|
||||
return true
|
||||
end
|
||||
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found " .. rewardName .. ".")
|
||||
|
||||
local attackAttribute = math.random(-2, 5)
|
||||
local rewardClone = reward:clone()
|
||||
if rewardClone:getType():getAttack() > 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_ATTACK, rewardClone:getType():getAttack() + attackAttribute)
|
||||
local description = rewardClone:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) and rewardClone:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) or rewardClone:getType():getDescription()
|
||||
if description ~= nil and description ~= '' then
|
||||
description = description .. ". "
|
||||
end
|
||||
|
||||
if attackAttribute == 5 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with perfect attack.")
|
||||
else
|
||||
if attackAttribute ~= 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with " .. attackAttribute .. " attack.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local defenseAttribute = math.random(-2, 5)
|
||||
if rewardClone:getType():getDefense() > 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DEFENSE, rewardClone:getType():getDefense() + defenseAttribute)
|
||||
local description = rewardClone:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) and rewardClone:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) or rewardClone:getType():getDescription()
|
||||
|
||||
if rewardClone:getType():getAttack() > 0 and attackAttribute ~= 0 then
|
||||
if defenseAttribute == 5 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. " Enchanted with perfect defense.")
|
||||
else
|
||||
if defenseAttribute ~= 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. " Enchanted with " .. defenseAttribute .. " defense.")
|
||||
end
|
||||
end
|
||||
else
|
||||
if description ~= nil and description ~= '' then
|
||||
description = description .. ". "
|
||||
end
|
||||
|
||||
if defenseAttribute == 5 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with perfect defense.")
|
||||
else
|
||||
if defenseAttribute ~= 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with " .. defenseAttribute .. " defense.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local armorAttribute = math.random(-1, 2)
|
||||
if rewardClone:getType():getArmor() > 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_ARMOR, rewardClone:getType():getArmor() + armorAttribute)
|
||||
local description = rewardClone:hasAttribute(ITEM_ATTRIBUTE_DESCRIPTION) and rewardClone:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) or rewardClone:getType():getDescription()
|
||||
if description ~= nil and description ~= '' then
|
||||
description = description .. ". "
|
||||
end
|
||||
|
||||
if armorAttribute == 2 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with perfect armor protection.")
|
||||
else
|
||||
if armorAttribute ~= 0 then
|
||||
rewardClone:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, description .. "Enchanted with " .. armorAttribute .. " armor protection.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
player:addItemEx(rewardClone, true)
|
||||
player:setStorageValue(chestQuestNumber, 1)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,50 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
|
||||
local bundleTypes = {
|
||||
[6506] = { -- red christmas bundle
|
||||
6503
|
||||
},
|
||||
[6507] = { -- blue christmas bundle
|
||||
6504
|
||||
},
|
||||
[6508] = { -- green christmas bundle
|
||||
6502
|
||||
}
|
||||
}
|
||||
|
||||
local common = {
|
||||
{6569, 15}, {3598, 20}, {3599, 10}, {3586, 10}, {3585, 5}, 6500, 6501, 6489, 6387
|
||||
}
|
||||
|
||||
local targetItem = bundleTypes[item.itemid]
|
||||
if not targetItem then
|
||||
return true
|
||||
end
|
||||
|
||||
targetItem = common
|
||||
|
||||
-- In case there's going to be more than one unique item per bundle
|
||||
for i = 1, #bundleTypes[item.itemid] do
|
||||
table.insert(targetItem, bundleTypes[item.itemid][i])
|
||||
end
|
||||
|
||||
local rewards = {}
|
||||
repeat
|
||||
local count = 1
|
||||
local rand = math.random(#targetItem)
|
||||
local gift = targetItem[rand]
|
||||
if type(gift) == "table" then
|
||||
count = gift[2]
|
||||
gift = gift[1]
|
||||
end
|
||||
rewards[#rewards + 1] = {gift, count}
|
||||
table.remove(targetItem, rand)
|
||||
until #rewards == 7
|
||||
|
||||
for i = 1, #rewards do
|
||||
player:addItem(rewards[i][1], rewards[i][2])
|
||||
end
|
||||
item:remove(1)
|
||||
fromPosition:sendMagicEffect(CONST_ME_GIFT_WRAPS)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_YELLOW)
|
||||
item:getPosition():sendMonsterSay("Merry Christmas, " .. player:getName() .. "!")
|
||||
return true
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if Tile(item:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
else
|
||||
item:transform(3482, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
@@ -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
|
@@ -0,0 +1,61 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if math.random(1, 100) <= 95 then
|
||||
item:getPosition():sendMagicEffect(19)
|
||||
local parent = item:getParent()
|
||||
if parent:isContainer() or parent:isPlayer() then
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
else
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
end
|
||||
else
|
||||
item:getPosition():sendMagicEffect(19)
|
||||
local parent = item:getParent()
|
||||
if parent:isContainer() or parent:isPlayer() then
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
parent:addItem(3592, 1)
|
||||
else
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
Game.createItem(3592, 1, fromPosition)
|
||||
end
|
||||
item:transform(3592, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
36
app/SabrehavenServer/data/actions/scripts/misc/crowbar.lua
Normal file
36
app/SabrehavenServer/data/actions/scripts/misc/crowbar.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 4848 and player:getStorageValue(297) == 0 then
|
||||
player:setStorageValue(297, 1)
|
||||
target:getPosition():sendMagicEffect(1)
|
||||
target:transform(4849, 1)
|
||||
target:decay()
|
||||
return true
|
||||
elseif target:getId() == 4848 and player:getStorageValue(297) == 1 then
|
||||
player:setStorageValue(297, 2)
|
||||
target:getPosition():sendMagicEffect(1)
|
||||
target:transform(4849, 1)
|
||||
target:decay()
|
||||
return true
|
||||
elseif target:getId() == 4848 and player:getStorageValue(297) == 2 then
|
||||
player:setStorageValue(297, 3)
|
||||
target:getPosition():sendMagicEffect(1)
|
||||
target:transform(4849, 3)
|
||||
target:decay()
|
||||
return true
|
||||
elseif target:getId() == 1628 and toPosition.x == 32680 and toPosition.y == 32083 and toPosition.z == 09 then
|
||||
Game.transformItemOnMap({x = 32680, y = 32083, z = 09}, 1628, 1630)
|
||||
return true
|
||||
elseif target:getId() == 3501 and toPosition.x == 32013 and toPosition.y == 31562 and toPosition.z == 04 and player:getStorageValue(228) == 1 then
|
||||
Game.sendMagicEffect({x = 32013, y = 31562, z = 04}, 15)
|
||||
player:setStorageValue(228, 2)
|
||||
return true
|
||||
elseif target:getId() == 3501 and toPosition.x == 32013 and toPosition.y == 31562 and toPosition.z == 04 then
|
||||
Game.sendMagicEffect({x = 32013, y = 31562, z = 04}, 3)
|
||||
return true
|
||||
end
|
||||
return doDestroyItem(target)
|
||||
end
|
31
app/SabrehavenServer/data/actions/scripts/misc/dice.lua
Normal file
31
app/SabrehavenServer/data/actions/scripts/misc/dice.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local playerPosition = player:getPosition()
|
||||
local afrompos = {x=playerPosition.x - 1, y=playerPosition.y - 1, z=playerPosition.z}
|
||||
local atopos = {x=playerPosition.x + 1, y=playerPosition.y + 1, z=playerPosition.z}
|
||||
for xa = afrompos.x,atopos.x do
|
||||
for ya = afrompos.y,atopos.y do
|
||||
for za = afrompos.z,atopos.z do
|
||||
local npos = {x = xa,y = ya,z = za}
|
||||
local depotItem = Tile(npos):getItemByType(ITEM_TYPE_DEPOT)
|
||||
if depotItem ~= nil then
|
||||
player:sendCancelMessage("You cannot use this object.")
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local dicePosition = item:getPosition()
|
||||
local value = math.random(6)
|
||||
local isInGhostMode = player:isInGhostMode()
|
||||
|
||||
dicePosition:sendMagicEffect(CONST_ME_CRAPS, isInGhostMode and player)
|
||||
|
||||
local spectators = Game.getSpectators(dicePosition, false, true, 3, 3)
|
||||
for i = 1, #spectators do
|
||||
player:say(player:getName() .. " rolled a " .. value .. ".", TALKTYPE_MONSTER_SAY, isInGhostMode, spectators[i], dicePosition)
|
||||
end
|
||||
|
||||
item:transform(5791 + value)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,20 @@
|
||||
local distillingMachines = {
|
||||
[5468] = 5512,
|
||||
[5469] = 5513
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
local machine = distillingMachines[target:getId()]
|
||||
if machine then
|
||||
target:transform(machine, 1)
|
||||
target:decay()
|
||||
item:remove(1)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
@@ -0,0 +1,26 @@
|
||||
local greenDjinnItem = 6549
|
||||
local blueDjinnItem = 6551
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if player:getStorageValue(278) > 1 then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already finished one of the djinn quest or your quest is in-progress.")
|
||||
return true
|
||||
end
|
||||
|
||||
if item:getId() == greenDjinnItem then
|
||||
player:setStorageValue(278, 3)
|
||||
player:setStorageValue(286, 3)
|
||||
player:setStorageValue(287, 3)
|
||||
player:setStorageValue(288, 3)
|
||||
elseif item:getId() == blueDjinnItem then
|
||||
player:setStorageValue(278, 2)
|
||||
player:setStorageValue(280, 2)
|
||||
player:setStorageValue(281, 2)
|
||||
player:setStorageValue(282, 2)
|
||||
player:setStorageValue(283, 3)
|
||||
end
|
||||
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
item:remove()
|
||||
return true
|
||||
end
|
74
app/SabrehavenServer/data/actions/scripts/misc/dolls.lua
Normal file
74
app/SabrehavenServer/data/actions/scripts/misc/dolls.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
local dolls = {
|
||||
[5080] = {"Hug me."},
|
||||
[5668] = {
|
||||
"It's not winning that matters, but winning in style.",
|
||||
"Today's your lucky day. Probably.",
|
||||
"Do not meddle in the affairs of dragons, for you are crunchy and taste good with ketchup.",
|
||||
"That is one stupid question.",
|
||||
"You'll need more rum for that.",
|
||||
"Do or do not. There is no try.",
|
||||
"You should do something you always wanted to.",
|
||||
"If you walk under a ladder and it falls down on you it probably means bad luck.",
|
||||
"Never say 'oops'. Always say 'Ah, interesting!'",
|
||||
"Five steps east, fourteen steps south, two steps north and seventeen steps west!"
|
||||
},
|
||||
[5791] = {
|
||||
"Fchhhhhh!",
|
||||
"Zchhhhhh!",
|
||||
"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."
|
||||
}
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local sounds = dolls[item.itemid]
|
||||
if not sounds then
|
||||
return false
|
||||
end
|
||||
|
||||
if fromPosition.x == CONTAINER_POSITION then
|
||||
fromPosition = player:getPosition()
|
||||
end
|
||||
|
||||
local random = math.random(#sounds)
|
||||
local sound = sounds[random]
|
||||
if item.itemid == 5791 then
|
||||
if random == 3 then
|
||||
fromPosition:sendMagicEffect(CONST_ME_POFF)
|
||||
elseif random == 4 then
|
||||
fromPosition:sendMagicEffect(CONST_ME_FIREAREA)
|
||||
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())
|
||||
player:say(sound, TALKTYPE_MONSTER_SAY, false, 0, fromPosition)
|
||||
return true
|
||||
end
|
275
app/SabrehavenServer/data/actions/scripts/misc/doors.lua
Normal file
275
app/SabrehavenServer/data/actions/scripts/misc/doors.lua
Normal file
@@ -0,0 +1,275 @@
|
||||
local lockedDoors = {
|
||||
1628, 1631, 1650, 1653, 1668, 1671, 1682, 1691, 5006, 5007, 5097, 5106, 5115, 5124, 5133, 5136, 5139, 5142, 5277, 5280, 5732, 5735, 6191, 6194, 6248, 6251
|
||||
}
|
||||
|
||||
local closedNormalDoors = {
|
||||
[1629] = 1630,
|
||||
[1632] = 1633,
|
||||
[1638] = 1639,
|
||||
[1640] = 1641,
|
||||
[1651] = 1652,
|
||||
[1654] = 1655,
|
||||
[1656] = 1657,
|
||||
[1658] = 1659,
|
||||
[1669] = 1670,
|
||||
[1672] = 1673,
|
||||
[1683] = 1684,
|
||||
[1685] = 1686,
|
||||
[1692] = 1693,
|
||||
[1694] = 1695,
|
||||
[4912] = 4911,
|
||||
[4913] = 4914,
|
||||
[5082] = 5083,
|
||||
[5084] = 5085,
|
||||
[2177] = 2178,
|
||||
[2179] = 2180,
|
||||
[5098] = 5099,
|
||||
[5100] = 5101,
|
||||
[5107] = 5108,
|
||||
[5109] = 5110,
|
||||
[5116] = 5117,
|
||||
[5118] = 5119,
|
||||
[5125] = 5126,
|
||||
[5127] = 5128,
|
||||
[5134] = 5135,
|
||||
[5137] = 5138,
|
||||
[5140] = 5141,
|
||||
[5143] = 5144,
|
||||
[5278] = 5279,
|
||||
[5281] = 5282,
|
||||
[5283] = 5284,
|
||||
[5285] = 5286,
|
||||
[5514] = 5515,
|
||||
[5516] = 5517,
|
||||
[5733] = 5734,
|
||||
[5736] = 5737,
|
||||
[6192] = 6193,
|
||||
[6195] = 6196,
|
||||
[6197] = 6198,
|
||||
[6199] = 6200,
|
||||
[6249] = 6250,
|
||||
[6252] = 6253,
|
||||
[6254] = 6255,
|
||||
[6256] = 6257,
|
||||
}
|
||||
|
||||
local openVerticalDoors = {
|
||||
[1630] = 1629,
|
||||
[1639] = 1638,
|
||||
[1643] = 1642,
|
||||
[1647] = 1646,
|
||||
[1652] = 1651,
|
||||
[1657] = 1656,
|
||||
[1661] = 1660,
|
||||
[1665] = 1664,
|
||||
[1670] = 1669,
|
||||
[1675] = 1674,
|
||||
[1679] = 1678,
|
||||
[1693] = 1692,
|
||||
[1695] = 1694,
|
||||
[1697] = 1696,
|
||||
[1699] = 1698,
|
||||
[4914] = 4913,
|
||||
[5083] = 5082,
|
||||
[2178] = 2177,
|
||||
[5108] = 5107,
|
||||
[5110] = 5109,
|
||||
[5112] = 5111,
|
||||
[5114] = 5113,
|
||||
[5126] = 5125,
|
||||
[5128] = 5127,
|
||||
[5130] = 5129,
|
||||
[5132] = 5131,
|
||||
[5141] = 5140,
|
||||
[5144] = 5143,
|
||||
[5282] = 5281,
|
||||
[5284] = 5283,
|
||||
[5288] = 5287,
|
||||
[5292] = 5291,
|
||||
[5515] = 5514,
|
||||
[5737] = 5736,
|
||||
[5748] = 5749,
|
||||
[6193] = 6192,
|
||||
[6198] = 6197,
|
||||
[6202] = 6201,
|
||||
[6206] = 6205,
|
||||
[6250] = 6249,
|
||||
[6255] = 6254,
|
||||
[6259] = 6258,
|
||||
[6263] = 6262,
|
||||
}
|
||||
|
||||
local openHorizontalDoors = {
|
||||
[1633] = 1632,
|
||||
[1641] = 1640,
|
||||
[1645] = 1644,
|
||||
[1649] = 1648,
|
||||
[1655] = 1654,
|
||||
[1659] = 1658,
|
||||
[1663] = 1662,
|
||||
[1667] = 1666,
|
||||
[1673] = 1672,
|
||||
[1677] = 1676,
|
||||
[1681] = 1680,
|
||||
[1684] = 1683,
|
||||
[1686] = 1685,
|
||||
[1688] = 1687,
|
||||
[1690] = 1689,
|
||||
[4911] = 4912,
|
||||
[5085] = 5084,
|
||||
[2180] = 2179,
|
||||
[5099] = 5098,
|
||||
[5101] = 5100,
|
||||
[5103] = 5102,
|
||||
[5105] = 5104,
|
||||
[5117] = 5116,
|
||||
[5119] = 5118,
|
||||
[5121] = 5120,
|
||||
[5123] = 5122,
|
||||
[5135] = 5134,
|
||||
[5138] = 5137,
|
||||
[5279] = 5278,
|
||||
[5286] = 5285,
|
||||
[5290] = 5289,
|
||||
[5294] = 5293,
|
||||
[5517] = 5516,
|
||||
[5734] = 5733,
|
||||
[5746] = 5745,
|
||||
[6196] = 6195,
|
||||
[6200] = 6199,
|
||||
[6204] = 6203,
|
||||
[6208] = 6207,
|
||||
[6253] = 6252,
|
||||
[6257] = 6256,
|
||||
[6261] = 6260,
|
||||
[6265] = 6264,
|
||||
}
|
||||
|
||||
local levelDoors = {
|
||||
[1646] = 1647,
|
||||
[1648] = 1649,
|
||||
[1664] = 1665,
|
||||
[1666] = 1667,
|
||||
[1678] = 1679,
|
||||
[1680] = 1681,
|
||||
[1687] = 1688,
|
||||
[1696] = 1697,
|
||||
[5102] = 5103,
|
||||
[5111] = 5112,
|
||||
[5120] = 5121,
|
||||
[5129] = 5130,
|
||||
[5291] = 5292,
|
||||
[5293] = 5294,
|
||||
[6205] = 6206,
|
||||
[6207] = 6208,
|
||||
[6262] = 6263,
|
||||
[6264] = 6265,
|
||||
}
|
||||
|
||||
local questDoors = {
|
||||
[1642] = 1643,
|
||||
[1644] = 1645,
|
||||
[1660] = 1661,
|
||||
[1662] = 1663,
|
||||
[1674] = 1675,
|
||||
[1676] = 1677,
|
||||
[1689] = 1690,
|
||||
[1698] = 1699,
|
||||
[5104] = 5105,
|
||||
[5113] = 5114,
|
||||
[5122] = 5123,
|
||||
[5131] = 5132,
|
||||
[5287] = 5288,
|
||||
[5289] = 5290,
|
||||
[5745] = 5746,
|
||||
[5749] = 5748,
|
||||
[6201] = 6202,
|
||||
[6203] = 6204,
|
||||
[6258] = 6259,
|
||||
[6260] = 6261,
|
||||
}
|
||||
|
||||
local passthrough = {
|
||||
[2334] = 2335,
|
||||
[2335] = 2334,
|
||||
[2336] = 2337,
|
||||
[2337] = 2336,
|
||||
[2338] = 2339,
|
||||
[2339] = 2338,
|
||||
[2340] = 2341,
|
||||
[2341] = 2340,
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if table.contains(lockedDoors, item:getId()) then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is locked.")
|
||||
return true
|
||||
end
|
||||
|
||||
local door = closedNormalDoors[item:getId()]
|
||||
if door then
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = openVerticalDoors[item:getId()]
|
||||
if door then
|
||||
local doorCreature = Tile(item:getPosition()):getTopCreature()
|
||||
if doorCreature then
|
||||
doorCreature:teleportTo(item:getPosition():moveRel(1, 0, 0), true)
|
||||
end
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = openHorizontalDoors[item:getId()]
|
||||
if door then
|
||||
local doorCreature = Tile(item:getPosition()):getTopCreature()
|
||||
if doorCreature then
|
||||
doorCreature:teleportTo(item:getPosition():moveRel(0, 1, 0), true)
|
||||
end
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = levelDoors[item:getId()]
|
||||
if door then
|
||||
if player:getLevel() < item:getAttribute(ITEM_ATTRIBUTE_DOORLEVEL) then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, item:getType():getDescription() .. ".")
|
||||
return true
|
||||
end
|
||||
|
||||
player:teleportTo(item:getPosition(), true)
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = questDoors[item:getId()]
|
||||
if door then
|
||||
local questNumber = item:getAttribute(ITEM_ATTRIBUTE_DOORQUESTNUMBER)
|
||||
local questValue = item:getAttribute(ITEM_ATTRIBUTE_DOORQUESTVALUE)
|
||||
if questNumber > 0 then
|
||||
if player:getStorageValue(questNumber) ~= questValue then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
player:teleportTo(item:getPosition(), true)
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = passthrough[item:getId()]
|
||||
if door then
|
||||
item:transform(door, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,14 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 4094 then
|
||||
item:transform(4853, 1)
|
||||
item:decay()
|
||||
target:getPosition():sendMagicEffect(12)
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
32
app/SabrehavenServer/data/actions/scripts/misc/fire_bug.lua
Normal file
32
app/SabrehavenServer/data/actions/scripts/misc/fire_bug.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if player:getStorageValue(17520) == 5 and target.itemid == 5601 then
|
||||
player:setStorageValue(17520, 6)
|
||||
toPosition:sendMagicEffect(CONST_ME_FIREAREA)
|
||||
return true
|
||||
end
|
||||
|
||||
local random = math.random(10)
|
||||
if random >= 4 then --success 6% chance
|
||||
if target.itemid == 5465 then --Burn Sugar Cane
|
||||
toPosition:sendMagicEffect(CONST_ME_FIREAREA)
|
||||
target:transform(5464)
|
||||
target:decay()
|
||||
elseif target.itemid == 3514 then --Light Up empty coal basins
|
||||
toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
|
||||
target:transform(3513)
|
||||
elseif target.itemid == 2114 then --Light Up empty coal basins
|
||||
toPosition:sendMagicEffect(CONST_ME_HITBYFIRE)
|
||||
target:transform(2113)
|
||||
end
|
||||
elseif random == 2 then --it remove the fire bug 2% chance
|
||||
item:remove(1)
|
||||
toPosition:sendMagicEffect(CONST_ME_POFF)
|
||||
elseif random == 1 then --it explode on the user 1% chance
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -5, -5, CONST_ME_HITBYFIRE)
|
||||
player:say('OUCH!', TALKTYPE_MONSTER_SAY)
|
||||
item:remove(1)
|
||||
else
|
||||
toPosition:sendMagicEffect(CONST_ME_POFF) --it fails, but dont get removed 3% chance
|
||||
end
|
||||
return true
|
||||
end
|
@@ -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
|
@@ -0,0 +1,36 @@
|
||||
local water = {
|
||||
4597, 4598, 4599, 4600, 4601, 4602,
|
||||
4609, 4610, 4611, 4612, 4613, 4614,
|
||||
4615, 4616, 4617, 4618, 4619, 4620,
|
||||
622
|
||||
}
|
||||
|
||||
local fishableWater = {
|
||||
4597, 4598, 4599, 4600, 4601, 4602
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if not table.contains(water, target:getId()) then
|
||||
return false
|
||||
end
|
||||
|
||||
if not Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE) then
|
||||
player:addSkillTries(SKILL_FISHING, 1)
|
||||
if math.random(1, 100) <= math.min(math.max(10 + (player:getEffectiveSkillLevel(SKILL_FISHING) - 10) * 0.597, 10), 50) then
|
||||
player:addItem(3578, 1)
|
||||
|
||||
if target:getId() ~= 622 then
|
||||
target:transform(4609, 1)
|
||||
end
|
||||
|
||||
target:decay()
|
||||
end
|
||||
end
|
||||
|
||||
target:getPosition():sendMagicEffect(2)
|
||||
return true
|
||||
end
|
120
app/SabrehavenServer/data/actions/scripts/misc/fluids.lua
Normal file
120
app/SabrehavenServer/data/actions/scripts/misc/fluids.lua
Normal file
@@ -0,0 +1,120 @@
|
||||
local drunk = Condition(CONDITION_DRUNK)
|
||||
drunk:setParameter(CONDITION_PARAM_TICKS, 60000)
|
||||
|
||||
local poison = Condition(CONDITION_POISON)
|
||||
poison:setTiming(100)
|
||||
|
||||
local messages = {
|
||||
[FLUID_WATER] = "Gulp.",
|
||||
[FLUID_WINE] = "Aah...",
|
||||
[FLUID_BEER] = "Aah...",
|
||||
[FLUID_MUD] = "Gulp.",
|
||||
[FLUID_BLOOD] = "Gulp.",
|
||||
[FLUID_SLIME] = "Urgh!",
|
||||
[FLUID_OIL] = "Gulp.",
|
||||
[FLUID_URINE] = "Urgh!",
|
||||
[FLUID_MILK] = "Mmmh.",
|
||||
[FLUID_MANAFLUID] = "Aaaah...",
|
||||
[FLUID_LIFEFLUID] = "Aaaah...",
|
||||
[FLUID_LEMONADE] = "Mmmh.",
|
||||
[FLUID_RUM] = "Aah...",
|
||||
[FLUID_COCONUTMILK] = "Mmmh.",
|
||||
[FLUID_FRUITJUICE] = "Mmmh."
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local targetItemType = ItemType(target:getId())
|
||||
if targetItemType and targetItemType:isFluidContainer() then
|
||||
if target:getFluidType() == 0 and item:getFluidType() ~= 0 then
|
||||
target:transform(target:getId(), item:getFluidType())
|
||||
item:transform(item:getId(), 0)
|
||||
return true
|
||||
elseif target:getFluidType() ~= 0 and item:getFluidType() == 0 then
|
||||
player:sendCancelMessage("You cannot use this object.")
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if (configManager.getBoolean(configKeys.UH_TRAP)) then
|
||||
local tile = Tile(toPosition)
|
||||
local creature = tile:getBottomCreature()
|
||||
if creature and creature:isPlayer() then
|
||||
target = creature
|
||||
end
|
||||
else
|
||||
-- monsters do not use mana also I do not know if you can use life fluid on monsters
|
||||
-- if you can just want to use life fluids on monster then change isPlayer to isCreature
|
||||
target = target:isPlayer() and target
|
||||
end
|
||||
|
||||
if target:isCreature() and target:getPlayer() ~= nil then
|
||||
if item:getFluidType() == FLUID_NONE then
|
||||
player:sendCancelMessage("It is empty.")
|
||||
else
|
||||
local self = target == player
|
||||
if self and item:getFluidType() == FLUID_BEER or item:getFluidType() == FLUID_WINE or item:getFluidType() == FLUID_RUM then
|
||||
player:addCondition(drunk)
|
||||
elseif self and item:getFluidType() == FLUID_SLIME then
|
||||
player:addCondition(poison)
|
||||
elseif item:getFluidType() == FLUID_MANAFLUID then
|
||||
target:addMana(math.random(50, 100))
|
||||
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
|
||||
elseif item:getFluidType() == FLUID_LIFEFLUID then
|
||||
target:addHealth(math.random(25, 50))
|
||||
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
|
||||
end
|
||||
|
||||
if not self then
|
||||
if item:getFluidType() ~= FLUID_MANAFLUID and item:getFluidType() ~= FLUID_LIFEFLUID then
|
||||
if toPosition.x == CONTAINER_POSITION then
|
||||
toPosition = player:getPosition()
|
||||
end
|
||||
Game.createItem(2886, item:getFluidType(), toPosition):decay()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local message = messages[item:getFluidType()]
|
||||
if message then
|
||||
target:say(message, TALKTYPE_MONSTER_SAY)
|
||||
else
|
||||
target:say("Gulp.", TALKTYPE_MONSTER_SAY)
|
||||
end
|
||||
|
||||
if player:getStorageValue(17742) ~= 1 then
|
||||
item:transform(item:getId(), FLUID_NONE)
|
||||
else
|
||||
item:remove()
|
||||
end
|
||||
end
|
||||
else
|
||||
if toPosition.x == CONTAINER_POSITION then
|
||||
toPosition = player:getPosition()
|
||||
end
|
||||
|
||||
local tile = Tile(toPosition)
|
||||
if not tile then
|
||||
return false
|
||||
end
|
||||
|
||||
if item:getFluidType() ~= FLUID_NONE and tile:hasFlag(TILESTATE_IMMOVABLEBLOCKSOLID) then
|
||||
return false
|
||||
end
|
||||
|
||||
local fluidSource = targetItemType and targetItemType:getFluidSource() or FLUID_NONE
|
||||
if fluidSource ~= FLUID_NONE then
|
||||
item:transform(item:getId(), fluidSource)
|
||||
elseif item:getFluidType() == FLUID_NONE then
|
||||
player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.")
|
||||
else
|
||||
if item:getFluidType() == FLUID_BLOOD and target:getActionId() == 17639 then
|
||||
doRelocate({x = 32791, y = 32334, z = 09}, {x = 32791, y = 32332, z = 10})
|
||||
Position({x = 32791, y = 32332, z = 10}):sendMonsterSay("Muahahahaha...")
|
||||
end
|
||||
|
||||
Game.createItem(2886, item.type, toPosition):decay()
|
||||
item:transform(item:getId(), 0)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
73
app/SabrehavenServer/data/actions/scripts/misc/food.lua
Normal file
73
app/SabrehavenServer/data/actions/scripts/misc/food.lua
Normal file
@@ -0,0 +1,73 @@
|
||||
local foods = {
|
||||
[3250] = "Crunch.", -- the carrot of doom
|
||||
[3577] = "Munch.", -- meat
|
||||
[3578] = "Munch.", -- fish
|
||||
[3579] = "Mmmm.", -- salmon
|
||||
[3580] = "Munch.", -- fish
|
||||
[3581] = "Gulp.", -- shrimp
|
||||
[3582] = "Chomp.", -- ham
|
||||
[3583] = "Chomp.", -- dragon ham
|
||||
[3584] = "Yum.", -- pear
|
||||
[3585] = "Yum.", -- red apple
|
||||
[3586] = "Yum.", -- orange
|
||||
[3587] = "Yum.", -- banana
|
||||
[3588] = "Yum.", -- blueberry
|
||||
[3589] = "Slurp.", -- coconut
|
||||
[3590] = "Yum.", -- cherry
|
||||
[3591] = "Yum.", -- strawberry
|
||||
[3592] = "Yum.", -- grapes
|
||||
[3593] = "Yum.", -- melon
|
||||
[3594] = "Munch.", -- pumpkin
|
||||
[3595] = "Crunch.", -- carrot
|
||||
[3596] = "Munch.", -- tomato
|
||||
[3597] = "Crunch.", -- corncob
|
||||
[3598] = "Crunch.", -- cookie
|
||||
[3599] = "Munch.", -- candy cane
|
||||
[3600] = "Crunch.", -- bread
|
||||
[3601] = "Crunch.", -- roll
|
||||
[3602] = "Crunch.", -- brown bread
|
||||
[3606] = "Gulp.", -- egg
|
||||
[3607] = "Smack.", -- cheese
|
||||
[3723] = "Munch.", -- white mushroom
|
||||
[3724] = "Munch.", -- red mushroom
|
||||
[3725] = "Munch.", -- brown mushroom
|
||||
[3726] = "Munch.", -- orange mushroom
|
||||
[3727] = "Munch.", -- wood mushroom
|
||||
[3728] = "Munch.", -- dark mushroom
|
||||
[3729] = "Munch.", -- some mushrooms
|
||||
[3730] = "Munch.", -- some mushrooms
|
||||
[3731] = "Munch.", -- fire mushroom
|
||||
[3732] = "Munch.", -- green mushroom
|
||||
[5096] = "Yum.", -- mango
|
||||
[5678] = "Gulp.", -- tortoise egg
|
||||
[6125] = "Gulp.", -- tortoise egg from Nargor
|
||||
[6277] = "Mmmm.", -- cake
|
||||
[6278] = "Mmmm.", -- cake
|
||||
[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)
|
||||
local itemType = ItemType(item:getId())
|
||||
local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
|
||||
if condition and math.floor(condition:getTicks() / 1000 + (itemType:getNutrition() * 12)) >= 1200 then
|
||||
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are full.")
|
||||
else
|
||||
player:feed(itemType:getNutrition() * 12)
|
||||
item:remove(1)
|
||||
|
||||
if configManager.getNumber(configKeys.CLIENT_VERSION) >= 790 then
|
||||
player:say(foods[item:getId()] or "Munch.", TALKTYPE_MONSTER_SAY)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,65 @@
|
||||
local parcels = {
|
||||
[2775] = 2374,
|
||||
[2776] = 2378,
|
||||
[2777] = 2358,
|
||||
[2778] = 2382,
|
||||
[2779] = 2366,
|
||||
[2780] = 2418,
|
||||
[2781] = 2422,
|
||||
[2782] = 2319,
|
||||
[2783] = 2316,
|
||||
[2784] = 2315,
|
||||
[2785] = 2314,
|
||||
[2786] = 2346,
|
||||
[2787] = 2349,
|
||||
[2788] = 2351,
|
||||
[2789] = 2433,
|
||||
[2790] = 2441,
|
||||
[2791] = 2449,
|
||||
[2792] = 2524,
|
||||
[2793] = 2523,
|
||||
[2794] = 2483,
|
||||
[2795] = 2465,
|
||||
[2796] = 2976,
|
||||
[2797] = 2979,
|
||||
[2798] = 2934,
|
||||
[2799] = 3485,
|
||||
[2800] = 2998,
|
||||
[2801] = 2445,
|
||||
[2802] = 2025,
|
||||
[2803] = 2029,
|
||||
[2804] = 2030,
|
||||
[2805] = 2904,
|
||||
[2806] = 3510,
|
||||
[2807] = 2959,
|
||||
[2808] = 2963,
|
||||
[2809] = 2426,
|
||||
[2810] = 2352,
|
||||
[2811] = 2982,
|
||||
[2812] = 2986,
|
||||
[5086] = 5046,
|
||||
[5087] = 5055,
|
||||
[5088] = 5056,
|
||||
[6114] = 6111,
|
||||
[6115] = 6109,
|
||||
[6371] = 6355,
|
||||
[6372] = 6367,
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local parcel = parcels[item:getId()]
|
||||
if not parcel then
|
||||
return false
|
||||
end
|
||||
|
||||
if not item:getParent():isTile() then
|
||||
item:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
elseif not Tile(fromPosition):getHouse() then
|
||||
item:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
else
|
||||
item:transform(parcel)
|
||||
item:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,14 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 3030 then
|
||||
item:getPosition():sendMagicEffect(14)
|
||||
item:transform(3230, 1)
|
||||
item:decay()
|
||||
target:remove(1)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/misc/ice_pick.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/misc/ice_pick.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 4994 and player:getStorageValue(306) == 1 and player:getStorageValue(307) == 0 then
|
||||
local parent = item:getParent()
|
||||
if parent:isContainer() or parent:isPlayer() then
|
||||
parent:addItem(4837, 1)
|
||||
else
|
||||
Game.createItem(4837, 1, item:getPosition())
|
||||
end
|
||||
target:getPosition():sendMagicEffect(2)
|
||||
player:setStorageValue(307, 1)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,28 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() >= 2948 and item:getId() <= 2950 or item:getId() >= 2952 and item:getId() <= 2958 or
|
||||
item:getId() >= 2963 and item:getId() <= 2964 then
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_GREEN)
|
||||
elseif (item:getId() >= 2959 and item:getId() <= 2962 or item:getId() == 2965) and math.random(1, 100) <= 50 then
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_GREEN)
|
||||
elseif item:getId() >= 2959 and item:getId() <= 2962 or item:getId() == 2965 then
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_PURPLE)
|
||||
elseif item:getId() == 3219 then
|
||||
item:getPosition():sendMagicEffect(19)
|
||||
elseif item:getId() == 5786 then
|
||||
Game.createMonster("wolf", player:getPosition())
|
||||
local random = math.random(1,10)
|
||||
if random > 3 then -- destroy 70% chance
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_RED)
|
||||
item:remove(1)
|
||||
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
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
local fruits = {3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3595, 3596, 5096}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if isInArray(fruits, target.itemid) and player:removeItem(2874, 1, 0) then
|
||||
target:remove(1)
|
||||
player:addItem(2874, target.itemid == 3589 and 14 or 15)
|
||||
return true
|
||||
end
|
||||
end
|
104
app/SabrehavenServer/data/actions/scripts/misc/key.lua
Normal file
104
app/SabrehavenServer/data/actions/scripts/misc/key.lua
Normal file
@@ -0,0 +1,104 @@
|
||||
local closedDoors = {
|
||||
[1628] = 1630,
|
||||
[1629] = 1628,
|
||||
[1631] = 1633,
|
||||
[1632] = 1631,
|
||||
[1650] = 1652,
|
||||
[1651] = 1650,
|
||||
[1653] = 1655,
|
||||
[1654] = 1653,
|
||||
[1668] = 1670,
|
||||
[1669] = 1668,
|
||||
[1671] = 1673,
|
||||
[1672] = 1671,
|
||||
[1682] = 1684,
|
||||
[1683] = 1682,
|
||||
[1691] = 1693,
|
||||
[1692] = 1691,
|
||||
[5097] = 5099,
|
||||
[5098] = 5097,
|
||||
[5106] = 5108,
|
||||
[5107] = 5106,
|
||||
[5115] = 5117,
|
||||
[5116] = 5115,
|
||||
[5124] = 5126,
|
||||
[5125] = 5124,
|
||||
[5133] = 5135,
|
||||
[5134] = 5133,
|
||||
[5136] = 5138,
|
||||
[5137] = 5136,
|
||||
[5139] = 5141,
|
||||
[5140] = 5139,
|
||||
[5142] = 5144,
|
||||
[5143] = 5142,
|
||||
[5277] = 5279,
|
||||
[5278] = 5277,
|
||||
[5280] = 5282,
|
||||
[5281] = 5280,
|
||||
[5732] = 5734,
|
||||
[5733] = 5732,
|
||||
[5735] = 5737,
|
||||
[5736] = 5735,
|
||||
[6191] = 6193,
|
||||
[6192] = 6191,
|
||||
[6194] = 6196,
|
||||
[6195] = 6194,
|
||||
[6248] = 6250,
|
||||
[6249] = 6248,
|
||||
[6251] = 6253,
|
||||
[6252] = 6251,
|
||||
}
|
||||
|
||||
local openDoors = {
|
||||
[1630] = 1628,
|
||||
[1633] = 1631,
|
||||
[1652] = 1650,
|
||||
[1655] = 1653,
|
||||
[1670] = 1668,
|
||||
[1673] = 1671,
|
||||
[1684] = 1682,
|
||||
[1693] = 1691,
|
||||
[5099] = 5097,
|
||||
[5108] = 5106,
|
||||
[5117] = 5115,
|
||||
[5126] = 5124,
|
||||
[5135] = 5133,
|
||||
[5138] = 5136,
|
||||
[5141] = 5139,
|
||||
[5144] = 5142,
|
||||
[5279] = 5277,
|
||||
[5282] = 5280,
|
||||
[5734] = 5732,
|
||||
[5737] = 5735,
|
||||
[6193] = 6191,
|
||||
[6196] = 6194,
|
||||
[6250] = 6248,
|
||||
[6253] = 6251,
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
local door = closedDoors[target:getId()]
|
||||
if not door then
|
||||
door = openDoors[target:getId()]
|
||||
end
|
||||
|
||||
if not door then
|
||||
return false
|
||||
end
|
||||
|
||||
local keyNumber = item:getAttribute(ITEM_ATTRIBUTE_KEYNUMBER)
|
||||
local keyHoleNumber = target:getAttribute(ITEM_ATTRIBUTE_KEYHOLENUMBER)
|
||||
|
||||
if keyHoleNumber == 0 or keyNumber ~= keyHoleNumber then
|
||||
player:sendCancelMessage("The key does not match.")
|
||||
return true
|
||||
end
|
||||
|
||||
target:transform(door)
|
||||
target:decay()
|
||||
return true
|
||||
end
|
19
app/SabrehavenServer/data/actions/scripts/misc/knife.lua
Normal file
19
app/SabrehavenServer/data/actions/scripts/misc/knife.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local fruits = {3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3595, 3596, 5096}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 3594 then
|
||||
target:transform(2977, 1)
|
||||
target:decay()
|
||||
return true
|
||||
elseif isInArray(fruits, target:getId()) and player:removeItem(6277, 1) then
|
||||
target:remove(1)
|
||||
player:addItem(6278, 1)
|
||||
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,10 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if target:getId() == 3221 and toPosition.x == 31948 and toPosition.y == 31711 and toPosition.z == 06 then
|
||||
item:transform(2859, 1)
|
||||
item:decay()
|
||||
player:setStorageValue(244, 2)
|
||||
Game.sendMagicEffect({x = 31948, y = 31711, z = 06}, 19)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,12 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if math.random(100) == 1 then
|
||||
player:getPosition():sendMagicEffect(CONST_ME_SOUND_YELLOW)
|
||||
player:say("Congratulations! You won a prize!", TALKTYPE_MONSTER_SAY)
|
||||
item:transform(5958)
|
||||
else
|
||||
player:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
player:say("Sorry, but you drew a blank.", TALKTYPE_MONSTER_SAY)
|
||||
item:remove(1)
|
||||
end
|
||||
return true
|
||||
end
|
19
app/SabrehavenServer/data/actions/scripts/misc/machete.lua
Normal file
19
app/SabrehavenServer/data/actions/scripts/misc/machete.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 3696 then
|
||||
target:transform(3695, 1)
|
||||
target:decay()
|
||||
return true
|
||||
elseif target:getId() == 3702 then
|
||||
target:transform(3701, 1)
|
||||
target:decay()
|
||||
return true
|
||||
elseif target:getId() == 2130 then
|
||||
target:remove()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:transform(3481, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:getPosition():sendMagicEffect(CONST_ME_POFF)
|
||||
item:transform(6278, 1)
|
||||
item:getPosition():sendMonsterSay(player:getName() .. " blew out the candle.")
|
||||
return true
|
||||
end
|
@@ -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
|
89
app/SabrehavenServer/data/actions/scripts/misc/pick.lua
Normal file
89
app/SabrehavenServer/data/actions/scripts/misc/pick.lua
Normal file
@@ -0,0 +1,89 @@
|
||||
local pitsOfInfernoLava = {
|
||||
Position(32808, 32336, 11),
|
||||
Position(32809, 32336, 11),
|
||||
Position(32810, 32336, 11),
|
||||
Position(32808, 32334, 11),
|
||||
Position(32807, 32334, 11),
|
||||
Position(32807, 32335, 11),
|
||||
Position(32807, 32336, 11),
|
||||
Position(32807, 32337, 11),
|
||||
Position(32806, 32337, 11),
|
||||
Position(32805, 32337, 11),
|
||||
Position(32805, 32338, 11),
|
||||
Position(32805, 32339, 11),
|
||||
Position(32806, 32339, 11),
|
||||
Position(32806, 32338, 11),
|
||||
Position(32807, 32338, 11),
|
||||
Position(32808, 32338, 11),
|
||||
Position(32808, 32337, 11),
|
||||
Position(32809, 32337, 11),
|
||||
Position(32810, 32337, 11),
|
||||
Position(32811, 32337, 11),
|
||||
Position(32811, 32338, 11),
|
||||
Position(32806, 32338, 11),
|
||||
Position(32810, 32338, 11),
|
||||
Position(32810, 32339, 11),
|
||||
Position(32809, 32339, 11),
|
||||
Position(32809, 32338, 11),
|
||||
Position(32811, 32336, 11),
|
||||
Position(32811, 32335, 11),
|
||||
Position(32810, 32335, 11),
|
||||
Position(32809, 32335, 11),
|
||||
Position(32808, 32335, 11),
|
||||
Position(32809, 32334, 11),
|
||||
Position(32809, 32333, 11),
|
||||
Position(32810, 32333, 11),
|
||||
Position(32811, 32333, 11),
|
||||
Position(32806, 32338, 11),
|
||||
Position(32810, 32334, 11),
|
||||
Position(32811, 32334, 11),
|
||||
Position(32812, 32334, 11),
|
||||
Position(32813, 32334, 11),
|
||||
Position(32812, 32333, 11),
|
||||
Position(32810, 32334, 11),
|
||||
Position(32812, 32335, 11),
|
||||
Position(32813, 32335, 11),
|
||||
Position(32813, 32333, 11)
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local tile = Tile(toPosition)
|
||||
if not tile then
|
||||
return false
|
||||
end
|
||||
|
||||
local ground = tile:getGround()
|
||||
if not ground then
|
||||
return false
|
||||
end
|
||||
|
||||
if ground:getId() == 372 then
|
||||
ground:transform(394, 1)
|
||||
ground:decay()
|
||||
return true
|
||||
elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 and math.random(1, 100) <= 40 then
|
||||
Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
|
||||
Game.removeItemOnMap({x = 32648, y = 32134, z = 10}, 1772)
|
||||
return true
|
||||
elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 then
|
||||
Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
|
||||
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -40, -40)
|
||||
return true
|
||||
elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 and math.random(1, 100) <= 40 then
|
||||
Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
|
||||
Game.removeItemOnMap({x = 32356, y = 32074, z = 10}, 1791)
|
||||
return true
|
||||
elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 then
|
||||
Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
|
||||
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -50, -50)
|
||||
return true
|
||||
elseif target:getActionId() == 17643 then
|
||||
for i = 1, #pitsOfInfernoLava do
|
||||
Game.createItem(5815, 1, pitsOfInfernoLava[i])
|
||||
end
|
||||
target:transform(3141)
|
||||
toPosition:sendMagicEffect(CONST_ME_POFF)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,22 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if player:getStorageValue(250) == 5 then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already finished The Postman Missions.")
|
||||
return true
|
||||
end
|
||||
|
||||
player:setStorageValue(227, 6)
|
||||
player:setStorageValue(228, 3)
|
||||
player:setStorageValue(229, 4)
|
||||
player:setStorageValue(230, 21)
|
||||
player:setStorageValue(231, 3)
|
||||
player:setStorageValue(233, 11)
|
||||
player:setStorageValue(234, 8)
|
||||
player:setStorageValue(242, 2)
|
||||
player:setStorageValue(244, 3)
|
||||
player:setStorageValue(245, 3)
|
||||
player:setStorageValue(250, 5)
|
||||
|
||||
item:getPosition():sendMagicEffect(CONST_ME_SOUND_GREEN)
|
||||
item:remove()
|
||||
return true
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
item:remove()
|
||||
return true
|
||||
end
|
@@ -0,0 +1,13 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 2917 then
|
||||
item:transform(2978, 1)
|
||||
item:decay()
|
||||
target:remove()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
12
app/SabrehavenServer/data/actions/scripts/misc/rake.lua
Normal file
12
app/SabrehavenServer/data/actions/scripts/misc/rake.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
-- The Shattered Isles Parrot ring
|
||||
if target:getId() == 6094 then
|
||||
if player:getStorageValue(17502) == 1 and player:getStorageValue(17503) ~= 1 then
|
||||
toPosition:sendMagicEffect(CONST_ME_POFF)
|
||||
Game.createItem(6093, 1, Position(32422, 32770, 1))
|
||||
player:say("You have found a ring.", TALKTYPE_MONSTER_SAY)
|
||||
player:setStorageValue(17503, 1)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,21 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if player:getStorageValue(17572) ~= 1 and player:getLevel() <= 7 then
|
||||
player:setStorageValue(17572, 1)
|
||||
player:addHealth(-math.random(player:getHealth()-20, player:getHealth()-1))
|
||||
item:getPosition():sendMagicEffect(CONST_ME_HITBYFIRE)
|
||||
player:say('OUCH!', TALKTYPE_MONSTER_SAY)
|
||||
player:addExperience(4200 - player:getExperience())
|
||||
|
||||
player:addItem(3355,1)
|
||||
player:addItem(3361,1)
|
||||
player:addItem(3559,1)
|
||||
player:addItem(3552,1)
|
||||
player:addItem(3412,1)
|
||||
player:addItem(3273,1)
|
||||
player:addItem(3031,25)
|
||||
player:addItem(3582,3)
|
||||
player:addItem(3003,1)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
76
app/SabrehavenServer/data/actions/scripts/misc/rope.lua
Normal file
76
app/SabrehavenServer/data/actions/scripts/misc/rope.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
local ropeSpots = {
|
||||
386, 421
|
||||
}
|
||||
|
||||
local holeSpots = {
|
||||
293, 294, 369, 370, 385, 394, 411, 412,
|
||||
421, 432, 433, 435, 482, 5081, 483, 594,
|
||||
595, 607, 609, 610, 615, 1066, 1067, 1080
|
||||
}
|
||||
|
||||
local pools = {2886, 2887, 2888, 2889, 2890, 2891, 2895, 2896, 2897, 2898, 2899, 2900}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if (configManager.getBoolean(configKeys.ROPE_SPOT_BLOCK)) then
|
||||
-- Rope for 7.4 protocol.
|
||||
local newPos = {x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 0}
|
||||
local groundItem = getThingfromPos(newPos)
|
||||
local blockingItem = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 255})
|
||||
if table.contains(ropeSpots, groundItem.itemid) then
|
||||
newPos.y = newPos.y + 1
|
||||
newPos.z = newPos.z - 1
|
||||
if((blockingItem.itemid > 0 and not isInArray(pools, blockingItem.itemid)) or isCreature(blockingItem.uid)) then
|
||||
doPlayerSendCancel(player, "You cannot use this object.")
|
||||
else
|
||||
doTeleportThing(player, newPos)
|
||||
end
|
||||
elseif table.contains(holeSpots, groundItem.itemid) then
|
||||
newPos.y = newPos.y + 1
|
||||
local downPos = {x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = 255}
|
||||
local downItem = getThingfromPos(downPos)
|
||||
if(downItem.itemid > 0) then
|
||||
doTeleportThing(downItem.uid, newPos)
|
||||
else
|
||||
doPlayerSendCancel(player, "You cannot use this object.")
|
||||
end
|
||||
end
|
||||
return true
|
||||
else
|
||||
local tile = Tile(toPosition)
|
||||
if not tile then
|
||||
return false
|
||||
end
|
||||
|
||||
if not tile:getGround() then
|
||||
return false
|
||||
end
|
||||
|
||||
if table.contains(ropeSpots, tile:getGround():getId()) then
|
||||
player:teleportTo(target:getPosition():moveRel(0, 1, -1))
|
||||
return true
|
||||
elseif table.contains(holeSpots, tile:getGround():getId()) or target:getId() == 435 then
|
||||
local tile = Tile(target:getPosition():moveRel(0, 0, 1))
|
||||
if not tile then
|
||||
return false
|
||||
end
|
||||
|
||||
local thing = tile:getTopCreature()
|
||||
if not thing then
|
||||
thing = tile:getTopVisibleThing()
|
||||
end
|
||||
|
||||
if thing:isCreature() then
|
||||
thing:teleportTo(target:getPosition():moveRel(0, 1, 0), false)
|
||||
return true
|
||||
end
|
||||
if thing:isItem() and thing:getType():isMovable() then
|
||||
thing:moveTo(target:getPosition():moveRel(0, 1, 0))
|
||||
return true
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,10 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
if player:getStorageValue(17582) < os.time() then
|
||||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your experience earnings have been enchanted by the Tibianus Gods.")
|
||||
player:setStorageValue(17582, os.time() + 24 * 60 * 60) -- 24 hour
|
||||
item:remove(1)
|
||||
else
|
||||
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You shoud not take any more today.")
|
||||
end
|
||||
return true
|
||||
end
|
21
app/SabrehavenServer/data/actions/scripts/misc/scythe.lua
Normal file
21
app/SabrehavenServer/data/actions/scripts/misc/scythe.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 3652 then
|
||||
player:sendCancelMessage(target:getType():getDescription() .. ".")
|
||||
return true
|
||||
elseif target:getId() == 3653 then
|
||||
target:transform(3651, 1)
|
||||
target:decay()
|
||||
Game.createItem(3605, 1, target:getPosition())
|
||||
return true
|
||||
elseif target:getId() == 5463 then
|
||||
target:transform(5462, 1)
|
||||
target:decay()
|
||||
Game.createItem(5466, 1, target:getPosition())
|
||||
return true
|
||||
end
|
||||
return doDestroyItem(target)
|
||||
end
|
@@ -0,0 +1,10 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if target:getId() == 2199 and toPosition.x == 32754 and toPosition.y == 32559 and toPosition.z == 09 and player:getStorageValue(315) == 1 then
|
||||
item:transform(4843, 1)
|
||||
item:decay()
|
||||
player:setStorageValue(316, 1)
|
||||
target:getPosition():sendMagicEffect(4)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,15 @@
|
||||
local hundredPoints = 6554
|
||||
local fiftyPoints = 6555
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == hundredPoints then
|
||||
db.query("UPDATE znote_accounts SET points = points + 100 WHERE account_id = ".. player:getAccountId() .."")
|
||||
elseif item:getId() == fiftyPoints then
|
||||
db.query("UPDATE znote_accounts SET points = points + 50 WHERE account_id = ".. player:getAccountId() .."")
|
||||
end
|
||||
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
item:remove()
|
||||
player:save()
|
||||
return true
|
||||
end
|
57
app/SabrehavenServer/data/actions/scripts/misc/shovel.lua
Normal file
57
app/SabrehavenServer/data/actions/scripts/misc/shovel.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
local tile = Tile(toPosition)
|
||||
if not tile then
|
||||
return false
|
||||
end
|
||||
|
||||
local ground = tile:getGround()
|
||||
if not ground then
|
||||
return false
|
||||
end
|
||||
|
||||
local toTarget = target;
|
||||
|
||||
local itemType = ItemType(target:getId())
|
||||
if itemType:isSplash() then
|
||||
toTarget = ground
|
||||
end
|
||||
|
||||
if toTarget:getId() == 231 then
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
return true
|
||||
elseif toTarget:getId() == 593 then
|
||||
toTarget:transform(594, 1)
|
||||
toTarget:decay()
|
||||
doRelocate(toTarget:getPosition(), toTarget:getPosition():moveRel(0,0,1))
|
||||
return true
|
||||
elseif toTarget:getId() == 606 then
|
||||
toTarget:transform(607, 1)
|
||||
toTarget:decay()
|
||||
doRelocate(toTarget:getPosition(), toTarget:getPosition():moveRel(0,0,1))
|
||||
return true
|
||||
elseif toTarget:getId() == 608 then
|
||||
toTarget:transform(609, 1)
|
||||
toTarget:decay()
|
||||
doRelocate(toTarget:getPosition(), toTarget:getPosition():moveRel(0,0,1))
|
||||
elseif toTarget:getId() == 614 and math.random(1, 100) <= 50 then
|
||||
toTarget:transform(615, 1)
|
||||
toTarget:decay()
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
doRelocate(toTarget:getPosition(), toTarget:getPosition():moveRel(0,0,1))
|
||||
elseif toTarget:getId() == 614 then
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
elseif toTarget:getId() == 616 and math.random(1, 100) <= 95 then
|
||||
toTarget:transform(617, 1)
|
||||
toTarget:decay()
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
Game.createMonster("scarab", toTarget:getPosition())
|
||||
elseif toTarget:getId() == 616 then
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
Game.createItem(3042, 1, toTarget:getPosition())
|
||||
toTarget:transform(617, 1)
|
||||
toTarget:decay()
|
||||
elseif toTarget:getId() == 617 then
|
||||
toTarget:getPosition():sendMagicEffect(3)
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,30 @@
|
||||
local statues = {
|
||||
[17725] = SKILL_SWORD,
|
||||
[17724] = SKILL_AXE,
|
||||
[17726] = SKILL_CLUB,
|
||||
[17727] = SKILL_DISTANCE,
|
||||
[17728] = SKILL_MAGLEVEL
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
-- local skill = statues[item:getActionId()]
|
||||
-- if not player:isPremium() then
|
||||
-- player:sendCancelMessage(RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
|
||||
-- return true
|
||||
-- end
|
||||
|
||||
-- if player:isPzLocked() then
|
||||
-- return false
|
||||
-- end
|
||||
|
||||
-- local entreePrice = 1000
|
||||
-- if player:getBankBalance() < entreePrice then
|
||||
-- player:sendCancelMessage("You do not have 1000 gold coins in your bank account balance to participate in offline training.")
|
||||
-- return true
|
||||
-- end
|
||||
|
||||
-- player:setOfflineTrainingSkill(skill)
|
||||
-- player:setBankBalance(player:getBankBalance() - entreePrice)
|
||||
-- player:remove()
|
||||
return true
|
||||
end
|
@@ -0,0 +1,80 @@
|
||||
local config = {
|
||||
[5908] = {
|
||||
-- Minotaurs
|
||||
[4011] = {value = 25000, newItem = 5878},
|
||||
[4047] = {value = 25000, newItem = 5878},
|
||||
[4057] = {value = 25000, newItem = 5878},
|
||||
[4052] = {value = 25000, newItem = 5878},
|
||||
|
||||
-- Low Class Lizards
|
||||
[4321] = {value = 25000, newItem = 5876},
|
||||
[4327] = {value = 25000, newItem = 5876},
|
||||
[4324] = {value = 25000, newItem = 5876},
|
||||
|
||||
-- Dragons
|
||||
[4025] = {value = 25000, newItem = 5877},
|
||||
|
||||
-- Dragon Lords
|
||||
[4062] = {value = 25000, newItem = 5948},
|
||||
|
||||
-- Behemoths
|
||||
[4112] = {value = 35000, newItem = 5893},
|
||||
|
||||
-- Bone Beasts
|
||||
[4212] = {value = 25000, newItem = 5925},
|
||||
},
|
||||
[5942] = {
|
||||
-- Demon
|
||||
[4097] = {value = 25000, newItem = 5906},
|
||||
|
||||
-- Vampires
|
||||
[4137] = {value = 25000, newItem = 5905}
|
||||
}
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local skin = config[item.itemid][target.itemid]
|
||||
if not skin then
|
||||
return false
|
||||
end
|
||||
|
||||
local random, effect, transform = math.random(1, 100000), CONST_ME_MAGIC_GREEN, true
|
||||
if type(skin[1]) == 'table' then
|
||||
local _skin
|
||||
for i = 1, #skin do
|
||||
_skin = skin[i]
|
||||
if random <= _skin.value then
|
||||
if isInArray({7441, 7442, 7444, 7445}, target.itemid) then
|
||||
player:addItem(_skin.newItem, _skin.amount or 1)
|
||||
effect = CONST_ME_HITAREA
|
||||
else
|
||||
player:addItem(_skin.newItem, _skin.amount or 1)
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
elseif random <= skin.value then
|
||||
if isInArray({7441, 7442, 7444, 7445}, target.itemid) then
|
||||
player:addItem(skin.newItem, skin.amount or 1)
|
||||
effect = CONST_ME_HITAREA
|
||||
else
|
||||
player:addItem(skin.newItem, skin.amount or 1)
|
||||
end
|
||||
else
|
||||
if isInArray({7441, 7442, 7444, 7445}, target.itemid) then
|
||||
player:say('The attempt of sculpting failed miserably.', TALKTYPE_MONSTER_SAY)
|
||||
effect = CONST_ME_HITAREA
|
||||
else
|
||||
effect = CONST_ME_POFF
|
||||
end
|
||||
end
|
||||
|
||||
toPosition:sendMagicEffect(effect)
|
||||
if transform then
|
||||
target:transform(skin.after or target.itemid + 1)
|
||||
target:decay()
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
@@ -0,0 +1,14 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 2917 then
|
||||
player:addItem(5813, 1)
|
||||
item:remove(1)
|
||||
target:remove(1)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
@@ -0,0 +1,15 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 4850 and player:getStorageValue(293) == 17 then
|
||||
target:transform(4851, 1)
|
||||
target:decay()
|
||||
player:setStorageValue(299, 1)
|
||||
item:remove()
|
||||
target:getPosition():sendMagicEffect(7)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
Game.createItem(2992, 1, fromPosition)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,37 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if player:hasFlag(PlayerFlag_SpecialMoveUse) then
|
||||
if item:getId() == 372 then
|
||||
item:transform(394, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 386 or item:getId() == 421 then
|
||||
local relPos = item:getPosition():moveRel(0, 1, -1)
|
||||
player:teleportTo(relPos)
|
||||
elseif item:getId() == 593 then
|
||||
item:transform(594, 1)
|
||||
item:decay()
|
||||
doRelocate(item:getPosition(),item:getPosition():moveRel(0, 0, 1))
|
||||
elseif item:getId() == 606 or item:getId() == 608 then
|
||||
item:transform(607, 1)
|
||||
item:decay()
|
||||
doRelocate(item:getPosition(), item:getPosition():moveRel(0, 0, 1))
|
||||
elseif item:getId() == 614 then
|
||||
item:transform(615, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
doRelocate(item:getPosition(), item:getPosition():moveRel(0, 0, 1))
|
||||
elseif item:getId() == 3653 then
|
||||
item:transform(3651, 1)
|
||||
item:decay()
|
||||
Game.createItem(3605, 1, item:getPosition())
|
||||
elseif item:getId() == 3696 then
|
||||
item:transform(3695, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 3702 then
|
||||
item:transform(3701, 1)
|
||||
item:decay()
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,12 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if target:getId() == 599 and toPosition.x == 32665 and toPosition.y == 32736 and toPosition.z == 06 and player:getStorageValue(320) == 5 then
|
||||
player:setStorageValue(321,1)
|
||||
target:getPosition():sendMagicEffect(13)
|
||||
return true
|
||||
elseif target:getId() == 599 and toPosition.x == 32497 and toPosition.y == 31622 and toPosition.z == 06 and player:getStorageValue(320) == 5 then
|
||||
player:setStorageValue(322,1)
|
||||
target:getPosition():sendMagicEffect(13)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
32
app/SabrehavenServer/data/actions/scripts/misc/spellbook.lua
Normal file
32
app/SabrehavenServer/data/actions/scripts/misc/spellbook.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
|
||||
local count = getPlayerInstantSpellCount(player)
|
||||
local text = ""
|
||||
local spells = {}
|
||||
for i = 0, count - 1 do
|
||||
local spell = getPlayerInstantSpellInfo(player, i)
|
||||
if spell.level ~= 0 then
|
||||
if spell.manapercent > 0 then
|
||||
spell.mana = spell.manapercent .. "%"
|
||||
end
|
||||
spells[#spells + 1] = spell
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(spells, function(a, b) return a.level < b.level end)
|
||||
|
||||
local prevLevel = -1
|
||||
for i, spell in ipairs(spells) do
|
||||
local line = ""
|
||||
if prevLevel ~= spell.level then
|
||||
if i ~= 1 then
|
||||
line = "\n"
|
||||
end
|
||||
line = line .. "Spells for Level " .. spell.level .. "\n"
|
||||
prevLevel = spell.level
|
||||
end
|
||||
text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
|
||||
end
|
||||
|
||||
player:showTextDialog(item:getId(), text)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,15 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2566 then
|
||||
item:transform(2567, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2567 then
|
||||
player:sendCancelMessage("It doesn't move.")
|
||||
elseif item:getId() == 2569 then
|
||||
item:transform(2570, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2570 then
|
||||
item:transform(2569, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,16 @@
|
||||
local downstairs = {
|
||||
435
|
||||
}
|
||||
|
||||
local upstairs = {
|
||||
1948, 1968, 5542
|
||||
}
|
||||
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if table.contains(downstairs, item:getId()) then
|
||||
player:teleportTo(item:getPosition():moveRel(0, 0, 1))
|
||||
elseif table.contains(upstairs, item:getId()) then
|
||||
player:teleportTo(item:getPosition():moveRel(0, 1, -1))
|
||||
end
|
||||
return true
|
||||
end
|
4
app/SabrehavenServer/data/actions/scripts/misc/time.lua
Normal file
4
app/SabrehavenServer/data/actions/scripts/misc/time.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "The time is " .. getFormattedWorldTime() .. ".")
|
||||
return true
|
||||
end
|
13
app/SabrehavenServer/data/actions/scripts/misc/used_lamp.lua
Normal file
13
app/SabrehavenServer/data/actions/scripts/misc/used_lamp.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if not target:isItem() then
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getId() == 2874 and target:getFluidType() == FLUID_OIL then
|
||||
target:transform(target:getId(), FLUID_NONE)
|
||||
item:transform(2914, 1)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if math.random(1, 100) <= 90 then
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
return true
|
||||
else
|
||||
player:getPosition():sendMagicEffect(3)
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,3 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
return doDestroyItem(target)
|
||||
end
|
26
app/SabrehavenServer/data/actions/scripts/nostalrius/1.lua
Normal file
26
app/SabrehavenServer/data/actions/scripts/nostalrius/1.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32627, y = 31699, z = 10}, 1771) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32627, y = 31699, z = 10},{x = 32626, y = 31699, z = 10})
|
||||
doRelocate({x = 32628, y = 31699, z = 10},{x = 32626, y = 31699, z = 10})
|
||||
doRelocate({x = 32629, y = 31699, z = 10},{x = 32626, y = 31699, z = 10})
|
||||
Game.transformItemOnMap({x = 32627, y = 31699, z = 10}, 1771, 622)
|
||||
Game.createItem(4788, 1, {x = 32627, y = 31699, z = 10})
|
||||
Game.transformItemOnMap({x = 32628, y = 31699, z = 10}, 1771, 622)
|
||||
Game.transformItemOnMap({x = 32629, y = 31699, z = 10}, 1771, 622)
|
||||
Game.createItem(4786, 1, {x = 32629, y = 31699, z = 10})
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32628, y = 31699, z = 10}, 622) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32627, y = 31699, z = 10}, 622, 1771)
|
||||
Game.transformItemOnMap({x = 32628, y = 31699, z = 10}, 622, 1771)
|
||||
Game.transformItemOnMap({x = 32629, y = 31699, z = 10}, 622, 1771)
|
||||
Game.removeItemOnMap({x = 32627, y = 31699, z = 10}, 4788)
|
||||
Game.removeItemOnMap({x = 32629, y = 31699, z = 10}, 4786)
|
||||
end
|
||||
return true
|
||||
end
|
19
app/SabrehavenServer/data/actions/scripts/nostalrius/10.lua
Normal file
19
app/SabrehavenServer/data/actions/scripts/nostalrius/10.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32792, y = 31581, z = 07},1282) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32792, y = 31581, z = 07}, 1282)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32792, y = 31581, z = 07}, 1282) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32792, y = 31581, z = 07},{x = 32792, y = 31582, z = 07})
|
||||
Game.createItem(1282, 1, {x = 32792, y = 31581, z = 07})
|
||||
end
|
||||
return true
|
||||
end
|
32
app/SabrehavenServer/data/actions/scripts/nostalrius/11.lua
Normal file
32
app/SabrehavenServer/data/actions/scripts/nostalrius/11.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 32685, y = 32084, z = 09}, 1771) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32687, y = 32084, z = 09},{x = 32683, y = 32084, z = 09})
|
||||
doRelocate({x = 32686, y = 32084, z = 09},{x = 32683, y = 32084, z = 09})
|
||||
doRelocate({x = 32685, y = 32084, z = 09},{x = 32683, y = 32084, z = 09})
|
||||
doRelocate({x = 32684, y = 32084, z = 09},{x = 32683, y = 32084, z = 09})
|
||||
Game.transformItemOnMap({x = 32687, y = 32084, z = 09}, 1771, 727)
|
||||
Game.createItem(4798, 1, {x = 32687, y = 32084, z = 09})
|
||||
Game.transformItemOnMap({x = 32686, y = 32084, z = 09}, 1771, 727)
|
||||
Game.transformItemOnMap({x = 32685, y = 32084, z = 09}, 1771, 727)
|
||||
Game.transformItemOnMap({x = 32684, y = 32084, z = 09}, 1771, 727)
|
||||
Game.createItem(4800, 1, {x = 32684, y = 32084, z = 09})
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2772 and Game.isItemThere({x = 32685, y = 32084, z = 09},727) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32684, y = 32084, z = 09}, 4800)
|
||||
Game.transformItemOnMap({x = 32684, y = 32084, z = 09}, 727, 1771)
|
||||
Game.transformItemOnMap({x = 32685, y = 32084, z = 09}, 727, 1771)
|
||||
Game.removeItemOnMap({x = 32687, y = 32084, z = 09}, 4798)
|
||||
Game.transformItemOnMap({x = 32687, y = 32084, z = 09}, 727, 1771)
|
||||
Game.transformItemOnMap({x = 32686, y = 32084, z = 09}, 727, 1771)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
26
app/SabrehavenServer/data/actions/scripts/nostalrius/12.lua
Normal file
26
app/SabrehavenServer/data/actions/scripts/nostalrius/12.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32673, y = 32085, z = 08},430) and Game.isItemThere ({x = 32669, y = 32089, z = 08},430) and Game.isItemThere ({x = 32673, y = 32093, z = 08},430) and Game.isItemThere ({x = 32677, y = 32089, z = 08},430) and Game.isItemThere ({x = 32673, y = 32083, z = 08},3349) and Game.isItemThere ({x = 32667, y = 32089, z = 08},3585) and Game.isItemThere ({x = 32673, y = 32094, z = 08},3264) and Game.isItemThere ({x = 32679, y = 32089, z = 08},3059) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32673, y = 32083, z = 08}, 3349)
|
||||
Game.removeItemOnMap({x = 32667, y = 32089, z = 08}, 3585)
|
||||
Game.removeItemOnMap({x = 32673, y = 32094, z = 08}, 3264)
|
||||
Game.removeItemOnMap({x = 32679, y = 32089, z = 08}, 3059)
|
||||
Game.sendMagicEffect({x = 32673, y = 32083, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32667, y = 32089, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32673, y = 32094, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32679, y = 32089, z = 08}, 11)
|
||||
doRelocate({x = 32673, y = 32093, z = 08},{x = 32671, y = 32069, z = 08})
|
||||
doRelocate({x = 32669, y = 32089, z = 08},{x = 32672, y = 32069, z = 08})
|
||||
doRelocate({x = 32673, y = 32085, z = 08},{x = 32671, y = 32070, z = 08})
|
||||
doRelocate({x = 32677, y = 32089, z = 08},{x = 32672, y = 32070, z = 08})
|
||||
Game.sendMagicEffect({x = 32671, y = 32069, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32672, y = 32069, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32671, y = 32070, z = 08}, 11)
|
||||
Game.sendMagicEffect({x = 32672, y = 32070, z = 08}, 11)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
17
app/SabrehavenServer/data/actions/scripts/nostalrius/13.lua
Normal file
17
app/SabrehavenServer/data/actions/scripts/nostalrius/13.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32568, y = 32078, z = 12},2185) and Game.isItemThere ({x = 32569, y = 32078, z = 12},2185) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32568, y = 32078, z = 12}, 2185)
|
||||
Game.removeItemOnMap({x = 32569, y = 32078, z = 12}, 2185)
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32568, y = 32078, z = 12},2185) and Game.isItemThere ({x = 32569, y = 32078, z = 12}, 2185) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.createItem(2185, 1, {x = 32568, y = 32078, z = 12})
|
||||
Game.createItem(2185, 1, {x = 32569, y = 32078, z = 12})
|
||||
end
|
||||
return true
|
||||
end
|
16
app/SabrehavenServer/data/actions/scripts/nostalrius/14.lua
Normal file
16
app/SabrehavenServer/data/actions/scripts/nostalrius/14.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 33314, y = 31592, z = 15}, 1842)
|
||||
doRelocate({x = 33316, y = 31591, z = 15},{x = 33317, y = 31591, z = 15})
|
||||
Game.createItem(1949, 1, {x = 33316, y = 31591, z = 15})
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 33314, y = 31592, z = 15},{x = 33315, y = 31592, z = 15})
|
||||
Game.createItem(1842, 1, {x = 33314, y = 31592, z = 15})
|
||||
Game.removeItemOnMap({x = 33316, y = 31591, z = 15}, 1949)
|
||||
end
|
||||
return true
|
||||
end
|
31
app/SabrehavenServer/data/actions/scripts/nostalrius/15.lua
Normal file
31
app/SabrehavenServer/data/actions/scripts/nostalrius/15.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 33295, y = 31677, z = 15},1791) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 33295, y = 31677, z = 15}, 1791)
|
||||
Game.removeItemOnMap({x = 33296, y = 31677, z = 15}, 1791)
|
||||
Game.removeItemOnMap({x = 33297, y = 31677, z = 15}, 1791)
|
||||
Game.removeItemOnMap({x = 33298, y = 31677, z = 15}, 1791)
|
||||
Game.removeItemOnMap({x = 33299, y = 31677, z = 15}, 1791)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 33295, y = 31677, z = 15}, 1791) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 33295, y = 31677, z = 15},{x = 33295, y = 31678, z = 15})
|
||||
doRelocate({x = 33296, y = 31677, z = 15},{x = 33296, y = 31678, z = 15})
|
||||
doRelocate({x = 33297, y = 31677, z = 15},{x = 33297, y = 31678, z = 15})
|
||||
doRelocate({x = 33298, y = 31677, z = 15},{x = 33298, y = 31678, z = 15})
|
||||
doRelocate({x = 33299, y = 31677, z = 15},{x = 33299, y = 31678, z = 15})
|
||||
Game.createItem(1791, 1, {x = 33295, y = 31677, z = 15})
|
||||
Game.createItem(1791, 1, {x = 33296, y = 31677, z = 15})
|
||||
Game.createItem(1791, 1, {x = 33297, y = 31677, z = 15})
|
||||
Game.createItem(1791, 1, {x = 33298, y = 31677, z = 15})
|
||||
Game.createItem(1791, 1, {x = 33299, y = 31677, z = 15})
|
||||
end
|
||||
return true
|
||||
end
|
13
app/SabrehavenServer/data/actions/scripts/nostalrius/16.lua
Normal file
13
app/SabrehavenServer/data/actions/scripts/nostalrius/16.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 33171, y = 31897, z = 08}, 1772)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 33171, y = 31897, z = 08},{x = 33171, y = 31898, z = 08})
|
||||
Game.createItem(1772, 1, {x = 33171, y = 31897, z = 08})
|
||||
end
|
||||
return true
|
||||
end
|
31
app/SabrehavenServer/data/actions/scripts/nostalrius/17.lua
Normal file
31
app/SabrehavenServer/data/actions/scripts/nostalrius/17.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 33222, y = 31671, z = 13},430) and Game.isItemThere ({x = 33223, y = 31671, z = 13},430) and Game.isItemThere ({x = 33224, y = 31671, z = 13},430) and Game.isItemThere ({x = 33225, y = 31671, z = 13},430) and Game.isItemThere ({x = 33220, y = 31659, z = 13},1772) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 33220, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33221, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33222, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33223, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33224, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33219, y = 31659, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33219, y = 31657, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33221, y = 31657, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33220, y = 31661, z = 13}, 1772)
|
||||
Game.removeItemOnMap({x = 33222, y = 31661, z = 13}, 1772)
|
||||
Game.createMonster("Demon", {x = 33224, y = 31659, z = 13})
|
||||
Game.createMonster("Demon", {x = 33223, y = 31659, z = 13})
|
||||
Game.createMonster("Demon", {x = 33219, y = 31657, z = 13})
|
||||
Game.createMonster("Demon", {x = 33221, y = 31657, z = 13})
|
||||
Game.createMonster("Demon", {x = 33220, y = 31661, z = 13})
|
||||
Game.createMonster("Demon", {x = 33222, y = 31661, z = 13})
|
||||
doRelocate({x = 33222, y = 31671, z = 13},{x = 33219, y = 31659, z = 13})
|
||||
doRelocate({x = 33223, y = 31671, z = 13},{x = 33220, y = 31659, z = 13})
|
||||
doRelocate({x = 33224, y = 31671, z = 13},{x = 33221, y = 31659, z = 13})
|
||||
doRelocate({x = 33225, y = 31671, z = 13},{x = 33222, y = 31659, z = 13})
|
||||
Game.sendMagicEffect({x = 33219, y = 31659, z = 13}, 11)
|
||||
Game.sendMagicEffect({x = 33220, y = 31659, z = 13}, 11)
|
||||
Game.sendMagicEffect({x = 33221, y = 31659, z = 13}, 11)
|
||||
Game.sendMagicEffect({x = 33222, y = 31659, z = 13}, 11)
|
||||
end
|
||||
return true
|
||||
end
|
14
app/SabrehavenServer/data/actions/scripts/nostalrius/18.lua
Normal file
14
app/SabrehavenServer/data/actions/scripts/nostalrius/18.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32483, y = 31633, z = 09}, 385) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32483, y = 31633, z = 09}, 355, 385)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
20
app/SabrehavenServer/data/actions/scripts/nostalrius/19.lua
Normal file
20
app/SabrehavenServer/data/actions/scripts/nostalrius/19.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
item:remove()
|
||||
Game.createItem(2126, 1, {x = 32487, y = 31628, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32487, y = 31629, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32488, y = 31629, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32487, y = 31627, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32486, y = 31627, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32486, y = 31628, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32486, y = 31629, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32486, y = 31630, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32487, y = 31630, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32488, y = 31630, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32486, y = 31626, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32487, y = 31626, z = 13})
|
||||
Game.createItem(2126, 1, {x = 32488, y = 31626, z = 13})
|
||||
Game.sendMagicEffect({x = 32488, y = 31628, z = 13}, 3)
|
||||
end
|
||||
return true
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if Game.isItemThere({x = 33211, y = 32698, z = 13}, 1306) then
|
||||
Game.removeItemOnMap({x = 33211, y = 32698, z = 13}, 1306)
|
||||
else
|
||||
doRelocate({x = 33211, y = 32698, z = 13}, {x = 33211, y = 32697, z = 13})
|
||||
Game.createItem(1306, 1, {x = 33211, y = 32698, z = 13})
|
||||
end
|
||||
return true
|
||||
end
|
19
app/SabrehavenServer/data/actions/scripts/nostalrius/20.lua
Normal file
19
app/SabrehavenServer/data/actions/scripts/nostalrius/20.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32259, y = 31891, z = 10},2129) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32259, y = 31891, z = 10}, 2129)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32259, y = 31891, z = 10}, 2129) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32259, y = 31891, z = 10},{x = 32259, y = 31892, z = 10})
|
||||
Game.createItem(2129, 1, {x = 32259, y = 31891, z = 10})
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/21.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/21.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32313, y = 31975, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32313, y = 31975, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32313, y = 31975, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32313, y = 31975, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/22.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/22.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32313, y = 31976, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32313, y = 31976, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32313, y = 31976, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32313, y = 31976, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/23.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/23.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32311, y = 31976, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32311, y = 31976, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32311, y = 31976, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32311, y = 31976, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/24.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/24.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32311, y = 31975, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32311, y = 31975, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32311, y = 31975, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32311, y = 31975, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/25.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/25.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32309, y = 31976, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32309, y = 31976, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32309, y = 31976, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32309, y = 31976, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/26.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/26.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32309, y = 31975, z = 13}, 1998) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32309, y = 31975, z = 13}, 1998, 1996)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32309, y = 31975, z = 13}, 1996) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32309, y = 31975, z = 13}, 1996, 1998)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
20
app/SabrehavenServer/data/actions/scripts/nostalrius/27.lua
Normal file
20
app/SabrehavenServer/data/actions/scripts/nostalrius/27.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32266, y = 31860, z = 11},2129) then
|
||||
Game.removeItemOnMap({x = 32266, y = 31860, z = 11}, 2129)
|
||||
Game.transformItemOnMap({x = 32266, y = 31860, z = 11}, 410, 411)
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32266, y = 31860, z = 11}, 2129) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.transformItemOnMap({x = 32266, y = 31860, z = 11}, 411, 410)
|
||||
Game.createItem(2129, 1, {x = 32266, y = 31860, z = 11})
|
||||
end
|
||||
return true
|
||||
end
|
19
app/SabrehavenServer/data/actions/scripts/nostalrius/28.lua
Normal file
19
app/SabrehavenServer/data/actions/scripts/nostalrius/28.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 32259, y = 31890, z = 10},2129) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32259, y = 31890, z = 10}, 2129)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 32259, y = 31890, z = 10}, 2129) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32259, y = 31890, z = 10},{x = 32259, y = 31889, z = 10})
|
||||
Game.createItem(2129, 1, {x = 32259, y = 31890, z = 10})
|
||||
end
|
||||
return true
|
||||
end
|
17
app/SabrehavenServer/data/actions/scripts/nostalrius/29.lua
Normal file
17
app/SabrehavenServer/data/actions/scripts/nostalrius/29.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 32220, y = 31845, z = 15}, 2772) and player:getStorageValue(7) ~= 1 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
Game.sendMagicEffect({x = 32217, y = 31842, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32217, y = 31844, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32217, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31844, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31843, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31845, z = 14}, 12)
|
||||
elseif item:getId() == 2773 then
|
||||
item:getPosition():sendMagicEffect(12)
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -170, -170)
|
||||
end
|
||||
return true
|
||||
end
|
22
app/SabrehavenServer/data/actions/scripts/nostalrius/3.lua
Normal file
22
app/SabrehavenServer/data/actions/scripts/nostalrius/3.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 and Game.isItemThere({x = 33148, y = 32867, z = 09}, 2129) and Game.isItemThere ({x = 33149, y = 32867, z = 09}, 2129) then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 33148, y = 32867, z = 09}, 2129)
|
||||
Game.removeItemOnMap({x = 33149, y = 32867, z = 09}, 2129)
|
||||
elseif item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 and Game.isItemThere({x = 33148, y = 32867, z = 09}, 2129) then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 33148, y = 32867, z = 09}, {x = 33148, y = 32869, z = 09})
|
||||
doRelocate({x = 33149, y = 32867, z = 09}, {x = 33149, y = 32869, z = 09})
|
||||
Game.createItem(2129, 1, {x = 33148, y = 32867, z = 09})
|
||||
Game.createItem(2129, 1, {x = 33149, y = 32867, z = 09})
|
||||
end
|
||||
return true
|
||||
end
|
16
app/SabrehavenServer/data/actions/scripts/nostalrius/30.lua
Normal file
16
app/SabrehavenServer/data/actions/scripts/nostalrius/30.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 32220, y = 31843, z = 15}, 2772) and player:getStorageValue(7) ~= 1 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
Game.sendMagicEffect({x = 32217, y = 31844, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31844, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31843, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32220, y = 31843, z = 14}, 12)
|
||||
elseif item:getId() == 2773 then
|
||||
item:getPosition():sendMagicEffect(12)
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -170, -170)
|
||||
end
|
||||
return true
|
||||
end
|
21
app/SabrehavenServer/data/actions/scripts/nostalrius/31.lua
Normal file
21
app/SabrehavenServer/data/actions/scripts/nostalrius/31.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 32220, y = 31842, z = 15}, 2772) and player:getStorageValue(7) ~= 1 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
Game.sendMagicEffect({x = 32217, y = 31843, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32217, y = 31844, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32217, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31843, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31842, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31846, z = 14}, 12)
|
||||
Game.transformItemOnMap({x = 32214, y = 31850, z = 15}, 2114, 2113)
|
||||
Game.transformItemOnMap({x = 32215, y = 31850, z = 15}, 2114, 2113)
|
||||
Game.transformItemOnMap({x = 32216, y = 31850, z = 15}, 2114, 2113)
|
||||
elseif item:getId() == 2773 then
|
||||
item:getPosition():sendMagicEffect(12)
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -170, -170)
|
||||
end
|
||||
return true
|
||||
end
|
16
app/SabrehavenServer/data/actions/scripts/nostalrius/32.lua
Normal file
16
app/SabrehavenServer/data/actions/scripts/nostalrius/32.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and Game.isItemThere({x = 32220, y = 31844, z = 15}, 2772) and player:getStorageValue(7) ~= 1 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
Game.sendMagicEffect({x = 32217, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31846, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32220, y = 31846, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31844, z = 14}, 12)
|
||||
elseif item:getId() == 2773 then
|
||||
item:getPosition():sendMagicEffect(12)
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -170, -170)
|
||||
end
|
||||
return true
|
||||
end
|
18
app/SabrehavenServer/data/actions/scripts/nostalrius/33.lua
Normal file
18
app/SabrehavenServer/data/actions/scripts/nostalrius/33.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2773 and player:getStorageValue(7) ~= 1 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(13)
|
||||
Game.sendMagicEffect({x = 32217, y = 31843, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31842, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31841, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32217, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32218, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32219, y = 31845, z = 14}, 12)
|
||||
Game.sendMagicEffect({x = 32220, y = 31845, z = 14}, 12)
|
||||
elseif item:getId() == 2773 then
|
||||
item:getPosition():sendMagicEffect(12)
|
||||
doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -170, -170)
|
||||
end
|
||||
return true
|
||||
end
|
28
app/SabrehavenServer/data/actions/scripts/nostalrius/34.lua
Normal file
28
app/SabrehavenServer/data/actions/scripts/nostalrius/34.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
doRelocate({x = 32636, y = 31881, z = 07},{x = 32636, y = 31881, z = 02})
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 07}, 3)
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 02}, 3)
|
||||
elseif item:getId() == 2772 then
|
||||
doRelocate({x = 32636, y = 31881, z = 07},{x = 32636, y = 31881, z = 02})
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 02}, 3)
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 07}, 3)
|
||||
elseif item:getId() == 2773 then
|
||||
doRelocate({x = 32636, y = 31881, z = 02},{x = 32636, y = 31881, z = 07})
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 07}, 3)
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 02}, 3)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32636, y = 31881, z = 02},{x = 32636, y = 31881, z = 07})
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 02}, 3)
|
||||
Game.sendMagicEffect({x = 32636, y = 31881, z = 07}, 3)
|
||||
end
|
||||
return true
|
||||
end
|
22
app/SabrehavenServer/data/actions/scripts/nostalrius/35.lua
Normal file
22
app/SabrehavenServer/data/actions/scripts/nostalrius/35.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
Game.removeItemOnMap({x = 32604, y = 31905, z = 03}, 1789)
|
||||
Game.removeItemOnMap({x = 32605, y = 31905, z = 03}, 1790)
|
||||
Game.removeItemOnMap({x = 32604, y = 31904, z = 03}, 1787)
|
||||
Game.removeItemOnMap({x = 32605, y = 31904, z = 03}, 1788)
|
||||
elseif item:getId() == 2773 then
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32604, y = 31904, z = 03},{x = 32604, y = 31906, z = 03})
|
||||
doRelocate({x = 32604, y = 31905, z = 03},{x = 32604, y = 31906, z = 03})
|
||||
doRelocate({x = 32605, y = 31904, z = 03},{x = 32605, y = 31906, z = 03})
|
||||
doRelocate({x = 32605, y = 31905, z = 03},{x = 32605, y = 31906, z = 03})
|
||||
Game.createItem(1787, 1, {x = 32604, y = 31904, z = 03})
|
||||
Game.createItem(1789, 1, {x = 32604, y = 31905, z = 03})
|
||||
Game.createItem(1788, 1, {x = 32605, y = 31904, z = 03})
|
||||
Game.createItem(1790, 1, {x = 32605, y = 31905, z = 03})
|
||||
end
|
||||
return true
|
||||
end
|
13
app/SabrehavenServer/data/actions/scripts/nostalrius/36.lua
Normal file
13
app/SabrehavenServer/data/actions/scripts/nostalrius/36.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
function onUse(player, item, fromPosition, target, toPosition)
|
||||
if item:getId() == 2772 then
|
||||
Game.transformItemOnMap({x = 32605, y = 31902, z = 04}, 436, 432)
|
||||
item:transform(2773, 1)
|
||||
item:decay()
|
||||
doRelocate({x = 32605, y = 31902, z = 04},{x = 32605, y = 31902, z = 05})
|
||||
elseif item:getId() == 2773 then
|
||||
Game.transformItemOnMap({x = 32605, y = 31902, z = 04}, 432, 436)
|
||||
item:transform(2772, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user