DelavaR
Elpy
Posts: 3
Joined: Sep 2013
Reputation: 0
Version:
1.4.1.110
|
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. 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 |
|
DelavaR
Elpy
Posts: 3
Joined: Sep 2013
Reputation: 0
Version:
1.4.1.110
|
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 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 )
(This post was last modified: 11-18-2013 11:09 AM by DelavaR.)
|
|
11-18-2013 10:58 AM |
|
DelavaR
Elpy
Posts: 3
Joined: Sep 2013
Reputation: 0
Version:
1.4.1.110
|
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 |
|