Jump to content
  • 0

Special Time Buff for VIP


Question

Posted

Hi , I'm trying to set up a special time for players who are vip.

I've made the field in characters for VIP, and added in L2pcinstance.

Ok..

 

My problem is anytime you need to do the comparison and check if the player is or is not vip.

By the time I did this setting in Config.java, but I'm not getting through to see if the player.isVip == True, shows no error, but when you start the server would not start.

        ENABLE_VIP_DURATION = Boolean.parseBoolean(COSettings.getProperty("VipTempoCustom", "True"));
                                   
                                   
                                    L2PcInstance player = null;
         
                                    if (ENABLE_VIP_DURATION && player.isVip())
                                   {
                                       String[] propertySplit = COSettings.getProperty("SkillVipDuration", "").split(";");
                                        SKILL_DURACAO = new TIntIntHashMap(propertySplit.length);
                                        for (String skill : propertySplit)
                                       {
                                           String[] skillSplit = skill.split(",");
                                           if (skillSplit.length != 2)
                                             _log.warning(StringUtil.concat("[skillVipDuration]: invalid config property -> SkillDurationList \"", skill, "\""));
                                            else
                                            {
                                                try
                                                {
                                                    SKILL_DURACAO.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
                                                }
                                                catch (NumberFormatException nfe)
                                                {
                                                    if (!skill.isEmpty())
                                                    {
                                                        _log.warning(StringUtil.concat("[skillVipDuration]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    

Recommended Posts

  • 0
Posted

you may change the buff effect time from com.l2jserver.gameserver.model.L2Effect.

To get the player instance using the buff, use getEffected() inside that class

  • 0
Posted

show me how can I accomplish this? but I would pick the skills that would change the time.

is possible that the way I said? or if not, tell me how to do the way you speak.

 

Thankkk!

  • 0
Posted
Index: java/com/l2jserver/gameserver/model/L2Effect.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Effect.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Effect.java	(working copy)
@@ -357,7 +357,13 @@
		if (_period > 0)
		{
			stopEffectTask();
-			final int initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			int initialDelay = 0;
+			L2PcInstance plr = getEffected().getActingPlayer();
+			if(plr != null && plr.isVip() && getSkill().getSkillType() == L2SkillType.BUFF)
+				initialDelay = YOUR_VIP_BUFF_TIME_GOES_HERE;
+			else
+				initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			
			if (_count > 1)
				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _period * 1000);
			else

  • 0
Posted
Index: java/com/l2jserver/gameserver/model/L2Effect.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Effect.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Effect.java	(working copy)
@@ -357,7 +357,13 @@
		if (_period > 0)
		{
			stopEffectTask();
-			final int initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			int initialDelay = 0;
+			L2PcInstance plr = getEffected().getActingPlayer();
+			if(plr != null && plr.isVip() && getSkill().getSkillType() == L2SkillType.BUFF)
+				initialDelay = YOUR_VIP_BUFF_TIME_GOES_HERE;
+			else
+				initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			
			if (_count > 1)
				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _period * 1000);
			else

  • 0
Posted

 

thank you, one question in this case all the skills that are defined as a "buffer" will have more time right?

 

in this case, there is a way I can define the skills that have changed over time?

 

 

THankkk BIG!

  • 0
Posted

 

thank you, one question in this case all the skills that are defined as a "buffer" will have more time right?

 

in this case, there is a way I can define the skills that have changed over time?

 

 

THankkk BIG!

  • 0
Posted

1) I corrected the code i posted, since before, it would change the time of all effects, with the new code just buffs time are changed

2) Didnt understand your question

  • 0
Posted

1) I corrected the code i posted, since before, it would change the time of all effects, with the new code just buffs time are changed

2) Didnt understand your question

  • 0
Posted

Index: java/com/l2jserver/gameserver/model/L2Effect.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Effect.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Effect.java	(working copy)
@@ -357,7 +357,13 @@
		if (_period > 0)
		{
			stopEffectTask();
-			final int initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			final int initialDelay = 0;
+			final L2PcInstance plr = getEffected().getActingPlayer();
+			if(plr != null && plr.isVip() && getSkill().canModifyTime())
+				initialDelay = YOUR_VIP_BUFF_TIME_IN_MILLIS_GOES_HERE;
+			else
+				initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			
			if (_count > 1)
				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _period * 1000);
			else
Index: java/com/l2jserver/gameserver/model/L2Skill.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Skill.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Skill.java	(working copy)
@@ -291,8 +291,10 @@
	private final boolean _excludedFromCheck;
	private final boolean _simultaneousCast;

-	private L2ExtractableSkill _extractableItems = null;;
+	private L2ExtractableSkill _extractableItems = null;

+	private boolean _canModifyTime = false;
+	
	protected L2Skill(StatsSet set)
	{
		_id = set.getInteger("skill_id");
@@ -532,6 +534,8 @@

			_extractableItems = parseExtractableSkill(_id, _level, capsuled_items);
		}
+		
+		_canModifyTime = set.getBool("canModifyTime", false);
	}

	public abstract void useSkill(L2Character caster, L2Object[] targets);
@@ -541,6 +545,11 @@
		return _isPotion;
	}

+	public final boolean canModifyTime()
+	{
+		return _canModifyTime;
+	}
+	
	public final int getArmorsAllowed()
	{
		return _armorsAllowed;

 

In those skill where you would like to modify the time based if the player is vip or not, you would have to add

 

<set name="canModifyTime" val="true" />

  • 0
Posted

Index: java/com/l2jserver/gameserver/model/L2Effect.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Effect.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Effect.java	(working copy)
@@ -357,7 +357,13 @@
		if (_period > 0)
		{
			stopEffectTask();
-			final int initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			final int initialDelay = 0;
+			final L2PcInstance plr = getEffected().getActingPlayer();
+			if(plr != null && plr.isVip() && getSkill().canModifyTime())
+				initialDelay = YOUR_VIP_BUFF_TIME_IN_MILLIS_GOES_HERE;
+			else
+				initialDelay = Math.max((_period - _periodFirstTime) * 1000, 5);
+			
			if (_count > 1)
				_currentFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new EffectTask(), initialDelay, _period * 1000);
			else
Index: java/com/l2jserver/gameserver/model/L2Skill.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Skill.java	(revision 4536)
+++ java/com/l2jserver/gameserver/model/L2Skill.java	(working copy)
@@ -291,8 +291,10 @@
	private final boolean _excludedFromCheck;
	private final boolean _simultaneousCast;

-	private L2ExtractableSkill _extractableItems = null;;
+	private L2ExtractableSkill _extractableItems = null;

+	private boolean _canModifyTime = false;
+	
	protected L2Skill(StatsSet set)
	{
		_id = set.getInteger("skill_id");
@@ -532,6 +534,8 @@

			_extractableItems = parseExtractableSkill(_id, _level, capsuled_items);
		}
+		
+		_canModifyTime = set.getBool("canModifyTime", false);
	}

	public abstract void useSkill(L2Character caster, L2Object[] targets);
@@ -541,6 +545,11 @@
		return _isPotion;
	}

