L2JMobius
Free Users => Shares/Contributions => Archived User Contributions => Topic started by: ReynalDev on November 27, 2019, 11:22:28 PM
-
I made this to "solve" the problem about diseases in Hot Springs, you might have aCis script. Actually i made this using .py script and aCis script.
package com.l2jfrozen.gameserver.ai.special;
import java.util.concurrent.ThreadLocalRandom;
import com.l2jfrozen.gameserver.datatables.SkillTable;
import com.l2jfrozen.gameserver.model.L2Effect;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
/**
* @author ReynalDev
*/
public class HotSprings extends Quest
{
private static final int DISEASE_CHANCE = 1;
private static final int[] MONSTERS = { 21314, 21316, 21317, 21319, 21321, 21322 };
private static final int[] DESEASES = { 4551, 4552, 4553, 4554 };
public HotSprings()
{
super(-1, "Hot Springs", "Hot Springs deseases");
for (int mobId : MONSTERS)
{
addAttackId(mobId);
}
}
@Override
public String onAttack(L2NpcInstance npc, L2PcInstance attacker, int damage, boolean isPet)
{
if (ThreadLocalRandom.current().nextInt(100) < DISEASE_CHANCE)
{
int level = 1;
int skillId = DESEASES[ThreadLocalRandom.current().nextInt(DESEASES.length)];
L2Effect effect = attacker.getFirstEffect(skillId);
if(effect != null)
{
level = effect.getLevel() + 1;
}
if(level > 10)
level = 10;
SkillTable.getInstance().getInfo(skillId, level).getEffects(npc, attacker);
}
return super.onAttack(npc, attacker, damage, isPet);
}
}
You have to register this script wherever you have to xD
-
We already have HotSprings AI.
https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/areas/HotSprings/HotSprings.java
-
hohohoho ;) nice catch
-
Archived.