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

Titanium sov

SirTitan

Member
Joined
May 4, 2008
Messages
262
Reaction score
9
Location
Germany/Dortmund
I got diffirent weapons on my server that got special power.
But u need to enchant them to +2 to reach the power.
Here are one of some scripts that i did created for annihilator items.

What id does?

When ur sword skill is high enough u got a chance that your magic sword does an area damage.


add this to weapon script folder-> sov.lua
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 29)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 0, 0, 4, 0)






local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0, 0, 1, 0)



local arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 3, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0}

}

local area = createCombatArea(arr)
setCombatArea(combat1, area)



function onUseWeapon(cid, var)
	pos = getPlayerPosition(cid)
	swordskill = getPlayerSkill(cid,2)
	rand = math.random(1,100)
	if swordskill < 35 then
		if rand >= 95 then
			doSendAnimatedText(pos,"Giantcut",math.random(1,255))
			return doCombat(cid, combat1, var) 
		else
			doCombat(cid, combat2, var) 
		end
	elseif swordskill >= 35 and swordskill < 55 then
		if rand >= 93 then
			doSendAnimatedText(pos,"Giantcut",math.random(1,255))
			return doCombat(cid, combat1, var) 
		else
			doCombat(cid, combat2, var) 
		end
	elseif swordskill >= 55 and swordskill < 75 then
		if rand >= 90 then
			doSendAnimatedText(pos,"Giantcut",math.random(1,255))
			return doCombat(cid, combat1, var) 
		else
			doCombat(cid, combat2, var) 
		end
	elseif swordskill >= 75 then
		if rand >= 85 then
			doSendAnimatedText(pos,"Giantcut",math.random(1,255))
			return doCombat(cid, combat1, var) 
		else
			doCombat(cid, combat2, var) 
		end
	end
end


add to weapons.xml
Code:
<melee id="2400" level="50" unproperly="1" enabled="1" function="internalLoadWeapon" script="sov.lua"/>


if u got allredy itemscript for id 2400 in your weapons.xml declared, remove the old line.

Have fun with that.

visit my server:
http://titanium.no-ip.org
 
Last edited:
ty for releasing it here ^^ (but does it work to TFS) i can't real test since my server is under C++ codding)
 
Last edited:
Haha, i canttest it under tfs too because i try to compile tfs 2 days now but got problems with LuaSQL thing.
But i guess it should work, because it works with basic lua functions
 
Last edited:
Why not just download the precompiled TFS then? ^.-

@Ontopic: Nice script, haven't really tried making weapon scripts, but maybe I should. ;P
 
Solved,
I did downloaded the tfs dev-cpp but because i did not uninstalled other dev-cpp it would not work.
But now im happy ;).


Im glad that u like my script ;)
 

Similar threads

Back
Top