• 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!

[War OT] Starter Equipment.

Dion078

New Member
Joined
Aug 27, 2010
Messages
32
Reaction score
0
Greetings,


Does anyone know how I can set-up starting equipment for diffrent vocations, because I'm making a War-Ot so I want all vocations to have their best set.

So if you're like making a mage your starting with the following;

Yalahari Mask, Focus Cape, Blue Legs, Spellbook of Dark Mysteries (Altho I'm making a noob-war 45 lvl+ don't know if the spellbook has a level requirement), Boots of Haste, Wand of Voodoo, Backpack of Holding with all pvp-related runes and food etc.

But when you're making a Paladin;

Master archer's armor, Yalahari legs and so on.

Also diffrent for the Knight.


Hopefully somebody can help me out with some-sort of script! =]


Kind regards,
Dion078
 
Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 40045) == -1 then
	if getPlayerVocation(cid) == 1 then
		doPlayerAddItem(cid, 2518, 1)--Beholder Shield
		doPlayerAddItem(cid, 8820, 1)--Mage hat
		doPlayerAddItem(cid, 8819, 1)--Magician's robe
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 2190, 1)--Wand Of Vortex
		doAddContainerItem(container, 2175, 1)--Spell Book
		doAddContainerItem(container, 2671, 3)--Ham
		doAddContainerItem(container, 2120, 1)--Rope
                doAddContainerItem(container, 7488, 1)--Manarune
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
	end
	if getPlayerVocation(cid) == 2 then
		doPlayerAddItem(cid, 2518, 1)--Beholder Shield
		doPlayerAddItem(cid, 8820, 1)--Mage hat
		doPlayerAddItem(cid, 8819, 1)--Magician's robe
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 2182, 1)--Snakekbite Rod
		doAddContainerItem(container, 2175, 1)--Spell Book
		doAddContainerItem(container, 2671, 3)--Ham
                doAddContainerItem(container, 7488, 1)--Manarune
		doAddContainerItem(container, 2120, 1)--Rope
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
	end
	if getPlayerVocation(cid) == 3 then
		doPlayerAddItem(cid, 2518, 1)--Beholder Shield
		doPlayerAddItem(cid, 2457, 1)--Steel Helmet
		doPlayerAddItem(cid, 2465, 1)--Brass Armor
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 8602, 1)--Jagged Sword
		doAddContainerItem(container, 2389, 2)--Spear
		doAddContainerItem(container, 2456, 1)--Bow
                doAddContainerItem(container, 7488, 1)--Manarune
		doAddContainerItem(container, 2671, 3)--Ham
		doAddContainerItem(container, 2120, 1)--Rope
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
	end
	if getPlayerVocation(cid) == 9 then
		doPlayerAddItem(cid, 2518, 1)--Beholder Shield
		doPlayerAddItem(cid, 2457, 1)--Steel Helmet
		doPlayerAddItem(cid, 2465, 1)--Brass Armor
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 7406, 1)--Orc Sword
                doAddContainerItem(container, 7488, 1)--Manarune
		doAddContainerItem(container, 2671, 3)--Ham
		doAddContainerItem(container, 2120, 1)--Rope
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
        end
	if getPlayerVocation(cid) == 10 then
		doPlayerAddItem(cid, 2457, 1)--Steel Helmet
		doPlayerAddItem(cid, 2465, 1)--Brass Armor
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 7632, 1)--Blue Bolt
                doAddContainerItem(container, 7488, 1)--Manarune
                doAddContainerItem(container, 2272, 1)--uh
		doAddContainerItem(container, 2455, 3)--Crossbow
		doAddContainerItem(container, 2120, 1)--Rope
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
        end
	if getPlayerVocation(cid) == 4 then
		doPlayerAddItem(cid, 2518, 1)--Beholder Shield
		doPlayerAddItem(cid, 2457, 1)--Steel Helmet
		doPlayerAddItem(cid, 2465, 1)--Brass Armor
		doPlayerAddItem(cid, 2478, 1)--Brass Legs
		doPlayerAddItem(cid, 2643, 1)--Leather Boots
		local container = doPlayerAddItem(cid, 2000, 1)--Backpack
		doAddContainerItem(container, 8602, 1)--Jagged Sword
		doAddContainerItem(container, 2439, 1)--Daramanian mace
		doAddContainerItem(container, 8601, 1)--Steel Axe
		doAddContainerItem(container, 2671, 3)--Ham
                doAddContainerItem(container, 7488, 1)--Manarune
                doAddContainerItem(container, 2272, 1)--uh
		doAddContainerItem(container, 2120, 1)--Rope
		doAddContainerItem(container, 2160, 10)--Crystal Coin
		doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." now you have the first items of "..getPlayerVocationName(cid)..".")
	end
		setPlayerStorageValue(cid, 40045, 1)
	end
