server first announcements thru quest system
i'm trying to set up so that when a player hits max level on your server, and they are the first to do so, it does a server wide announcement of it.
heres what i've got so far. i have it placed in quests/templates/player.pl, but I can't get it to work for some reason. can some one take a look at it, and tell me whats wrong pls? Code:
sub EVENT_LEVEL_UP { |
for starters, you need one more } at the very end
|
just curious, sorry if this seems ignorant, but why do I need one more }? accordin to notepad++ the sub is closed, and every if statement is closed as well.
|
Instead of copy pasting the code 15 times, you could do something like this:
Code:
sub EVENT_LEVEL_UP { If that ever occurs, I wrote a reporter NPC too, $qglobals are a little weird scope wise, NPC's don't load no NPC ID vars (aka Player vars). I may ask the coders to add a $pglobal that when you talk to a NPC, it loads non-NPC ID globals for the zone are loaded into $pglobal{}. Would be handy for this situation, and I can think of a few others. This code doesn't work, but I wrote it anyways if the theory of player global vars non-NPC specific ever get written in. Code:
sub EVENT_SAY |
Quote:
|
It should. There may be an issue with scripts in the zone folder conflicting with the templates folder, just for testing try to put the player.pl inside the zone you're inside, and #reloadpl
|
Some quest coder should help me out here.. I'm not very familiar with it. :/ but!
LoadPlayerScript() function in embparser.cpp it does this whole.. Code:
string filename= "quests/"; Code:
try { Code:
if(!isloaded(packagename.c_str())) |
did as suggested, tried it with the guild lobby, cut/paste the player.pl and #reloadpl, and worked. cut/paste back into templates folder, #reloadpl, doesn't work. now what I don't understand is there isn't anything in the guild lobby folder, cept the guildhall instance creation script, so i'm not seeing what would be conflicting with the EVENT_LEVEL_UP. btw is there a way to broadcast, instead of having "$name shouts, blah blah blah". was looking more for a system msg world wide, then having the player shout it world wide.
|
Try $client->Message(13, "Message here");
|
I really hate that 5 minute edit limit. So new post!
I'm working on a quest cheat sheet wiki. Not newb friendly, but a good quick reference is my objective. This link should go to the $client->function() section, the message one and show the different color types noted in source. |
does $client->Message() broadcast worldwide, or just to the client that triggered the event?
|
Yes, it will try to load the player.pl from the zone folder and if not there, it will load it from templates if one exists there. It would be nice if both could load and run simultaneously so you could have global stuff for player.pl as well as zone specific stuff.
I believe that for any scripts located in the templates folder, the server has to be restarted for them to take effect. Not 100% sure on that, but I think that was the conclusion I came to last time I tried playing around with it. Also, some notes on your compilation of quest wiki pages: EVENT_ENTER and EVENT_EXIT are both related to proximities, so they don't work from the player.pl. They are triggered when the client enters or exists a proximity around an NPC. EVENT_SCALE_CALC is for item quest files, specifically for items with something set in the charmfile field. This event is for setting how much you want an item's stats to scale based on a percentage. Here is an example of a custom quest I made for a custom charm I have on my server: /quests/items/CHRMTitanium.pl Code:
sub EVENT_SCALE_CALC |
Thanks trevius. and @ nightsta, hmm, that's a good question. Pretty sure it's possible, but can't think of a script I can pull up to find the function.
|
Quote:
|
To use the scale event you utilize "quests/items/" folder? Interesting. Wonder how I'll categorize that.
Sorry for derailing topic nightsta. I'm unsure at your answer, we'll see! |
All times are GMT -4. The time now is 04:47 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.