Merged various L2jServer changes from 31-08-2020 to 27-07-2022.

This commit is contained in:
MobiusDevelopment
2022-12-26 23:06:05 +00:00
parent d59171586a
commit 473164e739
27 changed files with 169 additions and 79 deletions

View File

@@ -19,6 +19,7 @@ package instances.DarkCloudMansion;
import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
@@ -615,6 +616,7 @@ public class DarkCloudMansion extends AbstractInstance
{
thisNpc = new DMCNpc();
thisNpc.npc = addSpawn(SC, x, y, -6115, 16215, false, 0, false, world.getInstanceId());
thisNpc.npc.disableCoreAI(true);
thisNpc.status = templist[yy][xx];
thisNpc.order = yy;
forthRoom.npcList.add(thisNpc);
@@ -656,6 +658,7 @@ public class DarkCloudMansion extends AbstractInstance
thisNpc = new DMCNpc();
thisNpc.npc = addSpawn(BS[idx], x, 182145, -6117, 48810, false, 0, false, world.getInstanceId());
thisNpc.npc.setRandomWalking(false);
thisNpc.npc.disableCoreAI(true);
thisNpc.order = idx;
thisNpc.status = temp[idx];
thisNpc.count = 0;
@@ -759,6 +762,8 @@ public class DarkCloudMansion extends AbstractInstance
else
{
fifthRoom.reset = 1;
mob.npc.disableCoreAI(false);
mob.npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
mob.npc.broadcastPacket(new NpcSay(mob.npc.getObjectId(), ChatType.NPC_GENERAL, mob.npc.getId(), _faildChat[getRandom(_faildChat.length)]));
startQuestTimer("decayChatBelethSamples", 4000, npc, player);
startQuestTimer("decayBelethSamples", 4500, npc, player);
@@ -1018,9 +1023,17 @@ public class DarkCloudMansion extends AbstractInstance
final DMCRoom forthRoom = world.getParameters().getObject("ForthRoom", DMCRoom.class);
for (DMCNpc mob : forthRoom.npcList)
{
if ((mob.npc == npc) && mob.npc.isInvul() && (getRandom(100) < 12))
if (mob.npc == npc)
{
addSpawn(BM[getRandom(BM.length)], attacker.getX(), attacker.getY(), attacker.getZ(), 0, false, 0, false, world.getInstanceId());
if (mob.npc.isCoreAIDisabled())
{
mob.npc.disableCoreAI(false);
mob.npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
}
if (mob.npc.isInvul() && (getRandom(100) < 12))
{
addSpawn(BM[getRandom(BM.length)], attacker.getX(), attacker.getY(), attacker.getZ(), 0, false, 0, false, world.getInstanceId());
}
}
}
}

View File

@@ -606,7 +606,7 @@ public class Q00334_TheWishingPotion extends Quest
case 1:
{
addSpawn(FAIRY_RUPINA, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 2:
@@ -614,19 +614,19 @@ public class Q00334_TheWishingPotion extends Quest
addSpawn(GRIMA, npc, true, 0, false);
addSpawn(GRIMA, npc, true, 0, false);
addSpawn(GRIMA, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 3:
{
giveItems(player, Q_CERTIFICATE_OF_ROYALTY, 1);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 4:
{
addSpawn(WISDOM_CHEST, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
}
@@ -642,25 +642,25 @@ public class Q00334_TheWishingPotion extends Quest
addSpawn(SUCCUBUS_OF_SEDUCTION, npc, true, 0, false);
addSpawn(SUCCUBUS_OF_SEDUCTION, npc, true, 0, false);
addSpawn(SUCCUBUS_OF_SEDUCTION, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 2:
{
giveAdena(player, 10000, true);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 3:
{
addSpawn(DLORD_ALEXANDROSANCHES, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 4:
{
addSpawn(WISDOM_CHEST, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
}
@@ -673,19 +673,19 @@ public class Q00334_TheWishingPotion extends Quest
case 2:
{
giveAdena(player, 10000, true);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 3:
{
giveItems(player, Q_ANCIENT_CROWN, 1);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
case 4:
{
addSpawn(WISDOM_CHEST, npc, true, 0, false);
qs.set("Exchange", 0);
qs.set(EXCHANGE, 0);
break;
}
}

View File

@@ -78,7 +78,7 @@ public class Q00382_KailsMagicCoin extends Quest
switch (event)
{
case "30386-03.htm":
case "30687-03.htm":
{
if (qs.isCreated())
{
@@ -87,8 +87,8 @@ public class Q00382_KailsMagicCoin extends Quest
}
break;
}
case "30386-05.htm":
case "30386-06.htm":
case "30687-05.htm":
case "30687-06.htm":
{
if (qs.isStarted())
{

View File

@@ -138,10 +138,10 @@ public class Q00628_HuntGoldenRam extends Quest
public String onKill(Npc npc, Player killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 1, npc);
if (qs != null)
if ((qs != null) && !qs.isCond(3))
{
final ItemChanceHolder item = MOBS_DROP_CHANCES.get(npc.getId());
if ((item.getCount() <= qs.getCond()) && !qs.isCond(3))
if (item.getCount() <= qs.getCond())
{
giveItemRandomly(qs.getPlayer(), npc, item.getId(), 1, REQUIRED_ITEM_COUNT, item.getChance(), true);
}

View File

@@ -348,7 +348,7 @@ public class Q00648_AnIceMerchantsDream extends Quest
if (hasQuestItems(player, SILVER_ICE_CRYSTAL))
{
final int val = qs.getInt("ex") % 10;
if (val == 0)
if (!qs.isSet("ex") || (val == 0))
{
htmltext = "32023-03.html";
qs.set("ex", 0);