Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2011, 11:32 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default Help understanding guildmaster script

this is the official guildmaster tome turn in plug-in

Code:
#looks through the items haded in for discipline tomes,
#processing them as we find them.
sub try_tome_handins {
	my $itemcount = shift;
	my $isclass = shift;
	my $expectclass = shift;
	
	my @tomes = ();
	foreach my $i(keys %{$itemcount}) {
		if(quest::isdisctome($i)) {
			push(@tomes, $i);
			delete $itemcount->{$i};
		}
	}
	if(@tomes > 0) {
		if($isclass eq $expectclass) {
			foreach my $i(@tomes) {
				quest::traindisc($i);
			}
		} else {
			quest::say('You are not a member of my guild. I will not train you!');
			foreach my $i(@tomes) {
				$itemcount->{$i} = 1;
			}
		}
	}
}

1;
what I need to understand how this script recognizes which tome has been given.
i see this line here:

quest::traindisc($i);

which scribes disc $i, but which line responsible for $i to be determined?

basically I am looking to rewrite for my own script, which will handle specific tome turn ins only, and from specific people only, but I don't know how to tell the npc which tome was given to him?
Reply With Quote
  #2  
Old 05-25-2011, 11:57 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

The part
Code:
if(quest::isdisctome($i))
looks to be what you want here.
Reply With Quote
  #3  
Old 05-26-2011, 12:43 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

This assigns the itemids given to $i: foreach my $i(keys %{$itemcount}) {
I would think isdisctome($i) only checks if the item is a discipline tome.

Maybe you are thinking too far outside the box?

Psuedo:
Code:
if (plugin::check_handin(\%itemcount, tomeid => 1)) {
  if (special_person_only || special_case_only) {
    quest::traindisc(tomeid);
  }
}
Reply With Quote
  #4  
Old 05-26-2011, 01:26 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

so you saying that traindisc automatically reads of the item the spell id field its assigned?
Reply With Quote
  #5  
Old 05-26-2011, 01:46 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

isdisctome() is actually kinda funny to read. It checks if the name of the item starts with "Tome ", an int caster can't use it, the spell scroll effect is a valid spell, and an int caster can't cast the spell.

traindisc() does a similar check to see if the name starts with "Tome ", you're not an int caster, your class can use the item, the spell scroll effect is a valid spell, your class can use the spell, you're high enough level, and you don't know it already, then it teaches it to you.
Reply With Quote
  #6  
Old 05-26-2011, 11:02 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

I have played around with this, and it does seem that it check class and level of the tome and spell, BUT it doesn't check the Deity, even if you set the deity on spell itself and the tome - regular spell scrolls do check for deity when you trying to scribe them (deity base imbue spells)

I guess I will have to write that part with a script.
Reply With Quote
  #7  
Old 05-26-2011, 11:54 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

You could always fix the code and post a diff.
Reply With Quote
  #8  
Old 05-27-2011, 12:04 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

I would, but this is beyond the scope of my abilities for the moment
Would be nice if someone with more source knowledge could do that
Reply With Quote
  #9  
Old 05-27-2011, 12:31 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

When you say this is correctly tested when scribing a spell, do you mean right-clicking a deity specific spell from inventory?

I looked, but I don't see anything in the server code that actually looks at the deity. Maybe I missed it, but it might be something that is checked for on the client, and the functionality was never needed for disciplines.
Reply With Quote
  #10  
Old 05-27-2011, 12:38 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

yes you are correct - its most likely that a client blocks wrong deity spells for spell casters
And I do realize this functionality was never needed for the Discs (at least on live)

However, the GAME - either server of client still check for VALID deity assignment on the tomes!

What I did is created 2 new discs and 2 new tomes. I have labeled 1 disc and its tome as Solusek Ro only, and another as Mith Marr only

I have then turn them both to my monk guildmaster - the guildmaster accepted both tomes and taught me both discs

HOWEVER, when I went to use, I was unable to use Ro marked disc, but i was able to use Marr marked disc (my monk is Marr follower)

So somewhere, the game does check for valid deity on the disc
Reply With Quote
  #11  
Old 05-27-2011, 12:44 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Most likely in the spells section.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:33 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3