Added Heal Over Time buffs, finished most of commando except kill meter and some abilities

This commit is contained in:
Light2
2013-11-25 22:10:33 +01:00
parent 23aeb02249
commit bb085477c4
26 changed files with 447 additions and 38 deletions
+10
View File
@@ -0,0 +1,10 @@
import sys
def setup(core, actor, buff):
actor.addSkillMod('expertise_innate_reduction_all_player', 6 * buff.getStacks())
return
def removeBuff(core, actor, buff):
actor.deductSkillMod('expertise_innate_reduction_all_player', 6 * buff.getStacks())
return
+12
View File
@@ -0,0 +1,12 @@
import sys
def setup(core, actor, buff):
core.skillModService.addSkillMod(actor, 'expertise_innate_protection_all', 1000)
core.skillModService.addSkillMod(actor, 'expertise_critical_niche_all', 5)
return
def removeBuff(core, actor, buff):
core.skillModService.deductSkillMod(actor, 'expertise_innate_protection_all', 1000)
core.skillModService.deductSkillMod(actor, 'expertise_critical_niche_all', 5)
return
+55
View File
@@ -0,0 +1,55 @@
import sys
def setup(core, actor, buff):
actor.setSpeedMultiplierMod(0)
core.skillModService.addSkillMod(actor, 'precision_modified', 200)
core.skillModService.addSkillMod(actor, 'strength_modified', 200)
if actor.getSkillMod('expertise_action_line_co_imp_pos_sec'):
core.skillModService.addSkillMod(actor, 'expertise_action_all', actor.getSkillMod('expertise_action_line_co_imp_pos_sec').getBase())
#if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_proc'):
if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus'):
core.skillModService.addSkillMod(actor, 'expertise_devastation_bonus', actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus').getBase() * 10)
if actor.getSkillMod('expertise_co_pos_secured_line_critical'):
core.skillModService.addSkillMod(actor, 'display_only_critical', actor.getSkillMod('expertise_co_pos_secured_line_critical').getBase() * 100)
if actor.getSkillMod('expertise_co_pos_secured_line_protection'):
core.skillModService.addSkillMod(actor, 'display_only_expertise_critical_hit_reduction', actor.getSkillMod('expertise_co_pos_secured_line_protection').getBase() * 100)
if actor.hasSkill('expertise_co_base_of_operations_1'):
if actor.getGroupId() != 0 and core.objectService.getObject(actor.getGroupId()):
group = core.objectService.getObject(actor.getGroupId())
for member in group.getMemberList():
core.buffService.addBuffToCreature(member, 'co_base_of_operations')
else:
core.buffService.addBuffToCreature(actor, 'co_base_of_operations')
return
def removeBuff(core, actor, buff):
actor.setSpeedMultiplierMod(1)
core.skillModService.deductSkillMod(actor, 'precision_modified', 200)
core.skillModService.deductSkillMod(actor, 'strength_modified', 200)
if actor.getSkillMod('expertise_action_line_co_imp_pos_sec'):
core.skillModService.deductSkillMod(actor, 'expertise_action_all', actor.getSkillMod('expertise_action_line_co_imp_pos_sec').getBase())
#if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_proc'):
if actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus'):
core.skillModService.deductSkillMod(actor, 'expertise_devastation_bonus', actor.getSkillMod('expertise_co_pos_secured_line_burst_fire_devastation_bonus').getBase() * 10)
if actor.getSkillMod('expertise_co_pos_secured_line_critical'):
core.skillModService.deductSkillMod(actor, 'display_only_critical', actor.getSkillMod('expertise_co_pos_secured_line_critical').getBase() * 100)
if actor.getSkillMod('expertise_co_pos_secured_line_protection'):
core.skillModService.deductSkillMod(actor, 'display_only_expertise_critical_hit_reduction', actor.getSkillMod('expertise_co_pos_secured_line_protection').getBase() * 100)
if actor.hasSkill('expertise_co_base_of_operations_1'):
if actor.getGroupId() != 0 and core.objectService.getObject(actor.getGroupId()):
group = core.objectService.getObject(actor.getGroupId())
for member in group.getMemberList():
core.buffService.removeBuffToCreature(member, 'co_base_of_operations')
else:
core.buffService.removeBuffToCreature(actor, 'co_base_of_operations')
return
+19
View File
@@ -0,0 +1,19 @@
import sys
def setup(core, actor, buff):
if actor.getSkillMod('expertise_buff_duration_line_co_stand_fast'):
buff.setDuration(buff.getDuration() + actor.getSkillMod('expertise_buff_duration_line_co_stand_fast').getBase())
if actor.getSkillMod('expertise_damage_decrease_percentage'):
core.skillModService.addSkillMod(actor, 'damage_decrease_percentage', (60 + actor.getSkillMod('expertise_damage_decrease_percentage').getBase()) / 2)
else:
core.skillModService.addSkillMod(actor, 'damage_decrease_percentage', 60 / 2)
return
def removeBuff(core, actor, buff):
if actor.getSkillMod('expertise_damage_decrease_percentage'):
core.skillModService.deductSkillMod(actor, 'damage_decrease_percentage', (60 + actor.getSkillMod('expertise_damage_decrease_percentage').getBase()) / 2)
else:
core.skillModService.deductSkillMod(actor, 'damage_decrease_percentage', 60 / 2)
return
+14
View File
@@ -0,0 +1,14 @@
import sys
def setup():
return
def run(core, actor, target, commandString):
if actor.hasBuff('co_position_secured'):
core.buffService.removeBuffFromCreature(actor, actor.getBuff('co_position_secured'))
else:
core.buffService.addBuffToCreature(actor, 'co_position_secured')
return
@@ -0,0 +1,9 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_cooldown_line_co_riddle_armor'):
command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_riddle_armor').getBase())
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
+15
View File
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
+15
View File
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
+15
View File
@@ -0,0 +1,15 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_area_size_line_co_grenade'):
command.setConeLength(command.getConeLength() + actor.getSkillMod('expertise_area_size_line_co_grenade').getBase())
if actor.getSkillMod('expertise_damage_line_co_grenade'):
command.setAddedDamage(command.getAddedDamage() * (1 + (actor.getSkillMod('expertise_damage_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_action_line_co_grenade'):
command.setActionCost(command.getActionCost() * (1 - (actor.getSkillMod('expertise_action_line_co_grenade').getBase() / 100)))
if actor.getSkillMod('expertise_delay_reduce_line_co_grenade'):
command.setDelayAttackInterval(command.getDelayAttackInterval() - 1)
return
def run(core, actor, target, commandString):
return
@@ -0,0 +1,9 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_cooldown_line_co_riddle_armor'):
command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_riddle_armor').getBase())
return
def run(core, actor, target, commandString):
return
+9
View File
@@ -0,0 +1,9 @@
import sys
def setup(core, actor, target, command):
if actor.getSkillMod('expertise_cooldown_line_co_stand_fast'):
command.setCooldown(command.getCooldown() - actor.getSkillMod('expertise_cooldown_line_co_stand_fast').getBase())
return
def run(core, actor, target, commandString):
return
@@ -2,11 +2,11 @@ import sys
def add(core, actor, name, base):
actor.addSkillMod(name, base)
core.skillModService.addSkillMod(actor, 'display_only_critical', 100 * (actor.getSkillModBase('expertise_critical_niche_all')))
core.skillModService.addSkillMod(actor, 'display_only_critical', 100 * base)
return
def deduct(core, actor, name, base):
actor.deductSkillMod(name, base)
core.skillModService.deductSkillMod(actor, 'display_only_critical', 100 * (actor.getSkillModBase('expertise_critical_niche_all')))
core.skillModService.deductSkillMod(actor, 'display_only_critical', 100 * base)
return
@@ -1,10 +1,22 @@
import sys
def add(core, actor, name, base):
actor.addSkillMod('energy', base)
actor.addSkillMod('kinetic', base)
actor.addSkillMod('acid', base)
actor.addSkillMod('heat', base)
actor.addSkillMod('cold', base)
actor.addSkillMod('electricity', base)
actor.addSkillMod(name, base)
return
def deduct(core, actor, name, base):
actor.deductSkillMod('energy', base)
actor.deductSkillMod('kinetic', base)
actor.deductSkillMod('acid', base)
actor.deductSkillMod('heat', base)
actor.deductSkillMod('cold', base)
actor.deductSkillMod('electricity', base)
actor.deductSkillMod(name, base)
return
@@ -45,6 +45,7 @@ import engine.clients.Client;
import resources.objects.Buff;
import resources.objects.DamageOverTime;
import resources.objects.SWGList;
import engine.resources.common.CRC;
import engine.resources.objects.IPersistent;
import engine.resources.objects.MissionCriticalObject;
import engine.resources.objects.SWGObject;
@@ -926,32 +927,25 @@ public class CreatureObject extends TangibleObject implements IPersistent {
if(destination != getClient()) {
UpdatePVPStatusMessage upvpm = new UpdatePVPStatusMessage(getObjectID());
if (factionStatus == 1 && faction == "imperial") {
if (factionStatus == 1 && faction.equals("imperial")) {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Imperial);
upvpm.setStatus(16);
}
if (factionStatus == 1 && faction == "rebel") {
} else if (factionStatus == 1 && faction.equals("rebel")) {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Rebel);
upvpm.setStatus(16);
}
if (factionStatus == 2 && faction == "imperial") {
} else if (factionStatus == 2 && faction.equals("imperial")) {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Imperial);
upvpm.setStatus(55);
}
if (factionStatus == 2 && faction == "rebel") {
} else if (factionStatus == 2 && faction.equals("rebel")) {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Rebel);
upvpm.setStatus(55);
}
if(factionStatus == 0 && faction == "neutral" && getClient() != null) {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Neutral);
} else if(getSlottedObject("ghost") != null) {
upvpm.setFaction(CRC.StringtoCRC(faction));
upvpm.setStatus(16);
}
else {
} else {
upvpm.setFaction(UpdatePVPStatusMessage.factionCRC.Neutral);
upvpm.setStatus(0);
}
}
destination.getSession().write(upvpm.serialize());
}
}
+12 -1
View File
@@ -201,7 +201,7 @@ public class GroupService implements INetworkDispatch {
creature.setGroupId(0);
creature.makeUnaware(group);
creature.sendSystemMessage("You have left the group.", (byte) 0);
for(SWGObject member : memberList) {
CreatureObject creature2 = (CreatureObject) member;
@@ -209,6 +209,12 @@ public class GroupService implements INetworkDispatch {
}
// Remove group buffs
if(creature.hasBuff("co_base_of_operations"))
core.buffService.removeBuffFromCreature(creature, creature.getBuffByName("co_base_of_operations"));
} else {
for(SWGObject member : memberList) {
@@ -224,6 +230,11 @@ public class GroupService implements INetworkDispatch {
creature2.makeUnaware(group);
creature2.sendSystemMessage("The group has been disbanded.", (byte) 0);
// Remove group buffs
if(creature2.hasBuff("co_base_of_operations"))
core.buffService.removeBuffFromCreature(creature2, creature2.getBuffByName("co_base_of_operations"));
}
+2 -2
View File
@@ -169,7 +169,7 @@ public class PlayerService implements INetworkDispatch {
});
swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() {
/*swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer buffer) throws Exception {
@@ -198,7 +198,7 @@ public class PlayerService implements INetworkDispatch {
}
});
});*/
}
+10 -3
View File
@@ -23,6 +23,7 @@ package services;
import java.util.Map;
import resources.common.FileUtilities;
import resources.objects.SWGList;
import resources.objects.creature.CreatureObject;
import main.NGECore;
@@ -40,13 +41,19 @@ public class SkillModService implements INetworkDispatch {
public void addSkillMod(CreatureObject creature, String skillMod, int value) {
core.scriptService.callScript("scripts/skillMods/", skillMod, "add", core, creature, skillMod, value);
if(FileUtilities.doesFileExist("scripts/skillMods/" + skillMod + ".py"))
core.scriptService.callScript("scripts/skillMods/", skillMod, "add", core, creature, skillMod, value);
else
creature.addSkillMod(skillMod, value);
}
public void deductSkillMod(CreatureObject creature, String skillMod, int value) {
core.scriptService.callScript("scripts/skillMods/", skillMod, "deduct", core, creature, skillMod, value);
if(FileUtilities.doesFileExist("scripts/skillMods/" + skillMod + ".py"))
core.scriptService.callScript("scripts/skillMods/", skillMod, "deduct", core, creature, skillMod, value);
else
creature.deductSkillMod(skillMod, value);
}
+18 -6
View File
@@ -30,6 +30,7 @@ import org.apache.mina.core.session.IoSession;
import protocol.swg.ExpertiseRequestMessage;
import resources.common.Console;
import resources.common.FileUtilities;
import resources.common.Opcodes;
import resources.objects.creature.CreatureObject;
import resources.objects.player.PlayerObject;
@@ -144,8 +145,10 @@ public class SkillService implements INetworkDispatch {
}
}
for (String ability : abilities) {
creature.addAbility(ability);
if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script
for (String ability : abilities) {
creature.addAbility(ability);
}
}
for (String skillMod : skillMods) {
@@ -209,8 +212,10 @@ public class SkillService implements INetworkDispatch {
//creature.addExpertisePoints(pointsRequired);
}
for (String ability : abilities) {
creature.removeAbility(ability);
if(!skill.contains("expertise")) { // only mark 1 abilities in datatable need to remove abilities per script
for (String ability : abilities) {
creature.removeAbility(ability);
}
}
for (String skillMod : skillMods) {
@@ -235,7 +240,7 @@ public class SkillService implements INetworkDispatch {
@Override
public void insertOpcodes(Map<Integer, INetworkRemoteEvent> swgOpcodes, Map<Integer, INetworkRemoteEvent> objControllerOpcodes) {
/*swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() {
swgOpcodes.put(Opcodes.ExpertiseRequestMessage, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer buffer) throws Exception {
@@ -256,13 +261,20 @@ public class SkillService implements INetworkDispatch {
return;
CreatureObject creature = (CreatureObject) client.getParent();
PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost");
if(player == null)
return;
for(String expertiseName : expertise.getExpertiseSkills()) {
addSkill(creature, expertiseName);
if(!FileUtilities.doesFileExist("scripts/expertise/" + expertiseName + ".py"))
continue;
core.scriptService.callScript("scripts/expertise/", "addAbilities", expertiseName, core, creature, player);
}
}
});*/
});
}
+4 -7
View File
@@ -64,7 +64,6 @@ public class CombatCommands {
core.commandService.registerCombatCommand("fireStunCannon");
core.commandService.registerCombatCommand("fireVoidRocketLauncher");
// Bounty Hunter
core.commandService.registerCombatCommand("bh_ae_dm_1");
@@ -130,8 +129,6 @@ public class CombatCommands {
core.commandService.registerCombatCommand("bh_sh_2");
core.commandService.registerCombatCommand("bh_sh_3");
// Jedi
core.commandService.registerCombatCommand("fs_sweep_1");
@@ -195,7 +192,6 @@ public class CombatCommands {
core.commandService.registerCommand("fs_buff_invis_1"); // Force Cloak
core.commandService.registerCombatCommand("fs_force_throw_1");
core.commandService.registerCommand("forceThrow");
// Commando
@@ -233,8 +229,8 @@ public class CombatCommands {
core.commandService.registerCombatCommand("co_ae_hw_dot_kinetic_4");
core.commandService.registerCombatCommand("co_ae_hw_dot_kinetic_5");
core.commandService.registerCombatCommand("co_armor_cracker");
core.commandService.registerCombatCommand("co_cluster_bomb");
core.commandService.registerCombatCommand("co_cluster_bomblet");
//core.commandService.registerCombatCommand("co_cluster_bomb");
//core.commandService.registerCombatCommand("co_cluster_bomblet");
core.commandService.registerCombatCommand("co_del_ae_cc_1_1");
core.commandService.registerCombatCommand("co_del_ae_cc_1_2");
core.commandService.registerCombatCommand("co_del_ae_cc_1_3");
@@ -307,9 +303,10 @@ public class CombatCommands {
core.commandService.registerCombatCommand("co_sh_1");
core.commandService.registerCombatCommand("co_sh_2");
core.commandService.registerCombatCommand("co_sh_3");
core.commandService.registerCombatCommand("co_stand_fast");
core.commandService.registerCommand("co_hw_dot");
core.commandService.registerCommand("co_ae_hw_dot");
core.commandService.registerCommand("co_position_secured");
// Entertainer
+115 -1
View File
@@ -327,6 +327,11 @@ public class CombatService implements INetworkDispatch {
}
if(command.getAttackType() != 1 && target.getSkillMod("area_damage_resist_full_percentage") != null) {
if(new Random().nextFloat() <= target.getSkillModBase("area_damage_resist_full_percentage"))
damage = 0;
}
if(damage > 0)
applyDamage(attacker, target, (int) damage);
@@ -433,6 +438,9 @@ public class CombatService implements INetworkDispatch {
baseArmor = target.getSkillMod("electricity").getBase();
}
if(target.getSkillMod("expertise_innate_reduction_all_player") != null)
baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100;
float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000);
@@ -677,7 +685,7 @@ public class CombatService implements INetworkDispatch {
}
float critChance = (float) attacker.getSkillMod("display_only_critical").getBase() / 10000;
float critChance = (float) (attacker.getSkillMod("display_only_critical").getBase() - target.getSkillModBase("display_only_expertise_critical_hit_reduction")) / 10000;
r = random.nextFloat();
if(r <= critChance)
return HitType.CRITICAL;
@@ -845,6 +853,12 @@ public class CombatService implements INetworkDispatch {
private void doSingleTargetHeal(CreatureObject healer, CreatureObject target, WeaponObject weapon, CombatCommand command, int actionCounter) {
if(command.getDotDuration() > 0) {
addHealOverTimeToCreature(healer, target, command);
return;
}
int healAmount = command.getAddedDamage();
int healPotency = 0;
@@ -1123,6 +1137,10 @@ public class CombatService implements INetworkDispatch {
}
if(target.getSkillMod("expertise_innate_reduction_all_player") != null) {
baseArmor *= (100 - target.getSkillMod("expertise_innate_reduction_all_player").getBase()) / 100;
}
if(baseArmor > 0) {
float mitigation = (float) (90 * (1 - Math.exp(-0.000125 * baseArmor)) + baseArmor / 9000);
mitigation /= 100;
@@ -1137,7 +1155,101 @@ public class CombatService implements INetworkDispatch {
applyDamage(attacker, target, damage);
}
public void doSelfBuff(CreatureObject creature, WeaponObject weapon, CombatCommand command, int actionCounter) {
boolean success = true;
if(!applySpecialCost(creature, weapon, command))
success = false;
if(!success) {
IoSession session = creature.getClient().getSession();
CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(creature.getObjectId(), actionCounter);
session.write(new ObjControllerMessage(0x0B, commandRemove).serialize());
StartTask startTask = new StartTask(actionCounter, creature.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), -1);
session.write(new ObjControllerMessage(0x0B, startTask).serialize());
return;
}
core.buffService.addBuffToCreature(creature, command.getBuffNameSelf());
StartTask startTask = new StartTask(actionCounter, creature.getObjectID(), command.getCommandCRC(), CRC.StringtoCRC(command.getCooldownGroup()), command.getCooldown());
ObjControllerMessage objController2 = new ObjControllerMessage(0x0B, startTask);
creature.getClient().getSession().write(objController2.serialize());
CommandEnqueueRemove commandRemove = new CommandEnqueueRemove(creature.getObjectID(), actionCounter);
ObjControllerMessage objController3 = new ObjControllerMessage(0x0B, commandRemove);
creature.getClient().getSession().write(objController3.serialize());
}
public void addHealOverTimeToCreature(final CreatureObject healer, final CreatureObject target, final CombatCommand command) {
if(target.getDotByName(command.getCommandName()) != null) {
DamageOverTime oldDot = target.getDotByName(command.getCommandName());
oldDot.getTask().cancel(true);
target.removeDot(oldDot);
}
final DamageOverTime dot = new DamageOverTime(command.getCommandName(), null, command.getDotType(), command.getDotDuration(), command.getDotIntensity());
target.addDot(dot);
dot.setStartTime(System.currentTimeMillis());
final ScheduledFuture<?> task = scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
if(dot.getRemainingDuration() <= 0) {
target.removeDot(dot);
dot.getTask().cancel(true);
}
doHealOverTimeTick(healer, target, command, dot);
}
}, 0, command.getDotDuration() / (command.getAddedDamage() / command.getDotIntensity()), TimeUnit.SECONDS);
dot.setTask(task);
}
private void doHealOverTimeTick(CreatureObject healer, CreatureObject target, CombatCommand command, DamageOverTime dot) {
int healAmount = command.getDotIntensity();
int healPotency = 0;
if(healer.getSkillMod("expertise_healing_all") != null)
healPotency += healer.getSkillMod("expertise_healing_all").getBase();
if(healer.getSkillMod("expertise_healing_line_me_heal") != null)
healPotency += healer.getSkillMod("expertise_healing_line_me_heal").getBase();
if(healer.getSkillMod("expertise_healing_line_of_heal") != null)
healPotency += healer.getSkillMod("expertise_healing_line_of_heal").getBase();
if(healer.getSkillMod("expertise_healing_line_sm_heal") != null)
healPotency += healer.getSkillMod("expertise_healing_line_sm_heal").getBase();
if(healer.getSkillMod("expertise_healing_line_sp_heal") != null)
healPotency += healer.getSkillMod("expertise_healing_line_sp_heal").getBase();
if(healPotency > 0)
healAmount += (healAmount * (healPotency / 100));
if(target.getSkillMod("expertise_healing_reduction") != null)
healAmount *= (1 - target.getSkillMod("expertise_healing_reduction").getBase() / 100);
synchronized(target.getMutex()) {
target.setHealth(target.getHealth() + healAmount);
}
target.notifyObservers(new PlayClientEffectLocMessage("appearance/pt_heal_2.prt", target.getPlanet().getName(), target.getWorldPosition()), true);
}
public enum HitType{;
public static final byte MISS = 0;
@@ -1166,4 +1278,6 @@ public class CombatService implements INetworkDispatch {
}
}
+6 -1
View File
@@ -168,7 +168,7 @@ public class CommandService implements INetworkDispatch {
//if((command.getHitType() == 5 || command.getHitType() == 7) && !(target instanceof CreatureObject))
// success = false;
if(!(command.getAttackType() == 2) && !(command.getHitType() == 5)) {
if(!(command.getAttackType() == 2) && !(command.getHitType() == 5) && !(command.getHitType() == 0)) {
if(target == null || !(target instanceof TangibleObject) || target == attacker)
success = false;
} else {
@@ -245,6 +245,11 @@ public class CommandService implements INetworkDispatch {
core.combatService.doRevive(attacker, (CreatureObject) target, weapon, command, actionCounter);
return;
}
if(command.getHitType() == 0 && command.getBuffNameSelf().length() > 0) {
core.combatService.doSelfBuff(attacker, weapon, command, actionCounter);
return;
}
core.combatService.doCombat(attacker, (TangibleObject) target, weapon, command, actionCounter);
}