L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
doubt with CancelTarget()
Author Message
rORUMI Offline
Expired VIP Member
**

Posts: 278
Joined: May 2014
Reputation: 50
Version: 1.4.2.142
Post: #1
doubt with CancelTarget()

CancelTarget(breakActiveAction) | Cancels active target in true|false

why the difference between true or false if you are looking to cancel the target because I have seen several script:

    LUA Programming
ClearTarget();
CancelTarget(false);
CancelTarget(false);
CancelTarget(false);



and why is the diference with true, if we want to cancel the target or lost the target...

    LUA Programming
CancelTarget(true);



ty
09-09-2014 05:59 AM
Find all posts by this user Quote this message in a reply
capucine Offline
Expired VIP Member
**

Posts: 1,083
Joined: Jan 2013
Reputation: 208
Version: 1.4.2.142
Post: #2
RE: doubt with CancelTarget()

(09-09-2014 05:59 AM)rORUMI Wrote:  CancelTarget(breakActiveAction) | Cancels active target in true|false

why the difference between true or false if you are looking to cancel the target because I have seen several script:

    LUA Programming
ClearTarget();
CancelTarget(false);
CancelTarget(false);
CancelTarget(false);



and why is the diference with true, if we want to cancel the target or lost the target...

    LUA Programming
CancelTarget(true);



ty

I dont know lua a lot, barely not at all... but my understanding with
ClearTarget();
CancelTarget(false);
is that it will switch back to the previous target...

You are attacking a mob, script makes you heal a player for example, then will switch back to your previous target.

Not sure about the TRUE option... I guess it doesn't go back to you previous target...
09-09-2014 14:59 PM
Find all posts by this user Quote this message in a reply
diegol Offline
Expired VIP Member
**

Posts: 89
Joined: Jun 2013
Reputation: 15
Version: 1.4.1.121
Post: #3
RE: doubt with CancelTarget()

I want to ask the same many time, but oh well
09-09-2014 16:18 PM
Find all posts by this user Quote this message in a reply
kerberos464 Offline
Bug revealer

Posts: 1,539
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #4
RE: doubt with CancelTarget()

ClearTargets() - clears all targets internally, without immediately canceling target in game
CancelTarget(false) - immediately cancel target
CancelTarget(true) - immediately cancel target and interrupt current skill casting

Everything is possible. The impossible just takes longer.
09-09-2014 17:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
 Reputed by : rORUMI(+2) , diegol(+2)
rORUMI Offline
Expired VIP Member
**

Posts: 278
Joined: May 2014
Reputation: 50
Version: 1.4.2.142
Post: #5
RE: doubt with CancelTarget()

(09-09-2014 17:14 PM)kerberos464 Wrote:  ClearTargets() - clears all targets internally, without immediately canceling target in game
CancelTarget(false) - immediately cancel target
CancelTarget(true) - immediately cancel target and interrupt current skill casting

Last night i finish 2 functions to protect me at GF, in one my wynns kills the pet of "bugged" pk wynn in the hight parts of towers just if they target me or pet are near, and the other kill gazem or Issad if it target me or any of my party are target or attacked.

And of course, a correct cancel of action was important to take a new action the most fast possible.

I think i need to check the last party of this with the function:

IsAttacking() -> can be conbined with GetMe() like IsAttacking(GetMe()) or
gazem:IsAttacking(me)

To do some like that:

if Gazem IsAttacking() in a range of 800, kill the mob.. then kill Gazem (or Issad) for safe
if Gazem IsAttacking(me), cancel the mob now and kill Gazem..



thanks Kerberos.
(This post was last modified: 09-10-2014 02:09 AM by rORUMI.)
09-10-2014 01:50 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  doubt about optimal gear to hit lvl 99 drake182 5 2,856 07-05-2015 16:38 PM
Last Post: drake182
  CancelTarget(true) diukas 2 2,475 06-22-2012 21:38 PM
Last Post: diukas



User(s) browsing this thread: 1 Guest(s)