Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonyrewind committed Feb 21, 2025
1 parent 7ceabb7 commit a6e9f2e
Show file tree
Hide file tree
Showing 21 changed files with 3,201 additions and 333 deletions.
4 changes: 2 additions & 2 deletions data-otservbr-global/npc/altar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ local function creatureSayCallback(npc, creature, type, message)

message = message:lower()
if MsgContains(message, "kneel") then
npcHandler:say("Prepare your offer and cling to the sanctitity of this place.", npc, creature)
npcHandler:say("Prepare your {offer} and cling to the sanctitity of this place.", npc, creature)
npcHandler:setTopic(playerId, 1)
elseif MsgContains(message, "offer") and npcHandler:getTopic(playerId) == 1 then
npcHandler:say("Five tainted hearts and five darklight hearts drowned in a worldly wealth of 50000000 gold pieces for the righteous. Are you prepared?", npc, creature)
Expand Down Expand Up @@ -80,7 +80,7 @@ local function creatureSayCallback(npc, creature, type, message)
return true
end

npcHandler:setMessage(MESSAGE_GREET, "Kneel before the all-devouring power of blooded decay.")
npcHandler:setMessage(MESSAGE_GREET, "{Kneel} before the all-devouring power of blooded decay.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Bye.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Bye, |PLAYERNAME|.")

