doAttack Method...
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 24
- Joined: Fri Mar 13, 2009 11:22 am
doAttack Method...
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?
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?
-
- Posts: 1
- Joined: Thu Jul 21, 2011 9:20 pm
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
Just simply...
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.
- Cobra
- Posts: 18
- Joined: Thu Sep 11, 2008 4:46 pm
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
probably, but I am sure about thatCobra wrote:You are a badCatlord_rex wrote:Just simply...
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.
- Zoey76
- L2j Inner Circle
- Posts: 7005
- Joined: Tue Aug 11, 2009 3:36 am
Re: doAttack Method...
3033 commits, Holy Cow!
Powered by Eclipse 4.30 | Eclipse Temurin 21 | MariaDB 11.3.2 | L2J Server 2.6.3.0 - High Five
Join our Discord!
Join our Discord!
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
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...Zoey76 wrote:3033 commits, Holy Cow!
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: doAttack Method...
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- BiggBoss
- L2j Veteran
- Posts: 1104
- Joined: Wed Apr 15, 2009 3:11 pm
- Location: Spain
Re: doAttack Method...
doAttack its called also by npcs AI's (those who attack), not only for playersSpooKNoF 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?
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
thanks, fine, actually I work in privatejurchiks wrote:Well well, look who the cat dragged in (pun intended). What's up? How you doing with your l2j project?
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: doAttack Method...
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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
actually, we're working in the shadowsjurchiks wrote:And how's that working out for you?
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.
- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: doAttack Method...
...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.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
- lord_rex
- Posts: 78
- Joined: Sat Jun 06, 2009 2:38 pm
- Location: Hell, 9th circle, centre
- Contact:
Re: doAttack Method...
we do not reached the stage of earning profit, need some monthsjurchiks wrote:...so then how is it going? Good/bad? Any profit?
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.
-
- Posts: 24
- Joined: Fri Mar 13, 2009 11:22 am
Re: doAttack Method...
BiggBoss wrote:doAttack its called also by npcs AI's (those who attack), not only for playersSpooKNoF 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?
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;
}