Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defensive script
Author Message
DelavaR Offline
Elpy
*

Posts: 3
Joined: Sep 2013
Reputation: 0
Version: 1.4.1.110
Post: #1
Defensive script
Hey everyone!

I'm looking for you help with one of the script I wrote.

The idea is to protect party members by main damage dealer.
So I've tried to check each moster arround and if someone is targeting my party member select this monster as target and then another script will start attack.

But here is a trouble. function GetTarget() always returns 0. Sad Seems like server doesn't send this type of information.

Is there other ways to implement that with script?

Looking forward to your reply!

Here is the script:
Code:
Monsters = nil;

function TargetIfAttacked(CoverId)
    for m in Monsters do
        if (m:GetTarget() == CoverId) then
            Target(m)
            break;
        end;
    end;
end;

repeat
    Monsters = GetMonsterList().list;
    for user in GetPartyList().list do
        TargetIfAttacked(user:GetId())
    end;
    Sleep(1000);
    if GetTarget() ~= nil and GetMe():GetTarget() ~= 0 and GetTarget():IsAlikeDeath() then
        ClearTargets()
        CancelTarget(true)
    end;
until false;
(This post was last modified: 11-18-2013 10:40 AM by DelavaR.)
11-18-2013 10:35 AM
Find all posts by this user Quote this message in a reply
Fox Away
Fraka-kaka-kaka-kaka-kow!
******

Posts: 5,635
Joined: Oct 2011
Reputation: -6666548
Version: 1.4.2.142
Post: #2
RE: Defensive script
by default it should auto check and attack agroed mobs by party before targeting new mob

just keep your party in skill range


G2A is a fantastic web-store where you can buy games cheap (40%+ Discounts!)
[Image: uaFndGu.gif]
(This post was last modified: 11-18-2013 10:54 AM by Fox.)
11-18-2013 10:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
DelavaR Offline
Elpy
*

Posts: 3
Joined: Sep 2013
Reputation: 0
Version: 1.4.1.110
Post: #3
RE: Defensive script
Maybe you are right, next target will be closest one or even agroed. But I want to drop current target and select a new one even if previous is still alive. Thats the idea.

By the way, there are a lot of troubles with L2Tower on server I'm playing. Auto nukes is not working - it launches first skill and then just stops, so I had to write my own script to make it work. Auto buffs and Heal is not working too - when party heal is activated character just stops to follow other char and doesn't heal at all. I have to use my own scripts for everything Smile Server is Interlude, can it be a reason why L2Tower works incorrect?

By the way, if someone needs scripts for party heal, auto nuke and auto spoil I can share it with you. (autospoil works on interlude on my server but auto sweep is not working Smile)
(This post was last modified: 11-18-2013 11:09 AM by DelavaR.)
11-18-2013 10:58 AM
Find all posts by this user Quote this message in a reply
Fox Away
Fraka-kaka-kaka-kaka-kow!
******

Posts: 5,635
Joined: Oct 2011
Reputation: -6666548
Version: 1.4.2.142
Post: #4
RE: Defensive script
older tower version ware optimized for interlude so give it a try


G2A is a fantastic web-store where you can buy games cheap (40%+ Discounts!)
[Image: uaFndGu.gif]
11-18-2013 12:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
DelavaR Offline
Elpy
*

Posts: 3
Joined: Sep 2013
Reputation: 0
Version: 1.4.1.110
Post: #5
RE: Defensive script
I've tried 1.4.1.83 and 1.4.1.44 but I've faced the same troubles =/ So... does any one have suggestions about how to detect monsters are attacking my party member?
11-18-2013 13:07 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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