PDA

View Full Version : Completely lost, can i get some input?


Songsinger
03-18-2015, 09:16 PM
OK i'm completely lost on this one. I'm trying to run this quest. the first two event hand ins work perfect, however the third one does nothing. no response, no return item, nothing.

sub EVENT_ITEM {
if($itemcount{11602} == 1 && $itemcount{59943} == 1 && $itemcount{188016} == 1 && $itemcount{188015} == 1){
quest::say("Here is your kobold skull infused with the power of the white dragon scales.");
quest::summonitem("188013");
}
if($itemcount{11622} == 1 && $itemcount{59943} == 1 && $itemcount{188016} == 1 && $itemcount{188015} == 1){
quest::say("Here is your kobold skull infused with the power of the red dragon scales.");
quest::summonitem("188012");
}
if($itemcount{188031} == 1){
quest::whisper("This is not good. We must investigate this matter imediatly. Take this note to my spy. He is currently on a mission off the Great Divide, attempting to infiltrate the laboratory of a great alchamist.");
quest::summonitem("188032");
}
plugin::return_items(\%itemcount);
}

Like I said the first one is perfect, the second is perfect. the third you give item and he just looks at you. Running it in cmd gave an OK message. Anyone see any problems?

Kingly_Krab
03-18-2015, 09:20 PM
Try this: sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount, 11602 => 1, 59943 => 1, 188016 => 1, 188015 => 1)) {
plugin::Whisper("Here is your kobold skull infused with the power of the white dragon scales.");
quest::summonitem(188013);
} elsif(plugin::check_handin(\%itemcount, 11622 => 1, 59943 => 1, 188016 => 1, 188015 => 1)){
plugin::Whisper("Here is your kobold skull infused with the power of the red dragon scales.");
quest::summonitem(188012);
} elsif(plugin::check_handin(\%itemcount, 188031 => 1)) {
plugin::Whisper("This is not good. We must investigate this matter immediately. Take this note to my spy. He is currently on a mission off the Great Divide, attempting to infiltrate the laboratory of a great alchemist.");
quest::summonitem(188032);
}
plugin::return_items(\%itemcount);
}

Songsinger
03-18-2015, 09:24 PM
that works thank you. I still dont really understand why the first did not work. but thank you!

Kingly_Krab
03-18-2015, 09:29 PM
Well, $itemcount is a hash reference used to see if a client has that item, which is not useful in EVENT_ITEM where you're checking for hand in, rather than just checking if a client has an item or not, meaning you should use plugin::check_handin, not $itemcount. You can use $itemcount in other subroutines like this: sub EVENT_SAY {
if ($text=~/Hail/i && $itemcount{59943} >= 1) {
plugin::Whisper("You have the skull!");
} elsif ($text=~/Hail/i && $itemcount{59943} == 0) {
plugin::Whisper("You don't have the skull!");
}
}

Songsinger
03-18-2015, 10:18 PM
Ah, okay thank you very much

Kingly_Krab
03-18-2015, 10:25 PM
You're welcome. If I may ask, what server do you operate?

Uleat
03-18-2015, 10:54 PM
http://wiki.eqemulator.org/p?Ultimate_Perl_Reference&frm=Main

I don't see a 'quest::whisper' operator there..though, I haven't checked the api itself.

Anything after the 'croak' would probably be ignored.

Kingly_Krab
03-18-2015, 10:57 PM
Yeah, he meant plugin::Whisper, apparently he had gotten confused by reading something.

Songsinger
03-21-2015, 09:59 PM
ah yeah, sorry i'm still trying to teach myself this stuff. It all goes well then I hit a hiccup.
Right now i'm running Ancient Memories, though it is currently down as there is a lot of editing going in that I just could not do with people logged in(sorry but it happens during alpha).

Songsinger
03-21-2015, 10:03 PM
I do have another question though, not sure if I need to post a new thread or not, however ill post it here first. I'm using an auto skill trainer on level, the one floating around on the forums. I would like this code

# scribe all spells for current level
quest::scribespells( $ulevel, $ulevel - 1 );


To not scribe certain spells but cannot figure out how to do it. Mainly I do not want it to scribe the Mage epic spell. The only ideas I have had are to create a unscribe event for the spell id, though it would be risky if someone did epic, died and re-dinged and lost it, but even that i'm unsure of how to do. Is there an except clause I could put in that would skip over that spell ID?
Thank you in advance!

ghanja
03-21-2015, 10:18 PM
quest::scribespells ($ulevel, $ulevel - 1, "xxxx");


Where xxxx is the spell you wish for it to omit/block.

If I remember correctly.

ghanja
03-21-2015, 10:22 PM
Oh sorry, you said spells as in plural


my @blockedspells = (xxxx,xxxx,xxxx,xxxx);
quest::scribespells ($ulevel, $ulevel - 1, $blockedspells);

Songsinger
03-21-2015, 10:30 PM
:) thank you very much!

Songsinger
03-21-2015, 10:42 PM
cant get either of these to work, Mage epic spell id for Summon orb is 1944. it still scribes when put into both of these configurations? does this not got off the ID in the database or am I still missing something?

With my @blockedspells = (1944);
quest::scribespells ($ulevel, $ulevel - 1, $blockedspells);
in the 1944 is in red, still scribes all spells.

with the other formate the
quest::scribespells ($ulevel, $ulevel - 1, "1944"); the 1944 is grayed out and still scribes all spells.

ghanja
03-21-2015, 11:00 PM
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {


Oh, hmmm.. could have sworn blocking spells was a parameter, evidently not. There is a means to unscribe a spell if you know its book slot, though I see no way to find what slot a spell id is in.

Songsinger
03-21-2015, 11:18 PM
Wonder if there is any way to put a flag or status requirement on the spell, and make the quest give that flag? Maybe that would bypass the autoscribe on it.

Kingly_Krab
03-22-2015, 03:11 AM
To block a spell from being scribed you have to create a spell global in the spell globals table. It's very undocumented, you must also enable spell globals in the rule_values table under the Spell:EnableSpellGlobals rule.

Songsinger
03-22-2015, 03:28 PM
So i take it the Spellid and spell_name are obvious, the spell id and name of one i want to block. what do i need to do for qglobal and value? Tha main spell I want to block is 1944 the mage epic spell summon orb. It is unfair for mages to get a free epic :)

Kingly_Krab
03-22-2015, 04:15 PM
For qglobal you put the name of the qglobal you'd want to set for them to be able to scribe that spell. The value is the value of the qglobal necessary to scribe the spell. For example, you want qglobal UberSpells to have a value of 1 and block spell 1944. This is how you would do it: INSERT INTO `spell_globals` ('1944', 'Summon Orb', 'UberSpells', '1');

Songsinger
03-22-2015, 09:23 PM
Thank you very much!

Kingly_Krab
03-22-2015, 10:34 PM
You're welcome.