Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.

Join the forum, it's quick and easy

Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.
Tibia Mod
Czy chcesz zareagować na tę wiadomość? Zarejestruj się na forum za pomocą kilku kliknięć lub zaloguj się, aby kontynuować.

[8.54] Moby nie mogą się zabijać

Go down

[8.54] Moby nie mogą się zabijać Empty [8.54] Moby nie mogą się zabijać

Pisanie by Anastazjusz Czw Lis 15, 2012 9:05 pm

Witam.
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

Powrót do góry Go down

Powrót do góry


 
Permissions in this forum:
Nie możesz odpowiadać w tematach