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

05-25-2011, 11:32 PM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
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?
|
 |
|
 |

05-25-2011, 11:57 PM
|
 |
Discordant
|
|
Join Date: Mar 2009
Location: Ottawa
Posts: 495
|
|
The part
Code:
if(quest::isdisctome($i))
looks to be what you want here.
|

05-26-2011, 12:43 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
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);
}
}
|

05-26-2011, 01:26 AM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
so you saying that traindisc automatically reads of the item the spell id field its assigned?
|

05-26-2011, 01:46 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
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.
|

05-26-2011, 11:02 PM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
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.
|

05-26-2011, 11:54 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
You could always fix the code and post a diff.
|

05-27-2011, 12:04 AM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
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 
|

05-27-2011, 12:31 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
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.
|

05-27-2011, 12:38 AM
|
 |
Demi-God
|
|
Join Date: Mar 2009
Location: Umm
Posts: 1,492
|
|
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
|

05-27-2011, 12:44 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Most likely in the spells section.
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 06:39 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |