Lineage 2 Tower Forum

Full Version: Help with Scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko
You can add those skills to Nuke Attack and enable also nuke attack settings....

GetMe():IsAttacking() this function may be "bugged" and don't have to work very well, it will be changed in future. But you can check if your target is mob and his hp is bellow 100%, and if distance to him isn't more than for example 100...
(04-14-2011 10:03 AM)D0nnieDarko Wrote: [ -> ]Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko

You script has logic error.

main loop sleeps until you are under 1% of hp, and then u use skill.
(04-14-2011 11:16 AM)Geddys Wrote: [ -> ]
(04-14-2011 10:03 AM)D0nnieDarko Wrote: [ -> ]Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko

You script has logic error.

main loop sleeps until you are under 1% of hp, and then u use skill.

Omg, as i read it i saw it xD ... anyways i tried diffrent ways of that i also made a infinite loop instead of the repeat-until construct and it didnt work aswell

Code:
while true do
if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;
This other try was looking like that (I typed that right now, so it may contain syntax bugs)

So probably what Clock said is correct, i am going to try out the nuke setting things.

@Clock
How is the syntax to check target-type and target-hp status? I wanted to do that but didnt find the correct syntax. Would be nice for skills which can be activated at certain levels of hp (target or self).


Thanks for ur fast replies Big Grin ... its awesome to have such a fast "support".

Greetings
http://forum.l2tower.eu/showthread.php?tid=178

What do you mean by saying target-type?
(04-14-2011 13:30 PM)sakaszli Wrote: [ -> ]http://forum.l2tower.eu/showthread.php?tid=178

What do you mean by saying target-type?

player or npc or monster i mean with target type
bool IsPlayer();
bool IsMyPartyMember();
bool IsFriend();
bool IsMe();
bool IsNpc();

In user, mob i NPC too. Bool= true/false.
(04-14-2011 13:38 PM)sakaszli Wrote: [ -> ]bool IsPlayer();
bool IsMyPartyMember();
bool IsFriend();
bool IsMe();
bool IsNpc();

In user, mob i NPC too. Bool= true/false.

ah ... k npc = mob aswell xD that is what i missed here ... ty
Use bool IsEnemy(); to detect if it is mob or npc. You can also use this bool CanSeeMe();
Reference URL's