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

Bonus Attack on weapons..

Santy

Member
Joined
Aug 14, 2007
Messages
654
Reaction score
22
This script makes weapons have extra attacks, elements attacks, just like in Diablo II..

Add this script to weapons

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 1000, -15)
addDamageCondition(condition, 1, 1000, -10)
addDamageCondition(condition, 1, 1000, -5)
setCombatCondition(combat, condition)

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

And add this to weapons.xml

Code:
<!-- Melee weapons -->
<melee id="2392" range="1" level="1" mana="0" enabled="1" exhaustion="0" script="fire sword.lua"><vocation id="4"/><vocation id="8"/></melee>

P.S I made it so only knights can have extra elements dmg, so vocations can be more balanced..
 
can u plz explain this to noobs (like me) like every line what it does ... so that i can make some for other weps ... and can u also show me how to make a paralyze attack on a for example a crystal arrow ?
Thanks
Kimo
 
Nice man, I was suggesting stuff like this years ago ;p Too bad I can't test it :p
 
it hit the self damage -.-, i want to add a bonus, like Has a 10% chance of burn the attacked creature, and the other 90% normal attack, can somebody help?
 
Last edited:
Thank you, really needed this :D

100 Post Btw :D
 
how to add the random?????????, can you give me the script with the bonus? ^^
 
how to add the random?????????, can you give me the script with the bonus? ^^

Try this one, and tell me if it works.
Code:
local random = math.random(1, 100)

if random < 90 then

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)

elseif random > 89 then

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 1000, -15)
addDamageCondition(condition, 1, 1000, -10)
addDamageCondition(condition, 1, 1000, -5)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    doCombat(cid, combat, var)
end
 
somebody can help?
Code:
Warning: [Event::loadScript] Can not load script. data/weapons/scripts/fire.lua
data/weapons/scripts/fire.lua:24: 'end' expected (to close 'if' at line 3) near '<eof>'
 
Last edited:
Code:
local random = math.random(1, 100)

if random < 90 then

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
end

elseif random > 89 then

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 1000, -15)
addDamageCondition(condition, 1, 1000, -10)
addDamageCondition(condition, 1, 1000, -5)
setCombatCondition(combat, condition)
end

function onUseWeapon(cid, var)
    doCombat(cid, combat, var)
end
 
omg, help plz!!!! ^^'
Code:
Warning: [Event::loadScript] Can not load script. data/weapons/scripts/fire.lua
data/weapons/scripts/fire.lua:10: '<eof>' expected near 'elseif'
 
Try this one :p..

Code:
local random = math.random(1, 100)

if random < 90 then

	local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
else
	local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)

		local condition = createConditionObject(CONDITION_FIRE)
		setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
		addDamageCondition(condition, 1, 1000, -15)
		addDamageCondition(condition, 1, 1000, -10)
		addDamageCondition(condition, 1, 1000, -5)
		setCombatCondition(combat, condition)
	end
end

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

If it doesn't work remove an end (the first one) and the extra big lines from the 4rth local.
 
it simply do not attack xD, it does not work, and i don't know if i have put good on weapons.xml:
Code:
	<melee id="2392" range="1" level="20" mana="0" enabled="1" exhaustion="0" script="fire sword.lua" unproperly="1" function="internalLoadWeapon"/>

Code:
luaDoCombat(). Combat not found

Lua Script Error: [Weapon Interface] 
data/weapons/scripts/fire sword.lua:onUseWeapon
 
Lol u don't hafta put that in weapons.xml.. check at my first post..
 
but if i put the self in your first post it is not compatible with forgotten server, it is for evolutions
 
Code:
local random = math.random(1, 100)

if random < 90 then
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
else
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
end

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 1000, -15)
addDamageCondition(condition, 1, 1000, -10)
addDamageCondition(condition, 1, 1000, -5)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    doCombat(cid, combat, var)
end
I think this one is correct
 
Code:
local random = math.random(1, 100)

if random < 90 then
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
else
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 0, 0)
end

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 1000, -15)
addDamageCondition(condition, 1, 1000, -10)
addDamageCondition(condition, 1, 1000, -5)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
    doCombat(cid, combat, var)
end
I think this one is correct
Not really, its always gonig to cast the condition.
 
Back
Top