[Help] Map Message

Skilled Illusionist
Joined
Sep 2, 2010
Messages
393
Reaction score
10
How do I make a specific mapMessage for the map only and make it announce when a player enters it. It can be announced to the whole map or just the player's chatlog (I think it's the same idea lol but I can't think atm)? I tried Maplemap methods but failed.
PHP:
} else if (mapid == 910000018) {
            chr.getClient().getSession().write(MaplePacketCreator.musicChange("Bgm09/TimeAttack"));
            chr.getClient().getPlayer().dropMessage(5, "[PvP] " + chr.getName() + " has entered the PvP map!");
This doesn't work only shows it in my chatlog. and ONLY shows when I ENTER the map.

My second question would be why do map BGM's for major towns and some others repeat for starting? I would use @go henesys and the bgm would play regularly for 1 second then pause for a moment of silence then start all over again. This is the only repack Iv'e encountered it, the repack is NakedStory v83. I want the BGM's to play regularly the moment you enter the map instead of causing them to repeat after a brief moment of silence.
 
Obviously it doesn't show for everyone because you're only sending it to the person who just joined the map.

I'm assuming some functions exist for this to work.

Code:
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Bitches be like, she wants the D.")); /*Blue Message*/
 
Upvote 0
That's a serverNotice message. Which means the whole server will be notified when a player enter's the PvP map. I'm looking for a mapMessage for just the PvP map.
 
Upvote 0
Yes. It is a serverNotice message. However, as what Occulta has stated...
player <- the player
.getMap() <- the map the player is in
.broadcastMessage() <- shows a packet

How this works:
It shows the message for all players in the same map as the character.

In your case, this might be:
Code:
chr.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "[PvP] " + chr.getName() + " has entered the PvP map!"));

Alternatively, if you're looking to show the message through a NPC, you can add this function (if you do not have it):
Code:
In AbstractPlayerInteraction,
public void mapMessage(int type, String message) {
        getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverNotice(type, message));
    }
 
Upvote 0
Back