[Only registered and activated users can see links. Click Here To Register...]
skill:2052
Code:
<skill_template skill_id="2052" name="Divine Grasp II" nameId="590791" cooldownId="525" stack="SKILL_KN_LANDSNACHER" lvl="2" skilltype="PHYSICAL" skillsubtype="ATTACK" tslot="DEBUFF" dispel_category="DEBUFF_PHYSICAL" req_dispel_level="1" activation="ACTIVE" cooldown="36000" duration="2000" cancel_rate="10">
<properties first_target="TARGET" first_target_range="15" target_relation="ENEMY" target_type="AREA" target_distance="20" target_maxcount="18" awr="true" revision_distance="12"/>
<startconditions>
<dp value="4000"/>
<weapon weapon="SWORD_2H DAGGER_1H MACE_1H POLEARM_2H STAFF_2H SWORD_1H"/>
</startconditions>
<useconditions>
<playermove allow="false"/>
</useconditions>
<effects>
<skillatk value="203" e="1" hoptype="SKILLLV" hopb="40415">
<subeffect skill_id="8441"/>
</skillatk>
<snare duration2="10000" effectid="20007" e="2" element="EARTH" preeffect="1">
<change stat="SPEED" func="PERCENT" value="-50"/>
<change stat="FLY_SPEED" func="PERCENT" value="-50"/>
</snare>
</effects>
<actions>
<dpuse value="4000"/>
</actions>
<motion name="snatchatk"/>
</skill_template>
java code
Code:
package com.aionemu.gameserver.skillengine.effect;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import com.aionemu.gameserver.model.gameobjects.Creature;
import com.aionemu.gameserver.model.stats.container.StatEnum;
import com.aionemu.gameserver.network.aion.serverpackets.SM_FORCED_MOVE;
import com.aionemu.gameserver.network.aion.serverpackets.SM_TARGET_IMMOBILIZE;
import com.aionemu.gameserver.skillengine.model.Effect;
import com.aionemu.gameserver.skillengine.model.SkillMoveType;
import com.aionemu.gameserver.utils.MathUtil;
import com.aionemu.gameserver.utils.PacketSendUtility;
import com.aionemu.gameserver.world.World;
/**
* @author Sarynth modified by Wakizashi, Sippolo
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PulledEffect")
public class PulledEffect extends EffectTemplate {
@Override
public void applyEffect(Effect effect) {
effect.addToEffectedController();
final Creature effected = effect.getEffected();
effected.getController().cancelCurrentSkill();
effected.getMoveController().abortMove();
World.getInstance().updatePosition(effected, effect.getTargetX(), effect.getTargetY(), effect.getTargetZ(), effected.getHeading());
PacketSendUtility.broadcastPacketAndReceive(effected, new SM_FORCED_MOVE(effected, effected.getObjectId(), effect.getTargetX(), effect.getTargetY(), effect.getTargetZ()));
}
@Override
public void calculate(Effect effect) {
if (effect.getEffected() == null)
return;
if (!super.calculate(effect, StatEnum.PULLED_RESISTANCE, null))
return;
effect.setSkillMoveType(SkillMoveType.PULL);
final Creature effector = effect.getEffector();
// Target must be pulled just one meter away from effector, not IN place of effector
double radian = Math.toRadians(MathUtil.convertHeadingToDegree(effector.getHeading()));
final float x1 = (float) Math.cos(radian);
final float y1 = (float) Math.sin(radian);
effect.setTargetLoc(effector.getX() + x1, effector.getY() + y1, effector.getZ() + 0.25F);
}
@Override
public void startEffect(Effect effect) {
final Creature effected = effect.getEffected();
effected.getEffectController().setAbnormal(AbnormalState.CANNOT_MOVE.getId());
effect.setAbnormal(AbnormalState.CANNOT_MOVE.getId());
//PacketSendUtility.broadcastPacketAndReceive(effect.getEffected(), new SM_TARGET_IMMOBILIZE(effect.getEffected()));
}
@Override
public void endEffect(Effect effect) {
effect.getEffected().getEffectController().unsetAbnormal(AbnormalState.CANNOT_MOVE.getId());
}
}