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

Lua [Request] fix my burst arrow damage

dudie

Member
Joined
May 23, 2016
Messages
128
Reaction score
12
Someone could help me to fix my burst arrow damage?

Code:
[17:31:01.655] [Error - Weapon Interface]
[17:31:01.655] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[17:31:01.656] (Unknown script file)
[17:31:01.656] Description:
[17:31:01.656] data/weapons/scripts/burst_arrow.lua:18: attempt to perform arithmetic on upvalue 'atk' (a nil value)

[17:31:04.120] [Error - Weapon Interface]
[17:31:04.120] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[17:31:04.120] (Unknown script file)
[17:31:04.120] Description:
[17:31:04.120] data/weapons/scripts/burst_arrow.lua:18: attempt to perform arithmetic on upvalue 'atk' (a nil value)

burst arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

local atk

function onGetFormulaValues(cid, level, skill, attack, factor)
   min = (attack * 10.0) * -1
   max = (attack * 10.0) * -1
   return atk
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onGetFormulaValues(cid, level, maglevel)
   min = ( (((maglevel * 1) * 0.5) + ( atk ) )) * -1
   max = ( (((maglevel * 1) * 1.0) + ( atk ) )) * -1
   return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end
 
I tried
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

function onGetPlayerMinMaxValues(cid, weaponSkill, weaponAttack, attackStrength)
   --local magic = getPlayerMagLevel(cid)
   --min = (magic * 1) * -1
   --max = (magic * 1) * -1
   min = (weaponAttack * 1) * -1
   max = (weaponAttack * 1) * -1
  return min, max
end

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end

