Jump to content
  • 0

Automatic Potions When Activechar.isstunned


tiguz

Question

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
Link to comment
Share on other sites

Recommended Posts

  • 0

            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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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..

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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...

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Keto Move ||  https://rebrand.ly/keto-move-official   Keto Move, as the name the provider has given it, is a pragmatic and regular arrangement that will help you in consuming the additional fat that is all put away in different substantial segments of your body. It can help you through your weight reduction venture in each conceivable way and assist you with consuming off every one of the additional calories put away in your headstrong body districts. On a keto diet, you should comply to specific tight rules, for example, consuming only 5% of carbs, considerably less than whatever we ordinarily take.   Facebook:- https://www.facebook.com/Keto.Move.Official/   Keto Move targets obstinate fat stores all through your body and attempts to kill them, permitting you to get thinner. This keto supplement contains BHB salts, green tea remove, espresso separate, and other home grown parts. Each part of this recipe ensures that Ketosis works appropriately in the body. What's more, this adds to fruitful weight reduction. These sticky bears offer your body all it expects for appropriate cell action. These desserts taste better, yet they additionally work better.   More Relative Blogs https://keto-move.webflow.io/ https://keto-move.company.site/ https://keto-move.jimdosite.com/ https://keto-move.mystrikingly.com/ https://ketomove.journoportfolio.com/ https://solo.to/ketomove https://bio.link/ketomoveofficial https://in.pinterest.com/pin/1145532855383041696 https://soundcloud.com/ketomove/keto-move-weight-loss-review-price-benefits https://medium.com/@ketomove/keto-move-expert-tips-for-staying-on-track-with-keto-71933c4ceaa5 https://sketchfab.com/3d-models/keto-move-better-sale-price-2024-54158d06ed6b48a485ec4ae5568792d9 https://www.eventbrite.com/e/keto-move-keto-move-updated-customer-warning-alert-exposed-tickets-891768873707
    • Attention, attention, the heroes of Elmoraden are wanted! Get ready for new adventures, because our gates are open for you! We switch to the Interlude chronicles on Lionna x5 server, where exciting battles, exciting quests and incredible adventures await you! But that's not all! For beginners, we have a special offer – shadow equipment that will help you develop faster and more efficiently in the world of Elmoraden. With these powerful items, you can easily reach new heights! Join us on May 17th and become a part of the great saga! An unforgettable adventure awaits you on the Lionna X5 server with the Interlude chronicles. Don't miss your chance to become a real hero!     More info: - Characters created from 17.05 09:00 server time, when created will receive gifts in the form of chests with coupons for temporary weapons \ armor No Grade - A grade; - Characters created from 15.05 00:00 server time to 17.05 09:00 will receive gifts in the form of chests with coupons for temporary weapons \ armor No Grade - A grade; - Gifts are divided by grades (No Grade - A Grade) and gifts can be opened at levels corresponding to the grade of the gift. (A gift of D Grade can be opened at the 20th level, B Grade at 52, etc.), but the character's level when opening the gift should not exceed the 75th; - The duration of the equipment \ weapon is 10 hours; - Chaotic characters (characters whose PK counter is higher than 0) cannot use shadow equipment; - On 17.05 at 09:00 server time (10:00 Moscow time), you can meet Looney the Cat in the cities, who will exchange coupons for temporary weapons and equipment; Coupon amount in the gift chests: No Grade: 1 D Grade: 2 C Grade: 2 B Grade: 1 A Grade: 1   On 17.06 at 00:00 server time, the cats will disappear, and with them the chests and coupons. Items received for coupons are not deleted.
  • Topics

×
×
  • Create New...