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

problem adding a spell to The Forgotten server 8.22

baskplaya120

New Member
Joined
Aug 19, 2008
Messages
16
Reaction score
0
I am trying to add a super exori this is my lua file for it
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMLA_SKILL, 0, -90, 0.7, -50)

local are =area createCombatArea(AREA_SQUARE5x5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
And in my xml file i have this.
<instant name="super exori" words="uber exori" lvl="70" manapercent="50" exhaustion="100" needlearn"100" script="custum/super exori.lua">

Everytime that i try and start my server it debugs and says "The Forgotten server has quit working" how do i do this i am out of ideas . Thank you for you help
 
You have a spelling mistake:

On super exori.lua replace:
Code:
local are =area createCombatArea(AREA_SQUARE5x5)
setCombatArea(combat, area)

with:
Code:
local area = createCombatArea(AREA_SQUARE5X5)
setCombatArea(combat, area)
 
ok i just tried it again and it is doing the same thing .. ill copy and paste both files again
super exori. lua
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMLA_SKILL, 0, -90, 0.7, -50)

local area = createCombatArea(AREA_SQUARE5x5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
and my xml is
<instant name="Super Exori" words="uber exori" lvl="70" manapercent="60" exhaustion="100" needlearn="0"

script="custom/super exori.lua">
<vocation name="Knight"/>
<vocation name="Elite Knight"/>
</instant>
 
Try replacing the XML part with this:

<instant name="Super Exori" words="uber exori" lvl="70" manapercent="60" prem="0" needweapon="0" exhaustion="2000" needlearn="0" script="custom/super exori.lua">
<vocation name="Knight" />
<vocation name="Elite Knight" />
</instant>

A bit on info on what I added (Took them from default Berserk spell from 0.2.14)
needweapon="0" -- 0 means no weapon needed to cast this spell. 1 means you must be wielding a weapon.
exhaustion="2000" -- The exhaustion.
prem="0" -- 0 means you don't need a premium account to cast it, 1 means you do.

Haven't tested it but it should work.
 
Nope, im out of ideas but here is the original codes I used to try to figure out your problem:

spells/scripts/attack/berserk.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -90, 0.7, -50)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

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

In spells.xml
Code:
	<instant name="Berserk" words="exori" lvl="35" mana="115" prem="1" needweapon="1" exhaustion="2000" needlearn="0" script="attack/berserk.lua">
		<vocation name="Knight" />
		<vocation name="Elite Knight" />
	</instant>

The only changes you are using are "manapercent" instead of "mana", area and names.

Good luck,
Pazzur
 
ok here is my new script for it.It still doesnt work but its getting close. when i try to use it in the game, it takes mana away but there is no animation and it doesnt do any damage so i know its gettin close can anyone tell me what wrong in this?
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE,COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT,CONST_ME_GROUNDSHAKER)
setCombatParam(combat, COMBAT_PARAM_EFFECT,CONST_ANI_DEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.0, -100, 1.6, -400)

arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

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

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Try this one, Im using it as an Energy Exori on my server. Just modified it abit.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
	min = -(level * 32) / 10
	max = -(level * 48.5) / 10
 
	return min, max
end
 
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
local arr = {
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1}
}
 
local area = createCombatArea(arr)
setCombatArea(combat, area)
 
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Back
Top