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

Again about weapons formulas ;>

Fare

Advanced OT User
Joined
Apr 3, 2008
Messages
2,387
Reaction score
151
Location
Ukraine
I want to use scripts in weapons, but I don't want to lose source formulas, is that script for weapon is accurate to source formula? :

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 1.0, 0)


also I want to know distance formula? How can I use it in script to be accurate with source formula? :D


@Elf, plizzzz ))) I beg you ;D
 
Try setCombatFormula(combat, COMBAT_FORMULA_SKILL , -1.1, 0, -1.1, 0)
 
viper star.lua :
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_GREENSTAR)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , -1.1, 0, -1.1, 0)

local xCombat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 4, 2000, -2)
addDamageCondition(condition, 6, 2000, -1)
setCombatCondition(xCombat, condition)

function onUseWeapon(cid, var)
	local ret = doCombat(cid, combat, var)
	if(ret == LUA_ERROR) then
		return LUA_ERROR
	end

	local target = variantToNumber(var)
	if(target ~= 0) then
		-- chance to poison the enemy
		local chance = math.random(0, 100)
		if(chance > 90) then
			ret = doCombat(cid, xCombat, var)
		end
	end
	return ret
end

my hits always 0(sparks).
Also I asked someone who know sources, Is that weapon script accurate to source weapon damage formula?
 
PHP:
function getWeaponDamage(cid, weaponSkill, weaponAttack, attackStrength)
	local level = getPlayerLevel(cid)

	local min = 0
	local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*10

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getWeaponDamage")

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

and comment/remove this line
PHP:
setCombatFormula(combat, COMBAT_FORMULA_SKILL , -1.1, 0, -1.1, 0)
(--)
 
@Marcinek Paladinek i love you xD thanks!
p.s. it is for distance? melee?
 
Guess they are the same for dist and melee.
 
@Marcinek Paladinek
your formula works fine for melee, and for spears\stars, but hits with bolts\arrows are so low, did you got same formula? it works?
 
I havent edited any of my scripts with that nor any other formula.
 
Back
Top