• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How to make a Wand!

Oldschool'er

Tibia since 1998'
Joined
Dec 14, 2010
Messages
2,198
Reaction score
149
Location
United States
Add this in Weapons/Weapons.xml
Code:
<wand id="ITEMID" level="8" mana="20" min="0" max="0" type="earth" event="script" value="wand.lua">
		<vocation id="1"/>
		<vocation id="2"/>
	</wand>

Add this in Weapons/Scripts/Wand.lua
Code:
w = {
	[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
	[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
	[3] = {ef = 45, sh = 38, dmg = COMBAT_POISONDAMAGE},
	[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
	[5] = {ef = 11, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
	[6] = {ef = 31, sh = 35, dmg = COMBAT_PHYSICALDAMAGE},
	[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
}

function onUseWeapon(cid, var)
	min, max = 300, 300 -- what damage you want
	target = getCreatureTarget(cid)
	if target ~= 0 then
		wx = w[math.random(1, #w)]
		doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
		addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
	end
	return true
end

Also if you want to change the damage wich it give's
Code:
min, max = 300, 300 -- What damage you want

And there you go :)


I accept no credit therefore this is not my script :D
 
wow, thanks. I understand, this wand is hitting over all effects and all attacks randomly typed, yeah?

Yes but you can make hit what ever you want ^^ like here is all the attacks

[1] = {ef = 36, sh = 3, dmg = COMBAT_FIREDAMAGE},
[2] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
[3] = {ef = 45, sh = 38, dmg = COMBAT_POISONDAMAGE},
[4] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
[5] = {ef = 11, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
[6] = {ef = 31, sh = 35, dmg = COMBAT_PHYSICALDAMAGE},
[7] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}

you can edit it like this

[1] = {ef = 42, sh = 28, dmg = COMBAT_ICEDAMAGE},
[2] = {ef = 17, sh = 31, dmg = COMBAT_DEATHDAMAGE},
[3] = {ef = 49, sh = 37, dmg = COMBAT_HOLYDAMAGE}
 
Back
Top