Continuing from here.
another url http://apolyton.net/showthread.php/1...d_functions?s=
I hope to make a multi-dimensional array that gives specific unit's a buff in attack/defensive/and-or ranged attack values based on whether they have a magical item or not.
The function seems to be pretty undocumented, but from the thread, it looks like the function had some marginal success in reducing attack values after the initial round (maybe they needed to move the function into an event handler that started at the beginning of combat).
Here's from the sourcecode
UnitData.cpp
sint32 intDef = (sint32)base;
sint32 modDef = g_slicEngine->CallMod(mod_UnitDefense, intDef, m_id, attacker.m_id, intDef);
if(modDef != intDef)
Here's it in action
SlicEngine.cpp
SMF_3A(mod_UnitAttack, ST_UNIT, ST_UNIT, ST_INT);
SMF_3A(mod_UnitRangedAttack, ST_UNIT, ST_UNIT, ST_INT);
SMF_3A(mod_UnitDefense, ST_UNIT, ST_UNIT, ST_INT);
base = modDef;
Header file declaration
SlicModFuncEnum.h
mod_UnitDefense,
Note:
I'm worried this might adjust all unit's of a specific type vs individual... I might be able to just simply check (using a multi-dimensional array) to modify the value dynamically. It would require a lot of calculation. But each unit could be checked if it has the item, and if it does, adjust all the unit types attack value, then undo it after the attack is over before the next unit attacks.
Update:
Just read that that's not even used (the in action part), the commented notes in the source say use GetOffense
Update2:
It does appear mod_UnitAttack is used, just the function of it in action isn't, however it's used in UniteData::GetOffense. It's weird tho, mod_UnitAttack is being used as a variable vs a function)
another url http://apolyton.net/showthread.php/1...d_functions?s=
I hope to make a multi-dimensional array that gives specific unit's a buff in attack/defensive/and-or ranged attack values based on whether they have a magical item or not.
The function seems to be pretty undocumented, but from the thread, it looks like the function had some marginal success in reducing attack values after the initial round (maybe they needed to move the function into an event handler that started at the beginning of combat).
Here's from the sourcecode
UnitData.cpp
sint32 intDef = (sint32)base;
sint32 modDef = g_slicEngine->CallMod(mod_UnitDefense, intDef, m_id, attacker.m_id, intDef);
if(modDef != intDef)
Here's it in action
SlicEngine.cpp
SMF_3A(mod_UnitAttack, ST_UNIT, ST_UNIT, ST_INT);
SMF_3A(mod_UnitRangedAttack, ST_UNIT, ST_UNIT, ST_INT);
SMF_3A(mod_UnitDefense, ST_UNIT, ST_UNIT, ST_INT);
base = modDef;
Header file declaration
SlicModFuncEnum.h
mod_UnitDefense,
Note:
I'm worried this might adjust all unit's of a specific type vs individual... I might be able to just simply check (using a multi-dimensional array) to modify the value dynamically. It would require a lot of calculation. But each unit could be checked if it has the item, and if it does, adjust all the unit types attack value, then undo it after the attack is over before the next unit attacks.
Update:
Just read that that's not even used (the in action part), the commented notes in the source say use GetOffense
Update2:
It does appear mod_UnitAttack is used, just the function of it in action isn't, however it's used in UniteData::GetOffense. It's weird tho, mod_UnitAttack is being used as a variable vs a function)
Comment