View Single Post
  #9  
Old 08-08-2013, 06:56 PM
Mariomario
Hill Giant
 
Join Date: Jul 2004
Posts: 143
Default

Code:
sub EVENT_SAY {
my $sl1 = quest::saylink("Good", 1, "Join, The Order of Heaven");
my $sl2 = quest::saylink("Evil", 1, "Join, The Legion of the Infernal");
my $sl3 = quest::saylink("Undead", 1, "Join, The Unliving");
my $sl4 = quest::saylink("Dragon", 1, "Join, The Order of the Dragon");
my $sl5 = quest::saylink("Light", 1, "I accept, I will give my life in service to Heaven and the Innocent!");
my $sl6 = quest::saylink("Dark", 1, "I accept, I will pursue carnage, chaos and vengence and be a force of pure violence!");
my $sl7 = quest::saylink("Unliving", 1, "I accept, I will become death and visit it upon all. I will bless those I meet with death or undeath if they be lucky!");
my $sl8 = quest::saylink("Draco", 1, "I accept, I will follow the dragon blood in my veins and aide the great lords in once again ruling the world!");
my $sl9 = quest::saylink("Decline", 1, "I decline!");
my $rejoin = quest::saylink("silent rejoin",1,"rejoin");

	if(!defined $qglobals{"Guild_Assignment"}) {
		if($text=~/Hail/i) {
			plugin::ClientSay("Welcome. Please join an order that matches your soul. Remember once a choice is made it can not be changed! Choose wisely!");
			$client->Message(11,"::: $sl1");
			$client->Message(11,"::: $sl2");
			$client->Message(11,"::: $sl3");
			$client->Message(11,"::: $sl4");
		} elsif ($text=~/Good/i) {
			plugin::ClientSay("The Order of Heaven strives to meet Evil head on and lay it low in order to protect those who are innocent. Do you wish to join our Order of Heaven Sent Knights?");
			$client->Message(11,"::: $sl5");
			$client->Message(11,"::: $sl9");
		} elsif ($text=~/Light/i) {
			quest::setglobal("Guild_Assignment",30,5,"F");
			quest::setguild(30,0);
			plugin::ClientSay("I welcome the newest Heavensent Knight, $name!"); 
		} elsif ($text=~/evil/i) {
			plugin::ClientSay("The Legion of the Infernal wishes to lay waste to all that is good and holy. Do you wish to join the Legion of the Infernal?");
			$client->Message(11,"::: $sl6");
			$client->Message(11,"::: $sl9");
		} elsif ($text=~/dark/i) {
			quest::setglobal("Guild_Assignment",31,5,"F");
			quest::setguild(31,0);
			plugin::ClientSay("All fear the newest Infernal Deathbringer, $name!");
		} elsif ($text=~/undead/i) {
			plugin::ClientSay("The Unliving will bring death and undeath rebirth to the world. Do you wish to be part of the rebirth of undeath?");
			$client->Message(11,"::: $sl7");
			$client->Message(11,"::: $sl9");
		} elsif ($text=~/unliving/i) {
			quest::setglobal("Guild_Assignment",32,5,"F");
			quest::setguild(32,0);
			plugin::ClientSay("The living tremble in terror at your might, $name!");
		} elsif ($text=~/Dragon/i) {
			plugin::ClientSay("The Dragons shall rule the world again! Do you wish to join their ranks of soldiers!");
			$client->Message(11,"::: $sl8");
			$client->Message(11,"::: $sl9");
		} elsif ($text=~/draco/i) {
			quest::setglobal("Guild_Assignment",33,5,"F");
			quest::setguild(33,0);
			plugin::ClientSay("A powerful change overcomes you, rise as a dragonborn!, $name!");
		}
	}
	else
	{
		if($text=~/hail/i)
		{
			plugin::ClientSay("You already belong to a guild, if you have forsaken that name, but wish to $rejoin their cause I may induct you back into their guild.");
		}
		
		if($text=~/rejoin/i)
		{
			if($qglobals{"Guild_Assignment"} == 30)
			{
				quest::setguild(30,0);
				plugin::ClientSay("Welcome back Heavensent Knight, $name!");
			}
			if($qglobals{"Guild_Assignment"} == 31)
			{
				quest::setguild(31,0);
				plugin::ClientSay("Welcome back Infernal Deathbringer, $name!");
			}
			if($qglobals{"Guild_Assignment"} == 32)
			{
				quest::setguild(32,0);
				plugin::ClientSay("The living tremble in terror at your might, $name!");
			}
			if($qglobals{"Guild_Assignment"} == 33)
			{
				quest::setguild(33,0);
				plugin::ClientSay("Rise again as a dragonborn!, $name!");
			}
		}	
	}	
}
I simply copied your code, so your initial set up is still there along with your wording. I changed a few things around and added in the qglobal set up. I tested it for fun just to ensure it worked correctly. Just be sure those 4 guilds are properly created and make the leaders of each guild (since a guild needs a leader) one of your own toons, therefore making invites impossible. Also be sure the NPC you use has qglobal turned on (1) in the DB under npc_types, otherwise he wont function correctly.

There were also changes to your 'evil','evil2' etc say links since they overlapped. /evil2/i =~ /evil/i since evil2 contains all the same characters as evil and overlapped causing you to receive the first saylink asking to join the guild. I changed them around to different words associated with the type, ie. good, light, evil, dark, undead, unliving, dragon, draco so the saylinks work as intended. Hope this is helpful.
__________________
Wrath - Lead Admin and Owner of Enlightened Dark: Ascension

Enlightened Dark: Ascension
Reply With Quote