And no damage too :(
Copy paste the script, and update the function with my post from here.
 
Copy paste the script, and update the function with my post from here.

How could i get weapon attack like
Code:
01:54 You see a bow (Range:6, Atk +1).
It weighs 31.00 oz.
ItemID: [2456].
Position: [X: 962] [Y: 1037] [Z: 6].

Code:
function onGetPlayerMinMaxValues(cid, weaponSkill, weaponAttack, attackStrength)
  local magic = getPlayerMagLevel(cid)
  -- local damage = (attack / 20 * (skill + magic) * 2 + attack + level / 10) / 10 * 1
  local damage = (weaponAttack * 10) * 1
  return 0, damage
end

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

function onUseWeapon(cid, var)
  return doCombat(cid, combat, var)
end
 
How could i get weapon attack like
Code:
01:54 You see a bow (Range:6, Atk +1).
It weighs 31.00 oz.
ItemID: [2456].
Position: [X: 962] [Y: 1037] [Z: 6].

Code:
function onGetPlayerMinMaxValues(cid, weaponSkill, weaponAttack, attackStrength)
  local magic = getPlayerMagLevel(cid)
  -- local damage = (attack / 20 * (skill + magic) * 2 + attack + level / 10) / 10 * 1
  local damage = (weaponAttack * 10) * 1
  return 0, damage
end

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

function onUseWeapon(cid, var)
  return doCombat(cid, combat, var)
end
Looking into it..
But I assume the best option at the moment would be to simply make a new script for each weapon and edit the 'attack' in the script to the bow damage.
Not ideal.. but best I can think of at the moment.

if you add

print(weaponAttack)
Does it print the bow's damage value?
hell, just do all (inside function)

print("cid: " .. cid) -- will be a random number
print("weaponSkill: " .. weaponSkill) -- should be your distance skill, I assume
print("weaponAttack: " .. weaponAttack) -- should be the bow dmg?
print("attackStrength: " .. attackStrength) -- ammo dmg?

Try with different bows, and find out what changes.

I'm terrible with weapons.xml .. I'm just trying to help. :p
 
Couldn't you use
Code:
getItemAttack((getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid))
if weaponAttack doesn't work?
(Checking both hands, of course)
 
Couldn't you use
Code:
getItemAttack((getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid))
if weaponAttack doesn't work?
(Checking both hands, of course)
Probably.
I'm just wondering if it's pre-loaded into var already, so we don't have to use work-arounds.
If I was home I'd test myself, but meh.

-- edit,

I see your edit now. xD
too fast on the trigger. :x :p
 
How!?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

function onGetFormulaValues(cid, level, skill, attack, factor)
   -- get magic level
   local magic = getPlayerMagLevel(cid)
   -- get weapon attack
   local item1 = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
   local item2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
   local atk, atk1, atk2 = 0, 0, 0
   if item1.uid ~= 0 then
     atk1 = getItemAttack(item1.uid)
   end
   if item2.uid ~= 0 then
     atk2 = getItemAttack(item2.uid)
   end
   if atk1 > atk2 then
     atk = atk1
   else
     atk = atk2
   end
   -- get min / max
   min = (atk * 1 + magic * 1) * -1
   max = (atk * 1 + magic * 1) * -1
   return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end

Code:
[2:30:14.330] [Error - Weapon Interface]
[2:30:14.330] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[2:30:14.330] (Unknown script file)
[2:30:14.330] Description:
[2:30:14.330] data/weapons/scripts/burst_arrow.lua:16: attempt to call global 'getItemAttack' (a nil value)

[2:30:16.460] [Error - Weapon Interface]
[2:30:16.460] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[2:30:16.460] (Unknown script file)
[2:30:16.460] Description:
[2:30:16.460] data/weapons/scripts/burst_arrow.lua:16: attempt to call global 'getItemAttack' (a nil value)
 
Why do you need it to get the item attack anyways?
You can do the exact same thing by putting the attack value into the script instead of making it this hard.
 
How!?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

function onGetFormulaValues(cid, level, skill, attack, factor)
   -- get magic level
   local magic = getPlayerMagLevel(cid)
   -- get weapon attack
   local item1 = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
   local item2 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
   local atk, atk1, atk2 = 0, 0, 0
   if item1.uid ~= 0 then
     atk1 = getItemAttack(item1.uid)
   end
   if item2.uid ~= 0 then
     atk2 = getItemAttack(item2.uid)
   end
   if atk1 > atk2 then
     atk = atk1
   else
     atk = atk2
   end
   -- get min / max
   min = (atk * 1 + magic * 1) * -1
   max = (atk * 1 + magic * 1) * -1
   return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end

Code:
[2:30:14.330] [Error - Weapon Interface]
[2:30:14.330] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[2:30:14.330] (Unknown script file)
[2:30:14.330] Description:
[2:30:14.330] data/weapons/scripts/burst_arrow.lua:16: attempt to call global 'getItemAttack' (a nil value)

[2:30:16.460] [Error - Weapon Interface]
[2:30:16.460] In a callback: data/weapons/scripts/burst_arrow.lua:onGetFormulaValues
[2:30:16.460] (Unknown script file)
[2:30:16.460] Description:
[2:30:16.460] data/weapons/scripts/burst_arrow.lua:16: attempt to call global 'getItemAttack' (a nil value)
Why do you keep going back to your broken code?
Use the updated code and tell us what it prints to your console.
 
Why do you keep going back to your broken code?
Use the updated code and tell us what it prints to your console.
Doesn't matter that he's using broken code in this situation.
I made script myself and tried to print every single thing, and it stopped at getItemAttack
Function must be broken.
 
Doesn't matter that he's using broken code in this situation.
I made script myself and tried to print every single thing, and it stopped at getItemAttack
Function must be broken.
It'd probably work if you did it like this instead
Code:
local weapon_damage = getItemAttribute(getPlayerWeapon(cid, true).uid, "attack") -- true = ignore ammo
 
It'd probably work if you did it like this instead
Code:
local weapon_damage = getItemAttribute(getPlayerWeapon(cid, true).uid, "attack") -- true = ignore ammo
Doesn't work, I don't think getItemAttribute exists in 0.3.6
Script:
//Note: I did try local Damage = getItemAttribute(getPlayerWeapon(cid, true).uid, "attack"), same error.
//Another note: Yes, I do have the weapon in the correct hand (Right hand)

Code:
function onGetFormulaValues(cid, level, skill, attack, factor)
    -- Misc --
    print("ID -> " .. BowID)
    local Magic = getPlayerMagLevel(cid)
    print("Magic Level -> " .. Magic)
    local SlotLEFT = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
    local SlotRIGHT = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
    print("Left Slot ID -> " .. SlotLEFT.itemid)
    print("Right Slot ID -> " .. SlotRIGHT.itemid)
    local Damage = getItemAttribute(SlotRIGHT.uid, "attack")
    print("Attack -> " .. Damage)

    -- Damage --
    local dmgMIN = (Damage * 0.5 + Magic * 0.5)
    local dmgMAX = (Damage * 1 + Magic * 1)

    return -dmgMIN, -dmgMAX
end

local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
    setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
    setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
    setCombatArea(combat, area)

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
Console:
Code:
[06/06/2016 01:21:54] ID -> 12649
[06/06/2016 01:21:54] Magic Level -> 1
[06/06/2016 01:21:54] Left Slot ID -> 0
[06/06/2016 01:21:54] Right Slot ID -> 12649

[06/06/2016 01:21:54] [Error - Weapon Interface]
[06/06/2016 01:21:54] In a callback: data/weapons/scripts/Testing.lua:onGetFormulaValues
[06/06/2016 01:21:54] (Unknown script file)
[06/06/2016 01:21:54] Description:
[06/06/2016 01:21:54] data/weapons/scripts/Testing.lua:12: attempt to concatenate local 'Damage' (a nil value)
 
@dudie if read carefully your thread about wands that i helped you out to solve you will figure out how to make it.

I've tried bro, not work... I tested function like i gave me...
Not work using bows
Code:
04:07 You see a bow (Range:6, Atk +1).
It weighs 31.00 oz.
ItemID: [2456].
Position: [X: 1030] [Y: 1016] [Z: 7].

Code:
04:07 You see a +3 bow (Range:6, Atk +10).
It weighs 31.00 oz.
ItemID: [2456].
Position: [X: 1030] [Y: 1016] [Z: 7].

That's your base script:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

function onGetFormulaValues(cid, level, skill, attack, factor)
   min = (attack * 10) * -1
   max = (attack * 10) * -1
   return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end

There is no damage
 
EDIT: This probably won't happen without source edits or some complex scripting, cause you're asking for a script that counts extraAttack, and the functions that check item attrs are broken (unless they're fixed in 0.4, in which case my testing stops for now cause I don't have an 0.4 test server set up)
 
Last edited:
Set up a 0.4 test server, turns out the attack on bows look different from 0.3.6 for some reason (+ x), anyways here's the script
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)

