Gelio
Lua PHP C++ programmer
Hello. It's my first C++ code. I've tested it and it run. Ok, now:
In configmanager.cpp:
Under:
Add:
In configmanager.h:
Under:
Add:
In combat.cpp:
Under:
Add:
And thats it. If you attack player with same color you get a message:
It's good code for wars. I'm using this code on my war.
Yours,
Gelio
@edit
Now I'm going to disable damage when player step on else player field.
@down
What? Which option? No damage to same look feet?
In configmanager.cpp:
Under:
Code:
m_confNumber[ALLOW_CLONES] = getGlobalNumber(L, "allowClones", 0);
Code:
m_confNumber[NO_DAMAGE_TO_SAME_COLORS] = getGlobalNumber(L, "noDamageToSameColors", 0);
Under:
Code:
ALLOW_CLONES,
Code:
NO_DAMAGE_TO_SAME_COLORS,
Under:
Code:
if((attackerPlayer = attacker->getPlayer()) || (attacker->getMaster() && (attackerPlayer = attacker->getMaster()->getPlayer())))
Code:
uint32_t color = g_config.getNumber(ConfigManager::NO_DAMAGE_TO_SAME_COLORS);
if(color != 0)
{
Outfit_t attackerOutfit = attackerPlayer->getCurrentOutfit();
Outfit_t targetOutfit = targetPlayer->getCurrentOutfit();
if(attackerOutfit.lookHead == targetOutfit.lookHead && attackerOutfit.lookBody == targetOutfit.lookBody && attackerOutfit.lookLegs == targetOutfit.lookLegs && attackerOutfit.lookFeet == targetOutfit.lookFeet)
{
return RET_YOUMAYNOTATTACKTHISPLAYER;
}
}
And thats it. If you attack player with same color you get a message:
You may not attack this player.
It's good code for wars. I'm using this code on my war.
Yours,
Gelio
@edit
Now I'm going to disable damage when player step on else player field.
@down
What? Which option? No damage to same look feet?
Last edited: