need your help Otlanders!
I did a spell checks the skills of the master's cid
but when put to a monster called, the damage always goes 0
I understand that:
if I take the min = "", and the max = ""
the magic does not take damage
I think to solve my problem I have to shake in monsters.cpp!
I think it's here!
in function
the magic does not work
please help me to understand
thx for advanced
I did a spell checks the skills of the master's cid
but when put to a monster called, the damage always goes 0
I understand that:
if I take the min = "", and the max = ""
the magic does not take damage
I think to solve my problem I have to shake in monsters.cpp!
I think it's here!
PHP:
if((sb.spell = g_spells->getSpellByName(name)))
return true;
CombatSpell* combatSpell = CombatSpell* combatSpell;
bool needTarget = false, needDirection = false;
if(isScripted)
{
if(readXMLString(node, "direction", strValue))
needDirection = booleanString(strValue);
if(readXMLString(node, "target", strValue))
needTarget = booleanString(strValue);
combatSpell = new CombatSpell(NULL, needTarget, needDirection);
if(!combatSpell->loadScript(getFilePath(FILE_TYPE_OTHER, g_spells->getScriptBaseName() + "/scripts/" + scriptName), true))
{
delete combatSpell;
return false;
}
if(!combatSpell->loadScriptCombat())
{
delete combatSpell;
return false;
}
combatSpell->getCombat()->setPlayerCombatValues(FORMULA_VALUE, sb.minCombatValue, 0, sb.maxCombatValue, 0, 0, 0, 0, 0, 0, 0);
}
in function
PHP:
bool Monsters::deserializeSpell(xmlNodePtr node, spellBlock_t& sb, const std::string& description)
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 1)
function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = getPlayerStorageValue(getCreatureMaster(cid),STORAGE.TAILEVEL), getPlayerStorageValue(getCreatureMaster(cid),STORAGE.LEVEL)
return -(skillTotal * 0.1 + levelTotal), -(skillTotal * 1.0 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
doCombat(cid, combat, var)
end
thx for advanced