Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d74793e01d | |||
| e79da63556 | |||
| 533565e37e | |||
| da0510d2bc | |||
| 1f732a8ca9 | |||
| 0d24789a93 | |||
| 35427cfb4a |
@@ -19,6 +19,7 @@ import engine.net.client.msg.UpdateStateMsg;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
|
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -196,6 +197,8 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkForProc(attacker,target,weapon);
|
||||||
|
|
||||||
//get delay for the auto attack job
|
//get delay for the auto attack job
|
||||||
long delay = 5000;
|
long delay = 5000;
|
||||||
|
|
||||||
@@ -651,4 +654,20 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
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));
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2721,7 +2721,7 @@ public class mbEnums {
|
|||||||
ANTIMONY(1580014, 1256147265, 452320058, 1000, 10),
|
ANTIMONY(1580014, 1256147265, 452320058, 1000, 10),
|
||||||
AZOTH(1580012, -1205326951, 78329697, 2000, 20),
|
AZOTH(1580012, -1205326951, 78329697, 2000, 20),
|
||||||
BLOODSTONE(1580020, -1912381716, -1569826353, 500, 5),
|
BLOODSTONE(1580020, -1912381716, -1569826353, 500, 5),
|
||||||
BRONZEWOOD(1580006, -519681813, 1334770447, 500, 10),
|
BRONZEWOOD(1580006, -519681813, 1334770447, 1000, 30),
|
||||||
COAL(1580008, -1672872311, 2559427, 3000, 30),
|
COAL(1580008, -1672872311, 2559427, 3000, 30),
|
||||||
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
||||||
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
||||||
|
|||||||
@@ -264,8 +264,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
player.cancelOnSpell();
|
player.cancelOnSpell();
|
||||||
break;
|
break;
|
||||||
case RUNE:
|
case RUNE:
|
||||||
ApplyRuneMsg.applyRune(uuid, origin, player);
|
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||||
itemMan.consume(item);
|
itemMan.consume(item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default: //shouldn't be here, consume item
|
default: //shouldn't be here, consume item
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -306,41 +306,65 @@ public class City extends AbstractWorldObject {
|
|||||||
if (city.parentZone == null)
|
if (city.parentZone == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (city.parentZone.guild_zone && city.isOpen() && city.getTOL().rank > 4) {
|
//can't repledge to a guild you're already part of
|
||||||
|
|
||||||
|
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (city.parentZone.guild_zone) {
|
||||||
|
|
||||||
|
//players can all port and repledge inside their own nation
|
||||||
|
|
||||||
|
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
||||||
|
cities.add(city);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (city.isOpen() && city.getTOL().rank > 4) {
|
||||||
|
|
||||||
// Filter Lore cities
|
// Filter Lore cities
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
|
||||||
if (!repledge)
|
if (repledge) {
|
||||||
if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (repledge)
|
|
||||||
if (!city.getGuild().charter.canJoin(playerCharacter))
|
if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||||
continue;
|
continue;
|
||||||
}
|
} else if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||||
|
|
||||||
if (!city.getTOL().reverseKOS) {
|
|
||||||
cities.add(city);//can teleport to any open ToL that shares charter
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.objectUUID) && city.getTOL().getCondemned().get(playerCharacter.objectUUID).active) {
|
Integer playerUUID = playerCharacter.objectUUID;
|
||||||
cities.add(city);//this player is allowed for the reverse KOS
|
Integer guildUUID = playerCharacter.guildUUID;
|
||||||
continue;
|
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
|
||||||
|
boolean allowed = false;
|
||||||
|
|
||||||
|
if (city.getTOL().reverseKOS) {
|
||||||
|
|
||||||
|
//reverse KOS, specific values are allowed
|
||||||
|
|
||||||
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
|
allowed = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//not reverse KOS, everyone is allowed by default
|
||||||
|
|
||||||
|
allowed = true;
|
||||||
|
|
||||||
|
//specific values are not allowed
|
||||||
|
|
||||||
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
|
allowed = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (city.getTOL().getCondemned().containsKey(playerCharacter.guildUUID) && city.getTOL().getCondemned().get(playerCharacter.guildUUID).active) {
|
if (allowed)
|
||||||
cities.add(city);//this guild is allowed for the reverse KOS
|
cities.add(city);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
// Filter NPC cities
|
// Filter NPC cities
|
||||||
|
|
||||||
@@ -376,7 +400,7 @@ public class City extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return cities;
|
return cities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user