return true
end
Code:
<event type="login" name="FirstItems" script="firstitems.lua"/>

Change the Id of the item As u Wish..
Rep if i helped Please.
 
Just a quick question, I put the long script in otserv/mods and made a firstitems.xml

Where must the code be

<event type="login" name="FirstItems" script="firstitems.lua"/>
 
How exactly do I save this script and that other code, where in Creaturescripts. I know it a littlebit, but I think it's better if you explain to avoid futher problems =]


[Edit] It worked! for those who don't know! go to data/creaturescripts/creaturescripts.xml and add <event type="login" name="FirstItems" script="firstitems.lua"/>[/


Then go into creaturescripts/scripts and add a new file 'firstitems.lua' and add the long script! +rep Ns Sparkz if it worked!
 
Last edited:
LUA:
local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=2120, count=1}, -- rope
  {itemid=5710, count=1}, -- shovel
  {itemid=2789, count=100}, -- brown mushrooms
}

local firstItems = {
  { -- SORC ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=2647, count=1}, -- plate legs
    {itemid=2643, count=1}, -- leather boots
    {itemid=2525, count=1}, -- dwarven shield
    {itemid=2191, count=1}, -- wand of dragonbreath


    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7620, count=1}, -- mp
	{itemid=7618, count=1}, -- hp
    {itemid=2293, count=1}, -- mw
	{itemid=2261, count=1}, -- dr
    {itemid=2274, count=1}, -- avalanche rune
	{itemid=2305, count=1}, -- firebomb rune
  },
  { -- DRUID ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=2647, count=1}, -- plate legs
    {itemid=2643, count=1}, -- leather boots
    {itemid=2525, count=1}, -- dwarven shield
    {itemid=2186, count=1}, -- moonlight rod 

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7620, count=1}, -- mp
	{itemid=7618, count=1}, -- hp
    {itemid=2293, count=1}, -- mw
	{itemid=2261, count=1}, -- dr
    {itemid=2269, count=1}, -- wg
    {itemid=2274, count=1}, -- avalanche rune
	{itemid=2305, count=1}, -- firebomb rune
  },
  { -- PALADIN ITEMS
    {itemid=2457, count=1}, -- steel helemet
    {itemid=8891, count=1}, -- belted cape
    {itemid=2647, count=1}, -- plate legs
    {itemid=2643, count=1}, -- leather boots
    {itemid=2525, count=1}, -- dwarven shield
    {itemid=7368, count=1}, -- assassin stars

    {itemid=2268, count=1}, -- sd
    {itemid=2273, count=1}, -- uh
    {itemid=7620, count=1}, -- mp
	{itemid=7618, count=1}, -- hp
    {itemid=2293, count=1}, -- mw
	{itemid=2261, count=1}, -- dr
	{itemid=2305, count=1}, -- firebomb rune
	{itemid=2274, count=1}, -- avalanche rune
  },
  { -- KNIGHT ITEMS
    {itemid=2457, count=1}, -- steel helemet
    {itemid=2463, count=1}, -- plate armor
    {itemid=2647, count=1}, -- plate legs
    {itemid=2643, count=1}, -- leather boots
    {itemid=2525, count=1}, -- dwarven shield
    {itemid=10313, count=1}, -- Incredible Mumpiz Slayer

	{itemid=2273, count=1}, -- uh
    {itemid=7620, count=1}, -- mp
	{itemid=7618, count=1}, -- hp
    {itemid=2293, count=1}, -- mw
	{itemid=2261, count=1}, -- dr
	{itemid=2305, count=1}, -- firebomb rune
	{itemid=2274, count=1}, -- avalanche rune

  }
}

for _, items in ipairs(firstItems) do
  for _, item in ipairs(commonItems) do
    table.insert(items, item)
  end
end

function onLogin(cid)
  if getPlayerGroupId(cid) < 2 then
    local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

    if hasReceivedFirstItems ~= 1 then
      --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

      local giveItems = firstItems[getPlayerVocation(cid)]

      if giveItems ~= nil then
        for _, v in ipairs(giveItems) do
          --doAddContainerItem(backpack, v.itemid, v.count or 1)
          doPlayerAddItem(cid, v.itemid, v.count or 1)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your first items!")
      end
      setPlayerStorageValue(cid, 67708, 1)
    end
  end
  return TRUE
end

Try Using that One.
 
Back
Top