• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent TFS 1.0 Firstitems

Status
Not open for further replies.

javiKINGA

Learning everyday!
Joined
May 5, 2014
Messages
19
Reaction score
6
Hope you enjoy!
- Sorc EQ: Soldier Helmet, Wand of Vortex, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots.
- Sorc BP: Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom.
- Druid EQ: Soldier Helmet, Snakebite Rod, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots.
- Druid BP: Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom.
- Paladin EQ: Soldier Helmet, Bow, Brass Armor, Brass Legs, Amulet of Loss, 100 Arrow, Leather Boots.
- Paladin BP: Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom.
- Knight EQ: Soldier Helmet, Steel Axe, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots.
- Knight BP: Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom, Banana Staff, Jagged Sword.
(Data/Creaturescripts/Scripts/Others/Firstitems.lua)
Creaturescripts.xml
(<event type="login" name="FirstItems" script="others/firstitems.lua"/>)


-- With Rookgaard

--[[
local firstItems = {2050, 2382}

function onLogin(cid)
local player = Player(cid)
if player:getLastLoginSaved() <= 0 then
for i = 1, #firstItems do
player:addItem(firstItems, 1)
end
player:addItem(player:getSex() == 0 and 2651 or 2650, 1)
player:addItem(1987, 1)
player:addItem(2674, 1)
end
return true
end
]]--

-- Without Rookgaard

local config = {
[1] = {
--equipment; Soldier Helmet, Wand of Vortex, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots
{{2481, 1}, {2190, 1}, {2465, 1}, {2478, 1}, {2173, 1}, {2529, 1}, {2643, 1}},
--container; Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom
{{8712, 1}, {5710, 1}, {2152, 30}, {2789, 100}}
},
[2] = {
--equipment; Soldier Helmet, Snakebite Rod, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots
{{2481, 1}, {2182, 1}, {2465, 1}, {2478, 1}, {2173, 1}, {2529, 1}, {2643, 1}},
--container; Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom
{{8712, 1}, {5710, 1}, {2152, 30}, {2789, 100}}
},
[3] = {
--equipment; Soldier Helmet, Bow, Brass Armor, Brass Legs, Amulet of Loss, 100 Arrow, Leather Boots
{{2481, 1}, {2456, 1}, {2465, 1}, {2478, 1}, {2173, 1}, {2544, 100}, {2643, 1}},
--container; Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom
{{8712, 1}, {5710, 1}, {2152, 30}, {2789, 100}}
},
[4] = {
--equipment; Soldier Helmet, Steel Axe, Brass Armor, Brass Legs, Amulet of Loss, Black Shield, Leather Boots
{{2481, 1}, {8601, 1}, {2465, 1}, {2478, 1}, {2173, 1}, {2529, 1}, {2643, 1}},
--container; Rope, Light Shovel, 30 Platinum Coins, 100 Brown Mushroom, Banana Staff, Jagged Sword
{{8712, 1}, {5710, 1}, {2152, 30}, {2789, 100}, {3966, 1}, {8602, 1}}
}
}

function onLogin(cid)
local player = Player(cid)
local targetVocation = config[player:getVocation():getId()]
if not targetVocation then
return true
end

if player:getLastLoginSaved() == 0 then
for i = 1, #targetVocation[1] do
player:addItem(targetVocation[1][1], targetVocation[1][2])
end

local backpack = player:addItem(1988)
for i = 1, #targetVocation[2] do
backpack:addItem(targetVocation[2][1], targetVocation[2][2])
end
end
return true
end

Regards, javiKINGA
 
Doesn't work! No errors, no problems, it just doesn't work.
 
Status
Not open for further replies.
Back
Top