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

All new Weapon: Earth, Ice, Fire And Energy

Status
Not open for further replies.

Starmio

Starmio
Joined
Feb 9, 2008
Messages
167
Reaction score
2
Location
...
Hello, This Thread is up again.

Code:
just add it to your server ;)

Download the Weapons Here.
 
Last edited:
Did you tested it?

Because I think the weapons will dissappear after the 1000 charges are used.
And I don't think "showduration" is need, as the weapons don't have duration... and you forgot articles...

And to reduce the size of the post, you should only post the part of weapons.xml that contains the enchanted weapons...and you can make all the fire weapons use one file, all the energy weapons use another file and such... I will post em later here.

Anyways, nice job =D
 
Last edited:
@UP: Probably not you, you don't even have time to raise your post count in a good way :rolleyes:

I think this way is simplier(for weapons scripts):
Add this at the end of weapons.xml(before </weapons> of course)
Code:
<!-- enchanted weapons -->
	<melee id="7744" script="fire.lua"/> --spike sword
	<melee id="7763" script="ice.lua"/>
	<melee id="7854" script="earth.lua"/>
	<melee id="7869" script="energy.lua"/>

	<melee id="7747" level="35" unproperly="1" script="fire.lua"> //blacksteel sword
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7766" level="35" unproperly="1" script="ice.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7857" level="35" unproperly="1" script="earth.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7872" level="35" unproperly="1" script="energy.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>

	<melee id="7748" level="45" unproperly="1" script="fire.lua"> --dragon slayer
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7767" level="45" unproperly="1" script="ice.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7858" level="45" unproperly="1" script="earth.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7873" level="45" unproperly="1" script="energy.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>

	<melee id="7745" level="50" unproperly="1" script="fire.lua"/> --relic sword
	<melee id="7764" level="50" unproperly="1" script="ice.lua"/>
	<melee id="7855" level="50" unproperly="1" script="earth.lua"/>
	<melee id="7870" level="50" unproperly="1" script="energy.lua"/>

	<melee id="7746" level="60" unproperly="1" script="fire.lua"/> --mystic blade
	<melee id="7765" level="60" unproperly="1" script="ice.lua"/>
	<melee id="7856" level="60" unproperly="1" script="earth.lua"/>
	<melee id="7871" level="60" unproperly="1" script="energy.lua"/>

	<melee id="7754" level="20" unproperly="1" script="fire.lua"/> --clerical mace
	<melee id="7773" level="20" unproperly="1" script="ice.lua"/>
	<melee id="7864" level="20" unproperly="1" script="earth.lua"/>
	<melee id="7879" level="20" unproperly="1" script="energy.lua"/>

	<melee id="7755" level="35" unproperly="1" script="fire.lua"/> --crystal mace
	<melee id="7774" level="35" unproperly="1" script="ice.lua"/>
	<melee id="7865" level="35" unproperly="1" script="earth.lua"/>
	<melee id="7880" level="35" unproperly="1" script="energy.lua"/>

	<melee id="7757" level="35" unproperly="1" script="fire.lua"/> --orcish maul
	<melee id="7776" level="35" unproperly="1" script="ice.lua"/>
	<melee id="7867" level="35" unproperly="1" script="earth.lua"/>
	<melee id="7882" level="35" unproperly="1" script="energy.lua"/>

	<melee id="7758" level="50" unproperly="1" script="fire.lua"/> --war hammer
	<melee id="7777" level="50" unproperly="1" script="ice.lua"/>
	<melee id="7868" level="50" unproperly="1" script="earth.lua"/>
	<melee id="7883" level="50" unproperly="1" script="energy.lua"/>

	<melee id="7756" level="60" unproperly="1" script="fire.lua"/> --cranial basher
	<melee id="7775" level="60" unproperly="1" script="ice.lua"/>
	<melee id="7866" level="60" unproperly="1" script="earth.lua"/>
	<melee id="7881" level="60" unproperly="1" script="energy.lua"/>

	<melee id="7749" level="20" unproperly="1" script="fire.lua"/> --barbarian axe
	<melee id="7768" level="20" unproperly="1" script="ice.lua"/>
	<melee id="7859" level="20" unproperly="1" script="earth.lua"/>
	<melee id="7874" level="20" unproperly="1" script="energy.lua"/>

	<melee id="7750" level="25" unproperly="1" script="fire.lua"/> --knight axe
	<melee id="7769" level="25" unproperly="1" script="ice.lua"/>
	<melee id="7860" level="25" unproperly="1" script="earth.lua"/>
	<melee id="7875" level="25" unproperly="1" script="energy.lua"/>

	<melee id="7752" level="35" unproperly="1" script="fire.lua"> --headchopper
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7771" level="35" unproperly="1" script="ice.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7862" level="35" unproperly="1" script="earth.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7877" level="35" unproperly="1" script="energy.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>

	<melee id="7751" level="60" unproperly="1" script="fire.lua"/> --heroic axe
	<melee id="7770" level="60" unproperly="1" script="ice.lua"/>
	<melee id="7861" level="60" unproperly="1" script="earth.lua"/>
	<melee id="7876" level="60" unproperly="1" script="energy.lua"/>

	<melee id="7753" level="65" unproperly="1" script="fire.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7772" level="65" unproperly="1" script="ice.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7863" level="65" unproperly="1" script="earth.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<melee id="7878" level="65" unproperly="1" script="energy.lua">
		<vocation name="Knight"/>
		<vocation name="Elite Knight" showInDescription="0"/>
	</melee>
	<distance id="7838" level="20" unproperly="1" script="flash arrow.lua"/>
	<distance id="7839" level="20" unproperly="1" script="shiver arrow.lua"/>
	<distance id="7840" level="20" unproperly="1" script="flaming arrow.lua"/>
	<distance id="7850" level="20" unproperly="1" script="earth arrow.lua"/>

