doAttack Method...

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
SpooKNoF
Posts: 24
Joined: Fri Mar 13, 2009 11:22 am

doAttack Method...

Post 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?
ChrTrance
Posts: 1
Joined: Thu Jul 21, 2011 9:20 pm

Re: doAttack Method...

Post by ChrTrance »

User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post by lord_rex »

Just simply...

Image
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
User avatar
Cobra
Posts: 18
Joined: Thu Sep 11, 2008 4:46 pm

Re: doAttack Method...

Post by Cobra »

lord_rex wrote:Just simply...

Image
You are a badCat :twisted:
Image
User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post by lord_rex »

Cobra wrote:
lord_rex wrote:Just simply...

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

Image
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: doAttack Method...

Post by Zoey76 »

3033 commits, Holy Cow! :D
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.3.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post 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...
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: doAttack Method...

Post by jurchiks »

Well well, look who the cat dragged in (pun intended). What's up? How you doing with your l2j project?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: doAttack Method...

Post 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
Image
User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post 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 :)
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: doAttack Method...

Post by jurchiks »

And how's that working out for you?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post by lord_rex »

jurchiks wrote:And how's that working out for you?
actually, we're working in the shadows :)
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: doAttack Method...

Post by jurchiks »

...so then how is it going? Good/bad? Any profit?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
lord_rex
Posts: 78
Joined: Sat Jun 06, 2009 2:38 pm
Location: Hell, 9th circle, centre
Contact:

Re: doAttack Method...

Post 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
You're right. I have forgotten how to act like a normal human being. And I play games and I lie and I trick people to avoid the truth of how I feel.
Image
SpooKNoF
Posts: 24
Joined: Fri Mar 13, 2009 11:22 am

Re: doAttack Method...

Post 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;
}
Locked