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

Shooting Sword

mucha2222

New Member
Joined
May 25, 2010
Messages
2
Reaction score
0
Location
Poland
Hello i need sword who can attack from distance with ice xD

this is posible?



Sorry for my english. ;D
 
Of course it is. I have a sword with 2 sqm range...

Go to weapons xml and find id of your sword(if there isn't it yet then add this) and replace it with this:

Code:
<melee id="xxx" level="8" script="sword.lua" function="default">
		<vocation name="knight"/>
		<vocation name="elite knight"/>
	</melee>
And that it's. Fill there id and level.
and now go to scripts/sword.lua
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1.8, 2.1, 1.9, 2)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
And Write damages and effects and damage what do you want :D

Then go to items.xml and add these lines:
Code:
<attribute key="range" value="2"/>
Change range for what do you want :P
 
Ok, make it Like up, but change the script in weapons/sword.lua na ten:
Code:
local combat = createCombatObject() 
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) 
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) 
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1.8, 2.1, 1.9, 2) 

local distanceCombat = createCombatObject() 
setCombatParam(distanceCombat, COMBAT_PARAM_BLOCKARMOR, 1) 
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) 
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE) 
setCombatFormula(distanceCombat, COMBAT_FORMULA_SKILL, 1.8, 2.1, 1.9, 2) 


function onUseWeapon(cid, var)
	if(getDistanceBetween(cid, getCreatureTarget(cid) >=2)) then
		return doCombat(cid, distanceCombat, var)
	end
	return doCombat(cid, combat, var)
end
Should work :D
 
Last edited:
Back
Top