mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
Added 'Skill Shot' to Archery. Updated Archery command.
This commit is contained in:
@ -198,7 +198,7 @@ public class Combat {
|
||||
int skillLvl = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
|
||||
double dmgBonusPercent = ((skillLvl / 50) * 0.1D);
|
||||
|
||||
/* Cap maximum bonus at 100% */
|
||||
/* Cap maximum bonus at 200% */
|
||||
if(dmgBonusPercent > 2)
|
||||
dmgBonusPercent = 2;
|
||||
|
||||
@ -213,10 +213,6 @@ public class Combat {
|
||||
Archery.trackArrows(pluginx, target, PPa);
|
||||
}
|
||||
|
||||
if (mcPermissions.getInstance().ignition(attacker)) {
|
||||
Archery.ignitionCheck(target, attacker);
|
||||
}
|
||||
|
||||
startGainXp(attacker, PPa, target, SkillType.ARCHERY, pluginx);
|
||||
|
||||
if (target instanceof Player) {
|
||||
|
@ -25,18 +25,14 @@ public class ArcheryCommand implements CommandExecutor {
|
||||
|
||||
float skillvalue = (float) PP.getSkillLevel(SkillType.ARCHERY);
|
||||
String percentage = String.valueOf((skillvalue / 1000) * 100);
|
||||
|
||||
int ignition = 20;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) >= 200)
|
||||
ignition += 20;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) >= 400)
|
||||
ignition += 20;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) >= 600)
|
||||
ignition += 20;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) >= 800)
|
||||
ignition += 20;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) >= 1000)
|
||||
ignition += 20;
|
||||
|
||||
double dmgBonusPercent = ((PP.getSkillLevel(SkillType.ARCHERY) / 50) * 0.1D);
|
||||
|
||||
/* Cap maximum bonus at 200% */
|
||||
if(dmgBonusPercent > 2)
|
||||
dmgBonusPercent = 2;
|
||||
|
||||
dmgBonusPercent = dmgBonusPercent * 100; //Convert to percentage
|
||||
|
||||
String percentagedaze;
|
||||
if (PP.getSkillLevel(SkillType.ARCHERY) < 1000)
|
||||
@ -55,9 +51,9 @@ public class ArcheryCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsArchery2_0"), mcLocale.getString("m.EffectsArchery2_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsArchery4_0"), mcLocale.getString("m.EffectsArchery4_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
|
||||
player.sendMessage(mcLocale.getString("m.ArcherySkillShot", new Object[] { dmgBonusPercent }));
|
||||
player.sendMessage(mcLocale.getString("m.ArcheryDazeChance", new Object[] { percentagedaze }));
|
||||
player.sendMessage(mcLocale.getString("m.ArcheryRetrieveChance", new Object[] { percentage }));
|
||||
player.sendMessage(mcLocale.getString("m.ArcheryIgnitionLength", new Object[] { (ignition / 20) }));
|
||||
|
||||
Page.grabGuidePageForSkill(SkillType.ARCHERY, player, args);
|
||||
|
||||
|
@ -15,7 +15,6 @@ import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
|
||||
public class Archery {
|
||||
|
||||
@ -41,50 +40,6 @@ public class Archery {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for ignition on arrow hit.
|
||||
*
|
||||
* @param entity Entity damaged by the arrow
|
||||
* @param attacker Player who fired the arrow
|
||||
*/
|
||||
public static void ignitionCheck(Entity entity, Player attacker) {
|
||||
|
||||
//Check to see if PVP for this world is disabled before executing
|
||||
if (!entity.getWorld().getPVP()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int IGNITION_CHANCE = 25;
|
||||
final int MAX_IGNITION_TICKS = 120;
|
||||
|
||||
PlayerProfile PPa = Users.getProfile(attacker);
|
||||
|
||||
if (random.nextInt(100) <= IGNITION_CHANCE) {
|
||||
int ignition = 20;
|
||||
|
||||
/* Add 20 ticks for every 200 skill levels */
|
||||
ignition += (PPa.getSkillLevel(SkillType.ARCHERY) / 200) * 20;
|
||||
|
||||
if (ignition > MAX_IGNITION_TICKS) {
|
||||
ignition = MAX_IGNITION_TICKS;
|
||||
}
|
||||
|
||||
if (entity instanceof Player) {
|
||||
Player defender = (Player) entity;
|
||||
|
||||
if (!Party.getInstance().inSameParty(attacker, defender)) {
|
||||
defender.setFireTicks(defender.getFireTicks() + ignition);
|
||||
attacker.sendMessage(mcLocale.getString("Combat.Ignition"));
|
||||
defender.sendMessage(mcLocale.getString("Combat.BurningArrowHit"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
entity.setFireTicks(entity.getFireTicks() + ignition);
|
||||
attacker.sendMessage(mcLocale.getString("Combat.Ignition"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for Daze.
|
||||
*
|
||||
|
Reference in New Issue
Block a user