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

problem with firstitems!

wafuboe

Member
Joined
Dec 24, 2010
Messages
882
Solutions
2
Reaction score
23
well im having problem, my first items doesnt work and also i have an error in console..
i only receive the backpack lol

here is the error on consele

Code:
[5/4/2014 17:16:36] Account Manager has logged in.
[5/4/2014 17:16:36] [Warning - Vocations::getVocation] Vocation 4294967295 not found.
[5/4/2014 17:16:36] [Warning - Vocations::getVocation] Vocation 4294967295 not found.

[5/4/2014 17:16:36] [Error - CreatureScript Interface]
[5/4/2014 17:16:36] data/creaturescripts/scripts/advancesave.lua:onAdvance
[5/4/2014 17:16:36] Description:
[5/4/2014 17:16:36] attempt to index a nil value
[5/4/2014 17:16:36] stack traceback:
[5/4/2014 17:16:36]    [C]: in function 'doSendMagicEffect'
[5/4/2014 17:16:36]    data/creaturescripts/scripts/advancesave.lua:15: in function <data/creaturescripts/scripts/advancesave.lua:7>
[5/4/2014 17:16:36]    [C]: in function 'doPlayerAddExperience'
[5/4/2014 17:16:36]    data/creaturescripts/scripts/lowlevellock.lua:4: in function <data/creaturescripts/scripts/lowlevellock.lua:1>
[5/4/2014 17:16:49] Account Manager has logged out.

and here is the vocations.xml and the firstitems script

Code:
local commonItems = {
  -- ITEMS ALL VOCS RECEIVE
  {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 = {
  { --SORCERER ITEMS
    {itemid=2493, count=1}, -- demon helmet
    {itemid=2494, count=1}, -- demon armor
    {itemid=8918, count=1}, -- spellbook of dark mysteries
    {itemid=2195, count=1}, -- boots of haste
    {itemid=6132, count=1}, -- soft boots
    {itemid=2495, count=1}, -- demon 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=2493, count=1}, -- hat of the mad
    {itemid=2494, 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=2495, count=1}, -- demon 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=2494, count=1}, -- demon armor
    {itemid=2495, count=1}, -- demon 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=2493, count=1}, -- demon helmet
    {itemid=2494, count=1}, -- demon armor
    {itemid=2514, count=1}, -- mastermind shield
    {itemid=6132, count=1}, -- soft boots
    {itemid=2195, count=1}, -- boots of haste
    {itemid=2495, count=1}, -- demon 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, "Estas listo para war!")
      end
      setPlayerStorageValue(cid, 67708, 1)
    end
  end
  return TRUE
end


Code:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
    <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="550" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.1" attackspeed="550" soulmax="100" gainsoulticks="120" fromvoc="1">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.1" attackspeed="550" soulmax="100" gainsoulticks="120" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="1.4" attackspeed="550" soulmax="100" gainsoulticks="120" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="5" gainmanaticks="3" gainmanaamount="10" manamultiplier="3.0" attackspeed="500" soulmax="100" gainsoulticks="120" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="550" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.1" attackspeed="550" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="1.4" attackspeed="550" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
    <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="10" gainmanaticks="2" gainmanaamount="20" manamultiplier="3.0" attackspeed="500" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30">
        <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
        <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
    </vocation>
</vocations>



Thanks!!
 
Actually the errors are not related to that script.
I believe you have bad libs, I'm not sure so you better wait for someone more expert.
 
the vocation error is a problem with the vocation set to your account manager in the database, you can change it to whatever you prefer and get rid of the error.
The other errors are on advancesave.lua and lowlevellock.lua, cant say what it is without the script.
Didn´t catch the error on your first items also, here is the one i use if you want to replace yours:

Code:
local storage = 87777
function onLogin(cid)
   local config = {
     voc_items = {
       { -- SORC
         {2190}, -- wand of vortex
       },
       { -- DRUID
         {2182}, -- snakebite rod
       },
       { -- PALADIN
         {2410}, -- throwing knife
       },
       { -- KNIGHT
         {8602}, -- jagged sword
       }
     },
     all_items = {
       {2478}, -- brass legs
       {2643} -- leather boots
       {2465} -- brass armor
       {2509} -- steel shield
       {2480}, -- legion helmet
     },
     extra_items = {
       {2789, 15},
       {2120},
       {2554}
     },
     knight_weapons = {
       {2439}, -- daramanian mace
       {8601} -- steel axe
     }
   }
   if getPlayerGroupId(cid) < 3 then
     if getPlayerStorageValue(cid, storage) == -1 then
       local common = config.voc_items[getPlayerVocation(cid)]
       if common ~= nil then
         for _, v in ipairs(common) do
           doPlayerAddItem(cid, v[1], v[2] or 1)
         end
       end
       
       local all = config.all_items
       if all ~= nil then
         for _, v in ipairs(all) do
           doPlayerAddItem(cid, v[1], v[2] or 1)
         end
       end
       
       local extra = config.extra_items
       local bp = doPlayerAddItem(cid, 1988, 1)
       if extra ~= nil then
         for _, v in ipairs(extra) do
           doAddContainerItem(bp, v[1], v[2] or 1)
         end
       end
       
       local weapons = config.knight_weapons
       if weapons ~= nil then
         for _, w in ipairs(weapons) do
           if isKnight(cid) then
             doAddContainerItem(bp, w[1], w[2] or 1)
           end
         end
       end
       
       setPlayerStorageValue(cid, storage, 1)
     end
   end
   return true
end
 
Back
Top