Okey so I have added new sex to the server so there is:
Male
Female
Orc
Orc(female)
Elf
Elf(female)
They work great.
But the problem is when I want to add so other races dont need to turn on the secure thing to attack another races. But if they are in the same race they need to turn it on.
- So basicly if a Male Human attack a Orc the human dont need to turn on the secure mode to attack. Same thing for the orc.
- If Orc(Male) attack an Orc(female) then Orc(Male) need to turn on the secure mode and he will get skull.
This is how it looks like:
But I get this error:
Anyone know how to fix this? Thanks for the help!
Male
Female
Orc
Orc(female)
Elf
Elf(female)
They work great.
But the problem is when I want to add so other races dont need to turn on the secure thing to attack another races. But if they are in the same race they need to turn it on.
- So basicly if a Male Human attack a Orc the human dont need to turn on the secure mode to attack. Same thing for the orc.
- If Orc(Male) attack an Orc(female) then Orc(Male) need to turn on the secure mode and he will get skull.
This is how it looks like:
Code:
if(target->getPlayer())
{
if(isProtected(player, target->getPlayer()))
return RET_YOUMAYNOTATTACKTHISPLAYER;
if(((player->getSex() == 0 || player->getSex() == 2 || player->getSex() == 4) && (target->getSex() == player->getSex() + 1)) || ((player->getSex() == 1 ||
player->getSex() == 3 || player->getSex() == 5) && (target->getSex() == player->getSex() - 1)))
{
//Same race
if(player->getSecureMode() == SECUREMODE_ON && !Combat::isInPvpZone(player, target) &&
player->getSkullClient(target->getPlayer()) == SKULL_NONE)
{
return RET_TURNSECUREMODETOATTACKUNMARKEDPLAYERS;
}
}else{
//Diffrent race
}
}
But I get this error:
Code:
- In static member function `static ReturnValue Combat::canTargetCreature(const Player*, const Creature*)':
- 279 C:\Users\Christer\Documents\Server\Sources 3.5\Sources 3.0\Sources 3.0\combat.cpp 'const class Creature' has no member named 'getSex'
- 280 C:\Users\Christer\Documents\Server\Sources 3.5\Sources 3.0\Sources 3.0\combat.cpp 'const class Creature' has no member named 'getSex'
- 280 C:\Users\Christer\Documents\Server\Sources 3.5\Sources 3.0\Sources 3.0\combat.cpp *** [../combat.o] Error 1
Anyone know how to fix this? Thanks for the help!