PDA

View Full Version : quest::popup with linked response...


Adcid
12-18-2014, 01:52 PM
sub EVENT_SAY{
if($text=~/hail/i){
my $TextToCenter = plugin::PWAutoCenter("Hail there! Would you like to test your strength against Lady ["..quest::saylink("Vox",false,"Vox").."] or Lord [Nagafen]? Please remember these Dragons will banish you above level 52. Once you've been ported to your location, you are on your own getting back here!");
my $TextToCenter2 = plugin::PWAutoCenter("2nd line to be centered");
my $TextToCenter3 = plugin::PWAutoCenter("3rd line");
my $TextToCenter4 = plugin::PWAutoCenter("4th line to be centered");
my $TextToCenter5 = plugin::PWAutoCenter("5th line to be centered, blah, blah, blah, blah, blah");
my $Indent = plugin::PWIndent();
my $Yel = plugin::PWColor("Yellow");
my $Blu = plugin::PWColor("Light Blue");
my $Red = plugin::PWColor("Red");
my $grn = plugin::PWColor("Forest Green");
quest::popup("Stage Zero Raids", "$TextToCenter <br>
$Yel $TextToCenter2 </c> <br>
$Blu $TextToCenter3 </c> <br>
<br><br>
$Red $TextToCenter4 </c> <br>
$grn $TextToCenter5 </c> <br><br><br>
$Indent $Link
");
}
}

I've used this as my building block to create a popup. Little has been modified until I can resolve the link issue. What I've created are NPC's that will port you to raid locations allowing people to bypass trash mobs. My example above is an NPC that ports to Lady Vox or Lord Nagafen. In terms of simple code, it works fine without the popup. I've create spells to teleport to safe locations near said mobs. However, I would like the user to hail this NPC, then simply click on the Dragons name to implement the port rather than type in "/say Vox".

in /lua I found this code for going to plane of time without a popup.
function event_say (e)
if(e.message:findi("hail")) then
e.self:Say("Oh, yes, I'm still of one mind, for now. Time, time is all that matters. Would you like to see the [" .. eq.say_link("time",false,"time") .. "]?");
elseif (e.message:findi("time")) then
if (e.other:HasZoneFlag(219) == true) then
--Plane of Time A
e.other:MovePC(219, 110, 0, 8, 0);
end
end
end

I believe what I'm looking for can be done. Any ideas?

Asylum
12-22-2014, 02:10 PM
I see two ways you can do this:

1. If your goal is simply to avoid the trash mobs, create an instance of the zone within which the dragon resides and populate it with the dragon alone (plus any static adds for the event). The Perl files (or lua) will run the scripts no problem. I will link a short script for you when I get home.

2. If you wish to use the actual static zones, just place the characters, that's even easier, using the movepc function. Again, I'll make and post a short script for you when I get home.

NatedogEZ
12-22-2014, 03:57 PM
I am pretty sure saylinks are not supported inside the popup window. :(

If you however want fancy popup windows I'd suggest checking out this plugin from Akkadius.. looks very polished when implemented correctly :)

http://wiki.eqemulator.org/p?The_DiaWind_Plugin&frm=Main--Perl_Plugins_Master_Reference

Kingly_Krab
12-22-2014, 04:02 PM
Yeah, saylinks are not supported in the popup window. However, there is a EVENT_POPUPRESPONSE you can use based on you hitting 'Yes' on the popup window, use $popupid. Although I believe you have to specify ID in quest::popup(title, text, popupid, buttons, duration) in order to have different outcomes based on different popup windows.

ghanja
12-22-2014, 05:24 PM
I'm out the door, hoping syntax is correct:

sub EVENT_ENTERZONE {

quest::settimer ("dopopup",5);

}


sub EVENT_TIMER {
use Switch;

switch ($timer) {

case ("dopopup") {
quest::stoptimer ("dopopup");

my $Indent = plugin::PWIndent();
my $Yel = plugin::PWColor ("Yellow");
my $PopupLink = plugin::PWHyperLink ("HERE","http://www.google.com");
my $PopupLink2 = plugin::PWHyperLink ("HERE","http://www.eqemulator.org");
my $PopupTextCentered = plugin::PWAutoCenter ("Welcome");

quest::popup ("Popup Window Title",
"<br>$Indent $Indent $Indent [$Yel Welcome </c> ]<br> <br>
If you wish to search Google click $PopupLink<br><br>
If you wish to go to the EQEMu Site click $PopupLink2<br> <br> <br>
So do you understand the webz?",1,1,0);

# usage quest::popup (title,text,popupid,buttons,duration)
# -- whereas buttons 0 = just ok, 1 = yes (1) and no (0)
# -- duration in seconds before vanish 0 = wait for click response
}
}
}


sub EVENT_POPUPRESPONSE {

if ($popupid == 1) {
quest::gmsay ("Hey all $name understands the interwebz!",335,1,0,0);
}
}

Akkadius
12-22-2014, 05:26 PM
I am pretty sure saylinks are not supported inside the popup window. :(

If you however want fancy popup windows I'd suggest checking out this plugin from Akkadius.. looks very polished when implemented correctly :)

http://wiki.eqemulator.org/p?The_DiaWind_Plugin&frm=Main--Perl_Plugins_Master_Reference

The system I created also supports automatic responses with windows, so if you do your research it does everything you want it to do for dialogue

Adcid
01-08-2015, 05:35 PM
Its been a while, I've not had a lot of time to work on my server. Back to the grind stone after the holidays I suppose...

I've downloaded "The DiaWind Plugin" and added the needed file to the plug in folder but the problem I'm running into is the global_player file. In my quests\global\ folder global_player is a *.lua file, not a *.pl file. Am i missing something?

I created a global_player.pl file and placed it into the quests\global\ folder but doesn't seem to make a difference when it comes to functionality.

ghanja
01-08-2015, 05:40 PM
lua has precedence over perl for quest files

So the first check is if a lua exists, if so it wont bother looking for a perl (pl) file.

Curious, what is the global_player.lua (as in mind posting it?)?