View Single Post
  #6  
Old 08-24-2014, 06:04 PM
Asylum
Sarnak
 
Join Date: Jun 2013
Posts: 81
Default EVENT_PROXIMITY_SAY with ReadBook

I love this functionality; thank you for creating it. The Perl code below was working perfectly in 2013 but when I've revisited working on my server content recently, it no longer shows the books to players. The proximity text works fine, as does resetting proximity with exit. Is the problem with proximity_say? new ReadBook format? Thanks for the help.

Code:
#The_Codices_of_Ascension in Zenith of Ascension (harbingers v.1)
#A proximity say library of lore for players to read, 10 volumes
#Set to type 11 (untargetable) after placing in database

sub EVENT_SPAWN {
	quest::npcfeature("size", 150);
	$npc->NPCSpecialAttacks(ZHfDCAB, 0);
	quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
}

sub EVENT_ENTER {
	$client->Message(315, "'The Codices of Ascension' by Senior Researcher Xal'Fora.  State which volume you would like to read, [volume one] to [volume nine].");
	quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
}

sub EVENT_EXIT {
	quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
}

sub EVENT_PROXIMITY_SAY {
	my $playername = $client->GetName();
	my $playerlastname = $client->GetLastName();

	if($text=~/volume one/i && $ulevel >= 55) {
		$client->ReadBook("Volume I of The Codices of Ascension.  

The following are my thoughts and concerns on the actions of my peers concerning the discovery of this tower.  For many years our people have searched for ways to gain the favor of our gods, to learn of their plans for us, to become closer to them.  One day we discovered this cave in a most desolate land of bones.  This place evoked feelings we'd never experienced before.  Some saw this as prophetic, such as Councilmembers Atuli and Dayo.  It was Atuli who first decided to venture deeper into the cavern.  I have yet to decide if this was wise or blindly foolish.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6316); #Summons lore, no drop, temporary item Knowledge of Ascension I, needs to be turned in at top of zone for Knowledge of Ascension I
	}
	elsif($text=~/volume two/i && (plugin::check_hasitem($client, 6317))) {
		$client->ReadBook("Volume II of The Codices of Ascension.  

Atuli was quite an orator, convincing many to follow him deep into the cavern in the hopes of communing with our gods.  This seemed too good to be true, as most things of such nature tend to be.  However, I could not resist and convinced my dearest friend Boxilar to join me on this enlightening experience.  What I hope is for this to be an awakening for our people.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6318); #Summons lore, no drop, temporary item Knowledge of Ascension II, needs to be turned in at top of zone for Knowledge of Ascension II
	}
	elsif($text=~/volume three/i && (plugin::check_hasitem($client, 6374))) {
		$client->ReadBook("Volume III of The Codices of Ascension.  

It seemed simple enough.  A small, voluntary, insignificant sacrifice of life force from every member of a race would catapult one individual to godhood.  It appears this has happened before upon Norrath much to the dismay of the pantheon.  I intent to consult with one of our wisest of elders, Grand Minister Califax.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6381); #Summons lore, no drop, temporary item Knowledge of Ascension III, needs to be turned in at top of zone for Knowledge of Ascension III
	}
	elsif($text=~/volume four/i && (plugin::check_hasitem($client, 6387))) {
		$client->ReadBook("Volume IV of The Codices of Ascension.  

News from deep within the tower.  Along with Atuli, Dayo has convinced the stone masons to construct a ramp in hopes of discovering the extent of the fiery spire.  Although hesitant, the workers have undertaken the enormous task.  I fear we may anger the gods with this intrusion, but my comrads have tempered my worry with the belief that if we are true in spirit and genuinely wish to gain a deeper understanding of our relationship with and worship of our gods, they will not take offense to this action.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6389); #Summons lore, no drop, temporary item Knowledge of Ascension IV, needs to be turned in at top of zone for Knowledge of Ascension IV
	}
	elsif($text=~/volume five/i && (plugin::check_hasitem($client, 6390))) {
		$client->ReadBook("Volume V of The Codices of Ascension.  

A senior member of our governing council, Senator Pahria, has gone against the cautions of the council and ventured higher in the tower with the expressed intent to bring back proof of his communication with the gods.  Workers saw him enter the top of the spire of flame and was not seen again; they presumed him killed.  Weeks later it was discoverd that we, as a race of elves, had gained the ability to hold fire and flame in our hands and not be harmed.  Viewed as a gift of divine devotion, many embraced this ability.  It was far too late for us when it was discovered that the 'gift' was nothing of the sort, as we were being transformed into the bodies we have today, servants to a new god, Pahria, who has taken the name Osora Lynar.  A small group led by Evinna has begun desciphering the ancient heiroglyphs on the stone pillars near the pinnacle of the spire.  It will be interesting to learn what was carved into the stone there.  Could it be a warning?

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6391); #Summons lore, no drop, temporary item Knowledge of Ascension V, needs to be turned in at top of zone for Knowledge of Ascension V
	}
	elsif($text=~/volume six/i && (plugin::check_hasitem($client, 6392))) {
		$client->ReadBook("Volume VI of The Codices of Ascension.  

'An entire race must be sacrificed for one to fully achieve Ascension' is how Evinna's notes put it.  This seems quite a deterrent to the process.  One can understand my shock upon hearing her next words, 'Furthermore, the race in question must be the same as the individual seeking Ascension.'  This must not be allowed to happen.  We must find a way to stop this horror we have nurtured from idea to reality.  Evinna's top assistant Finteinar has quite the skill translating these runes.  I believe he has intrepreted a clue to help us avert our fate.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6393); #Summons lore, no drop, temporary item Knowledge of Ascension VI, needs to be turned in at top of zone for Knowledge of Ascension VI
	}
	elsif($text=~/volume seven/i && (plugin::check_hasitem($client, 6396))) {
		$client->ReadBook("Volume VII of The Codices of Ascension.  

The inscription is incomplete due to missing runes, but Finteinar has managed to translate a portion of the text, 'Veri---- S----ari V--ios.'  What our research needs is a gifted writer to fill in the blanks.  Seekers have been sent among our people to find anyone to help complete this phrase.  Personally, as a child I recall hearing a most enduring and somewhat haunting ghost story by Literist Gelash, meant to keep children from venturing too far into the Orc-occupied woods.  I shall attempt to find him and report back soon.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6399); #Summons lore, no drop, temporary item Knowledge of Ascension VII, needs to be turned in at top of zone for Knowledge of Ascension VII
	}
	elsif($text=~/volume eight/i && (plugin::check_hasitem($client, 6409))) {
		$client->ReadBook("Volume VIII of The Codices of Ascension.  

Gelash has such insight into the details of Ascension just from the ancient writing, despite it being incomplete, and has discovered a means to stop the process.  One must command the individual to show his true intentions and if selfless it will complete the rite.  However, if the person bears any selfish thoughts, the ascension will be interrupted and he can be harmed by the material world again.  I will continue my attempt to find the proper phrase in the ancient language with the assistance of Gelash to issue such a command to a nearly-ascended being.  I only hope the poor soul who follows my advice survives the encounter, for our sake.

-- Senior Researcher Xal'Fora", 1); #Contains information as to where to turn in item.
		quest::summonitem(6410); #Summons lore, no drop, temporary item Knowledge of Ascension VIII, needs to be turned in at top of zone for Knowledge of Ascension VIII
	}
	elsif($text=~/volume nine/i && (plugin::check_hasitem($client, 6412))) {
		$client->ReadBook("Volume IX of The Codices of Ascension.  

The being now called Osora Lynar must be trapped in this realm and killed to prevent the elimination of our entire race.  The process is nearly complete so we must act quickly.  With this scroll in hand, speak the words 'Veritona Spectari Visios' in his presence and break his concentration.  We who have been corrupted and engulfed in this scheme will come to assist you in whatever way we can.  We gladly give our life essence if it provides a means to stop this atrocity and save our race.  Our new-found means of controlling fire can be focused into artifacts others may use to inflict harm.  However, this can be done only once per individual and we do not survive the process.  Do not let our sacrifice be in vain.

-- Xal'Fora, Harbinger of Ascension", 1); #Explains information on how to initiate the final encounter.
		quest::summonitem(6413); #Summons lore, no drop, item Knowledge of Ascension IX, needs to be shown at top of zone to initiate the final encounter.
	}
	elsif($text=~/volume ten/i && (plugin::check_hasitem($client, 6317)) && (plugin::check_hasitem($client, 6374)) && (plugin::check_hasitem($client, 6387)) && (plugin::check_hasitem($client, 6390)) && (plugin::check_hasitem($client, 6392)) && (plugin::check_hasitem($client, 6396)) && (plugin::check_hasitem($client, 6409)) && (plugin::check_hasitem($client, 6412)) && (plugin::check_hasitem($client, 6420)) && (plugin::check_hasitem($client, 6421))) { #6421 Knowledge of Ascension X drop from Osora_Lynar
		$client->ReadBook("Volume X of The Codices of Ascension.  

Through my actions, and the actions of others, I have written my name into the pages of this history.  The efforts of those who wished to destroy an entire race for the selfish purpose of ascending a single individual have been thwarted.  May it forever be known that I played a small but significant role in these events and may these words serve to reiterate the ancient warning carved in stone above.

-- The Exalted $playername $playerlastname, Savior of Many", 1); #New volume written to explain what your actions have done.
		quest::summonitem(6424); #Summons reward Cloak of Ghostly Flames
	}
	else {
		$client->Message(315, "You yet lack the knowledge to understand that text or you have requested a volume that does not exist.");
	}
}
Reply With Quote