E
Emky
Guest
Last edited by a moderator:
Currently this is how it is:
player1 on top, player2 below, player1 uses UH = player1 gets healed
player1 on top, player2 below, player2 uses UH = player2 gets healed
so both gets healed no matter what currently, but it should be that only the top player gets healed(player1) regardless of who uses the UH.
acko uh trap: youtu.be/uRIDuixN88w?t=19m1s
Code:void Combat::CombatFunc(Creature* caster, const Position& pos, const AreaCombat* area, const CombatParams& params, COMBATFUNC func, void* data) { std::list<Tile*> tileList; if (caster){ getCombatArea(caster->getPosition(), pos, area, tileList); } else{ getCombatArea(pos, pos, area, tileList); } SpectatorVec list; uint32_t maxX = 0; uint32_t maxY = 0; uint32_t diff; //calculate the max viewable range for (std::list<Tile*>::iterator it = tileList.begin(); it != tileList.end(); ++it){ diff = std::abs((*it)->getPosition().x - pos.x); if (diff > maxX){ maxX = diff; } diff = std::abs((*it)->getPosition().y - pos.y); if (diff > maxY){ maxY = diff; } } g_game.getSpectators(list, pos, false, true, maxX + Map::maxViewportX, maxX + Map::maxViewportX, maxY + Map::maxViewportY, maxY + Map::maxViewportY); for (std::list<Tile*>::iterator it = tileList.begin(); it != tileList.end(); ++it){ Tile* iter_tile = *it; bool bContinue = true; if (canDoCombat(caster, iter_tile, params.isAggressive) == RET_NOERROR){ if (iter_tile->getCreatures()){ for (CreatureVector::iterator cit = iter_tile->getCreatures()->begin(), cend = iter_tile->getCreatures()->end(); bContinue && cit != cend; ++cit) { if (params.targetCasterOrTopMost){ if (caster && caster->getTile() == iter_tile){ if (*cit == caster){ bContinue = false; } } else if (*cit == iter_tile->getTopCreature()){ bContinue = false; } if (bContinue){ continue; } } if (!params.isAggressive || (caster != *cit && Combat::canDoCombat(caster, *cit) == RET_NOERROR)){ func(caster, *cit, params, data); if (params.targetCallback){ params.targetCallback->onTargetCombat(caster, *cit); } if (func == CombatDispelFunc || func == CombatConditionFunc){ onCreatureDoCombat(caster, *cit, params.isAggressive); } } } } combatTileEffects(list, caster, iter_tile, params); } } postCombatEffects(caster, pos, params); }
I'm using OThire Dist, if anyone know how to fix this. I would much appreciate it!, i already tested with avesta and it was wrong aswell.
if (caster && caster->getTile() == iter_tile){
if (*cit == caster){
bContinue = false;
}
}
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 7.3) + 42
local max = (level / 5) + (maglevel * 12.4) + 90
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant, isHotkey)
local selfPosition = creature:getPosition()
return combat:execute(creature, variant == selfPosition and selfPosition or variant)
end
function onCastSpell(cid, var)
local selfPosition = getPlayerPos(cid)
if var == selfPosition and selfPosition or var then
return doCombat(cid, combat, var)
end
end
function onCastSpell(cid, var)
local pos = getPlayerPos(cid)
var = var == pos and pos or var
return doCombat(cid, combat, var)
end
print( unpack(var) )
look above try unpacking varnope :/
You could learn luaStill nothing, if anyone have any other solutions let me know
You need a basic foundation in the language to have general idea of what your looking at, I am just trying to help, its nice to learn by example but at some point you have to learn the languageWell i'm gonna need help with that since i'm not so good with this. I would appreciate if anyone took their time to look into this issue for me
You could learn lua
You need a basic foundation in the language to have general idea of what your looking at, I am just trying to help, its nice to learn by example but at some point you have to learn the language![]()
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, -30, 2.5, 0)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 2 + maglevel * 3) * 2.5
max = (level * 2 + maglevel * 3) * 2.5
if min < 250 then
min = 250
end
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
local healed = variantToNumber(var)
if(healed == 0) then
local pos = variantToPosition(var)
healed = getTopCreature(pos).uid or getTopCreature(pos)
end
return doCombat(cid, combat, numberToVariant( healed ))
end