Expand Down
5 changes: 5 additions & 0 deletions data-otservbr-global/npc/yasir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ npcConfig.shop = {
{ itemName = "bakragore's amalgamation", clientId = 43968, sell = 2000000 },
{ itemName = "bamboo stick", clientId = 11445, sell = 30 },
{ itemName = "banana sash", clientId = 11511, sell = 55 },
{ itemName = "basalt crumbs", clientId = 43858, sell = 3000 },
{ itemName = "basalt core", clientId = 43859, sell = 5800 },
{ itemName = "basalt fetish", clientId = 17856, sell = 210 },
{ itemName = "basalt figurine", clientId = 17857, sell = 160 },
{ itemName = "bat decoration", clientId = 6491, sell = 2000 },
Expand All @@ -78,6 +80,7 @@ npcConfig.shop = {
{ itemName = "blazing bone", clientId = 16131, sell = 610 },
{ itemName = "bloated maggot", clientId = 43856, sell = 5200 },
{ itemName = "blood preservation", clientId = 11449, sell = 320 },
{ itemName = "blooded worm", clientId = 43857, sell = 4700 },
{ itemName = "blood tincture in a vial", clientId = 18928, sell = 360 },
{ itemName = "bloody dwarven beard", clientId = 17827, sell = 110 },
{ itemName = "bloody pincers", clientId = 9633, sell = 100 },
Expand Down Expand Up @@ -176,11 +179,13 @@ npcConfig.shop = {
{ itemName = "dangerous proto matter", clientId = 23515, sell = 300 },
{ itemName = "dark bell", clientId = 32596, sell = 310000 },
{ itemName = "darklight matter", clientId = 43851, sell = 5500 },
{ itemName = "darklight basalt chunk", clientId = 43852, sell = 3800 },
{ itemName = "dark obsidian splinter", clientId = 43850, sell = 4400 },
{ itemName = "dark rosary", clientId = 10303, sell = 48 },
{ itemName = "darklight core", clientId = 43853, sell = 4100 },
{ itemName = "darklight figurine", clientId = 43961, sell = 3400000 },
{ itemName = "darklight matter", clientId = 43851, sell = 5500 },
{ itemName = "decayed finger bone", clientId = 43846, sell = 5100 },
{ itemName = "dead weight", clientId = 20202, sell = 450 },
{ itemName = "deepling breaktime snack", clientId = 14011, sell = 90 },
{ itemName = "deepling claw", clientId = 14044, sell = 430 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
local items = { 34082, 34083, 34084, 34085, 34086, 34087, 34088, 34089, 34090, 34091, 34092, 34093, 34094, 34095, 34096, 34097, 34098, 34099, 39147, 39148, 39149, 39150, 39151, 39152, 39153, 39154, 39177, 39180, 39183, 39186, 43864, 43866, 43868, 43870, 43872, 43874, 43876, 43877, 43879, 43881, 43882, 43884, 43885, 43887 }
local classification = {
[1] = {amount = 15, specialChance = 0.15},
[2] = {amount = 30, specialChance = 0.30},
[3] = {amount = 45, specialChance = 0.45},
[4] = {amount = 60, specialChance = 0.60},
}

local specialItem = 37110 -- The special item that has a small chance to drop
local specialChance = 0.10 -- 5% chance (adjust as needed)

local crystalPickaxe = Action()

function crystalPickaxe.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local totalDusts = player:getForgeDusts()
local limitDusts = player:getForgeDustLevel()
local amount = 30
local totalDusts = player:getForgeDusts()
local limitDusts = player:getForgeDustLevel()
local class = target:getClassification()

if classification[class] then
local amount = classification[class].amount
local specialChance = classification[class].specialChance

if totalDusts + amount > limitDusts then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You did not receive any dust for the Exaltation Forge because it would exceed the maximum limit of " .. limitDusts .. " dust.")
return true
end

if totalDusts < limitDusts then
local dustToAdd = math.min(amount, limitDusts - totalDusts)
player:addForgeDusts(dustToAdd)
target:remove(1) -- Only remove the item if the player receives dust

if table.contains(items, target.itemid) then
if totalDusts < limitDusts then
local dustToAdd = math.min(amount, limitDusts - totalDusts)
player:addForgeDusts(dustToAdd)
target:remove(1) -- Only remove the item if the player receives dust
local actualTotalDusts = player:getForgeDusts()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. dustToAdd .. " dust for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. limitDusts .. " dusts.")

local actualTotalDusts = player:getForgeDusts()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. dustToAdd .. " dust for the Exaltation Forge. You now have " .. actualTotalDusts .. " out of a maximum of " .. limitDusts .. " dusts.")

-- Roll for special item drop
if math.random() < specialChance then
player:addItem(specialItem, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have also found a exalted core!")
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You did not receive any dust for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.")
end
return true
end
-- Roll for special item drop
if math.random() < specialChance then
player:addItem(specialItem, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have also found an exalted core!")
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You did not receive any dust for the Exaltation Forge because you have already reached the maximum of " .. limitDusts .. " dust.")
end
return true
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This item has no classification.")
return false
end

crystalPickaxe:id(32711)
Expand Down
4 changes: 2 additions & 2 deletions data-otservbr-global/scripts/actions/tools/skinning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function skinning.onUse(player, item, fromPosition, target, toPosition, isHotkey
end

if item.itemid == 5908 then
if target:getId() == CONST_FIREWORK_ITEMID_DISASSEMBLE then
if target.itemid == CONST_FIREWORK_ITEMID_DISASSEMBLE then
stopEvent(target:getCustomAttribute("event"))
player:addItem(target:getCustomAttribute("id"), 1)
target:remove()
Expand Down Expand Up @@ -176,7 +176,7 @@ function skinning.onUse(player, item, fromPosition, target, toPosition, isHotkey
end
end

if target:getId() == 12816 then
if target.itemid == 12816 then
if player:getStorageValue(Storage.Quest.U8_2.TheMutatedPumpkin.Skinned) > os.time() then
player:sendCancelMessage("You already used your knife on the corpse.")
return true
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local entrances = {
{ position = Position(33187, 31190, 7), destination = Position(33217, 31124, 14) }, --entrance
{ position = Position(33217, 31124, 14), destination = Position(33185, 31191, 7) }, -- exit
}

local teleportEvent = MoveEvent()

function teleportEvent.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end

for _, entrance in pairs(entrances) do
if entrance.position == position then
player:teleportTo(entrance.destination)
-- position:sendMagicEffect(CONST_ME_WATERSPLASH)
-- entrance.destination:sendMagicEffect(CONST_ME_WATERSPLASH)
break
end
end

return true
end

teleportEvent:type("stepin")
for _, entrance in pairs(entrances) do
teleportEvent:position(entrance.position)
end
teleportEvent:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local entrances = {
{ position = Position(32799, 32365, 8), destination = Position(32872, 32374, 8) }, --to bulltaur lair
{ position = Position(32875, 32376, 8), destination = Position(32800, 32367, 8) }, -- exit bulltaur lair
}

local teleportEvent = MoveEvent()

function teleportEvent.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end

for _, entrance in pairs(entrances) do
if entrance.position == position then
player:teleportTo(entrance.destination)
-- position:sendMagicEffect(CONST_ME_WATERSPLASH)
-- entrance.destination:sendMagicEffect(CONST_ME_WATERSPLASH)
break
end
end

return true
end

teleportEvent:type("stepin")
for _, entrance in pairs(entrances) do
teleportEvent:position(entrance.position)
end
teleportEvent:register()
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
local config = {
{ position = { x = 32728, y = 32878, z = 7 }, destination = { x = 34015, y = 31890, z = 8 } },
{ position = { x = 34038, y = 31726, z = 10 }, destination = { x = 34002, y = 31734, z = 9 } },
{ position = { x = 34000, y = 31732, z = 9 }, destination = { x = 34039, y = 31728, z = 10 } },
{ position = { x = 34071, y = 31445, z = 11 }, destination = { x = 34071, y = 31440, z = 11 } },
{ position = { x = 34070, y = 31442, z = 11 }, destination = { x = 34071, y = 31446, z = 11 } },
{ position = { x = 34095, y = 31431, z = 11 }, destination = { x = 32728, y = 32879, z = 7 } },
{ position = { x = 34077, y = 31580, z = 10 }, destination = { x = 34074, y = 31541, z = 9 } },
{ position = { x = 34072, y = 31539, z = 9 }, destination = { x = 34079, y = 31579, z = 10 } },
}

local entrance = Action()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ local helm = Action()

function helm.onUse(player, item, fromPosition, target, toPosition, isHotkey)
for key, helmPos in pairs(setting.helmPosition) do
if fromPosition == helmPos then -- Ensure correct position comparison
if fromPosition == helmPos then -- Ensure correct position comparison
local positions = setting.playersPositions[key] -- Get corresponding player positions
if positions then
for _, pos in ipairs(positions) do
local creature = Tile(pos.fromPos):getTopCreature()
if creature and creature:isPlayer() then
creature:teleportTo(pos.toPos)

if key == "helm1" then -- Special action for helm1
if key == "helm1" then -- Special action for helm1
creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "What's that huge shadow in the distance, an island?")
local randomLooktype = setting.looktypes[math.random(#setting.looktypes)]
local condition = Condition(CONDITION_OUTFIT)
Expand All @@ -56,7 +56,7 @@ end

-- Register all helm positions
for _, pos in pairs(setting.helmPosition) do
helm:position(pos)
helm:position(pos)
end
helm:register()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local config = {
boss = {
name = "The Rootkraken",
position = Position(32623, 32950, 15),
},
requiredLevel = 500,
playerPositions = {
{ pos = Position(32618, 32909, 14), teleport = Position(32618, 32941, 15) },
{ pos = Position(32618, 32910, 14), teleport = Position(32618, 32941, 15) },
{ pos = Position(32618, 32911, 14), teleport = Position(32618, 32941, 15) },
{ pos = Position(32618, 32912, 14), teleport = Position(32618, 32941, 15) },
{ pos = Position(32618, 32913, 14), teleport = Position(32618, 32941, 15) },
},
specPos = {
from = Position(32605, 32929, 15),
to = Position(32642, 32967, 15),
},
exit = Position(33852, 31983, 11),
}

lever = BossLever(config)
lever:position(Position(32618, 32908, 15))
lever:register()
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ local setting = {
lever1 = Position(32723, 32972, 15),
lever2 = Position(32563, 32940, 15),
lever3 = Position(32728, 32913, 15),
lever4 = Position(32618, 32908, 15),
lever5 = Position(33848, 31994, 10),
lever4 = Position(33848, 31994, 10),
},
looktypes = { 1693, 1694, 1695, 1696, 1698 },
playersPositions = {
Expand All @@ -29,22 +28,15 @@ local setting = {
{ fromPos = { x = 32728, y = 32917, z = 15 }, toPos = { x = 32689, y = 32904, z = 15 } },
{ fromPos = { x = 32728, y = 32918, z = 15 }, toPos = { x = 32689, y = 32904, z = 15 } },
},
lever4 = {
{ fromPos = { x = 32618, y = 32909, z = 15 }, toPos = { x = 32618, y = 32941, z = 15 } },
{ fromPos = { x = 32618, y = 32910, z = 15 }, toPos = { x = 32618, y = 32941, z = 15 } },
{ fromPos = { x = 32618, y = 32911, z = 15 }, toPos = { x = 32618, y = 32941, z = 15 } },
{ fromPos = { x = 32618, y = 32912, z = 15 }, toPos = { x = 32618, y = 32941, z = 15 } },
{ fromPos = { x = 32618, y = 32913, z = 15 }, toPos = { x = 32618, y = 32941, z = 15 } },
},
},
}

local helm = Action()

function helm.onUse(player, item, fromPosition, target, toPosition, isHotkey)
for key, leverPos in pairs(setting.leverPosition) do
if fromPosition == leverPos then -- Ensure correct position comparison
if key == "lever5" then -- Special action for helm1
if fromPosition == leverPos then -- Ensure correct position comparison
if key == "lever4" then -- Special action for helm1
if player:getPosition().y == 31993 then
player:teleportTo(Position(33848, 31995, 10))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
Expand All @@ -70,6 +62,6 @@ end

-- Register all helm positions
for _, pos in pairs(setting.leverPosition) do
helm:position(pos)
helm:position(pos)
end
helm:register()
helm:register()
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ teleportEvent:type("stepin")
for _, entrance in pairs(entrances) do
teleportEvent:position(entrance.position)
end
teleportEvent:register()
teleportEvent:register()

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local config = {
from = Position(33034, 32389, 15),
to = Position(33053, 32410, 15),
},
exit = Position(33044, 32409, 15),
exit = Position(34107, 32052, 13),
}

local lever = BossLever(config)
Expand Down
Loading

0 comments on commit a6e9f2e

Please sign in to comment.