PDA

View Full Version : Theoretical idea: Item Discovery Notifications


zerjz3
11-08-2014, 03:56 PM
I'm pondering whether or not this would be possible via perl, and how it would be done. If anyone has any ideas, feel free to let me know and maybe we can come up with a fun little custom feature.

My idea is that when a player gets the discovery on an item, a notification message would be sent to one of the following, depending on how the server admin has it set :

Option A: Directly to the player

Option B: To the player and a designated GM

Option C: Broadcast to all players on the server


I'm wondering if something can be scripted to pull this information from the discovered_items table, and then send a message with the item name (maybe even a link to the item) and the name of the player who discovered it.


Any thoughts?

Kingly_Krab
11-08-2014, 04:39 PM
This will work, yes. Here's why: sub EVENT_DISCOVER_ITEM - Triggered when an item is discovered.
$itemid - Item being discovered.Option A: $client->Message(335, "You discovered " . quest::varlink($itemid) . "!");

Option B: $client->Message(335, "You discovered " . quest::varlink($itemid) . "!");
quest::crosszonemessageplayerbyname(335, "Kinglykrab", "$name discovered " . plugin::varlink($itemid) . "!");

Option C: quest::gmsay("$name discovered " . quest::varlink($itemid) . "!", 335, 1, 0, 0);

zerjz3
11-08-2014, 04:54 PM
Oh, sweet! This makes me very happy! Thanks, Kingly!

Kingly_Krab
11-08-2014, 05:35 PM
You're welcome.

Akkadius
11-08-2014, 05:36 PM
Option C needs to leverage quest::we, not gmsay, only GMs get those messages, that is if you want to broadcast to all players

Kingly_Krab
11-08-2014, 05:50 PM
Not only GMs get them if you specify a minimum status of 0.

Akkadius
11-08-2014, 05:56 PM
Not only GMs get them if you specify a minimum status of 0.

What's the point

zerjz3
11-08-2014, 10:17 PM
Just for anyone reading this curious about it, this works for looted items, tradeskill made items, and even zones. Very cool! Thanks again to Kingly for helping figure this out.

Maceblade
11-23-2014, 04:25 PM
This is really cool idea but let me get this straight, this would be coded like:


## should there be a list of items up here to trigger this, so not every item is spammed via "we"?##


sub EVENT_DISCOVER_ITEM - Triggered when an item is discovered.
$itemid - Item being discovered.
quest::we("$name discovered " . quest::varlink($itemid) . "!", 335, 1, 0, 0);