L2JMobius

Free Users => Shares/Contributions => Archived User Contributions => Topic started by: ReynalDev on November 27, 2019, 11:22:28 PM

Title: Hot Springs (Diseases) AI
Post 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.

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
Title: Re: Hot Springs (Diseases) AI
Post by: Mobius on November 28, 2019, 12:48:16 AM
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
Title: Re: Hot Springs (Diseases) AI
Post by: ReynalDev on November 28, 2019, 06:15:38 PM
hohohoho  ;) nice catch
Title: Re: Hot Springs (Diseases) AI
Post by: Mobius on December 12, 2019, 02:44:34 AM
Archived.