As far as the script, make a file for the shortname. And then insert the appropriate script quoted earlier into player.pl and then #reloadpl in game to clear the memory cache.
If you take the NPC route and put that same instance function on an NPC, make sure you enable Qglobals for the NPC using the script mentioned above:
Code:
sub EVENT_SAY {
if ($text =~/hail/i)
{
quest::say("Hello $name, would you like to be transfered to your [GuildHall]?");
}
if($text =~/Guildhall/i)
{
quest::say("Let me see...");
if($uguild_id > 0)
{
if (defined($qglobals{"GuildInstance_$uguild_id"}))
{
my $QGlobalValue = $qglobals{"GuildInstance_$uguild_id"};
quest::AssignToInstance($qglobals{"GuildInstance_$uguild_id"});
quest::MovePCInstance(345, $QGlobalValue, 0, 0, 0);
quest::say("Moving you to the instance now");
}
else
{
quest::say("No instance existed, so creating one");
my $instanceID = quest::CreateInstance("guildhall", 0, -1);
quest::AssignToInstance($instanceID);
quest::setglobal("GuildInstance_$uguild_id",$instanceID,7,"M60");
quest::MovePCInstance(345, $instanceID, 0, 0, 0);
quest::say("Moving you to the instance now");
}
}
else
{
quest::say("I am sorry but you are not part of a guild");
}
}
}
The Guild Bank ZONE ID is set in Rules_Values:
Code:
INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'World:GuildBankZoneID', '345', 'ID of zone the Guild Bank works in. Default 345, guildhall');
The reason for this is: as quoted by Derision
Quote:
The guild bank is stored in the memory of that instance of that zone. While deposits/withdrawals etc are written to the database immediately, there is no mechanism to inform Guild Bankers in other zones to refresh their in-memory copies when changes are made.
Without that restriction, item duplication would be rampant.
While you might not like it, I believe it is live-like, and I really didn't feel like spending the extra hours required to allow the facility to have multiple guild bankers.
With the way inter-zone communication is handled via packets, assuring accurate synchronisation between zones is virtually impossible, without putting guild banks in shared memory and using mutexes to access them, and the facility to easily do that is not currently there. (It is technically possible).
|
Hope that helps!