+	public final boolean canModifyTime()
+	{
+		return _canModifyTime;
+	}
+	
	public final int getArmorsAllowed()
	{
		return _armorsAllowed;

 

In those skill where you would like to modify the time based if the player is vip or not, you would have to add

 

<set name="canModifyTime" val="true" />

  • 0
Posted

Very Good Big...

 

I will test to see how he was.

In case if I do not want a particular skill increase the time it just add the xml line and =false right?

 

Thank very much

  • 0
Posted

Very Good Big...

 

I will test to see how he was.

In case if I do not want a particular skill increase the time it just add the xml line and =false right?

 

Thank very much

Guest
This topic is now closed to further replies.


  • Posts

    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click   🚀 Promo code: MEDIUM5 (5% Discount)   ➡️ Online Store: Click ✅ ➡️ Telegram Bot: Click ✅ ➡️ SMM Panel: Click ✅   Regular customers receive additional discounts and promo codes!   Support: ➡️ Telegram: https://t.me/solomon_bog ✅ ➡️ Discord: https://discord.gg/y9AStFFsrh ✅ ➡️ WhatsApp: https://wa.me/79051904467 ✅ ➡️ Email: solomonbog@socnet.store ✅   ➡️ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners )  — Becoming a supplier   SocNet — your store for digital goods and premium subscriptions ✅
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • Buying & Selling Torn City Cash
  • 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