function onGetFormulaValues(cid, level, skill, attack, factor)
    local maglevel = getPlayerMagLevel(cid)
   min = attack + maglevel
   max = attack + maglevel
   return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})

setCombatArea(combat, area)

function onUseWeapon(cid, var)
   return doCombat(cid, combat, var)
end
If it doesn't work, there's something with either your weapons.xml or your items.xml
 
Use getPlayerSlotItem in conjunction with getItemInfo, getItemInfo's properties are.
Code:
int32_t LuaScriptInterface::luaGetItemInfo(lua_State* L)
{
    //getItemInfo(itemid)
    const ItemType* item;
    if(!(item = Item::items.getElement(popNumber(L))))
    {
        lua_pushboolean(L, false);
        return 1;
    }

    lua_newtable(L);
    setFieldBool(L, "stopTime", item->stopTime);
    setFieldBool(L, "showCount", item->showCount);
    setFieldBool(L, "clientCharges", item->clientCharges);
    setFieldBool(L, "stackable", item->stackable);
    setFieldBool(L, "showDuration", item->showDuration);
    setFieldBool(L, "showCharges", item->showCharges);
    setFieldBool(L, "showAttributes", item->showCharges);
    setFieldBool(L, "distRead", item->allowDistRead);
    setFieldBool(L, "readable", item->canReadText);
    setFieldBool(L, "writable", item->canWriteText);
    setFieldBool(L, "forceSerialize", item->forceSerialize);
    setFieldBool(L, "vertical", item->isVertical);
    setFieldBool(L, "horizontal", item->isHorizontal);
    setFieldBool(L, "hangable", item->isHangable);
    setFieldBool(L, "usable", item->useable);
    setFieldBool(L, "movable", item->moveable);
    setFieldBool(L, "pickupable", item->pickupable);
    setFieldBool(L, "rotable", item->rotable);
    setFieldBool(L, "replacable", item->replaceable);
    setFieldBool(L, "hasHeight", item->hasHeight);
    setFieldBool(L, "blockSolid", item->blockSolid);
    setFieldBool(L, "blockPickupable", item->blockPickupable);
    setFieldBool(L, "blockProjectile", item->blockProjectile);
    setFieldBool(L, "blockPathing", item->blockPathFind);
    setFieldBool(L, "allowPickupable", item->allowPickupable);
    setFieldBool(L, "alwaysOnTop", item->alwaysOnTop);

    createTable(L, "floorChange");
    for(int32_t i = CHANGE_FIRST; i <= CHANGE_LAST; ++i)
    {
        lua_pushnumber(L, i);
        lua_pushboolean(L, item->floorChange[i - 1]);
        pushTable(L);
    }

    pushTable(L);
    setField(L, "magicEffect", (int32_t)item->magicEffect);
    setField(L, "fluidSource", (int32_t)item->fluidSource);
    setField(L, "weaponType", (int32_t)item->weaponType);
    setField(L, "bedPartnerDirection", (int32_t)item->bedPartnerDir);
    setField(L, "ammoAction", (int32_t)item->ammoAction);
    setField(L, "combatType", (int32_t)item->combatType);
    setField(L, "corpseType", (int32_t)item->corpseType);
    setField(L, "shootType", (int32_t)item->shootType);
    setField(L, "ammoType", (int32_t)item->ammoType);

    createTable(L, "transformUseTo");
    setField(L, "female", item->transformUseTo[PLAYERSEX_FEMALE]);
    setField(L, "male", item->transformUseTo[PLAYERSEX_MALE]);

    pushTable(L);
    setField(L, "transformToFree", item->transformToFree);
    setField(L, "transformEquipTo", item->transformEquipTo);
    setField(L, "transformDeEquipTo", item->transformDeEquipTo);
    setField(L, "clientId", item->clientId);
    setField(L, "maxItems", item->maxItems);
    setField(L, "slotPosition", item->slotPosition);
    setField(L, "wieldPosition", item->wieldPosition);
    setField(L, "speed", item->speed);
    setField(L, "maxTextLength", item->maxTextLen);
    setField(L, "writeOnceItemId", item->writeOnceItemId);
    setField(L, "attack", item->attack);
    setField(L, "extraAttack", item->extraAttack);
    setField(L, "defense", item->defense);
    setField(L, "extraDefense", item->extraDefense);
    setField(L, "armor", item->armor);
    setField(L, "breakChance", item->breakChance);
    setField(L, "hitChance", item->hitChance);
    setField(L, "maxHitChance", item->maxHitChance);
    setField(L, "runeLevel", item->runeLevel);
    setField(L, "runeMagicLevel", item->runeMagLevel);
    setField(L, "lightLevel", item->lightLevel);
    setField(L, "lightColor", item->lightColor);
    setField(L, "decayTo", item->decayTo);
    setField(L, "rotateTo", item->rotateTo);
    setField(L, "alwaysOnTopOrder", item->alwaysOnTopOrder);
    setField(L, "shootRange", item->shootRange);
    setField(L, "charges", item->charges);
    setField(L, "decayTime", item->decayTime);
    setField(L, "attackSpeed", item->attackSpeed);
    setField(L, "wieldInfo", item->wieldInfo);
    setField(L, "minRequiredLevel", item->minReqLevel);
    setField(L, "minRequiredMagicLevel", item->minReqMagicLevel);
    setField(L, "worth", item->worth);
    setField(L, "levelDoor", item->levelDoor);
    setField(L, "name", item->name.c_str());
    setField(L, "plural", item->pluralName.c_str());
    setField(L, "article", item->article.c_str());
    setField(L, "description", item->description.c_str());
    setField(L, "runeSpellName", item->runeSpellName.c_str());
    setField(L, "vocationString", item->vocationString.c_str());

    createTable(L, "abilities");
    setFieldBool(L, "manaShield", item->abilities.manaShield);
    setFieldBool(L, "invisible", item->abilities.invisible);
    setFieldBool(L, "regeneration", item->abilities.regeneration);
    setFieldBool(L, "preventLoss", item->abilities.preventLoss);
    setFieldBool(L, "preventDrop", item->abilities.preventDrop);
    setField(L, "elementType", (int32_t)item->abilities.elementType);
    setField(L, "elementDamage", item->abilities.elementDamage);
    setField(L, "speed", item->abilities.speed);
    setField(L, "healthGain", item->abilities.healthGain);
    setField(L, "healthTicks", item->abilities.healthTicks);
    setField(L, "manaGain", item->abilities.manaGain);
    setField(L, "manaTicks", item->abilities.manaTicks);
    setField(L, "conditionSuppressions", item->abilities.conditionSuppressions);

    //TODO: absorb, increment, reflect, skills, skillsPercent, stats, statsPercent

    pushTable(L);
    setField(L, "group", (int32_t)item->group);
    setField(L, "type", (int32_t)item->type);
    setFieldFloat(L, "weight", item->weight);
    return 1;
}
Also the weapon types might come in handy as well.
Code:
enum WeaponType_t
{
WEAPON_NONE = 0,
WEAPON_SWORD = 1,
WEAPON_CLUB = 2,
WEAPON_AXE = 3,
WEAPON_SHIELD = 4,
WEAPON_DIST = 5,
WEAPON_WAND = 6,
WEAPON_AMMO = 7,
WEAPON_FIST = 8
};
 
For reference.. Now that I'm home to see how I did it previously.. :p
And it seems Omni came to the same conclusion..
Code:
getItemInfo(itemEx.itemid).attack
-- You can decide how best to find the item
 
15dggm.jpg
 
Back
Top