View Full Version : Instances.
Zamthos
01-20-2013, 10:38 PM
All right, so I recently got the Instances.pl to create Solo, Group, Guild, or Public instances, however, whenever I zone in to one of these there are no enemies, how would I go about spawning them here? My friend said I would have to spawn them within each individual Instance ID, if so, how would I do that? 0.o Thanks!
c0ncrete
01-20-2013, 10:52 PM
what are you using for the version parameter?
Zamthos
01-20-2013, 11:08 PM
Whenever I use "solo", "group", or "guild" the NPCs do not spawn, the zone is completely empty.
EDIT: Script below.
sub EVENT_SAY
{
my $Solo = quest::saylink("Solo", 1);
my $Group = quest::saylink("Group", 1);
my $Guild = quest::saylink("Guild", 1);
my $Public = quest::saylink("Public", 1);
my $NPCName = $npc->GetCleanName();
if($text=~/Hail/i)
{
$client->Message(315, "$NPCName whispers to you, 'Do you want to create a Instance? If so, $Solo, $Group, or $Guild?'");
}
if($text=~/Solo/i)
{
plugin::SendToInstance("solo", "cshome", 1, 88.6, 389.9, -11.6, "EXP", 604800);
}
if($text=~/Group/i)
{
plugin::SendToInstance("group", "cshome", 1, 88.6, 389.9, -11.6, "EXP", 604800);
}
if($text=~/Guild/i)
{
plugin::SendToInstance("guild", "cshome", 1, 88.6, 389.9, -11.6, "EXP", 604800);
}
}
c0ncrete
01-20-2013, 11:11 PM
you're using plugin::SendToInstance() right?
what are you using for the version parameter (after zone short name and before x)?
Zamthos
01-20-2013, 11:13 PM
I'm using "1" for all of them, is that an issue? 0.o
c0ncrete
01-20-2013, 11:15 PM
if there is not a corresponding spawn2 entry in the database for the version number of the zone you are using, nothing will spawn.
EDIT:
version numbers start at 0
Zamthos
01-20-2013, 11:16 PM
All right, we shall see, thanks for the information!
EDIT: How exactly would I set a range? Or would I have to do it like 1,000,000,000 times? ;(
Not necessarily a range, just multiple spawn groups.
Zamthos
01-21-2013, 12:41 AM
No answers to how to do that? 0.o
c0ncrete
01-21-2013, 01:23 AM
your question isn't very clear.
Zamthos
01-21-2013, 01:37 PM
I apologize for not being clear, what I'm asking is, where you said the version must match the spawngroupID, does that mean I have to put multiple spawngroups within that somehow? I don't understand how this is supposed to work. ;(
c0ncrete
01-21-2013, 01:54 PM
i didn't say anything about matching spawngroupID. it's the 'version' field in the spawn2 table you need to have correct when creating the instance.
mysql> describe spawn2;
+--------------+-----------------------+------+-----+----------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-----------------------+------+-----+----------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| spawngroupID | int(11) | NO | | 0 | |
| zone | varchar(32) | YES | MUL | NULL | |
| version | smallint(5) unsigned | NO | | 0 | |
| x | float(14,6) | NO | | 0.000000 | |
| y | float(14,6) | NO | | 0.000000 | |
| z | float(14,6) | NO | | 0.000000 | |
| heading | float(14,6) | NO | | 0.000000 | |
| respawntime | int(11) | NO | | 0 | |
| variance | int(11) | NO | | 0 | |
| pathgrid | int(10) | NO | | 0 | |
| _condition | mediumint(8) unsigned | NO | | 0 | |
| cond_value | mediumint(9) | NO | | 1 | |
| enabled | tinyint(3) unsigned | NO | | 1 | |
| animation | tinyint(3) unsigned | NO | | 0 | |
+--------------+-----------------------+------+-----+----------+----------------+
15 rows in set (0.20 sec)
if you want to create an instance of cshome where the zone is populated with what is in the database by default, use 0 as the version in plugin::SendToInstance() instead of 1.
this is what spawn2 table entries look like for cshome:
mysql> select id, zone, version, spawngroupID, enabled from spawn2 where zone = 'cshome';
+-------+--------+---------+--------------+---------+
| id | zone | version | spawngroupID | enabled |
+-------+--------+---------+--------------+---------+
| 1154 | cshome | 0 | 5089 | 1 |
| 1155 | cshome | 0 | 5090 | 1 |
| 1156 | cshome | 0 | 5091 | 1 |
| 1157 | cshome | 0 | 5092 | 1 |
| 1158 | cshome | 0 | 5093 | 1 |
| 1159 | cshome | 0 | 5094 | 1 |
| 1160 | cshome | 0 | 5095 | 1 |
| 1161 | cshome | 0 | 5096 | 1 |
| 1162 | cshome | 0 | 5097 | 1 |
| 1163 | cshome | 0 | 5098 | 1 |
| 1164 | cshome | 0 | 5099 | 1 |
| 1165 | cshome | 0 | 5100 | 1 |
| 1166 | cshome | 0 | 5101 | 1 |
| 1167 | cshome | 0 | 5102 | 1 |
| 1168 | cshome | 0 | 5103 | 1 |
| 1169 | cshome | 0 | 5104 | 1 |
| 1170 | cshome | 0 | 5105 | 1 |
| 1171 | cshome | 0 | 5106 | 1 |
| 1172 | cshome | 0 | 5107 | 1 |
| 1173 | cshome | 0 | 5108 | 1 |
| 1174 | cshome | 0 | 5109 | 1 |
| 1175 | cshome | 0 | 5110 | 1 |
| 1176 | cshome | 0 | 5111 | 1 |
| 1177 | cshome | 0 | 5112 | 1 |
| 1178 | cshome | 0 | 5113 | 1 |
| 1179 | cshome | 0 | 5114 | 1 |
| 1180 | cshome | 0 | 5115 | 1 |
| 57892 | cshome | 0 | 32162 | 1 |
| 59368 | cshome | 0 | 48642 | 1 |
+-------+--------+---------+--------------+---------+
29 rows in set (0.00 sec)note that all of the spawn2 entries have a version number of 0. that indicates the version of the zone those spawn2 entries are valid for. you can have multiple configurations (versions) of the same zone, each with different spawns (as well as quest scripts).
Zamthos
01-21-2013, 02:55 PM
That makes more sense, thank you so much.
c0ncrete
01-21-2013, 03:03 PM
not a problem. you want to use 0 most of the time when creating instances.
unless you've done some heavy customization, there should only be 3 zones with other versions numbers in your database.
select zoneidnumber, version, long_name from zone where version > 0;
+--------------+---------+---------------------+
| zoneidnumber | version | long_name |
+--------------+---------+---------------------+
| 25 | 1 | The Nektulos Forest |
| 151 | 1 | The Bazaar |
| 114 | 1 | Skyshrine |
+--------------+---------+---------------------+
3 rows in set (0.06 sec)
Zamthos
01-21-2013, 03:25 PM
All right, worked perfectly, I misunderstood you the first time around, haha. And yeah, I probably won't be using instances in those zones.
Zamthos
01-21-2013, 05:50 PM
I implemented this into the zone Karnor's Castle and the players are saying it's sending them to different instances even if they're in the same group. Script below:
EDIT: Also wondering about the more advanced version of the script with buttons and everything, where could I find that?
sub EVENT_SAY
{
my $Solo = quest::saylink("Solo", 1);
my $Group = quest::saylink("Group", 1);
my $Guild = quest::saylink("Guild", 1);
my $NPCName = $npc->GetCleanName();
if($text=~/Hail/i)
{
$client->Message(315, "$NPCName whispers to you, 'Do you want to create an instance? If so, $Solo, $Group, or $Guild?'");
}
if($text=~/Solo/i)
{
plugin::SendToInstance("solo", "karnor", 0, 314.4, 24.8, 4.5, "EXP", 604800);
}
if($text=~/Group/i)
{
plugin::SendToInstance("group", "karnor", 0, 314.4, 24.8, 4.5, "EXP", 604800);
}
if($text=~/Guild/i)
{
plugin::SendToInstance("guild", "karnor", 0, 314.4, 24.8, 4.5, "EXP", 604800);
}
}
liquest
01-21-2013, 07:52 PM
Im actually curious about this aswell if there is a fixed script for this.
c0ncrete
01-21-2013, 09:02 PM
what do you mean fixed? fixed for what?
Zamthos
01-21-2013, 09:36 PM
By fixed he means one that sends the entire group to the same instance rather than making an instance per person, what I would like to see is the delete and enter button for each instance type.
c0ncrete
01-21-2013, 09:47 PM
hfjkdshkahkh
that's it.. back to linear display mode for me. i keep overlooking posts in hybrid mode. <grumble>
Zamthos
01-21-2013, 09:52 PM
You know what I'm asking, correct?
c0ncrete
01-21-2013, 09:57 PM
does the npc you are using have qglobal access enabled? if not, the plugin won't work correctly.
Zamthos
01-21-2013, 10:06 PM
Let me see if what you said will fix it.
Zamthos
01-21-2013, 10:09 PM
I believe you fixed it, didn't realize it was that simple, but that still doesn't have the delete or enter option.
c0ncrete
01-21-2013, 10:24 PM
you'll want to write your own plugin combining bits of both popup_window_utils.pl and Instances.pl then.
that being said... allowing just anyone to delete instances they did not create, but have access to, is probably a bad idea.
Zamthos
01-21-2013, 10:27 PM
I know servers, LootFest and EZ Server, that have this and it only allows you to delete if there aren't any players within it.
NatedogEZ
01-21-2013, 11:51 PM
Here is the instance code I am using.
Currently allows Solo / Group / Guild
Guild and group will only show up if you are in.. well... a GUILD or GROUP! =p
If that guild / group / solo -- has an instance already defined you have 2 options now!
Can either Enter the instance or Delete it -- I might have to add a pop-up for delete so people don't just go ... OOPS deleted.
The event spawn / timer were not written by me but adds a neat effect to the NPC.
Use this / pick through it --- might help you with what you are trying to do.
One thing I need to add is an Instance Wipe .. but I am lazy
sub EVENT_SPAWN {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $range = (15);
quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range, $z - 10, $z + 20);
quest::settimer("effect",1);
quest::settimer("effect2",1);
}
sub EVENT_ENTER
{
$client->Message(315, "For Waypoint Options: Target the portal and Hail for options.");
}
sub EVENT_TIMER
{
if($timer eq "effect"){
$npc->SpellEffect(178);
$npc->SpellEffect(203);
$npc->SendAppearanceEffect(77,78);
quest::stoptimer("effect");
quest::settimer("effect",12);
}
if($timer eq "effect2"){
$npc->SendAppearanceEffect(77,78);
quest::stoptimer("effect2");
quest::settimer("effect2",4);
}
}
sub EVENT_SAY
{
my $Cx = $client->GetX();
my $Cy = $client->GetY();
my $Cz = $client->GetZ();
my $createsolo = quest::saylink("Create Solo",1);
my $entersolo = quest::saylink("Enter Solo",1);
my $deletesolo = quest::saylink("Delete Solo",1);
my $createguild = quest::saylink("Create Guild",1);
my $enterguild = quest::saylink("Enter Guild",1);
my $deleteguild = quest::saylink("Delete Guild",1);
my $creategroup = quest::saylink("Create Group",1);
my $entergroup = quest::saylink("Enter Group",1);
my $deletegroup = quest::saylink("Delete Group",1);
my $space = "_";
my $instguild = "guild";
my $soloinst = "solo";
my $groupinst = "group";
my $soloname = "$name";
my $sologlob = "$name$space$soloinst$space$zonesn";
my $guildglob = "$uguild_id$space$instguild$space$zonesn";
my $qglobals = plugin::var('qglobals');
my $GETGROUP = plugin::GetGroupID();
my $groupglob = "$GETGROUP$space$groupinst$space$zonesn";
if($text=~/Hail/i)
{
$client->Message(15,"---------- ");
#Check to see if player has solo instance in current zone
if (defined $qglobals{$sologlob})
{
$client->Message(15,"$entersolo instance!");
$client->Message(15,"$deletesolo instance!");
}
else
{
$client->Message(15,"$createsolo instance!");
}
$client->Message(15,"----------");
#End solo check
#Check if player is in guild otherwise no prompt for guild
if($uguild_id >=1)
{
if (defined $qglobals{$guildglob})
{
$client->Message(15,"$enterguild instance!");
$client->Message(15,"$deleteguild instance!");
}
else
{
$client->Message(15,"$createguild instance!");
}
}
#End Guild check
$client->Message(15,"----------"); #break
#Check if player is grouped otherwise no prompt
if ($GETGROUP >= 1)
{
if (defined $qglobals{$groupglob})
{
$client->Message(15,"$entergroup instance!");
$client->Message(15,"$deletegroup instance!");
}
else
{
$client->Message(15,"$creategroup instance!");
}
}
#End Group Check
}
#Start Create
#Create solo start
if($text=~/Create Solo/i && !defined $qglobals{$sologlob})
{
plugin::SendToInstance("solo", "$zonesn", 0, $Cx, $Cy, $Cz, solo, 86400);
}
elsif($text=~/Create Solo/i && defined $qglobals{$sologlob})
{
$client->Message(15,"You have a solo instance type - $entersolo!");
}
#Create solo end
#Create group start
if($text=~/Create Group/i && !defined $qglobals{$groupglob})
{
my $isgrouped = $client->GetGroup();
if($isgrouped >= 1)
{
my $groupsid = $isgrouped->GetID();
plugin::SendToInstance("group", "$zonesn", 0, $Cx, $Cy, $Cz, group, 86400);
}
else
{
$client->Message(315,"You must be in a Group to create a Group Instance!");
}
}
elsif($text=~/Create Group/i && defined $qglobals{$groupglob})
{
$client->Message(15,"You have a guild instance type - $entergroup!");
}
#Create group end
#Create guild start
if($text=~/Create Guild/i && !defined $qglobals{$guildglob})
{
if ($uguild_id >=1)
{
plugin::SendToInstance("guild", "$zonesn", 0, $Cx, $Cy, $Cz, guild, 259200);
}
else {
$client->Message(15,"You must be in a guild to create a guild instance!");
}
}
elsif($text=~/Create Guild/i && defined $qglobals{$guildglob})
{
$client->Message(15,"You have a guild instance type - $enterguild!");
}
#Create guild end
#END CREATE
#Start ENTER
if($text=~/Enter Solo/i && defined $qglobals{$sologlob})
{
my $instid = $qglobals->{$sologlob};
quest::AssignToInstance($instid);
quest::MovePCInstance($zonesn, $instid, $Cx, $Cy, $Cz);
}
if($text=~/Enter Guild/i && defined $qglobals{$guildglob})
{
my $instid = $qglobals->{$guildglob};
quest::AssignToInstance($instid);
quest::MovePCInstance($zonesn, $instid, $Cx, $Cy, $Cz);
}
if($text=~/Enter Group/i && defined $qglobals{$groupglob})
{
my $instid = $qglobals->{$groupglob};
quest::AssignToInstance($instid);
quest::MovePCInstance($zonesn, $instid, $Cx, $Cy, $Cz);
}
#End Enter
#Start Delete
if($text=~/Delete Solo/i && defined $qglobals{$sologlob})
{
quest::delglobal($sologlob);
}
if($text=~/Delete Group/i && defined $qglobals{$groupglob})
{
quest::delglobal($groupglob);
}
if($text=~/Delete Guild/i && defined $qglobals{$guildglob})
{
quest::delglobal($guildglob);
}
#End Delete
}
Zamthos
01-22-2013, 12:04 AM
Thanks for that Nate, you've helped a lot!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.