Jump to content

Recommended Posts

Posted

Lineage II Gracia Part II

 

Once the "Invincible" skill effect is applied, it cannot be re-applied for a certain amount of time. Related skills include: Celestial Shield, Flames of Invincibility, Sonic Barrier, Force Barrier, Servitor Barrier, Sublime Self-Sacrifice.

 

Reworked

I decided to implement this small feature because it prevents players from using the one barrier after the other.

The default penalty time is 10 minutes.

I hope its gonna be useful for you people.

 

First of all,create a record in Characters table using navicat.

The record must be like this.

 

Characters

Name                 Type           Length             Decimals           Allow Null
isInvulLimited       tinyint            3                      0                 (untick this)

 

L2PcInstance.java

   // Character Character SQL String Definitions:
   private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,
-deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date) --values -------(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,isInvulLimited,last_recom_date) +values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprenti
-ce=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_Id=?";
+ce=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,isInvulLimited=?,death_penalty_level=? WHERE obj_Id=?";
   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, 
-varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_Id=?";
+varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,isInvulLimited,death_penalty_level FROM characters WHERE obj_Id=?";

                       statement.setInt(28, isIn7sDungeon() ? 1 : 0);
		statement.setInt(29, getClanPrivileges());
		statement.setInt(30, getWantsPeace());
		statement.setInt(31, getBaseClass());
		statement.setInt(32, getNewbie());
		statement.setInt(33, isNoble() ? 1 :0);
		statement.setLong(34, 0);
-                       statement.setLong(35,System.currentTimeMillis());
+                       statement.setInt(35, isInvulLimited() ? 1 : 0);
+			statement.setLong(36,System.currentTimeMillis());

               if (player.isInJail())
               	player.setJailTimer(rset.getLong("jail_timer"));
               else
               	player.setJailTimer(0);

               CursedWeaponsManager.getInstance().checkPlayer(player);

               player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally"));

+               player.startInvulPenalty(rset.getInt("isInvulLimited") == 1);

               player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));

                       statement.setLong(45,getSponsor());
                       statement.setInt(46, getAllianceWithVarkaKetra());
		statement.setLong(47, getClanJoinExpiryTime());
		statement.setLong(48, getClanCreateExpiryTime());
		statement.setString(49, getName());
-                       statement.setLong(50, getDeathPenaltyBuffLevel());
-                       statement.setInt(51, getObjectId());
+                       statement.setInt(50, isInvulLimited() ? 1 : 0);
+			statement.setLong(51, getDeathPenaltyBuffLevel());
+                       statement.setInt(52, getObjectId());

 

L2Character.java

 private boolean _isConfused                             = false; // Attack anyone randomly

 private boolean _isFakeDeath                            = false; // Fake death
 private boolean _isFlying                               = false; //Is flying Wyvern?

+ private boolean _isInvulLimited                         = false;
 private boolean _isMuted                                = false; // Cannot use magic
 private boolean _isMagicImmune                          = false;

   public final void stopPhysicalAttackMuted(L2Effect effect)
   {
      if (effect == null)
          stopEffects(L2Effect.EffectType.PHYSICAL_ATTACK_MUTE);
      else
           removeEffect(effect);

      setIsPhysicalAttackMuted(false);
   }
+
+   public boolean isInvulLimited()
+   {
+      return _isInvulLimited;	
+   }
+
+   public final void startInvulPenalty(boolean value)
+   {
+      _isInvulLimited = value;
+      if (isInvulLimited())
+      {
+             long limit = 600000;
+             ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+             {
+                     @Override
+	              public void run()
+                     {
+                             _isInvulLimited = false;
+                             sendMessage("The Invincible skill effect penalty has been removed.");
+                     }
+             }, limit);
+      }
+   }
}

 

L2Skill.java

   public final L2Effect[] getEffects(L2Character effector, L2Character effected)
   {
       if (isPassive()) return _emptyEffectSet;

       if (_effectTemplates == null)
       	return _emptyEffectSet;

+       if (effected.isInvulLimited() && (getId() == 1505 || getId() == 1496 || getId() == 1427 || getId() == 1418 || getId() == 837 || getId() == 443 || getId() == 442))
+               return _emptyEffectSet;

 

EffectInvincible.java

package net.sf.l2j.gameserver.skills.effects;

import net.sf.l2j.gameserver.model.L2Effect;
+import net.sf.l2j.gameserver.serverpackets.SystemMessage;
import net.sf.l2j.gameserver.skills.Env;

public class EffectInvincible extends L2Effect
{
public EffectInvincible(Env env, EffectTemplate template)
{
	super(env, template);
}

@Override
public EffectType getEffectType()
{
	return L2Effect.EffectType.INVINCIBLE;
}

@Override
public void onStart()
       {
	getEffected().setIsInvul(true);
+               getEffected().startInvulPenalty(true);
+               getEffected().sendMessage("Once the Invincible skill effect is applied, it cannot be re-applied for a certain amount of time.");

       }

 

*Note: For Interlude,you gotta remove skill ids 1496,1505 and 837.

 

Thank you for using it if you ever use it :)

Posted

Make a patch better , good work.

 

I currently face some errors with patch creation in my eclipse,

but as soon as i create the patch,i will post it here :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 我们正在寻找合作伙伴和账号供应商进行合作 我们愿意与以下约会服务的可靠账号供应商建立合作关系: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating 我们考虑长期合作、稳定的供应量以及互利共赢的合作条件。 如果您有任何合作提议,我们很乐意讨论具体细节。 请通过以下联系方式与我们联系。 ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We are looking for partners and account suppliers for cooperation We are open to partnerships with reliable account suppliers for the following dating services: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating We are considering long-term cooperation, stable volumes, and mutually beneficial terms. If you have any offers, we will be glad to discuss the details. Contact us using the details below. ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • We are looking for partners and account suppliers for cooperation We are open to partnerships with reliable account suppliers for the following dating services: ➡ Tinder ➡ Badoo ➡ Bumble ➡ Hinge ➡ Happn ➡ Meetic ➡ VK Dating We are considering long-term cooperation, stable volumes, and mutually beneficial terms. If you have any offers, we will be glad to discuss the details. Contact us using the details below. ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • 社交指标至关重要 可见度、信任度、互动度——这一切都可以通过系统化方式进行提升。 通过我们的 SMM 面板 ,您将获得把活跃度转化为增长的工具:粉丝、互动、转发和点击——一站式解决。 有效链接: SMM 面板: 前往 – 推广您的社交媒体账号。 促销活动 首次试用 SMM 面板即可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单即可。
    • 社交指标至关重要 可见度、信任度、互动度——这一切都可以通过系统化方式进行提升。 通过我们的 SMM 面板 ,您将获得把活跃度转化为增长的工具:粉丝、互动、转发和点击——一站式解决。 有效链接: SMM 面板: 前往 – 推广您的社交媒体账号。 促销活动 首次试用 SMM 面板即可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单即可。
  • 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