forked from MagicBane/Server
NPCs load rune sets
This commit is contained in:
@@ -458,4 +458,11 @@ public enum NPCManager {
|
||||
mob.skills.put(entry.skill_type, new CharacterSkill(skillBase, mob, entry.rank + mob.skills.get(entry.skill_type).getNumTrains()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyRunesForNPC(NPC npc){
|
||||
for(int runeID : _runeSetMap.get(npc.runeSetID)){
|
||||
RuneBase rb = RuneBase.getRuneBase(runeID);
|
||||
npc.runes.add(new CharacterRune(rb,npc.getObjectUUID()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
public int hidden = 0; // current rank of hide/sneak/invis
|
||||
public CopyOnWriteArrayList<Integer> minions = new CopyOnWriteArrayList();
|
||||
|
||||
protected ArrayList<CharacterRune> runes;
|
||||
public ArrayList<CharacterRune> runes;
|
||||
|
||||
public AbstractCharacter() {
|
||||
super();
|
||||
|
||||
@@ -972,6 +972,11 @@ public class NPC extends AbstractCharacter {
|
||||
Bounds npcBounds = Bounds.borrow();
|
||||
npcBounds.setBounds(this.getLoc());
|
||||
|
||||
//apply NPC rune effects
|
||||
if(NPCManager._runeSetMap.containsKey(this.runeSetID)){
|
||||
NPCManager.applyRunesForNPC(this);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user