Jump to content
  • 0

Automatic Potions When Activechar.isstunned


Question

Posted (edited)

Hello again. Im fixing some things in my automatic potions code.

 

It was spamming pots even when char had some abnormal status like stunned, sleeping, paralized etc.

 

So I added this:

 

if (activeChar.isStunned() || activeChar.isConfused() || activeChar.isAway() || activeChar.isParalyzed() || activeChar.isSleeping() || activeChar.isDead())
{
activeChar.sendMessage("You Cannot Use Items Right Now.");
activeChar.sendPacket(new ExAutoSoulShot(id, 0));
activeChar.setAutoPot(id, null, false);
return;
}
 
BUT, this way, im disabling the toggle skill with : activeChar.sendPacket(new ExAutoSoulShot(id, 0));
And stoping the use of the pots: activeChar.setAutoPot(id, null, false);
 
This way when I get stunned (etc) the toggle potion (ExAutoSoulShot)  is disabled and the usage stops. But its a pain in the ass cause when stun effect is off, I need to right click again in the 3 potions to activate it again.
 
Well, it fixes my problem but cause another one lol. The best solution would be: Keep toggle skill active but dont use pots, and once the abnormal effect is off, it will consume potions again without needing to right click them all again.
Edited by tiguz

Recommended Posts

  • 0
Posted (edited)

            if (activeChar.isStunned() || activeChar.isConfused() || activeChar.isAway() || activeChar.isParalyzed() || activeChar.isSleeping() || activeChar.isDead())
            {
                activeChar.sendMessage("You Cannot Use Items Right Now.");
                activeChar.sendPacket(new ExAutoSoulShot(id, 0));
                activeChar.setAutoPot(id, null, false);
                return;
           } 
The check already exists, simply remove two/three lines (return is a must) and voila.

 

AutoPot runnable method.

Edited by SweeTs
  • 0
Posted (edited)

You can let auto CP on even on stun but restricting the CP increase...

Edited by Solomun
  • 0
Posted

You can let auto CP on even on stun but restricting the CP increase...

So the pot will keep spamming but wont increase anything?

Alright, and where Should I edit that?

  • 0
Posted (edited)

data\scripts\handlers\effecthandlers\CpHeal.java

 

final L2Character target = info.getEffected();

-if ((target == null) || target.isDead() || target.isDoor())

+if ((target == null) || target.isDead() || target.isDoor() || target.isStunned())
  {
   return;
  }

double amount = _power;

 

 

Try this one and add the other cases like this (isConfused, isDead bla bla bla bla)

Edited by Solomun
  • 0
Posted

data\scripts\handlers\effecthandlers\CpHeal.java

 

final L2Character target = info.getEffected();

-if ((target == null) || target.isDead() || target.isDoor())

+if ((target == null) || target.isDead() || target.isDoor() || target.isStunned())

  {

   return;

  }

double amount = _power;

 

 

Try this one and add the other cases like this (isConfused, isDead bla bla bla bla)

OKay, but if the player leaves his char dead on pvp zone, he will burn all his cp potions cause it will keep spamming but will never heal? lol

  • 0
Posted (edited)

Also, If I add this exception to Heal.Java, Cardinal heals wont affect targets with stun, sleep etc. So it wont work =/

Same would happen to Overlord Cp heal Skill. 

I have an auto HP pot, auto MP pot, and  auto CP.

Edited by tiguz
  • 0
Posted

OKay, but if the player leaves his char dead on pvp zone, he will burn all his cp potions cause it will keep spamming but will never heal? lol

Hmm, sorry for that but i was thinking something else. I have no idea how your AutoCP works, so i had something else on my mind as an AutoCP..

  • 0
Posted

Also, If I add this exception to Heal.Java, Cardinal heals wont affect targets with stun, sleep etc. So it wont work =/

Same would happen to Overlord Cp heal Skill. 

I have an auto HP pot, auto MP pot, and  auto CP.

Yea, u need to make the Skill ID restriction i gave you on the other post. Just as mana potion here

  • 0
Posted

Simply add the check/return in the place where the cp is being used.

Could please paste the code here? Unfortunatelly I dont code. I can oly fix things things that I can copy from other files, or things that are very basic =P

  • 0
Posted

Yea, u need to make the Skill ID restriction i gave you on the other post. Just as mana potion here

l2jfrozen doesnt accept info.getSkill().getId() != 10001) "info"

  • 0
Posted

Could please paste the code here? Unfortunatelly I dont code. I can oly fix things things that I can copy from other files, or things that are very basic =P