Now, add these to weapons/scripts:
fire.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(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, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
energy.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(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, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
earth.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STONES)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(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, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
ice.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(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, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
shiver arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SHIVERARROW)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
	local level = getPlayerLevel(cid)
	local attack = 25
	local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)
	
	local min = 0
	local max = -(attack/20*skill+attack+skill+level/10)/10*10

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
flaming arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FLAMMINGARROW)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
	local level = getPlayerLevel(cid)
	local attack = 25
	local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)
	
	local min = 0
	local max = -(attack/20*skill+attack+skill+level/10)/10*10

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
flash arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FLASHARROW)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
	local level = getPlayerLevel(cid)
	local attack = 25
	local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)
	
	local min = 0
	local max = -(attack/20*skill+attack+skill+level/10)/10*10

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
earth arrow.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STONES)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTHARROW)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
	local level = getPlayerLevel(cid)
	local attack = 25
	local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)
	
	local min = 0
	local max = -(attack/20*skill+attack+skill+level/10)/10*10

	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")

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

Change the formulas if you want.
 
Looking good fellows!
Going to try it out soon :)

Good job.
 
If there isnt ready action in package you have to make it yourself :(
 
Hello @ AGS you script are bealtifull, but your formulas don't modifi atk of weapons, only make a efect and lower atack, i want to make a best skill atk with this, are you make it???

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

------

With this all enchanted weapons don't make a best atk, only magic atk...

please help us to make a great atk for weapons...
 
Yeah, I had a mistake in the formula, use this:

local max = -(weaponAttack/20*weaponSkill+weaponAttack+weaponSkill+level/10)/10*(attackStrength/10)
 
Anyone know what i should write in the Items.xml so it shows charges and decaying into the original weapon after charges are over? =)

any help is apreciated as im strugeling with it without succes..

This is what i use for my Barbarian axe and it doesn't work (not showing charges and the weapon dissapear after the charges are over)

Code:
	<item id="7768" article="a" name="barbarian axe">
		<attribute key="weight" value="5100"/>
		<attribute key="defense" value="18"/>
		<attribute key="attack" value="28"/>
		<attribute key="weaponType" value="axe"/>
		<attribute key="extradef" value="1"/>
		<attribute key="decayTo" value="2429"/>
		<attribute key="charges" value="10"/>
		<attribute key="showduration" value="1"/>
		<attribute key="description" value="It is temporarily enchanted with ice"/>
	</item>

//Massen
 
<attribute key="showcharges" value="1"/>

It's supposed to work, but seems like weapons are not supported, maybe in the next TFS version.
 
I may post tomorrow full release of my elemental system.
Everything works great except item charges (maximum allowed by OTServ is 255...)

Btw, damage you can do like this:

fire.lua
Code:
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, 0, 0.8, 0)

local elementalCombat = createCombatObject()
setCombatParam(elementalCombat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatFormula(elementalCombat, COMBAT_FORMULA_SKILL, 0.0, 0, 0.2, 0)

function onUseWeapon(cid, var)
	return doMultiCombat(cid, {combat, elementalCombat}, var)
end

and add to global.lua:
Code:
function doMultiCombat(cid, combatArray, var)
	for x = 0, #combatArray do   
		doCombat(cid, combatArray[x], var)
	end
end
 
Last edited:
@ up...

This is the error i get when I use your script. Any suggestions?



Code:
Lua Script Error: [Weapon Interface]
data/weapons/scripts/fire.lua:onUseWeapon

luaDoCombat(). Combat not found
 
<attribute key="showcharges" value="1"/>

It's supposed to work, but seems like weapons are not supported, maybe in the next TFS version.


Umm i see...


@up
What is that script doing?
 
Status
Not open for further replies.
Back
Top