firstitems.lua

main 115 lines · 2.4 KB Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1-- With Rookgaard
2
3--[[
4local firstItems = {2050, 2382} -- torch and club
5
6function onLogin(player)
7 if player:getLastLoginSaved() <= 0 then
8 for i = 1, #firstItems do
9 player:addItem(firstItems[i], 1)
10 end
11 player:addItem(player:getSex() == 0 and 2651 or 2650, 1) -- coat
12 player:addItem(ITEM_BAG, 1)
13 player:addItem(2674, 1) -- red apple
14 end
15 return true
16end
17]]--
18
19-- Without Rookgaard
20local config = {
21 [1] = { -- Sorcerer
22 items = {
23 {2175, 1}, -- spellbook
24 {2190, 1}, -- wand of vortex
25 {8819, 1}, -- magician's robe
26 {8820, 1}, -- mage hat
27 {2468, 1}, -- studded legs
28 {2643, 1}, -- leather boots
29 {2661, 1} -- scarf
30 },
31 container = {
32 {2120, 1}, -- rope
33 {2554, 1}, -- shovel
34 {7620, 1} -- mana potion
35 }
36 },
37 [2] = { -- Druid
38 items = {
39 {2175, 1}, -- spellbook
40 {2182, 1}, -- snakebite rod
41 {8819, 1}, -- magician's robe
42 {8820, 1}, -- mage hat
43 {2468, 1}, -- studded legs
44 {2643, 1}, -- leather boots
45 {2661, 1} -- scarf
46 },
47 container = {
48 {2120, 1}, -- rope
49 {2554, 1}, -- shovel
50 {7620, 1} -- mana potion
51 }
52 },
53 [3] = { -- Paladin
54 items = {
55 {2525, 1}, -- dwarven shield
56 {2389, 5}, -- 5 spears
57 {2660, 1}, -- ranger's cloak
58 {8923, 1}, -- ranger legs
59 {2643, 1}, -- leather boots
60 {2661, 1}, -- scarf
61 {2480, 1} -- legion helmet
62 },
63 container = {
64 {2120, 1}, -- rope
65 {2554, 1}, -- shovel
66 {7618, 1}, -- health potion
67 {2456, 1}, -- bow
68 {2544, 50} -- 50 arrows
69 }
70 },
71 [4] = { -- Knight
72 items = {
73 {2525, 1}, -- dwarven shield
74 {8601, 1}, -- steel axe
75 {2465, 1}, -- brass armor
76 {2460, 1}, -- brass helmet
77 {2478, 1}, -- brass legs
78 {2643, 1}, -- leather boots
79 {2661, 1} -- scarf
80 },
81 container = {
82 {8602, 1}, -- jagged sword
83 {2439, 1}, -- daramanian mace
84 {2120, 1}, -- rope
85 {2554, 1}, -- shovel
86 {7618, 1} -- health potion
87 }
88 }
89}
90
91function onLogin(player)
92 local targetVocation = config[player:getVocation():getId()]
93 if not targetVocation then
94 return true
95 end
96
97 if player:getLastLoginSaved() ~= 0 then
98 return true
99 end
100
101 for i = 1, #targetVocation.items do
102 player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
103 end
104
105 local backpack = player:addItem(1988)
106 if not backpack then
107 return true
108 end
109
110 for i = 1, #targetVocation.container do
111 backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
112 end
113 return true
114end
115
Top