[8.54] Moby nie mogą się zabijać
[8.54] Moby nie mogą się zabijać
Witam.
Przedstawiam wam kod uniemożliwiający mobom zabijania siebie nawzajem atakami aoe.
W game.cpp pod:
Doklej:
Pozdrawiam
Przedstawiam wam kod uniemożliwiający mobom zabijania siebie nawzajem atakami aoe.
W game.cpp pod:
- Kod:
bool deny = false;
CreatureEventList statsChangeEvents = target->getCreatureEvents(CREATURE_EVENT_STATSCHANGE);
for(CreatureEventList::iterator it = statsChangeEvents.begin(); it != statsChangeEvents.end(); ++it)
{
if(!(*it)->executeStatsChange(target, attacker, STATSCHANGE_HEALTHLOSS, combatType, damage))
deny = true;
}
Doklej:
- Kod:
if(attacker && target)
{
if(attacker->getMonster() && target->getMonster())
{
if(attacker->isSummon() && target->isSummon())
{
if(!attacker->isPlayerSummon() && !target->isPlayerSummon())
deny = true;
}
else if(attacker->isSummon())
deny = (!attacker->isPlayerSummon() ? true : false);
else if(target->isSummon())
deny = (!target->isPlayerSummon() ? true : false);
else
deny = true;
}
}
Pozdrawiam
Anastazjusz- Moderator
- Liczba postów : 12
Join date : 14/11/2012
Permissions in this forum:
Nie możesz odpowiadać w tematach
|
|