Jump to content

Code New Debuff Effects + Conditions


Recommended Posts

well all u know the special effects that gm's have.

the effect to dance when u are stunning and the effect of stun with a fire in the ground

so i was thinking about some new skills on bd and i remembered that effect of the stunning dance so i thought that it will be cool a skill like dat ;D

anyway lets start ;D

 

create in gameserver/skills/effects this

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.skills.effects;

import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Effect;
import com.l2jfrozen.gameserver.skills.Env;

final class EffectStunDance extends L2Effect
{

	public EffectStunDance(Env env, EffectTemplate template)
	{
		super(env, template);
	}

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

	@Override
	public void onStart()
	{
		getEffected().stopMove(null);
		getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_DANCE_STUNNED);
		getEffected().setIsParalyzed(true);
	}

	@Override
	public void onExit()
	{
		getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_DANCE_STUNNED);
		getEffected().setIsParalyzed(false);
	}

	@Override
	public boolean onActionTime()
	{
		return false;
	}
}

and this 

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.skills.effects;

import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.L2Effect;
import com.l2jfrozen.gameserver.skills.Env;

final class EffectStunFireRoot extends L2Effect
{

	public EffectStunFireRoot(Env env, EffectTemplate template)
	{
		super(env, template);
	}

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

	@Override
	public void onStart()
	{
		getEffected().stopMove(null);
		getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_FIREROOT_STUN);
		getEffected().setIsParalyzed(true);
	}

	@Override
	public void onExit()
	{
		getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_FIREROOT_STUN);
		getEffected().setIsParalyzed(false);
	}

	@Override
	public boolean onActionTime()
	{
		return false;
	}
}

now in model/L2Effect.java

find this

NEGATE,

and below add these

		STUNDANCE,
		FIREROOT, 

now in model/L2Character.java

find this

public static final int ABNORMAL_EFFECT_GROW = 0x010000;

and add below these

 

/** The Constant ABNORMAL_EFFECT_DANCE_STUNNED. */
public static final int ABNORMAL_EFFECT_DANCE_STUNNED = 0x040000;


/** The Constant ABNORMAL_EFFECT_FIREROOT_STUN. */
public static final int ABNORMAL_EFFECT_FIREROOT_STUN = 0x080000;

and last in gameserver/skills/DocumentBase.java

find this

			else if(abn.equals("stealth"))
			{
				abnormal = L2Character.ABNORMAL_EFFECT_STEALTH;
			}

and below add these

			else if(abn.equals("dance"))
			{
				abnormal = L2Character.ABNORMAL_EFFECT_DANCE_STUNNED;
			}
			else if(abn.equals("fireroot"))
			{
				abnormal = L2Character.ABNORMAL_EFFECT_FIREROOT_STUN;
			}

now u can add new skills with these effects ;D

example:

 

<skill id="367" levels="1" name="Dance of Medusa">
<set name="magicLvl" val="77"/>
<set name="mpConsume" val="53"/>
<set name="weaponsAllowed" val="512"/>
<set name="power" val="80"/>
<set name="saveVs" val="MEN"/>
<set name="skillRadius" val="150"/>
<set name="target" val="TARGET_AURA"/>
<set name="skillType" val="PARALYZE"/>
<set name="operateType" val="OP_ACTIVE"/>
<set name="hitTime" val="2000"/>
<set name="reuseDelay" val="120000"/>
<set name="isDebuff" val="true"/>
<set name="element" val="4"/>
<!-- Earth -->
<set name="lvlDepend" val="1"/>
<for>
<!-- <effect count="1" name="Petrification" time="30" val="0"/> -->
<!-- The player that will "eat" the debuff will get stunned and start dancing for 30sec. the dancing effect doesnt work in monster -->
<effect count="1" name="StunDance" time="30" val="0"/>
</for>
</skill>
<skill id="402" levels="10" name="Arrest" enchantLevels1="30" enchantLevels2="30">
  <table name="#enchantMagicLvl">76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85</table>
  <enchant1 name="magicLvl" val="#enchantMagicLvl"/>
  <enchant2 name="magicLvl" val="#enchantMagicLvl"/>
  <table name="#power">80 81 82 82 83 84 84 85 86 86 87 88 88 89 90 90 91 92 92 93 94 94 95 96 96 97 98 98 99 100</table>
  <table name="#chance">80 81 82 82 83 84 84 85 86 86 87 88 88 89 90 90 91 92 92 93 94 94 95 96 96 97 98 98 99 100</table>
  <table name="#mpConsume">25 27 28 29 30 31 32 33 34 34</table>
  <set name="mpConsume" val="#mpConsume"/>
  <set name="power" val="125"/>
  <set name="saveVs" val="MEN"/>
  <set name="lvlDepend" val="2"/>
  <set name="target" val="TARGET_ONE"/>
  <set name="reuseDelay" val="16000"/>
  <set name="hitTime" val="2000"/>
  <set name="skillType" val="ROOT"/>
  <set name="operateType" val="OP_ACTIVE"/>
  <set name="castRange" val="150"/>
  <set name="effectRange" val="650"/>
  <set name="isDebuff" val="true" />
  <enchant1 name="power" val="#power"/>
  <enchant2 name="power" val="#chance"/>
  <for>
  <!--  <effect count="1" name="Root" time="7" val="0" stackOrder="1" stackType="Root"/> -->
