first_items.lua

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