NPCs load rune sets

This commit is contained in:
2023-09-13 20:12:07 -05:00
parent f8269bb764
commit bd9dbcbb42
3 changed files with 13 additions and 1 deletions
+7
View File
@@ -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())); 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()));
}
}
} }
+1 -1
View File
@@ -121,7 +121,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
public int hidden = 0; // current rank of hide/sneak/invis public int hidden = 0; // current rank of hide/sneak/invis
public CopyOnWriteArrayList<Integer> minions = new CopyOnWriteArrayList(); public CopyOnWriteArrayList<Integer> minions = new CopyOnWriteArrayList();
protected ArrayList<CharacterRune> runes; public ArrayList<CharacterRune> runes;
public AbstractCharacter() { public AbstractCharacter() {
super(); super();
+5
View File
@@ -972,6 +972,11 @@ public class NPC extends AbstractCharacter {
Bounds npcBounds = Bounds.borrow(); Bounds npcBounds = Bounds.borrow();
npcBounds.setBounds(this.getLoc()); npcBounds.setBounds(this.getLoc());
//apply NPC rune effects
if(NPCManager._runeSetMap.containsKey(this.runeSetID)){
NPCManager.applyRunesForNPC(this);
}
} catch (Exception e) { } catch (Exception e) {
Logger.error(e.getMessage()); Logger.error(e.getMessage());
} }