Search in sources :

Example 1 with MonsterListener

use of server.life.MonsterListener in project HeavenMS by ronancpl.

the class MapleMap method spawnHorntailOnGroundBelow.

public void spawnHorntailOnGroundBelow(final Point targetPoint) {
    // ayy lmao
    MapleMonster htIntro = MapleLifeFactory.getMonster(8810026);
    spawnMonsterOnGroundBelow(htIntro, targetPoint);
    final MapleMonster ht = MapleLifeFactory.getMonster(8810018);
    ht.setParentMobOid(htIntro.getObjectId());
    ht.addListener(new MonsterListener() {

        @Override
        public void monsterKilled(int aniTime) {
        }

        @Override
        public void monsterDamaged(MapleCharacter from, int trueDmg) {
            ht.addHp(trueDmg);
        }

        @Override
        public void monsterHealed(int trueHeal) {
            ht.addHp(-trueHeal);
        }
    });
    spawnMonsterOnGroundBelow(ht, targetPoint);
    for (int x = 8810002; x <= 8810009; x++) {
        MapleMonster m = MapleLifeFactory.getMonster(x);
        m.setParentMobOid(htIntro.getObjectId());
        m.addListener(new MonsterListener() {

            @Override
            public void monsterKilled(int aniTime) {
            }

            @Override
            public void monsterDamaged(MapleCharacter from, int trueDmg) {
                ht.applyAndGetHpDamage(trueDmg, true);
                ht.broadcastMobHpBar(from);
            }

            @Override
            public void monsterHealed(int trueHeal) {
                ht.addHp(trueHeal);
            }
        });
        spawnMonsterOnGroundBelow(m, targetPoint);
    }
}
Also used : MonsterListener(server.life.MonsterListener) MapleCharacter(client.MapleCharacter) MapleMonster(server.life.MapleMonster) Point(java.awt.Point) SpawnPoint(server.life.SpawnPoint)

Aggregations

MapleCharacter (client.MapleCharacter)1 Point (java.awt.Point)1 MapleMonster (server.life.MapleMonster)1 MonsterListener (server.life.MonsterListener)1 SpawnPoint (server.life.SpawnPoint)1