Page 1 of 4

doAttack Method...

Posted: Thu Aug 01, 2013 7:21 pm
by SpooKNoF
hello guys i wander somthing why in code doAttack we using 2 times

protected void doAttack(L2Character target)
{
if ((target == null) || isAttackingDisabled() || !getEvents().onAttack(target))
{
return;
}


because you using the same method on clientpacket AttackRequest.java

the null check in doAttack is for npcs or for players? or for l2phx?

Re: doAttack Method...

Posted: Thu Aug 01, 2013 7:39 pm
by ChrTrance

Re: doAttack Method...

Posted: Thu Aug 01, 2013 7:54 pm
by lord_rex
Just simply...

Image

Re: doAttack Method...

Posted: Thu Aug 01, 2013 8:03 pm
by Cobra
lord_rex wrote:Just simply...

Image
You are a badCat :twisted:

Re: doAttack Method...

Posted: Thu Aug 01, 2013 8:06 pm
by lord_rex
Cobra wrote:
lord_rex wrote:Just simply...

Image
You are a badCat :twisted:
probably, but I am sure about that

Image

Re: doAttack Method...

Posted: Thu Aug 01, 2013 8:43 pm
by Zoey76
3033 commits, Holy Cow! :D

Re: doAttack Method...

Posted: Thu Aug 01, 2013 9:40 pm
by lord_rex
Zoey76 wrote:3033 commits, Holy Cow! :D
ah, it's really old and a bit confused/mixed with deleted repositories, on open source I have just near 2,2-2,5K really, but on private repositories it would be near 4000...

Re: doAttack Method...

Posted: Fri Aug 02, 2013 8:01 am
by jurchiks
Well well, look who the cat dragged in (pun intended). What's up? How you doing with your l2j project?

Re: doAttack Method...

Posted: Fri Aug 02, 2013 8:31 am
by BiggBoss
SpooKNoF wrote:hello guys i wander somthing why in code doAttack we using 2 times

protected void doAttack(L2Character target)
{
if ((target == null) || isAttackingDisabled() || !getEvents().onAttack(target))
{
return;
}


because you using the same method on clientpacket AttackRequest.java

the null check in doAttack is for npcs or for players? or for l2phx?
doAttack its called also by npcs AI's (those who attack), not only for players

Re: doAttack Method...

Posted: Fri Aug 02, 2013 10:02 am
by lord_rex
jurchiks wrote:Well well, look who the cat dragged in (pun intended). What's up? How you doing with your l2j project?
thanks, fine, actually I work in private :)

Re: doAttack Method...

Posted: Fri Aug 02, 2013 10:04 am
by jurchiks
And how's that working out for you?

Re: doAttack Method...

Posted: Fri Aug 02, 2013 10:08 am
by lord_rex
jurchiks wrote:And how's that working out for you?
actually, we're working in the shadows :)

Re: doAttack Method...

Posted: Fri Aug 02, 2013 11:32 am
by jurchiks
...so then how is it going? Good/bad? Any profit?

Re: doAttack Method...

Posted: Fri Aug 02, 2013 1:46 pm
by lord_rex
jurchiks wrote:...so then how is it going? Good/bad? Any profit?
we do not reached the stage of earning profit, need some months

Re: doAttack Method...

Posted: Fri Aug 02, 2013 2:30 pm
by SpooKNoF
BiggBoss wrote:
SpooKNoF wrote:hello guys i wander somthing why in code doAttack we using 2 times

protected void doAttack(L2Character target)
{
if ((target == null) || isAttackingDisabled() || !getEvents().onAttack(target))
{
return;
}


because you using the same method on clientpacket AttackRequest.java

the null check in doAttack is for npcs or for players? or for l2phx?
doAttack its called also by npcs AI's (those who attack), not only for players




yes i know that but i think null check is useless because doAttack use method HitTimer

inside method HitTimer you call again null check so...

public void onHitTimer(L2Character target, int damage, boolean crit, boolean miss, boolean soulshot, byte shld)
{
// If the attacker/target is dead or use fake death, notify the AI with EVT_CANCEL
// and send a Server->Client packet ActionFailed (if attacker is a L2PcInstance)
if ((target == null) || isAlikeDead() || (isNpc() && ((L2Npc) this).isEventMob()))
{
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
return;
}