Author Topic: Interlude Hot Springs (Diseases) AI  (Read 73 times)

Offline ReynalDev

  • Knight
  • ***
  • Posts: 58
  • https://reynaldev.pythonanywhere.com/
    • ReynalDev
Hot Springs (Diseases) AI
« 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.

Code: [Select]
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
L2jDevelopment services: https://reynaldev.pythonanywhere.com/

Online Mobius

  • Administrator
  • Distinguished King
  • *****
  • Posts: 6349

Offline ReynalDev

  • Knight
  • ***
  • Posts: 58
  • https://reynaldev.pythonanywhere.com/
    • ReynalDev
Re: Hot Springs (Diseases) AI
« Reply #2 on: November 28, 2019, 06:15:38 PM »
hohohoho  ;) nice catch
L2jDevelopment services: https://reynaldev.pythonanywhere.com/