From c308121c47999bfc811c2f48d4366ef2e30b640d Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 21 Feb 2012 01:01:27 -0500 Subject: [PATCH] Added XP for Animal Taming --- Changelog.txt | 2 ++ .../gmail/nossr50/config/LoadProperties.java | 3 ++- .../nossr50/listeners/mcEntityListener.java | 19 +++++++++++++++++-- src/main/resources/config.yml | 2 ++ .../resources/locale/locale_de.properties | 2 +- .../resources/locale/locale_en_us.properties | 2 +- .../resources/locale/locale_es_es.properties | 2 +- .../resources/locale/locale_fi.properties | 2 +- .../resources/locale/locale_fr.properties | 2 +- .../resources/locale/locale_nl.properties | 2 +- .../resources/locale/locale_pl.properties | 2 +- .../resources/locale/locale_pt_br.properties | 2 +- .../resources/locale/locale_ru.properties | 2 +- 13 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 891089c5c..a0b054c74 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,6 +8,8 @@ Version 1.3.00-dev - Added hunger regain bonuses to Herbalism skill - Added framework for new Blast Mining skill - Added Fast Food Service subskill to Taming + - Added Wolf Taming XP to Taming + - Added Sheep Shearing XP to Taming - Re-added mcMMO reporting damage events - Fixed /mcability not respecting permissions - Changed Taming to also gain XP from shearing diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index 27e31719f..b9276ee7a 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -57,7 +57,7 @@ public class LoadProperties { MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone, nIron, nGold, nDiamond, locale, nString, nLeather; - public static int mshearing, mfishing, xpbar_x, xpbar_y, xpicon_x, xpicon_y, + public static int mtameWolf, mshearing, mfishing, xpbar_x, xpbar_y, xpicon_x, xpicon_y, chimaeraId, msandstone, mbase, mpine, mbirch, mspruce, mmelon, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapis, mobsidian, mnetherrack, @@ -267,6 +267,7 @@ public class LoadProperties { mmossstone = readInteger("Experience.Mining.Moss_Stone", 30); mshearing = readInteger("Experience.Taming.Shearing", 250); + mtameWolf = readInteger("Experience.Taming.Animal_Taming.Wolf", 250); mfishing = readInteger("Experience.Fishing.Base", 800); diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index 66b11277c..145f58dd7 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -32,6 +32,7 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityTameEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.inventory.ItemStack; @@ -39,6 +40,7 @@ import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.Combat; import com.gmail.nossr50.Users; import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; @@ -223,8 +225,7 @@ public class mcEntityListener implements Listener } } } - - + @EventHandler (priority = EventPriority.LOW) public void onEnitityExplode(EntityExplodeEvent event) { @@ -334,6 +335,20 @@ public class mcEntityListener implements Listener } } + @EventHandler (priority = EventPriority.MONITOR) + public void onEntityTame(EntityTameEvent event) + { + Player player = (Player) event.getOwner(); + if(mcPermissions.getInstance().taming(player)) + { + PlayerProfile PP = Users.getProfile(player); + if(event.getEntity() instanceof Wolf) + { + PP.addXP(SkillType.TAMING, LoadProperties.mtameWolf, player); + } + } + } + public boolean isBow(ItemStack is){ if (is.getTypeId() == 261){ return true; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0e9fc4cd1..684e22847 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -208,6 +208,8 @@ Experience: Moss_Stone: 30 Taming: Shearing: 250 + Animal_Taming: + Wolf: 250 # # Settings for Fishing diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 819fd70d1..2e9d158fe 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[YELLOW]]{0}: [[GREEN]]{1} m.Effects=EFFEKTE m.YourStats=[[DARK_AQUA]]_______ [[YELLOW]]DEINE WERTE [[DARK_AQUA]]_______ m.SkillTaming=Bestienkunde (Taming) -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=[[YELLOW]]Bestienkunde m.EffectsTaming1_1=[[AQUA]]mit Knochen schlagen inspiziert Woelfe m.EffectsTaming2_0=[[YELLOW]]Biss diff --git a/src/main/resources/locale/locale_en_us.properties b/src/main/resources/locale/locale_en_us.properties index 39e97a5fe..e9607ed9e 100644 --- a/src/main/resources/locale/locale_en_us.properties +++ b/src/main/resources/locale/locale_en_us.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFFECTS m.YourStats=YOUR STATS m.SkillTaming=TAMING -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Beast Lore m.EffectsTaming1_1=Bone-whacking inspects wolves m.EffectsTaming2_0=Gore diff --git a/src/main/resources/locale/locale_es_es.properties b/src/main/resources/locale/locale_es_es.properties index 4f1fb72fb..7c5a46e9c 100644 --- a/src/main/resources/locale/locale_es_es.properties +++ b/src/main/resources/locale/locale_es_es.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFECTOS m.YourStats=TUS ESTADISTICAS m.SkillTaming=DOMADURA -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Leyenda de bestias m.EffectsTaming1_1=Golpear con huesos examina a los lobos m.EffectsTaming2_0=Sangre diff --git a/src/main/resources/locale/locale_fi.properties b/src/main/resources/locale/locale_fi.properties index 36a807233..6c0780000 100644 --- a/src/main/resources/locale/locale_fi.properties +++ b/src/main/resources/locale/locale_fi.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFEKTIT m.YourStats=TILASTOSI m.SkillTaming=KESYTTÄMINEN -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Pedon Tarina m.EffectsTaming1_1=Luulla lyöminen tutkii susia m.EffectsTaming2_0=Pisto diff --git a/src/main/resources/locale/locale_fr.properties b/src/main/resources/locale/locale_fr.properties index 809852f72..6a3b763df 100644 --- a/src/main/resources/locale/locale_fr.properties +++ b/src/main/resources/locale/locale_fr.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFFETS m.YourStats=VOS STATS m.SkillTaming=DRESSAGE -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Connaissance des bêtes m.EffectsTaming1_1=Inspecte un loup avec un os m.EffectsTaming2_0=Morsures diff --git a/src/main/resources/locale/locale_nl.properties b/src/main/resources/locale/locale_nl.properties index fedd8c870..c1d2bd0ed 100644 --- a/src/main/resources/locale/locale_nl.properties +++ b/src/main/resources/locale/locale_nl.properties @@ -46,7 +46,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFFECTEN m.YourStats=JOUW STATUS m.SkillTaming=TEMMEN -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Wolfinspectie m.EffectsTaming1_1=Bone-meal inspecteert wolven m.EffectsTaming2_0=Gestold bloed diff --git a/src/main/resources/locale/locale_pl.properties b/src/main/resources/locale/locale_pl.properties index 04a9ea6fe..2bab49de7 100644 --- a/src/main/resources/locale/locale_pl.properties +++ b/src/main/resources/locale/locale_pl.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFEKTY m.YourStats=TWOJE STATYSTYKI m.SkillTaming=OSWAJANIE -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Wiedza o zwierzetach m.EffectsTaming1_1=Uderz koscia aby sprawdzic wilka. m.EffectsTaming2_0=Krwotok diff --git a/src/main/resources/locale/locale_pt_br.properties b/src/main/resources/locale/locale_pt_br.properties index 119033f7f..5f127286e 100644 --- a/src/main/resources/locale/locale_pt_br.properties +++ b/src/main/resources/locale/locale_pt_br.properties @@ -40,7 +40,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=EFEITOS m.YourStats=SUAS ESTATISTICAS m.SkillTaming=DOMESTICAR -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Conhecimento de Feras m.EffectsTaming1_1=Inspeciona um lobo com um osso m.EffectsTaming2_0=Mordida diff --git a/src/main/resources/locale/locale_ru.properties b/src/main/resources/locale/locale_ru.properties index 884df8368..2d2b38c1b 100644 --- a/src/main/resources/locale/locale_ru.properties +++ b/src/main/resources/locale/locale_ru.properties @@ -41,7 +41,7 @@ m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} m.Effects=ÝÔÔÅÊÒÛ m.YourStats=ÂÀØÈ ÕÀÐÀÊÒÅÐÈÑÒÈÊÈ m.SkillTaming=Ïðèðó÷åíèå -m.XPGainTaming=Shearing or combat w/ your wolves +m.XPGainTaming=Shearing, Animal Taming, or combat w/ your wolves m.EffectsTaming1_0=Óäàð Âîëêà m.EffectsTaming1_1=Óìåíüøåíèå êîëè÷åñòâà êîñòåé m.EffectsTaming2_0=Îêðàâëåíèå