<!-- The player that will "eat" the debuff will get stunned and shows a fire arrest him for 7sec. the fire effect doesnt work in monster -->
         <effect count="1" name="StunFireRoot" time="7" val="0" stackOrder="1" stackType="Root"/>
  </for>
</skill>

thats for the effects ;p

 

now the conditions.

the conditions are taken from client gracia++ i dont even know ;D

it works like the restorations skills of kamael.

u need to have a effect on u so u can use another skill

 

gameserver/skills/conditions.java

create new files

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jfrozen.gameserver.skills.conditions;

import com.l2jfrozen.gameserver.model.L2Effect;
import com.l2jfrozen.gameserver.skills.Env;

public class ConditionTargetActiveEffectId extends Condition
{
    
    private final int _effectId;
    
    public ConditionTargetActiveEffectId(int effectId)
    {
        _effectId = effectId;
    }
    
    @Override
    public boolean testImpl(Env env)
    {
        for (L2Effect e : env.target.getAllEffects())
        {
            if (e != null)
            {
                if (e.getSkill().getId() == _effectId)
                    return true;
            }
        }
        return false;
    }
}

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jfrozen.gameserver.skills.conditions;

import com.l2jfrozen.gameserver.model.L2Skill;
import com.l2jfrozen.gameserver.skills.Env;

public class ConditionTargetActiveSkillId extends Condition
{
    
    private final int _skillId;
    
    public ConditionTargetActiveSkillId(int skillId)
    {
        _skillId = skillId;
    }
    
    @Override
    public boolean testImpl(Env env)
    {
        for (L2Skill sk : env.target.getAllSkills())
        {
            if (sk != null)
            {
                if (sk.getId() == _skillId)
                    return true;
            }
        }
        return false;
    }
}

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.skills.conditions;

import com.l2jfrozen.gameserver.skills.Env;

/**
 * @author mkizub
 */
public class ConditionTargetSkill extends Condition
{

	private final int _skill;

	public ConditionTargetSkill(int skillId)
	{
		_skill = skillId;
	}

	@Override
	public boolean testImpl(Env env)
	{
		if(env.target == null)
			return false;
		return env.target.getAbnormalEffect() == _skill;
	}
}

thats it now in gameserver/skills/DocumentBase.java

find this

import com.l2jfrozen.gameserver.skills.conditions.ConditionPlayerState;

and add these below

import com.l2jfrozen.gameserver.skills.conditions.ConditionTargetActiveEffectId;
import com.l2jfrozen.gameserver.skills.conditions.ConditionTargetActiveSkillId;

now find this

			else if("class_id_restriction".equalsIgnoreCase(a.getNodeName()))
			{
				FastList<Integer> array = new FastList<Integer>();
				StringTokenizer st = new StringTokenizer(a.getNodeValue(), ",");
				while(st.hasMoreTokens())
				{
					String item = st.nextToken().trim();
					array.add(Integer.decode(getValue(item, null)));
				}
				cond = joinAnd(cond, new ConditionTargetClassIdRestriction(array));
			}

and below add these

            else if ("active_effect_id".equalsIgnoreCase(a.getNodeName()))
            {
                int effect_id = Integer.decode(getValue(a.getNodeValue(), template));
            	cond = joinAnd(cond, new ConditionTargetActiveEffectId(effect_id));
            }
            else if ("active_skill_id".equalsIgnoreCase(a.getNodeName()))
            {
                int skill_id = Integer.decode(getValue(a.getNodeValue(), template));
                cond = joinAnd(cond, new ConditionTargetActiveSkillId(skill_id));
            }

thats it ;D finished.

example

 

