Remove existing hack for 35303

This commit is contained in:
KingRainbow44 2023-05-31 22:38:15 -04:00
parent 6448bb1b9b
commit 5430956744
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
3 changed files with 17 additions and 44 deletions

View File

@ -13,12 +13,11 @@ import emu.grasscutter.game.quest.enums.QuestContent;
public class ActionAvatarSkillStart extends AbilityActionHandler {
@Override
public boolean execute(Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
GameEntity owner = ability.getOwner();
if(owner instanceof EntityAvatar avatar) {
var owner = ability.getOwner();
if (owner instanceof EntityAvatar avatar) {
avatar.getPlayer().getQuestManager().queueEvent(QuestContent.QUEST_CONTENT_SKILL, action.skillID);
} else {
Grasscutter.getLogger().warn("AvatarSkillStart not implemented for other entities than EntityAvatar right now");
return false;
}

View File

@ -7,7 +7,6 @@ import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.inventory.*;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.*;
import emu.grasscutter.game.quest.enums.*;
import emu.grasscutter.game.world.*;
import emu.grasscutter.net.proto.AbilityControlBlockOuterClass.AbilityControlBlock;
import emu.grasscutter.net.proto.AbilityEmbryoOuterClass.AbilityEmbryo;
@ -390,20 +389,4 @@ public class EntityAvatar extends GameEntity {
// Set position and rotation.
super.move(event.getDestination(), rotation);
}
@Override
public void onAbilityValueUpdate() {
super.onAbilityValueUpdate();
// TODO: Replace with a proper implementation/call.
// Check if the condition for 35303 is met.
if (this.getGlobalAbilityValues().containsKey("_ABILITY_UziExplode_Count")) {
var count = this.getGlobalAbilityValues().get("_ABILITY_UziExplode_Count");
if (count == 2f) {
this.getGlobalAbilityValues().remove("_ABILITY_UziExplode_Count");
this.getPlayer().getQuestManager()
.queueEvent(QuestContent.QUEST_CONTENT_SKILL, 10006);
}
}
}
}

View File

@ -1,7 +1,5 @@
package emu.grasscutter.scripts;
import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT;
import com.github.davidmoten.rtreemulti.RTree;
import com.github.davidmoten.rtreemulti.geometry.Geometry;
import emu.grasscutter.Grasscutter;
@ -11,37 +9,30 @@ import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.entity.*;
import emu.grasscutter.game.entity.gadget.platform.BaseRoute;
import emu.grasscutter.game.props.EntityType;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestGroupSuite;
import emu.grasscutter.game.world.GridPosition;
import emu.grasscutter.game.world.Position;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.game.world.SceneGroupInstance;
import emu.grasscutter.game.quest.*;
import emu.grasscutter.game.world.*;
import emu.grasscutter.net.proto.VisionTypeOuterClass;
import emu.grasscutter.scripts.constants.EventType;
import emu.grasscutter.scripts.data.*;
import emu.grasscutter.scripts.service.ScriptMonsterSpawnService;
import emu.grasscutter.scripts.service.ScriptMonsterTideService;
import emu.grasscutter.scripts.service.*;
import emu.grasscutter.server.packet.send.PacketGroupSuiteNotify;
import emu.grasscutter.utils.FileUtils;
import emu.grasscutter.utils.JsonUtils;
import emu.grasscutter.utils.*;
import io.netty.util.concurrent.FastThreadLocalThread;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import java.io.FileWriter;
import java.io.IOException;
import it.unimi.dsi.fastutil.ints.*;
import kotlin.Pair;
import lombok.val;
import org.luaj.vm2.*;
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
import javax.annotation.*;
import java.io.*;
import java.nio.file.Files;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import kotlin.Pair;
import lombok.val;
import org.luaj.vm2.LuaError;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.CoerceJavaToLua;
import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT;
public class SceneScriptManager {
private final Scene scene;
@ -272,7 +263,7 @@ public class SceneScriptManager {
targetGroupInstance = getGroupInstanceById(groupId);
Grasscutter.getLogger()
.debug(
"trying to regresh group suite {} in an unloaded and uncached group {} in scene {}",
"Tried to refresh group suite {} in an unloaded and uncached group {} in scene {}.",
suiteId,
groupId,
getScene().getId());