forked from MagicBane/Server
replace rune with wrapped rune
This commit is contained in:
@@ -24,7 +24,6 @@ public class HotzoneManager {
|
|||||||
public static boolean three_quarter_health = false;
|
public static boolean three_quarter_health = false;
|
||||||
public static boolean half_health = false;
|
public static boolean half_health = false;
|
||||||
public static boolean quarter_health = false;
|
public static boolean quarter_health = false;
|
||||||
public static long lastAnnounce = 0L;
|
|
||||||
public static void SelectRandomHotzone(){
|
public static void SelectRandomHotzone(){
|
||||||
if(hotzoneMob != null){
|
if(hotzoneMob != null){
|
||||||
hotzoneMob.killCharacter("Hotzone Over");
|
hotzoneMob.killCharacter("Hotzone Over");
|
||||||
@@ -92,56 +91,67 @@ public class HotzoneManager {
|
|||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
int roll = random.nextInt(100);
|
int roll = random.nextInt(100);
|
||||||
int itemId;
|
int itemId;
|
||||||
ItemBase runeBase;
|
//ItemBase runeBase;
|
||||||
if (roll >= 90) {
|
// if (roll >= 90) {
|
||||||
//35 or 40
|
//35 or 40
|
||||||
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_high.size() + 1);
|
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_high.size() + 1);
|
||||||
itemId = HellgateManager.static_rune_ids_high.get(0);
|
// itemId = HellgateManager.static_rune_ids_high.get(0);
|
||||||
try {
|
// try {
|
||||||
itemId = HellgateManager.static_rune_ids_high.get(roll);
|
// itemId = HellgateManager.static_rune_ids_high.get(roll);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
|
|
||||||
}
|
// }
|
||||||
runeBase = ItemBase.getItemBase(itemId);
|
// runeBase = ItemBase.getItemBase(itemId);
|
||||||
if (runeBase != null) {
|
// if (runeBase != null) {
|
||||||
MobLoot rune = new MobLoot(mob, runeBase, true);
|
// MobLoot rune = new MobLoot(mob, runeBase, true);
|
||||||
|
|
||||||
if (rune != null)
|
// if (rune != null)
|
||||||
mob.getCharItemManager().addItemToInventory(rune);
|
// mob.getCharItemManager().addItemToInventory(rune);
|
||||||
}
|
// }
|
||||||
} else if (roll >= 65 && roll <= 89) {
|
//} else if (roll >= 65 && roll <= 89) {
|
||||||
//30,35 or 40
|
//30,35 or 40
|
||||||
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_mid.size() + 1);
|
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_mid.size() + 1);
|
||||||
itemId = HellgateManager.static_rune_ids_mid.get(0);
|
// itemId = HellgateManager.static_rune_ids_mid.get(0);
|
||||||
try {
|
// try {
|
||||||
itemId = HellgateManager.static_rune_ids_mid.get(roll);
|
// itemId = HellgateManager.static_rune_ids_mid.get(roll);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
|
|
||||||
}
|
// }
|
||||||
runeBase = ItemBase.getItemBase(itemId);
|
// runeBase = ItemBase.getItemBase(itemId);
|
||||||
if (runeBase != null) {
|
// if (runeBase != null) {
|
||||||
MobLoot rune = new MobLoot(mob, runeBase, true);
|
// MobLoot rune = new MobLoot(mob, runeBase, true);
|
||||||
|
|
||||||
if (rune != null)
|
// if (rune != null)
|
||||||
mob.getCharItemManager().addItemToInventory(rune);
|
// mob.getCharItemManager().addItemToInventory(rune);
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
//5-30
|
//5-30
|
||||||
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_low.size() + 1);
|
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_low.size() + 1);
|
||||||
itemId = HellgateManager.static_rune_ids_low.get(0);
|
// itemId = HellgateManager.static_rune_ids_low.get(0);
|
||||||
try {
|
// try {
|
||||||
itemId = HellgateManager.static_rune_ids_low.get(roll);
|
// itemId = HellgateManager.static_rune_ids_low.get(roll);
|
||||||
} catch (Exception ignored) {
|
// } catch (Exception ignored) {
|
||||||
|
|
||||||
}
|
// }
|
||||||
runeBase = ItemBase.getItemBase(itemId);
|
// runeBase = ItemBase.getItemBase(itemId);
|
||||||
if (runeBase != null) {
|
// if (runeBase != null) {
|
||||||
MobLoot rune = new MobLoot(mob, runeBase, true);
|
// MobLoot rune = new MobLoot(mob, runeBase, true);
|
||||||
|
|
||||||
if (rune != null)
|
// if (rune != null)
|
||||||
mob.getCharItemManager().addItemToInventory(rune);
|
// mob.getCharItemManager().addItemToInventory(rune);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//wrapped rune:
|
||||||
|
ItemBase runeBase = ItemBase.getItemBase(971070);
|
||||||
|
if (runeBase != null) {
|
||||||
|
MobLoot rune = new MobLoot(mob, runeBase, true);
|
||||||
|
|
||||||
|
if (rune != null)
|
||||||
|
mob.getCharItemManager().addItemToInventory(rune);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
roll = ThreadLocalRandom.current().nextInt(1, 101);
|
roll = ThreadLocalRandom.current().nextInt(1, 101);
|
||||||
if (roll >= 95) {
|
if (roll >= 95) {
|
||||||
//glass
|
//glass
|
||||||
@@ -238,14 +248,7 @@ public class HotzoneManager {
|
|||||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||||
}else if (health > 75000){
|
}else if (health > 75000){
|
||||||
//mob at 75% - 100% health
|
//mob at 75% - 100% health
|
||||||
if(lastAnnounce + MBServerStatics.FIVE_MINUTES < System.currentTimeMillis()){
|
|
||||||
lastAnnounce = System.currentTimeMillis();
|
|
||||||
String name = hotzoneMob.getName();
|
|
||||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, name + " In The Hotzone Is Still Alive");
|
|
||||||
chatMsg.setMessageType(10);
|
|
||||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
|
||||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user