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

Get weapons attack power

Squirrelgun

New Member
Joined
May 2, 2009
Messages
15
Reaction score
0
Code:
function finalDamage(cid)
    local magicLevel = getPlayerMagLevel(cid)
	local distSkill = getPlayerSkill(cid, 4)
    local damage = (-(magicLevel*distSkill))*4/20 -- Damage formula

    return damage*0.8, damage
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "finalDamage")

This is the damage my spell does. I'd like to be able to use the currently equipped weapon's attack power in the formula too.
Is there a function like getWeaponDamage?

Edit: And if there isn't, how would I go about adding the function getWeaponDamage?
Thanks in advance! : )
 
You have some options

getItemAttack(uid)
getItemExtraAttack(uid)
getItemDefense(uid)
getItemExtraDefense(uid)
getItemArmor(uid)
getItemAttackSpeed(uid)
getItemHitChance(uid)

you could do
PHP:
local weap1 = getPlayerSlotItem(cid, 5)
local weap2 = getPlayerSlotItem(cid, 6)
local atack = ""
if (getItemAttack(weap1)==0) then
    atack = getItemAttack(weap2)
else
    atack = getItemAttack(weap1)
end
 
Last edited:
Wow I was totally unaware of those. Thanks mate :D

Edit: I just tried them. It seems they don't exist on Mystic Spirit. Sigh.
Is there any other way?
 
Last edited:
I wish there was a library for ALL of options for those scripts...I'm having the same problem trying to make a stronger exori spell.
 
Back
Top