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

Lua make wand shot in a area?

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
hey i need help im gona make a new wand and i want the wand to shoot in a area but im using this kind a script!
This is added in weapons!
can i do tha itack a target then i hit around it also?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -50000, 0, -100000)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
 
Well just make sure you have the wand in your items.xml as well for range that you want it to be able to shoot. and then you need to do a combat area. So your lua code should looks something like this

Add to weapons.xml
Code:
<wand id="7958" level="100" mana="50" script="new wand.lua"> <!-- Your new Wand -->
	<vocation name="Druid"/>
	<vocation name="Elder Druid"/>
	<vocation name="Sorcerer"/>
	<vocation name="Master Sorcerer"/>
</wand>

Add or change item in items.xml
Code:
<item id="7958" article="a" name="jester wand">
	<attribute key="description" value="funny how powerfull this is"/>
	<attribute key="weight" value="2300"/>
	<attribute key="weaponType" value="wand"/>
	<attribute key="shootType" value="death"/>
	<attribute key="range" value="4"/>
</item>


new wand.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -50000, 0, -100000)

arr1 = {
{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, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 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, 0}
}

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

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

I'm new here so if this helped you please rep me.
 
Back
Top