forked from MagicBane/Server
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da0510d2bc | |||
| 1f732a8ca9 | |||
| 0d24789a93 | |||
| 35427cfb4a |
@@ -19,6 +19,7 @@ import engine.net.client.msg.UpdateStateMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.DamageShield;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -196,6 +197,8 @@ public enum CombatManager {
|
||||
}
|
||||
}
|
||||
|
||||
checkForProc(attacker,target,weapon);
|
||||
|
||||
//get delay for the auto attack job
|
||||
long delay = 5000;
|
||||
|
||||
@@ -651,4 +654,20 @@ public enum CombatManager {
|
||||
int masteryLevel = 0;
|
||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||
}
|
||||
|
||||
public static void checkForProc(AbstractCharacter attacker, AbstractWorldObject target, Item weapon){
|
||||
|
||||
if(weapon == null) // cant proc without a weapon
|
||||
return;
|
||||
|
||||
for(Effect eff : weapon.effects.values()){
|
||||
for(AbstractEffectModifier mod : eff.getEffectsBase().getModifiers()){
|
||||
if(mod.modType.equals(mbEnums.ModType.WeaponProc))
|
||||
if(ThreadLocalRandom.current().nextInt(0,101) < 6)
|
||||
((WeaponProcEffectModifier)mod).applyProc(attacker,target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -264,8 +264,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
player.cancelOnSpell();
|
||||
break;
|
||||
case RUNE:
|
||||
ApplyRuneMsg.applyRune(uuid, origin, player);
|
||||
itemMan.consume(item);
|
||||
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||
itemMan.consume(item);
|
||||
}
|
||||
break;
|
||||
default: //shouldn't be here, consume item
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
|
||||
@@ -306,77 +306,103 @@ public class City extends AbstractWorldObject {
|
||||
if (city.parentZone == null)
|
||||
continue;
|
||||
|
||||
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4) {
|
||||
if(repledge && city.getGuild().equals(playerCharacter.guild)){
|
||||
//can't repledge to a guild you're already part of
|
||||
continue;
|
||||
}
|
||||
|
||||
// Filter Lore cities
|
||||
if (city.parentZone.guild_zone) {
|
||||
|
||||
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
||||
//players can all port and repledge inside their own nation
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
if (city.isOpen() && city.getTOL().rank > 4) {
|
||||
|
||||
// Filter Lore cities
|
||||
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
|
||||
if (!repledge)
|
||||
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||
continue;
|
||||
else if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||
continue;
|
||||
}
|
||||
Integer playerUUID = playerCharacter.objectUUID;
|
||||
Integer guildUUID = playerCharacter.guildUUID;
|
||||
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
|
||||
boolean allowed = false;
|
||||
if (city.getTOL().reverseKOS) {
|
||||
//reverse KOS, specific values are allowed
|
||||
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) {
|
||||
//individual is cleared for teleport/repledge
|
||||
allowed = true;
|
||||
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) {
|
||||
//player guild is cleared for teleport/repledge
|
||||
allowed = true;
|
||||
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) {
|
||||
//player nation is cleared for teleport/repledge
|
||||
allowed = true;
|
||||
}
|
||||
} else {
|
||||
//not reverse KOS, everyone is allowed by default
|
||||
allowed = true;
|
||||
//specific values are not allowed
|
||||
if (city.getTOL().getCondemned().contains(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) {
|
||||
//individual is cleared for teleport/repledge
|
||||
allowed = false;
|
||||
} else if (city.getTOL().getCondemned().contains(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) {
|
||||
//player guild is cleared for teleport/repledge
|
||||
allowed = false;
|
||||
} else if (city.getTOL().getCondemned().contains(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active) {
|
||||
//player nation is cleared for teleport/repledge
|
||||
allowed = false;
|
||||
}
|
||||
}
|
||||
if (allowed) {
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Filter NPC cities
|
||||
|
||||
if (city.isNoobIsle == 1) {
|
||||
|
||||
if (playerCharacter.level < 20)
|
||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Players cannot teleport to perdition or bastion
|
||||
|
||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||
continue;
|
||||
|
||||
// These cities are available for anyone off noob island
|
||||
|
||||
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add Lore cities
|
||||
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
|
||||
if (!repledge)
|
||||
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||
continue;
|
||||
|
||||
if (repledge)
|
||||
if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!city.getTOL().reverseKOS) {
|
||||
cities.add(city);//can teleport to any open ToL that shares charter
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) {
|
||||
cities.add(city);//this player is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guildUUID) && city.getTOL().getCondemned().get(playerCharacter.guildUUID).active) {
|
||||
cities.add(city);//this guild is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
|
||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(playerCharacter.guild.getNation().getObjectUUID()).active) {
|
||||
cities.add(city);//this nation is allowed for the reverse KOS
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Filter NPC cities
|
||||
|
||||
if (city.isNoobIsle == 1) {
|
||||
|
||||
if (playerCharacter.level < 20)
|
||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Players cannot teleport to perdition or bastion
|
||||
|
||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||
continue;
|
||||
|
||||
// These cities are available for anyone off noob island
|
||||
|
||||
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
|
||||
cities.add(city);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add Lore cities
|
||||
|
||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||
|
||||
if (repledge) {
|
||||
if (city.getGuild().charter.canJoin(playerCharacter))
|
||||
if (repledge) {
|
||||
if (city.getGuild().charter.canJoin(playerCharacter))
|
||||
cities.add(city);
|
||||
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||
cities.add(city);
|
||||
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||
cities.add(city);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cities;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user