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

Compiling [C++] Spell can attack only one, marked player

rsdsebek

C++/LUA coder
Joined
Oct 8, 2008
Messages
128
Reaction score
30
Hi
I am poking around my Source about 2 hours and I can't solve my problem. I want to do, that spell (for example "exevo gran mas vis") can attack only one, marked (marked means this is the target) person.

I know for sure, that I must do this in combat.cpp. Can someone help me with this problem?
Distro of the TFS is 0.3.5 (8.54)

Regards
 
I want to make, that every spell will attack only your target. For example
In normal:
You have 6 players on screen and you mark one. You type: "exevo gran mas vis" and all players are getting damage
In my version:
You have 6 players on screen and you mark one. You type: "exevo gran mas vis" and only one, marked player, that is your target is getting damage.

Regards
 
i'm in think for you could be much easer to do for all large areas spell rescript to work as example exori vis and just make old effect as was...

this is example for you, dont be lazy ass...

Tested on 0.2.10 worked as very fine the xml part need to be same as exori flam... i in think you should get my idea...

spell: Exori gran mas flam

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatFormula(distanceCombat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 0, 0, 0, 0)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat1, area)

function onCastSpell(cid, var)
	if(variantToNumber(var) ~= 0) then
		return doCombat(cid, distanceCombat, var) and doCombat(cid, combat1, var)
	end
	return doCombat(cid, combat, var) and doCombat(cid, combat1, var)
end
 
Back
Top