• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Weapon] Creating a new wand with cool effects!

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
Hey.
A lot of people don't know how to create a wand with attacks by lvl - ml and with another effects.
I'll post this one, hope will help someone :D

data/weapons/weapons.xml

Put:
Code:
	<wand id="ID OF YOUR WAND" level="LEVEL TO USE" mana="15" min="100" max="200" type="holy" event="script" value="new_wand.lua"> <!-- New Wand -->
	<vocation id="1"/>
	<vocation id="2"/>
	<vocation id="5"/>
	<vocation id="6"/>
	</wand>

data/weapons/scripts

Copy any file and rename to new_wand.lua
Open the new_wand.lua, delet all, and put these:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_[COLOR="Blue"]HOLYDAMAGE[/COLOR])
setCombatParam(combat, COMBAT_PARAM_EFFECT, [COLOR="YellowGreen"][B]1[/B][/COLOR])
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, [COLOR="Magenta"]CONST_ANI_ENERGY[/COLOR])
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, [COLOR="Red"][COLOR="Red"]-1.5, -60, -1.5, -70[/COLOR][/COLOR])

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

Blue = The damage type. It will be holy.
You can use:

Code:
COMBAT_NONE = 0
COMBAT_PHYSICALDAMAGE = 1
COMBAT_ENERGYDAMAGE = 2
COMBAT_EARTHDAMAGE = 4
COMBAT_POISONDAMAGE = 4
COMBAT_FIREDAMAGE = 8
COMBAT_UNDEFINEDDAMAGE = 16
COMBAT_LIFEDRAIN = 32
COMBAT_MANADRAIN = 64
COMBAT_HEALING = 128
COMBAT_DROWNDAMAGE = 256
COMBAT_ICEDAMAGE = 512
COMBAT_HOLYDAMAGE = 1024
COMBAT_DEATHDAMAGE = 2048

Red = The attack, by ml and lvl. Increase or decrease at what you want.

Pink = The distance effect. I recommend use this, cuz it's the best :p

Green = The effect of the wand
Here go a list with all effects you can use!

Code:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_SMOKE = 67
CONST_ME_INSECTS = 68
CONST_ME_NONE = 255
CONST_ME_LAST = CONST_ME_INSECTS

Credits: Me (picachu)

Is it people.
If i help you, or you like it, please rep++ me ^_^
:$

:peace:
 
hey man, I think is a great apport but I did it and it doesn´t work :S
 
Picture Thanks ^^ Want to see what for wand and what for effect
 
well is not working for me it atacks with fist fighting can someone tell whta attributes to change for the item plz im new in this :D plz hlep me
 

I'll help some people use this script so I post how I did my wand

first in item.xml:
Code:
<item id="ITEM_ID" article="a" name="NAME_OF_YOUR_WAND">
		<attribute key="weight" value="2900" />
        <attribute key="description" value="It was brought up from hell to deliver death." />
		<attribute key="weaponType" value="wand" />
		<attribute key="range" value="8" />
	</item>
remember that you cant just make another item in items.xml which will have same ID as other item, you need to find ID of thing you'll use as wand and add attributes, they can be just like mine.
Then you just need to follow picachu's tutorial. You cant miss any line and my favourite distance effect is this:
Code:
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
:D
Rep++ for tutorial, All is working perfectly
 
Well , to set a constant damage number for a weapon (works same way for spells) the formula works this way:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -350, 0, -350)

function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end
Where in the line "setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, the first number (0) stands for min multiplier , this is the minimum number which is multiplied by a random formula depending on player level and magic level/skills.. The 2nd number (-350) is the minimum constant damage value , the 3rd number (0)
is the max multiplier , and the last number (-350) is the maximum constant damage value. To make the damage always the same , you make the multipliers to "0" and make both constant damage slots equal to each other. In my script , the wand will always deal 350 damage on each hit. If you change the constant values , the attacks will be the minimum damage + random numbers that increase depending on your level and magic level/skills , but will never be higher than the max constant value. This way you may control the damage values to the way you exactly want them.
 
Back
Top Bottom