Jump to content
  • 0

Item on inventory which can change time of buffs !


0flee

Question

Ello folks, i want to ask if this method added on Skill.java do what i want. What i want? A item keeped on inventory by player and for change bufftime to 2 hours in this case. If SkillDurationList it;s 1 hour, with this Item ( 2 hours ) Total i want to be 3 hours.
Here it is method. ( I don't know if it's good as method )

P.S.- if player doesn;t have this item, he can get time of buffs from SkillDurationList.
Project L2j-Mobius !
Greetings !

if (player.getInventory().getItemByItemId(17423) != null)
		{
			if (player.getInventory().getInventoryItemCount(17423, -1, false) < 1)
			{
				player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT_2);
				return;
			}
			
			int duration = 7200;
			
			abnormalTime = abnormalTime + duration;
		}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I'm not into hi5 but, i guess your coded can be written like this:

 

if (player.getInventory().getInventoryItemCount(17423, -1, false) > 0 )
	abnormalTime += TimeUnit.HOURS.toMillis(2);

 

  • No null check
  • No return (its probably the issue you faced if the code stopped)

 

Also, i'm not sure where you coded that. But. I didn't get the message part. If a player request a full buff, it will send (buffs count) messages if the item is not in player's inventory?

Link to comment
Share on other sites

  • 0

It is simple think. If player no have this item on inventory and he get buffs, he get buff time specified on SkillDurationList. If player have this item on inventory and he rebuff or relog, he get time of buffs +2 hours in this case.

https://i.imgur.com/szC64yX.jpg
Why i get this?

I've tryed like this..
 

final PlayerInstance player = Skill.getActingPlayer();
        if (player.getInventory().getInventoryItemCount(17423, -1, false) > 0)
        {
            abnormalTime += TimeUnit.HOURS.toMillis(2);
        }
    }

But i get error on getActingPlayer() ..... This method should be created

 

Edited by 0flee
Link to comment
Share on other sites

  • 0

Because you don't need to be a developer to realize that "the variable can be only null at this time", means that the variable on top of that warning is assigned null and haven't change.

 

In addition both of you are wrong. Changing the abnormal duration won't affect the buff time individually. What you want to dig in is the following method: 

 

public void applyEffects(final L2Character effector, final L2Character effected, final boolean instant, final int abnormalTime)

 

Inside that method you will find the code that assign the buff a duration

 

final BuffInfo info = new BuffInfo(effector, effected, this);

if (addContinuousEffects && abnormalTime > 0)
{
	info.setAbnormalTime(abnormalTime);
}

 

There you can do your check and affect the abnormal time individually. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • oh, i didnt know that. I got everything i need. Thank you so much for your information and help!
    • In every mobius source there should be a readme file with all the links you need (system, client, IDEs etc). Best of luck!
    • I didnt say i dont know anything but i couldnt find a place to start. a guy here mentioned l2jmobius which is a good place to start. so i searched for it and its actually what i wanted. Now i just need to find a clean client to start. I know how to program and how to do changed to client but its hard to find clean clients. I dont really want to make my server exactly like gracia final. I just want to test out the clients and decide which one works better for me. I dont really like the awakening classes and the newest races. Can you please provide me with a couple of links of different clients so i can test them out before i start my project? As i said i cant really find any clean install client. Thank you in advance
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: Our cheat for Fortnite game has proven itself in the best way among players, the cheat has good optimization, a beautiful visual appearance and has extensive functionality. And reliable protection and HWID Spoofer give our cheat even more advantages over competitors! SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - BattlEye AC: Undetected & Safe - Hyperion AC: Undetected & Safe Our Fortnite cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Aim bone - Silent aim - Smooth - Fov - Distance - Key ESP: - Players - Loot - Vehicles - Traps - Other MISC: - No bloom - No spread - Vehicle flight - Instarevive - Aim while Jumping - Teleport to players within 4m (10m with pickaxe) or teleport downed players to you. - Teleport key - Fov changer REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: No (Engineering works. Will be available again soon). - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: We are offering the best in market Division 2 hacks without detection. If you are wondering where to get the best cheats and hacks for The Division 2, you are at the right place! Our private TD2  hack has been completely undetected since we released it! Also, our cheat has all the most necessary functions such as aimbot, esp, etc. And the limited slots will give even more security to our product. SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - FairFight AC: Undetected & Safe Our The Division 2 cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Enable aim - No recoil - Silent aim - Aim distance - Aim fov - Draw aim fov - Fov change - Weakspot - Aim hitbox - Head - Neck - Chest - Random ESP: - Enable visuals - Enable radar - Skeleton - Weakspot - Pre-rendering - ESP distance - Radar distance - Auto - Enemy - Name - Blacklist - Whitelist - Custom color - Clear whitelist - Clear blacklist MISC: - Auto fire/Triggerbot - Rapid of fire rate - Shotgun of fire rate - Magic bullets - Fast reload - Unlimited ammo - Shoot in safehouse - Accelerate - Noclip REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: Yes - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
  • Topics

×
×
  • Create New...