create this (its spoil skill transformed into restoration)

	<skill id="254" levels="8" name="Restoration">
		<table name="#mpConsume_Init"> 21 25 14 16 17 19 20 20 </table>
		<table name="#mpConsume"> 49 57 34 38 41 43 45 48 </table>
		<table name="#hot"> 45 54 66 75 81 87 90 96 </table>
		<table name="#ench1Heal"> 96 99 99 102 105 108 111 114 114 117 120 123 126 126 129 132 135 138 141 141 144 147 150 153 153 156 159 162 165 168 </table>
		<table name="#ench2Count"> 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 </table>
		<table name="#ench2mpInitialConsume"> 13 13 13 12 12 12 12 12 11 11 11 11 10 10 10 10 9 9 9 9 9 8 8 8 8 7 7 7 7 7 </table>
		<table name="#ench2mpConsume"> 53 52 50 50 49 48 48 46 46 45 44 42 42 41 40 38 38 38 37 36 34 34 33 32 30 30 29 29 28 26 </table>
		<set name="mpInitialConsume" val="#mpConsume_Init" />
		<set name="mpConsume" val="#mpConsume" />
		<set name="hitTime" val="2500" />
		<set name="operateType" val="OP_ACTIVE" />
		<set name="isMagic" val="true" />
		<set name="target" val="TARGET_ONE" />
		<set name="skillType" val="HOT" />
		<set name="castRange" val="600" />
		<set name="effectRange" val="1100" />
		<set name="reuseDelay" val="3000" />
		<enchant2 name="mpInitialConsume" val="#ench2mpInitialConsume" />
		<enchant2 name="mpConsume" val="#ench2mpConsume" />
		<for>
			<effect count="5" name="HealOverTime" time="3" val="#hot" stackOrder="1" stackType="touch_of_life">
			</effect>
		</for>
	</skill>
	<skill id="302" levels="3" name="Restoration Impact" enchantGroup1="1">
		<table name="#mpConsume_Init"> 7 8 10 </table>
		<table name="#mpConsume"> 16 20 23 </table>
		<table name="#power"> 10 15 20 </table>
		<table name="#ench1Power"> 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 </table>
		<set name="aggroPoints" val="#power" />
		<set name="mpInitialConsume" val="#mpConsume_Init" />
		<set name="mpConsume" val="#mpConsume" />
		<set name="power" val="#power" />
		<set name="hitTime" val="1000" />
		<set name="operateType" val="OP_ACTIVE" />
		<set name="isMagic" val="true" />
		<set name="target" val="TARGET_ONE" />
		<set name="skillType" val="HEAL_PERCENT" />
		<set name="castRange" val="600" />
		<set name="effectRange" val="1100" />
		<set name="reuseDelay" val="15000" />
		<set name="negateId" val="254" />
		<enchant1 name="power" val="#ench1Power" />
		<cond msg="You must use Restoration first">
			<target active_effect_id="254" />
		</cond>
		<for>
			<effect name="Negate" val="0" noicon="1" effectType="NEGATE" />
		</for>
	</skill>

so in order to use Restoration Impact u need the effect of "<target active_effect_id="254" />" 254 = Restoration

and u're done ;D u will be able to use Restoration Impact only if u have the effect of Restoration on you :)

Edited by te0x
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Posts

    • Our pack is based on - latest - acis rev with our own updates. What you're describing is old, garbage outdated acis revs that were indeed as bad as you're describing. Our formulas are 100% retail and yes, that means the classes you mentioned are strong, but at the same time you're forgetting that the same goes for all classes. Welcome to Interlude where all classes are very strong unlike H5 where all classes couldn't solo kill anyone in mass pvp unless the target was massively cancelled.   Skill spam is based on skill re-use formulas and atk speed which are also retail on our files. Also skill cooltime which is something only people who bother with skilldata are aware of. The files you're talking about are extremely outdated.   You completely forgot about mages and their retail MC rate and multiplier on Interlude which was indeed the most broken class on the client. You could google L2 Teon interlude forum archives and people talking about that sph "progamer" (from ITT side) who once obtained valakas + passive wild magic he was nearly 100% mcriting (x4) and solo-ing parties by himself with a single support behind him. I'm pretty sure if you youtube search "progamer l2" or "progamer lineage" you will find a few ridiculous videos of him.   Ah forgot to mention that the OBT is live and available for you to run your own tests. If you test something and think it's not retail like, THEN you can come to me and report it. Right now you're assuming based on information from 5 years ago.     His post would make sense back in 2016-17 probably
    • hello can some1 help me to instal sql files?  i have thisproblem and i cant find where to put batch of mysql  https://ibb.co/tZ8Ccp2
    • I was sitting here, thinking long and hard about where to begin or how to properly adress this post, but the only thing I can say is... "?"
    • not mentioning about gameplay but trying to have retail balance on acis gonna be a big problem. im 100% sure that the server gonna fail for this delusional idea. even in best scenario, if everything goes well, l2 itself designed without mana potions and limited buff times. so in general; with full buffs and unlimited mana potions, most of the classes will be over powered e.g duelist, grand khavatari. imagine a tyrant/glad goes aoe fight in full retail balance. a single glad can take over a party without its cp been decreased. there was a reason that those classes being nerfed in servers where you have access on mana potions and full buffs. not even talking about dagger classes' full retail formulas in l2j acis. you cant even compare l2off's and acis' movement system. that means in l2off, lets say in 5 seconds you can use 5 skills, in acis you can bypass the limit with its bad optimized movement system and possibly can spam 10 skills in that timeline. both, retail values and having to work on acis is a bad idea.
    • Hidden Content. You need to become Premium Member in order to view this.
  • 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 Disbaled AdBlock