Server upload

RD Core / Commit #2

Commit Server upload

Alex Alex committed 18/10/2026 23:38 main Patch
1,106 files +223,404 -0
A data/movements/scripts/decay.lua +5-0 View file
@@ -0,0 +1,5 @@
1+function onStepIn(creature, item, position, fromPosition)
2+ item:transform(item.itemid + 1)
3+ item:decay()
4+ return true
5+end
A data/movements/scripts/dough.lua +10-0 View file
@@ -0,0 +1,10 @@
1+function onAddItem(moveitem, tileitem, position)
2+ if moveitem:getId() == 2693 then
3+ moveitem:transform(2689)
4+ position:sendMagicEffect(CONST_ME_HITBYFIRE)
5+ elseif moveitem:getId() == 6277 then
6+ moveitem:transform(2687, 12)
7+ position:sendMagicEffect(CONST_ME_HITBYFIRE)
8+ end
9+ return true
10+end
A data/movements/scripts/level_door.lua +12-0 View file
@@ -0,0 +1,12 @@
1+function onStepIn(creature, item, position, fromPosition)
2+ if not creature:isPlayer() then
3+ return false
4+ end
5+
6+ if creature:getLevel() < item.actionid - actionIds.levelDoor then
7+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
8+ creature:teleportTo(fromPosition, true)
9+ return false
10+ end
11+ return true
12+end
A data/movements/scripts/quest_door.lua +12-0 View file
@@ -0,0 +1,12 @@
1+function onStepIn(creature, item, position, fromPosition)
2+ if not creature:isPlayer() then
3+ return false
4+ end
5+
6+ if creature:getStorageValue(item.actionid) == -1 then
7+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
8+ creature:teleportTo(fromPosition, true)
9+ return false
10+ end
11+ return true
12+end
A data/movements/scripts/tiles.lua +61-0 View file
@@ -0,0 +1,61 @@
1+local increasing = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215, [11062] = 11063}
2+local decreasing = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202, [11063] = 11062}
3+
4+function onStepIn(creature, item, position, fromPosition)
5+ if not increasing[item.itemid] then
6+ return true
7+ end
8+
9+ if not creature:isPlayer() or creature:isInGhostMode() then
10+ return true
11+ end
12+
13+ item:transform(increasing[item.itemid])
14+ if _NEW_RULES_ONLINE then
15+ if item.itemid == 11062 or item.itemid == 11063 then
16+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Personagens em treino ganham 1x Online Coins a cada 3 horas.")
17+ end
18+ end
19+
20+ if item.actionid >= actionIds.levelDoor then
21+ if creature:getLevel() < item.actionid - actionIds.levelDoor then
22+ creature:teleportTo(fromPosition, false)
23+ position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
24+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The tile seems to be protected against unwanted intruders.")
25+ end
26+ return true
27+ end
28+
29+ if Tile(position):hasFlag(TILESTATE_PROTECTIONZONE) then
30+ local lookPosition = creature:getPosition()
31+ lookPosition:getNextPosition(creature:getDirection())
32+ local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
33+ if depotItem then
34+ local depotItems = creature:getDepotChest(getDepotId(depotItem:getUniqueId()), true):getItemHoldingCount()
35+ creature:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
36+ creature:addAchievementProgress("Safely Stored Away", 1000)
37+ return true
38+ end
39+ end
40+
41+ if item.actionid ~= 0 and creature:getStorageValue(item.actionid) <= 0 then
42+ creature:teleportTo(fromPosition, false)
43+ position:sendMagicEffect(CONST_ME_MAGIC_BLUE)
44+ creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The tile seems to be protected against unwanted intruders.")
45+ return true
46+ end
47+ return true
48+end
49+
50+function onStepOut(creature, item, position, fromPosition)
51+ if not decreasing[item.itemid] then
52+ return true
53+ end
54+
55+ if creature:isPlayer() and creature:isInGhostMode() then
56+ return true
57+ end
58+
59+ item:transform(decreasing[item.itemid])
60+ return true
61+end
A data/movements/scripts/trap.lua +74-0 View file
@@ -0,0 +1,74 @@
1+local traps = {
2+ [26028] = {transformTo = 26026, damage = {-500, -1000}},
3+ [1510] = {transformTo = 1511, damage = {-50, -100}},
4+ [1513] = {damage = {-50, -100}},
5+ [2579] = {transformTo = 2578, damage = {-15, -30}},
6+ [4208] = {transformTo = 4209, damage = {-15, -30}, type = COMBAT_EARTHDAMAGE}
7+}
8+
9+function onStepIn(creature, item, position, fromPosition)
10+ local trap = traps[item.itemid]
11+ if not trap then
12+ return true
13+ end
14+
15+ if item.itemid == 26028 then
16+ addEvent(onActiveTrap, 1000, creature.uid, item:getPosition(), item:getId())
17+ return true
18+ end
19+
20+ if creature:isMonster() then
21+ doTargetCombat(0, creature, trap.type or COMBAT_PHYSICALDAMAGE, trap.damage[1], trap.damage[2], CONST_ME_NONE)
22+ end
23+
24+ if trap.transformTo then
25+ item:transform(trap.transformTo)
26+ end
27+ return true
28+end
29+
30+function onActiveTrap(cid, pos, target)
31+ local player = Player(cid)
32+ local item = Tile(pos):getItemById(target)
33+ if item then
34+ item:transform(26026)
35+ end
36+ if player then
37+ local playerTile = Tile(pos):getTopCreature()
38+ if playerTile ~= nil then
39+ if playerTile:isPlayer() then
40+ doTargetCombat(0, player, COMBAT_PHYSICALDAMAGE, traps[26028].damage[1], traps[26028].damage[2], CONST_ME_NONE)
41+ end
42+ else
43+ if item then
44+ addEvent(transforTo, 1000, item:getPosition(), item:getId())
45+ end
46+ end
47+ end
48+end
49+
50+function transforTo(toPosition, itemId)
51+ local item = Tile(toPosition):getItemById(itemId)
52+ if item then
53+ item:transform(26028)
54+ end
55+end
56+
57+function onStepOut(creature, item, position, fromPosition)
58+ if item.itemid == 26026 then
59+ item:transform(26028)
60+ return true
61+ end
62+
63+ item:transform(item.itemid - 1)
64+ return true
65+end
66+
67+function onRemoveItem(item, tile, position)
68+ local itemPosition = item:getPosition()
69+ if itemPosition:getDistance(position) > 0 then
70+ item:transform(item.itemid - 1)
71+ itemPosition:sendMagicEffect(CONST_ME_POFF)
72+ end
73+ return true
74+end
A data/movements/scripts/walkback.lua +42-0 View file
@@ -0,0 +1,42 @@
1+local function isQuestChest(item)
2+ local itemid = item:getId()
3+ if itemid == 1738 or itemid == 1740 or (itemid >= 1746 and itemid <= 1749) then
4+ return true
5+ end
6+end
7+
8+local function isWalkable(item)
9+ if item.uid > 0 and item.uid <= 65535 then
10+ return false
11+ end
12+ return true
13+end
14+
15+local function isPositionSafe(position)
16+ local tile = Tile(position)
17+ for _, item in ipairs(tile:getItems()) do
18+ if isQuestChest(item) and not isWalkable(item) then
19+ return false
20+ end
21+ end
22+ return true
23+end
24+
25+function onStepIn(creature, item, position, fromPosition)
26+ if not isWalkable(item) then
27+ if creature:isPlayer() then
28+ local safePosition = creature:getTown():getTemplePosition()
29+
30+ if position.x == fromPosition.x and position.y == fromPosition.y and position.z == fromPosition.z then
31+ creature:teleportTo(safePosition, false)
32+ return true
33+ elseif not isPositionSafe(fromPosition) then
34+ creature:teleportTo(safePosition, false)
35+ return true
36+ end
37+ end
38+
39+ creature:teleportTo(fromPosition, false)
40+ end
41+ return true
42+end
A data/npc/adonai.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Adonai" script="default.lua" walkinterval="0" speed="100" walkradius="2" floorchange="0" speechbubble="1" attackable = "1">
3+ <health max="100" now="100"/>
4+ <look type="131" head="114" body="100" legs="0" feet="114" addons="2" mount="0"/>
5+</npc>
A data/npc/albinius.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Albinius" walkinterval="0" speechbubble="1" floorchange="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="634" head="0" body="19" legs="86" feet="60" addons="0"/>
5+</npc>
A data/npc/alissa.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Alissa" walkinterval="0" floorchange="0" speechbubble="1" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="140" head="114" body="3" legs="72" feet="16" addons="0"/>
5+</npc>
A data/npc/alwin.xml +7-0 View file
@@ -0,0 +1,7 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Alwin" script="default.lua" walkinterval="0" floorchange="0">
3+ <health now="100" max="100" />
4+ <look type="131" head="113" body="113" legs="113" feet="115" addons="0" />
5+ <parameters>
6+ </parameters>
7+</npc>
A data/npc/amber.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Amber" walkinterval="2000" floorchange="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="136" head="59" body="113" legs="132" feet="76" addons="1"/>
5+</npc>
A data/npc/arnold.xml +7-0 View file
@@ -0,0 +1,7 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Arnold" script="default.lua" walkinterval="0" floorchange="0">
3+ <health now="100" max="100" />
4+ <look type="131" head="113" body="113" legs="113" feet="115" addons="0" />
5+ <parameters>
6+ </parameters>
7+</npc>
A data/npc/aruda.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Aruda" walkinterval="2000" floorchange="0" script="default.lua" speechbubble="1" attackable = "1">
3+ <health now="100" max="100"/>
4+ <look type="140" head="77" body="81" legs="79" feet="95" addons="0"/>
5+</npc>
A data/npc/barney.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Barney" walkinterval="0" floorchange="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="128" head="20" body="39" legs="115" feet="114" addons="0"/>
5+</npc>
A data/npc/benjamin.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Benjamin" walkinterval="0" floorchange="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="128" head="116" body="79" legs="117" feet="76" addons="0"/>
5+</npc>
A data/npc/black bert.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Black bert" walkinterval="2000" floorchange="0" script="default.lua" speechbubble="4" attackable = "1">
3+ <health now="100" max="100"/>
4+ <look type="151" head="0" body="38" legs="19" feet="76" addons="0"/>
5+</npc>
A data/npc/bozo.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Bozo" walkinterval="2000" floorchange="0" script="default.lua" speechbubble="4" attackable = "1">
3+ <health now="100" max="100"/>
4+ <look type="273" head="0" body="77" legs="80" feet="79" addons="3"/>
5+</npc>
A data/npc/bruce.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Bruce" walkinterval="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="131" head="58" body="43" legs="38" feet="76" addons="0"/>
5+</npc>
A data/npc/captain tiberius.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<npc name="Captain Tiberius" walkinterval="0" floorchange="0" script="default.lua">
3+ <health now="100" max="100"/>
4+ <look type="134" head="97" body="79" legs="95" feet="116" addons="0"/>
5+</npc>
A data/npc/charos.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Charos" walkinterval="2000" floorchange="0" script="default.lua" speechbubble="4" attackable = "1">
3+ <health now="100" max="100"/>
4+ <look type="133" head="60" body="94" legs="114" feet="115" addons="0"/>
5+</npc>
A data/npc/christoph.xml +7-0 View file
@@ -0,0 +1,7 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Christoph" script="default.lua" walkinterval="0" floorchange="0">
3+ <health now="100" max="100" />
4+ <look type="131" head="113" body="113" legs="113" feet="115" addons="0" />
5+ <parameters>
6+ </parameters>
7+</npc>
A data/npc/default.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Default" script="default.lua" walkinterval="0" speed="100" walkradius="2" floorchange="0" speechbubble="1" attackable = "1">
3+ <health max="100" now="100"/>
4+ <look type="1582" head="0" body="0" legs="0" feet="0" addons="0" mount="0"/>
5+</npc>
A data/npc/demonguard.xml +5-0 View file
@@ -0,0 +1,5 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<npc name="Demonguard" script="default.lua" walkinterval="0" floorchange="0">
3+ <health now="100" max="100" />
4+ <look type="131" head="97" body="94" legs="94" feet="94" addons="3" />
5+</npc>
Top