Added support for Knockdown Recovery and prevented posture changes /stand, /kneel, /prone and /sit while knocked down

This commit is contained in:
Ziggy
2022-07-05 12:35:35 +02:00
parent da3c132ee7
commit eea133bb17
7 changed files with 89 additions and 5 deletions
+1
View File
@@ -12,6 +12,7 @@ cyborgSureShot RIGHT_CLICK_SPECIAL STANDARD ATTACK HEALTH 1 object/tangib
forceRun Jedi Foce Run X no speed increase atm RIGHT_CLICK_SPECIAL NONE BUFF HEALTH 1 root object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD FALSE FALSE SINGLE_TARGET 0 0 0 0 0 0 0 0 1 0 0 0 0 0 150 0 0 0 0 0 0 0 fs_force_run 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 fs_force_run FALSE perform_notarget ACTION_NAME 0 0 1 0
forceStrike Jedi RIGHT_CLICK_SPECIAL STANDARD ATTACK HEALTH 1 appearance/pt_special_attack_defensive_bonus.prt weapon object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD TRUE TRUE fire_1_single_medium attack_special_knee_strike_medium combo_2b_medium combo_4c_medium combo_4c_medium fire_1_single_medium fire_1_single_medium fire_1_single_medium fire_1_single_medium *heavy_wpn SINGLE_TARGET 0 0 0 0 20 0 1 0 1 0 0 0 0 0 50 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 FALSE ACTION_NAME 0 0 1 0
forceThrow Jedi Force Throw X delay ignored RIGHT_CLICK_SPECIAL STANDARD DELAY_ATTACK HEALTH 1 object/tangible/space/content_infrastructure/generic_egg_small.iff 0 0 1 TARGET STANDARD FALSE TRUE saberthrow_medium saberthrow_medium saberthrow_medium saberthrow_medium saberthrow_medium saberthrow_^ saberthrow_^ saberthrow_^ SINGLE_TARGET 0 0 0 32 0 0 1 0 1 0 0 0 0 0 50 0 0 0 0 0 forceThrow 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 fs_force_throw FALSE perform_target ACTION_NAME 0 0 1 0
knockdownRecovery RIGHT_CLICK_SPECIAL NONE BUFF HEALTH 1 object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD TRUE TRUE SINGLE_TARGET 0 0 0 0 0 0 1 0 1 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 FALSE perform_notarget ACTION_NAME 0 0 1 0
legSweep LEFT_CLICK_DEFAULT STANDARD ATTACK HEALTH 1 object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD TRUE TRUE combo_3d_medium SINGLE_TARGET 0 0 0 0 0 0 0.5 0 1 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 FALSE WEAPON_NAME 0 0 1 60
meleeAssault LEFT_CLICK_DEFAULT STANDARD ATTACK HEALTH 1 object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD TRUE TRUE attack_high_right_medium_0,attack_high_right_medium_1,attack_high_center_medium_0,attack_high_center_medium_1,attack_high_center_1_jab_double_medium,attack_high_center_medium_2,attack_high_left_medium_0,attack_high_left_medium_1,attack_mid_left_medium_0,attack_mid_left_medium_1,attack_mid_left_medium_2,attack_mid_right_medium_0,attack_mid_right_medium_1,attack_mid_right_medium_2,attack_special_elbow_throw_medium SINGLE_TARGET 0 0 0 0 0 0 1.4 0 1 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 FALSE WEAPON_NAME 0 0 1 0
meleeHit LEFT_CLICK_DEFAULT STANDARD ATTACK HEALTH 1 object/tangible/space/content_infrastructure/generic_egg_small.iff -1 3 1 TARGET STANDARD TRUE TRUE attack_high_right_medium_0,attack_high_right_medium_1,attack_high_center_medium_0,attack_high_center_medium_1,attack_high_center_1_jab_double_medium,attack_high_center_medium_2,attack_high_left_medium_0,attack_high_left_medium_1,attack_mid_left_medium_0,attack_mid_left_medium_1,attack_mid_left_medium_2,attack_mid_right_medium_0,attack_mid_right_medium_1,attack_mid_right_medium_2,attack_special_elbow_throw_medium SINGLE_TARGET 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 PISTOL RANGED_WEAPON KINETIC KINETIC 0 0 0 FALSE WEAPON_NAME 0 0 1 0
@@ -29,6 +29,7 @@ package com.projectswg.holocore.resources.support.global.commands.callbacks;
import com.projectswg.common.data.encodables.tangible.Posture;
import com.projectswg.holocore.intents.gameplay.entertainment.dance.DanceIntent;
import com.projectswg.holocore.resources.support.global.commands.ICmdCallback;
import com.projectswg.holocore.resources.support.global.commands.Locomotion;
import com.projectswg.holocore.resources.support.global.player.Player;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
@@ -40,8 +41,14 @@ public class KneelCmdCallback implements ICmdCallback {
@Override
public void execute(@NotNull Player player, SWGObject target, @NotNull String args) {
CreatureObject creature = player.getCreatureObject();
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT))
if (Locomotion.KNOCKED_DOWN.isActive(creature)) {
return;
}
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT)) {
return;
}
if (creature.isPerforming()) {
new DanceIntent(player.getCreatureObject()).broadcast();
} else {
@@ -0,0 +1,60 @@
/***********************************************************************************
* Copyright (c) 2018 /// Project SWG /// www.projectswg.com *
* *
* ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on *
* July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
* Our goal is to create an emulator which will provide a server for players to *
* continue playing a game similar to the one they used to play. We are basing *
* it on the final publish of the game prior to end-game events. *
* *
* This file is part of Holocore. *
* *
* --------------------------------------------------------------------------------*
* *
* Holocore is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* Holocore is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with Holocore. If not, see <http://www.gnu.org/licenses/>. *
***********************************************************************************/
package com.projectswg.holocore.resources.support.global.commands.callbacks;
import com.projectswg.common.data.RGB;
import com.projectswg.common.data.encodables.oob.StringId;
import com.projectswg.common.data.encodables.tangible.Posture;
import com.projectswg.common.network.packets.swg.zone.object_controller.ShowFlyText;
import com.projectswg.holocore.resources.support.global.commands.ICmdCallback;
import com.projectswg.holocore.resources.support.global.commands.Locomotion;
import com.projectswg.holocore.resources.support.global.player.Player;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
import org.jetbrains.annotations.NotNull;
public class KnockdownRecoveryCmdCallback implements ICmdCallback{
@Override
public void execute(@NotNull Player player, SWGObject target, @NotNull String args) {
CreatureObject creatureObject = player.getCreatureObject();
if (Locomotion.KNOCKED_DOWN.isActive(creatureObject)) {
standUp(creatureObject);
} else {
showWrongPostureFlyText(creatureObject);
}
}
private void showWrongPostureFlyText(CreatureObject creatureObject) {
creatureObject.sendSelf(new ShowFlyText(creatureObject.getObjectId(), new StringId("combat_effects", "wrong_posture_fly"), ShowFlyText.Scale.MEDIUM, new RGB(255, 255, 255)));
}
private void standUp(CreatureObject creatureObject) {
creatureObject.setPosture(Posture.UPRIGHT);
}
}
@@ -30,6 +30,7 @@ import com.projectswg.common.data.encodables.tangible.Posture;
import com.projectswg.holocore.intents.gameplay.crafting.survey.StopSamplingIntent;
import com.projectswg.holocore.intents.gameplay.entertainment.dance.DanceIntent;
import com.projectswg.holocore.resources.support.global.commands.ICmdCallback;
import com.projectswg.holocore.resources.support.global.commands.Locomotion;
import com.projectswg.holocore.resources.support.global.player.Player;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
@@ -41,8 +42,14 @@ public class ProneCmdCallback implements ICmdCallback {
@Override
public void execute(@NotNull Player player, SWGObject target, @NotNull String args) {
CreatureObject creature = player.getCreatureObject();
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT))
if (Locomotion.KNOCKED_DOWN.isActive(creature)) {
return;
}
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT)) {
return;
}
if (creature.isPerforming()) {
new DanceIntent(player.getCreatureObject()).broadcast();
} else {
@@ -30,6 +30,7 @@ import com.projectswg.common.data.encodables.tangible.Posture;
import com.projectswg.common.data.location.Location;
import com.projectswg.common.network.packets.swg.zone.object_controller.SitOnObject;
import com.projectswg.holocore.resources.support.global.commands.ICmdCallback;
import com.projectswg.holocore.resources.support.global.commands.Locomotion;
import com.projectswg.holocore.resources.support.global.player.Player;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
@@ -42,7 +43,7 @@ public class SitOnObjectCmdCallback implements ICmdCallback {
public void execute(@NotNull Player player,SWGObject target, @NotNull String args) {
CreatureObject creature = player.getCreatureObject();
if (creature.getPosture() == Posture.DEAD || creature.getPosture() == Posture.INCAPACITATED || creature.isStatesBitmask(CreatureState.RIDING_MOUNT))
if (Locomotion.KNOCKED_DOWN.isActive(creature) || creature.getPosture() == Posture.DEAD || creature.getPosture() == Posture.INCAPACITATED || creature.isStatesBitmask(CreatureState.RIDING_MOUNT))
return;
long objectID = creature.getObjectId();
SitOnObject sot;
@@ -30,6 +30,7 @@ import com.projectswg.common.data.encodables.tangible.Posture;
import com.projectswg.holocore.intents.gameplay.crafting.survey.StopSamplingIntent;
import com.projectswg.holocore.intents.gameplay.entertainment.dance.DanceIntent;
import com.projectswg.holocore.resources.support.global.commands.ICmdCallback;
import com.projectswg.holocore.resources.support.global.commands.Locomotion;
import com.projectswg.holocore.resources.support.global.player.Player;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
@@ -42,9 +43,15 @@ public class StandCmdCallback implements ICmdCallback {
public void execute(@NotNull Player player, SWGObject target, @NotNull String args) {
CreatureObject creature = player.getCreatureObject();
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT))
if (Locomotion.KNOCKED_DOWN.isActive(creature)) {
return;
if(creature.isPerforming()) {
}
if (creature.isStatesBitmask(CreatureState.RIDING_MOUNT)) {
return;
}
if (creature.isPerforming()) {
// Ziggy: When you move while dancing, the client wants to execute /stand instead of /stopDance. Blame SOE.
new DanceIntent(player.getCreatureObject()).broadcast();
} else {
@@ -118,6 +118,7 @@ public class CommandExecutionService extends Service {
registerCppCallback("transferItemWeapon", TransferItemCallback::new);
registerScriptCallback("cmdStartLogout", LogoutCmdCallback::new);
registerCppCallback("requestDraftSlots", RequestDraftSlotsCallback::new);
registerScriptCallback("knockdownRecovery", KnockdownRecoveryCmdCallback::new);
addAdminScripts();
addChatScripts();