Browse Source

NPCs load rune sets

combat-2
FatBoy-DOTC 1 year ago
parent
commit
bd9dbcbb42
  1. 7
      src/engine/gameManager/NPCManager.java
  2. 2
      src/engine/objects/AbstractCharacter.java
  3. 5
      src/engine/objects/NPC.java

7
src/engine/gameManager/NPCManager.java

@ -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()));
}
}
} }

2
src/engine/objects/AbstractCharacter.java

@ -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
src/engine/objects/NPC.java

@ -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());
} }

Loading…
Cancel
Save