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

    • L2GOLD LEGACY x45 THE ORIGINAL GOLD-STYLE EXPERIENCE Official L2OFF PTS • Chronicle C4 / Interlude • Long-Term Server GRAND OPENING 28 AUGUST 2026 WEBSITE SERVER INFO DOWNLOAD DISCORD OLD GOLD ORIGINAL THE LEGEND RETURNS L2Gold Legacy brings back the authentic Gold-style x45 experience on official L2OFF PTS files with custom systems, balanced progression, competitive PvP and a carefully protected long-term economy. NO WIPES — KEEP YOUR PROGRESS FOREVER SERVER INFORMATION SERVER CHARACTERISTICS EXP / SP x45 ADENA x1 DROP x1 SPOIL x1 RAID BOSS DROP x1 PLATFORM L2OFF PTS Custom Drop & Spoil rates can be checked directly in-game with SHIFT + CLICK on NPCs. GAMEPLAY MAIN FEATURES GAMEPLAY • Auto-learn Skills • Automatic Monster Loot • Shift + Click Droplist • Unlimited Offline Shop • 80 Inventory Slots • Weight Limit Disabled • Maximum 3 Clients per PC • Manual Raid / Epic Loot • Official L2OFF PTS Files PLAYER FRIENDLY • NPC Buffer • 27 Buff Slots • 2 Hour Buff Duration • Mana Potion restores 500 MP • No Mana Potion Cooldown • FREE 1st Profession • FREE 2nd Profession • 3rd Profession: 500,000 Adena • Solo & Party Friendly CLANS • Maximum 45 Clan Members • Maximum 2 Clans per Alliance • Clan Penalty: 1 Hour • Clan Skills for All Members • Castle Sieges • 9 Available Clan Halls PROGRESSION • Rebirth System • Noblesse Progression • Custom Tattoos • Daily Missions • Mining System • Custom Gold Equipment • S-Grade Weapons • Long-Term Economy RAID CONTENT RAID BOSSES & EPIC BOSSES Progressive boss loot, PvP-oriented encounters and controlled progression designed to protect the economy. BAIUM ANTHARAS VALAKAS EPIC BOSS SCHEDULE SERVER TIME — GMT+3 DAY BOSS TIME Monday Core 20:00 Monday Orfen 22:30 Tuesday Zaken 22:30 Wednesday Queen Ant 22:30 Thursday Antharas 22:30 Friday Baium 22:30 Saturday Valakas 22:30 Sunday Frintezza 22:30 CUSTOM EQUIPMENT S-GRADE & L2GOLD GEAR Custom weapons, shields and jewelry are an important part of L2Gold's long-term progression. Draconic Bow Guidance / Focus Angel Slayer Critical Damage / Haste Arcana Mace Acumen / Mana Up Heaven's Divider Haste / Health / Focus S-GRADE WEAPON PRICE 300 Fire Mantras + 1,000,000 Adena Available from Wilbrand, Mantra Manager at Giran Harbor. COMPETITIVE PVP OLYMPIAD CYCLE 7 DAYS WEAPON ENCHANT MAX +21 ARMOR ENCHANT MAX +8 Wednesday 21:00–22:00   •   Friday 21:00–22:00   •   Sunday 21:00–22:00 S-GRADE EQUIPMENT IS FORBIDDEN DAILY & WEEKEND CONTENT EVENTS CAPTURE THE FLAG 50 vs 50 competitive CTF battles. HIGH RATE EVENT Weekend farming and progression event. MINING EVENT Collect Minerals and earn special rewards. Death Match • Bandit Stronghold • TvT • Gold Arena 1v1–9v9 Korean Event • CTF • High Rate • Mining • Piggy • Squash • Discord Events TRANSPARENCY REAL-TIME SERVER STATISTICS Players can verify clans, characters, bosses, items, Olympiad, castles, Gold Weapons and the server economy. NO HIDDEN DROPS • NO SHADOW EDITS • FULL TRANSPARENCY L2GOLD LEGACY x45 • L2OFF PTS • NO WIPES 28 AUGUST 2026 The Original Gold-Style Experience Returns.   PLAY L2GOLD JOIN DISCORD   Website: https://l2gold.co Server Info: https://l2gold.co/server-info.php Discord: discord.com/invite/CBSqxqkhy2
    • Hello my wanna be designer....I see that u are still the same dumb kid u were before some years,takeing some brushes adding soem letters and call it design..Sad that u body might have grown up but ur wanna be brain is still the same shit.... No hard feelings,happens.   Cheers
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..