dami1310
◄ Unidentified ►
Firstable, I am using tfs 1.3 downgrade 8.6 by nekiro.
Secondable, I am trying to add spells hitEffect and hitColor like it was done in 0.3.6, but I have found some problems.
Right now both hitEffect and hitColor depends on the combat type, example:
I want to read both of them from spell file, like that:
So, I have added:
Then I have found where the effects and colors are used and its combatChangeHealth in game.cpp
My question is, how can I use these values there?
I've tried using:
I can compile without any problems, but it is simply not working.
Additional info: it is only for personal use and I will have both of them registered in every single spell, so all I need is read and send these values properly without any checks etc.
Secondable, I am trying to add spells hitEffect and hitColor like it was done in 0.3.6, but I have found some problems.
Right now both hitEffect and hitColor depends on the combat type, example:
combatGetTypeInfo in game.cpp
Code:
case COMBAT_ICEDAMAGE: {
color = TEXTCOLOR_LIGHTBLUE;
effect = CONST_ME_LOSEENERGY;
break;
}
I want to read both of them from spell file, like that:
Code:
combat:setParameter(COMBAT_PARAM_HITCOLOR, TEXTCOLOR_ORANGE)
combat:setParameter(COMBAT_PARAM_HITEFFECT, 21)
So, I have added:
bool Combat::setParam in combat.cpp
CombatParams in combat.h
Both luaDoTargetCombat and luaDoAreaCombat in luascript.cpp
Near the rest of enums in luascript.cpp
CombatParam_t in enums.h
Code:
case COMBAT_PARAM_HITEFFECT: {
params.hittEffect = static_cast<uint8_t>(value);
return true;
}
case COMBAT_PARAM_HITCOLOR: {
params.hittColor = static_cast<TextColor_t>(value);
return true;
}
CombatParams in combat.h
Code:
uint8_t hittEffect = CONST_ME_NONE;
TextColor_t hittColor = TEXTCOLOR_NONE;
Both luaDoTargetCombat and luaDoAreaCombat in luascript.cpp
Code:
params.hittEffect = getNumber<uint8_t>(L, 7);
params.hittColor = getNumber<TextColor_t>(L, 7);
Near the rest of enums in luascript.cpp
Code:
registerEnum(COMBAT_PARAM_HITCOLOR)
registerEnum(COMBAT_PARAM_HITEFFECT)
CombatParam_t in enums.h
Code:
COMBAT_PARAM_HITEFFECT,
COMBAT_PARAM_HITCOLOR,
Then I have found where the effects and colors are used and its combatChangeHealth in game.cpp
My question is, how can I use these values there?
I've tried using:
Code:
CombatParams params;
params.hittColor
params.hittEffect
Additional info: it is only for personal use and I will have both of them registered in every single spell, so all I need is read and send these values properly without any checks etc.