• 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 Exura sio - heal only friend!

Bilip

New Member
Joined
Apr 15, 2009
Messages
41
Reaction score
0
I have small request, I need Exura sio"xxx (heal friend) with small condition
namely: xxx can not be person who uses spell.
To be precise: Druid can not heal himself by this spell, that's it.
I'm sure it's really easy, probably one 'if statement' more, but i failed, don't know why.
regs. :)
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 14)

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

This is oryginal version, I tried to compare combat with getcreaturename(), console didn't display any error, but spell didn't work
 
*bump*
Script is identical to exura vita script
cid = player who spells
As far as I see there is no value of cid of "friend"
so, problem has to be some where else (maybe source)
any ideas?
 
In source - spells.cpp, you have something like that:
Wklejka #1094857 – Wklej.org

There is code responsible for all spells like exura sio and exiva.

Code:
if(hasParam)
{
	Player* playerTarget = NULL;
	ReturnValue ret = g_game.getPlayerByNameWildcard(param, playerTarget);
	if(playerTarget && playerTarget->isAccessPlayer() && !player->isAccessPlayer())
		playerTarget = NULL;

	target = playerTarget;
	if(!target || target->getHealth() <= 0)
	{
		if(!casterTargetOrDirection)
		{
			player->sendCancelMessage(ret);
			g_game.addMagicEffect(player->getPosition(), NM_ME_POFF);
			return false;
		}
		useDirection = true;
	}
}

Now u must compare "playerTarget" and "player".

Codes from TFS 0.2.15r102
 
go to spells.xml
and paste
XML:
 	<instant name="Heal Friend" words="heal friend" aggressive="1" params="1" needtarget="1" lvl="500" maglv="15" mana="100" soul="0" exhaustion="1000" prem="1" enabled="1" script="heal friend.lua">
	    <vocation id="11"/>
	</instant>
 
go to spells.xml
and paste
XML:
 	<instant name="Heal Friend" words="heal friend" aggressive="1" params="1" needtarget="1" lvl="500" maglv="15" mana="100" soul="0" exhaustion="1000" prem="1" enabled="1" script="heal friend.lua">
	    <vocation id="11"/>
	</instant>

shouldnt your signature be "write PM." and not "write PW." ? :p sorry for offtopic
 
Back
Top