• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Firstitems script on a war server help here

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
Well i got this script..

Code:
local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=5801, count=1}, -- key ring
  {itemid=2197, count=10}, -- stone skin amulet
  {itemid=2789, count=100}, -- brown mushrooms
  {itemid=2261, count=1}, -- destroy field rune
  {itemid=2273, count=1}, -- uh
  {itemid=2293, count=1}, -- mw
  {itemid=2305, count=1}, -- fire bomb rune
}

local firstItems = {
  { -- SORC ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=8918, count=1}, -- spellbook of dark mysteries
    {itemid=2195, count=1}, -- boots of haste
    {itemid=6132, count=1}, -- soft boots
    {itemid=7730, count=1}, -- blue legs
    {itemid=8922, count=1}, -- wand of voodoo

    {itemid=2268, count=1}, -- sd
    {itemid=7590, count=1}, -- gmp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- DRUID ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=8918, count=1}, -- spellbook of dark mysteries
    {itemid=2195, count=1}, -- boots of haste
    {itemid=6132, count=1}, -- soft boots
    {itemid=7730, count=1}, -- blue legs
    {itemid=8910, count=1}, -- underworld rod

    {itemid=2268, count=1}, -- sd
    {itemid=7590, count=1}, -- gmp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- PALADIN ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=8888, count=1}, -- master archer's armor
    {itemid=2470, count=1}, -- golden legs
    {itemid=6132, count=1}, -- soft boots
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=7368, count=1}, -- assassin stars

    {itemid=2268, count=1}, -- sd
    {itemid=8472, count=1}, -- gsp
    {itemid=7589, count=1}, -- smp
    {itemid=7588, count=1}, -- shp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- KNIGHT ITEMS
    {itemid=2496, count=1}, -- horned helmet
    {itemid=2472, count=1}, -- magic plate armor
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=6132, count=1}, -- soft boots
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2470, count=1}, -- golden legs
    {itemid=2400, count=1}, -- magic sword
    {itemid=2431, count=1}, -- sca
    {itemid=2421, count=1}, -- thunder hammer

    {itemid=7620, count=1}, -- mp
    {itemid=7591, count=1}, -- ghp
    {itemid=8473, count=1}, -- uhp
  }
}

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, 2365, 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, "Ya has obtenido tus items y  eskiles estas listo para war^^!")
      end
      setPlayerStorageValue(cid, 67708, 1)
    end
  end
  return TRUE
end

But also i had registered in login.lua that new players on login will have promotion instantly, so the firstitems script isnt working properly because the script gives the items to sorcerer druid paladins, knights and players at login gets master sorcerer, elder druid royal paladin etc..

How can i modify the firstitems script so players with promotion (MS,ED,RP;EK) receives the first items??
 
Code:
local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {itemid=5801, count=1}, -- key ring
  {itemid=2197, count=10}, -- stone skin amulet
  {itemid=2789, count=100}, -- brown mushrooms
  {itemid=2261, count=1}, -- destroy field rune
  {itemid=2273, count=1}, -- uh
  {itemid=2293, count=1}, -- mw
  {itemid=2305, count=1}, -- fire bomb rune
}

local firstItems = {
  { -- SORC/MS ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=8918, count=1}, -- spellbook of dark mysteries
    {itemid=2195, count=1}, -- boots of haste
    {itemid=6132, count=1}, -- soft boots
    {itemid=7730, count=1}, -- blue legs
    {itemid=8922, count=1}, -- wand of voodoo

    {itemid=2268, count=1}, -- sd
    {itemid=7590, count=1}, -- gmp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- DRUID/ED ITEMS
    {itemid=2323, count=1}, -- hat of the mad
    {itemid=8871, count=1}, -- focus cape
    {itemid=8918, count=1}, -- spellbook of dark mysteries
    {itemid=2195, count=1}, -- boots of haste
    {itemid=6132, count=1}, -- soft boots
    {itemid=7730, count=1}, -- blue legs
    {itemid=8910, count=1}, -- underworld rod

    {itemid=2268, count=1}, -- sd
    {itemid=7590, count=1}, -- gmp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- PALADIN/RP ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=8888, count=1}, -- master archer's armor
    {itemid=2470, count=1}, -- golden legs
    {itemid=6132, count=1}, -- soft boots
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=7368, count=1}, -- assassin stars

    {itemid=2268, count=1}, -- sd
    {itemid=8472, count=1}, -- gsp
    {itemid=7589, count=1}, -- smp
    {itemid=7588, count=1}, -- shp
    {itemid=2278, count=1}, -- paralyze
    {itemid=2269, count=1}, -- wild growth
  },
  { -- KNIGHT/EK ITEMS
    {itemid=2496, count=1}, -- horned helmet
    {itemid=2472, count=1}, -- magic plate armor
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=6132, count=1}, -- soft boots
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2470, count=1}, -- golden legs
    {itemid=2400, count=1}, -- magic sword
    {itemid=2431, count=1}, -- sca
    {itemid=2421, count=1}, -- thunder hammer

    {itemid=7620, count=1}, -- mp
    {itemid=7591, count=1}, -- ghp
    {itemid=8473, count=1}, -- uhp
  }
}

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, 2365, 1)
      local playerVocation = getPlayerVocation(cid)
      if(isInArray({5, 6, 7, 8}, playerVocation)) then
            playerVocation = playerVocation - 4
      end
      local giveItems = firstItems[playerVocation]

      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, "Ya has obtenido tus items y  eskiles estas listo para war^^!")
      end
      setPlayerStorageValue(cid, 67708, 1)
    end
  end
  return TRUE
end
Should work, but not tested at all.
 
Hello

@Redan script works for me but distance weapon is on right hand. How to put it in left hand i try to use part of code from:

ostnog.png


VIEW THE SCRIPT HERE!

https://otland.net/threads/mod-advanced-first-items-useslot-slottype-usemessage-incontainer.149556/

{itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow


if v.useSlot then
doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end

But i failed :(
Help please.

(OTServ SVN)
 
Last edited:
Hello

@Redan script works for me but distance weapon is on right hand. How to put it in left hand i try to use part of code from:



https://otland.net/threads/mod-advanced-first-items-useslot-slottype-usemessage-incontainer.149556/

{itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow


if v.useSlot then
doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end

But i failed :(
Help please.

(OTServ SVN)
Just go into your config file, and find the line that says something about classic equipments slots, or something like that and change the line to true (or false, cant remember. Just make it opposite of what it is now). Then you have to mess around with the order of the itemID in the firstitems.xml.
 
Just go into your config file, and find the line that says something about classic equipments slots, or something like that and change the line to true (or false, cant remember. Just make it opposite of what it is now). Then you have to mess around with the order of the itemID in the firstitems.xml.

In config file i dont have any lines about classic equipment slot :/

(OTServ SVN)

In global.lua i try to change slot_right to 6 and slot_left to 5 but nothing happend :(
CONST_SLOT_HEAD = 1
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10
 
Back
Top