diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 83deab0f5f..ba014be835 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -6814,7 +6814,7 @@ as soon as the progress bar activates. // --------------------------------------- -*announce "",{,{,{,{,{,}}}}}; +*announce "",{,{,{,{,{,{,}}}}}}; This command will broadcast a message to all or most players, similar to @kami/@kamib GM commands. @@ -6830,11 +6830,12 @@ Target flags: - bc_all: Broadcast message is sent server-wide (default). - bc_map: Message is sent to everyone in the same map as the source of the broadcast (see below). - bc_area: Message is sent to players in the vicinity of the source. -- bc_self: Message is sent only to current player. +- bc_self: Message is sent only to current player , if the source flag is bc_pc it also can + be used to send the Message to the character id if it's provided. You cannot use more than one target flag. Source flags: -- bc_pc: Broadcast source is the attached player (default). +- bc_pc: Broadcast source is the attached player or the character id if it's provided (default). - bc_npc: Broadcast source is the NPC, not the player attached to the script (useful when a player is not attached or the message should be sent to those nearby the NPC). @@ -6871,6 +6872,9 @@ but it can be used instead in NPCs to "preview" an announce. // This will be shown on everyones screen that is in sight of the NPC. announce "This is my message just for you people here",bc_npc|bc_area; + // This will be a private message to the player with character id 150000 + announce "This is my message just for char id 150000",bc_self,0xFFF618,FW_NORMAL,12,0,0,150000; + --------------------------------------- *mapannounce "","",{,{,{,{,{,}}}}}}; diff --git a/src/map/script.cpp b/src/map/script.cpp index 7a5dcf2c98..6ef7bb2937 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -11162,7 +11162,7 @@ BUILDIN_FUNC(announce) }else{ struct map_session_data* sd; - if( script_rid2sd(sd) ) + if(script_charid2sd(9, sd)) bl = &sd->bl; else bl = NULL; @@ -24705,7 +24705,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(attachnpctimer,"?"), // attached the player id to the npc timer [Celest] BUILDIN_DEF(detachnpctimer,"?"), // detached the player id from the npc timer [Celest] BUILDIN_DEF(playerattached,""), // returns id of the current attached player. [Skotlex] - BUILDIN_DEF(announce,"si?????"), + BUILDIN_DEF(announce,"si??????"), BUILDIN_DEF(mapannounce,"ssi?????"), BUILDIN_DEF(areaannounce,"siiiisi?????"), BUILDIN_DEF(getusers,"i"),