Skip to content

Modify "Trigger" "Interact" in GameNPC.cs so Broadcast (b) and Yell (y) options work #358

@DeerHunt3r

Description

@DeerHunt3r

OnTheDOL has mentioned it should be easy to make this change so Broadcast (b) and Yell (y) work when triggers with interact are assigned to a mob. This will allow you to assign yell and broadcast text to mobs so they don't pop up a window every time, instead a message can be put into the chat window.

This code snip is the original GameNPC.cs and I think where the modification needs to be made.

// for interact text we pop up a window
if (trigger == eAmbientTrigger.interact)
{
(living as GamePlayer).Out.SendMessage(text, eChatType.CT_System, eChatLoc.CL_PopupWindow);
return;
}

        // broadcasted , yelled or talked ?
        if (chosen.Voice.StartsWith("b"))
        {
            foreach (GamePlayer player in CurrentRegion.GetPlayersInRadius(X, Y, Z, 25000, false, false))
            {
                player.Out.SendMessage(text, eChatType.CT_Broadcast, eChatLoc.CL_ChatWindow);
            }
            return;
        }
        if (chosen.Voice.StartsWith("y"))
        {
            Yell(text);
            return;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions