Log in

View Full Version : Guild bank questions??


Grimshad
04-19-2010, 03:34 PM
Ok so the guild bank is fully operational now. Thats great news!

But how do you use it? Since there doesn't seem to be a guild lobby?

Hrmmmm..

blackdragonsdg
04-19-2010, 03:52 PM
There is a guild lobby but entry is only done by quest script or #zone command.

Go to your emulator\quests\guildlobby directory and modify your player.pl file so that is includes this:

sub EVENT_CLICKDOOR {
if($doorid == 258 || $doorid == 260) {
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);
}
else
{
my $instanceID = quest::CreateInstance("guildhall", 0, 64800);
quest::AssignToInstance($instanceID);
quest::setglobal("GuildInstance_$uguild_id",$instanceID,7,"H18");
quest::MovePCInstance(345, $instanceID, 0, 0, 0);
}
}
}
}


Entry can also be done by quest npc. Create a quest npc and assign the following quest script to it.

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");
}
}


}

Grimshad
04-19-2010, 11:52 PM
Nice, someone actually responded to a question I asked ;)

Thanks much for that blackdragonsdg!

One last question about that:

Is it possible to have the guild bank open somewhere else?

Not that its not fine that way, but I play on my private server with some of my friends and there just isn't enough of us to make that way necessary.

Rather then zoning 3 times to reach the guild bank, is it possible to place a guild banker in pok by using the new rule_value along with some of that scripting?


EDIT: I have the latest source for quests and quests\guildlobby doesn't exist... was I supposed to make it?

EDIT: Since guildlobby doesn't exist I opened the player.pl in the Poknowledge folder and set the guild lobby door to go to the guild hall. However, this didn't do anything. I then set the database entry for that door to point to the guild hall, which then sends everyone to the same guild hall, even people without a guild.(no instancing)

Grimshad
04-20-2010, 01:16 AM
UPDATE:Can't edit anymore, weird forum rules.

I got it to partially work I think, I removed the destination zone from the database. Now it goes to the guild hall (IF you click a specific little spot on the door), unfortunately the hall is still not instanced, everyone goes to the same one, good news is that players without a guild seem to not be able to get in, although there is no fail message, it just doesn't work.

blackdragonsdg
04-20-2010, 03:23 AM
Sometimes the quest folders don't exist in that case just create the folder using the shortname for the zone that it is for. Once you have the folder created just copy the player.pl from another zone and place it in the guildlobby folder...once that is done just edit the file replacing its contents with the first section of scripting and it should work as long as you are in a guild.

I am sure it is possible to make the guild bankers function in other zones but it has not been done yet as far as I know. You can however create an npc in PoK or in any zone for that matter to port you to your guild hall. That second section of scripting will make an npc a guild hall teleporter if it is used right.

Akkadius
04-20-2010, 03:53 AM
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:

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:
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
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!

Grimshad
04-20-2010, 07:23 AM
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:

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:
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


Hope that helps!

Hrmm, well sorry but this actually didn't help, I know your trying to help inform, but you've only stated more things I already knew.

I understand the guild bank can only be located in a single zone. I want it ONLY located in pok, to remove the pointless zone after zone just to get to the guild bank.

I can easily change the zoneid of the guild bank in the database, but how do I then access the guild bank from pok. I will need to create an NPC players can use to access it right?

Thats the part I don't know how to do.

I currently have it setup so the guild lobby door goes strait to the guild hall(not instanced, I can't get instancing to work for the life of me, but each guild can access their guild bank, they just share the zone), to eliminate a pointless zone. It's still another zone away non-the-less.

P.S. I know that's not what this thread was originally about, but that's what I'm trying to do at this point.

mixxit
04-20-2010, 07:42 AM
What's the configuration for the NPC banker, class and such? There was already one in the guildhall for me but when I click him it causes my client to crash.

Akkadius
04-20-2010, 12:14 PM
Change the Zone ID in Rules_Values... Make a class 66 NPC in that zone

mixxit
04-20-2010, 06:03 PM
both done still crashes for anyone!

blackdragonsdg
04-20-2010, 11:58 PM
What's the configuration for the NPC banker, class and such? There was already one in the guildhall for me but when I click him it causes my client to crash.

Well I don't know about the crash part but the banker stuff I might can help with.

Banker = Class 40
Guild Banker = Class 66


Since examples tend to work better I exported the spawn data from the guild banker in the guild hall so here you go.

Guild Banker
INSERT INTO `spawnentry` (`spawngroupID`, `npcID`, `chance`) VALUES (46046, 345003, 100);
INSERT INTO `spawngroup` (`id`, `name`, `spawn_limit`, `dist`, `max_x`, `min_x`, `max_y`, `min_y`, `delay`) VALUES (46046, 'guildhall3450003', 0, 0, 0, 0, 0, 0, 0);
INSERT INTO `spawn2` (`id`, `spawngroupID`, `zone`, `version`, `x`, `y`, `z`, `heading`, `respawntime`, `variance`, `pathgrid`, `_condition`, `cond_value`, `enabled`) VALUES (57310, 46046, 'guildhall', 0, -37.000000, -4.000000, 4.125000, 20.000000, 640, 0, 0, 0, 1, 1);
INSERT INTO `npc_types` (`id`, `name`, `lastname`, `level`, `race`, `class`, `bodytype`, `hp`, `gender`, `texture`, `helmtexture`, `size`, `hp_regen_rate`, `mana_regen_rate`, `loottable_id`, `merchant_id`, `npc_spells_id`, `npc_faction_id`, `adventure_template_id`, `trap_template`, `mindmg`, `maxdmg`, `npcspecialattks`, `aggroradius`, `face`, `luclin_hairstyle`, `luclin_haircolor`, `luclin_eyecolor`, `luclin_eyecolor2`, `luclin_beardcolor`, `luclin_beard`, `drakkin_heritage`, `drakkin_tattoo`, `drakkin_details`, `armortint_id`, `armortint_red`, `armortint_green`, `armortint_blue`, `d_meele_texture1`, `d_meele_texture2`, `prim_melee_type`, `sec_melee_type`, `runspeed`, `MR`, `CR`, `DR`, `FR`, `PR`, `see_invis`, `see_invis_undead`, `qglobal`, `AC`, `npc_aggro`, `spawn_limit`, `attack_speed`, `findable`, `STR`, `STA`, `DEX`, `AGI`, `_INT`, `WIS`, `CHA`, `see_hide`, `see_improved_hide`, `trackable`, `isbot`, `exclude`, `ATK`, `Accuracy`, `slow_mitigation`, `version`, `maxlevel`, `scalerate`, `private_corpse`, `unique_spawn_by_name`) VALUES (345003, 'a_guild_treasurer', 'Guild Banker', 50, 1, 66, 1, 3750, 0, 11, 47, 6, 19, 19, 0, 0, 0, 0, 0, 0, 74, 200, '', 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28, 1.7, 41, 41, 41, 41, 41, 0, 1, 0, 1197, 0, 1, -15, 1, 191, 191, 191, 191, 191, 191, 191, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 100, 0, 0);


As an example of a normal banker I used a custom banker I had created for Relic, The Artifact City, so here you go.

Normal Banker
INSERT INTO `spawnentry` VALUES (70295, 700295, 100);
INSERT INTO `spawngroup` VALUES (70295, '70295', 1, 0, 0, 0, 0, 0, 0);
INSERT INTO `spawn2` VALUES (700295, 70295, 'relic', 0, 343.200012, 1129.000000, -273.899994, 67.800003, 1200, 0, 0, 0, 1, 1);
INSERT INTO `npc_types` (`id`, `name`, `lastname`, `level`, `race`, `class`, `bodytype`, `hp`, `gender`, `texture`, `helmtexture`, `size`, `hp_regen_rate`, `mana_regen_rate`, `loottable_id`, `merchant_id`, `npc_spells_id`, `npc_faction_id`, `adventure_template_id`, `trap_template`, `mindmg`, `maxdmg`, `npcspecialattks`, `aggroradius`, `face`, `luclin_hairstyle`, `luclin_haircolor`, `luclin_eyecolor`, `luclin_eyecolor2`, `luclin_beardcolor`, `luclin_beard`, `drakkin_heritage`, `drakkin_tattoo`, `drakkin_details`, `armortint_id`, `armortint_red`, `armortint_green`, `armortint_blue`, `d_meele_texture1`, `d_meele_texture2`, `runspeed`, MR, CR, DR, FR, PR, `see_invis`, `see_invis_undead`, `qglobal`, AC, `npc_aggro`, `spawn_limit`, `attack_speed`, `findable`, STR, STA, DEX, AGI, _INT, WIS, CHA, `see_hide`, `see_improved_hide`, `trackable`, `isbot`, `exclude`, ATK, `Accuracy`, `slow_mitigation`, `version`, `maxlevel`, `scalerate`, `private_corpse`, `unique_spawn_by_name`) VALUES (700295, 'Relic Banker', '', 85, 1, 40, 19, 7500000, 2, 0, 0, 6, 500, 0, 0, 0, 0, 0, 0, 0, 50000, 75000, 'SRENCMIf', 75, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 350, 350, 350, 350, 350, 1, 1, 1, 5000, 0, 1, -35, 0, 750, 750, 750, 750, 750, 750, 750, 1, 1, 0, 0, 1, 8000, 99, 0, 0, 0, 100, 0, 0);

Both examples are pulled from my database which is at rev 1395. I found that copying an existing banker or merchant then changing the zone and location data was much easier than creating one from scratch.