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

PVP System - area spells only on target.

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,838
Solutions
18
Reaction score
617
Location
Poland
Hello.
I want someone to make PVP System like:
If you have targeted person, your area spells damaging only that person what you target ex. if anyone else is on area of spell (ex. 6 people staying near your opponent, if you have targeted opponent, you don't deal damage to these 6 people who stay's near him) - offensive area spells only damaging the target.

Thanks in advance,
Fresh.
 
Whats the meaning of the spell if it just show effects on the area but doesn't deal damage?
You want it to hit on monsters in that area but not players?
 
Lua:
local combat1 = createCombatObject() 
setCombatParam(combat1, COMBAT_PARAM_TYPE, 8)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 5)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 5)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -110)
 
 
local top_left_corner = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y + 1}
local top_right_corner = {getPlayerPosition(cid).x + 1 + getPlayerPosition(cid).y + 1}
local top_middle = {getPlayerPosition(cid).x + 1 + getPlayerPosition(cid).y}
local middle_left = {getPlayerPosition(cid).x + getPlayerPosition(cid).y - 1}
local middle_right = {getPlayerPosition(cid).x + getPlayerPosition(cid).y + 1}
local bottom_left = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y - 1}
local bottom_middle = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y}
local bottom_right = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y + 1}
 
local area = {top_left_corner.xyz + bottom_right.xyz}
 
 
local magicEffect = 1 -- set this to your sells area effect.--
 
 
 
function onCastSpell(cid, var)
if (isPlayer(top_left_corner)) then
	if (isPlayer(top_right_corner)) then
		if	(isPlayer(top_middle)) then
			if	(isPlayer(middle_left)) then
				if	(isPlayer(middle_right)) then
					if	(isPlayer(bottom_left)) then
						if	(isPlayer(bottom_middle)) then
							if	(isPlayer(bottom_right)) then
							local area1 = {
							{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, 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, 0, 0, 0, 1, 1, 1, 0, 0, 0, 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, 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}}
 
							else
							local area1 = {
							{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, 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, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
							{0, 0, 0, 0, 0, 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, 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}}
							end
						else
						local area1 = {
						{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, 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, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
						{0, 0, 0, 0, 0, 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, 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}}
						end
 
 
					else
					local area1 = {
					{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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
					end
 
				else
				local area1 = {
				{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, 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, 0, 0, 0, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
				end
 -----middle right--------/\
			else
			local area1 = {
			{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, 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, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
			{0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
	{0, 0, 0, 0, 0, 0, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} 
	end
else
doSendMagicEffect(area, magicEffect)
end
setCombatArea(combat1, createCombatArea(area1))
addEvent(doCombat, 0, cid, combat1, var)
end

- - - Updated - - -

First script will tell spell to only cast in area, if there is a player there (within 1 sqm)...

This script will do an aera spell, buy only hit the targeted...

Lua:
local top_left_corner = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y + 1}
local bottom_right = {getPlayerPosition(cid).x - 1 + getPlayerPosition(cid).y + 1}
 
local area = {top_left_corner.xyz + bottom_right.xyz}
 
 
local magicEffect = 1 -- set this to your sells area effect.--
 
 
local combat = createCombatObject() 
setCombatParam(combat, COMBAT_PARAM_TYPE, 8)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -.1, -1, -.3)



function onCastSpell(cid, var)
	doSendMagicEffect(area, magicEffect)
	return doCombat(cid, combat, var)
end


You can also go into XML and chnage agressive="1" to agressive="0"
 
Last edited:
Ymm guys. You don't understand me :(

In normal Tibia pvp system - area spells are hitting all targets who reached XX level to enable pvp.
I want only the area spells hits the person who is targetted by me (with right click -> Attack) and don't deal damage to each others who have level to pvp.
 
Back
Top