Where did you find your AutoCP code? Post the link and i will see if i can do it to avoid giving CP to stunned players...

  • 0
Posted (edited)

Where did you find your AutoCP code? Post the link and i will see if i can do it to avoid giving CP to stunned players...

Actually this code is auto cp/hp/mp so I need for all 3 potions. The potion itself is a toggle skill that works like SoulShot with right click.

 

At moment when player isDead, isStunned etc, the toggle is turned off automaticaly to stop using potions, instead of just not using it while stun/sleep,death effects last.

There is no need to turn off the toggles everytime, should just stop using the potion itself while effect lasts, and start spamming again when effect is off.

So its a pain in the ass to click again in the 3 potions to activate them back after every stun, every sleep, every death.

Edited by tiguz
Guest
This topic is now closed to further replies.


  • Posts

    • - New Features in Anosim https://anosim.net -   You can now share your numbers with others via a unique link - no need to give them access to your account! How to Share Number https://prnt.sc/K83lxOjS-Fyb   How to Revoke Accsess: https://prnt.sc/jkVIQS2lhxvA   --- --- --- --- --- --- --- New OTP / SMS Activation Locations: - USA  - Australia - Honduras - Kenia
    • How to Create Multi-Accounts For TikTok, Youtube, Gmail....   Short Guide to Managing Multiple TikTok Accounts TikTok's anti-spam systems detect duplicate accounts via device IDs, IP addresses, and behavior. To avoid bans, follow these methods. 1. For 3-5 Accounts (Easiest) Use TikTok's built-in feature to add accounts in your app settings. Limitation: Frequent switching on the same device/IP can still trigger restrictions. 2. For Bulk Accounts (Safest) To make each account appear unique, you need to mask your digital footprint. Unique Emails & Proxies: Use a separate email and a residential/mobile proxy (e.g., MoMoProxy) for each account. Avoid free proxies. Anti-Detect Browsers: Use tools like AdsPower or Multilogin to create unique browser profiles, each with its own proxy and randomized digital fingerprint.   MoMoProxy Integrate with Adspower Browser   Process: In each unique browser profile, log into a separate Gmail and then create the TikTok account. 3. For One Device (Limited Use) Use app cloners like Parallel Space (Android) or Dual Space (iOS). Limitation: Not foolproof, as TikTok can sometimes detect cloned apps. Key Best Practices to Avoid Bans: Isolation: Use one proxy and one device/browser profile per account. Warm-Up: Act organically—watch videos, like, and comment—before posting content. Appear Unique: Use different usernames, bios, and profile pictures for each account. Avoid VPNs: Standard VPN IPs are often detected and flagged.   Youtube Video On How to Create TikTok Accounts  https://youtu.be/ZUihXj7BO4M  
    • How to Create Multi-Accounts For TikTok, Youtube, Gmail....   Short Guide to Managing Multiple TikTok Accounts TikTok's anti-spam systems detect duplicate accounts via device IDs, IP addresses, and behavior. To avoid bans, follow these methods. 1. For 3-5 Accounts (Easiest) Use TikTok's built-in feature to add accounts in your app settings. Limitation: Frequent switching on the same device/IP can still trigger restrictions. 2. For Bulk Accounts (Safest) To make each account appear unique, you need to mask your digital footprint. Unique Emails & Proxies: Use a separate email and a residential/mobile proxy (e.g., MoMoProxy) for each account. Avoid free proxies. Anti-Detect Browsers: Use tools like AdsPower or Multilogin to create unique browser profiles, each with its own proxy and randomized digital fingerprint.   MoMoProxy Integrate with Adspower Browser   Process: In each unique browser profile, log into a separate Gmail and then create the TikTok account. 3. For One Device (Limited Use) Use app cloners like Parallel Space (Android) or Dual Space (iOS). Limitation: Not foolproof, as TikTok can sometimes detect cloned apps. Key Best Practices to Avoid Bans: Isolation: Use one proxy and one device/browser profile per account. Warm-Up: Act organically—watch videos, like, and comment—before posting content. Appear Unique: Use different usernames, bios, and profile pictures for each account. Avoid VPNs: Standard VPN IPs are often detected and flagged.   Youtube Video On How to Create TikTok Accounts  https://youtu.be/ZUihXj7BO4M        
    • If you created it yourself for the first races just duplicate it in the same way for the other races (that is make the animations for the other races as well) and everything will work
    • OpenCV bot working for all l2 clients... but need special set for each server
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock