PDA

View Full Version : spell book help


spider661
11-14-2008, 03:21 AM
how do i remove disc from the spell book? now that the #melody command is in bards can load disc in there spell bar and use them with no timers with that command. and there is also a zone crash if you twist more then 1 disc.

so we need to remove disc from from the spell book or at the least the bard disc.

i tryed setting the lvl on the spell to a lvl that was not obtainable but then they cant get them in there disc window i don't want to remove the disc just take them out of the spell book.

trevius
11-14-2008, 05:22 AM
Sounds like the best solution would be to change the source code for #melody so that it won't allow the use of discs with the command. But, another idea would be to have your spell scriber remove those few disc spells after scribing all spells for bards.

spider661
11-14-2008, 05:35 AM
i tryed that only command i can find is $client<-UnscribeSpell(slot) but i dont know what slot there in.

so how would i go about removing only them spells?

the ids and spells are

puretone 4586
deft dance 4516
thousand blades 8030
resestant 4585
fearless 4587

trevius
11-14-2008, 05:54 AM
I haven't tested this yet, but I think something like this should work:

$client->UnscribeSpell(4586);
$client->UnscribeSpell(4516);
$client->UnscribeSpell(8030);
$client->UnscribeSpell(4585);
$client->UnscribeSpell(4587);

If that doesn't work, then we probably need to make a new quest command that lets you unscribe just one spell. Shouldn't be too hard to make.

trevius
11-14-2008, 06:09 AM
This is untested, but I think this should work, or should be very close to working if it was added to the source:

questmgr.cpp
void QuestManager::unscribespell(int spell_id, bool update_client=true) {
int i;

for(i = 0; i < MAX_PP_SPELLBOOK; i++)
{
if(m_pp.spell_book[i] == spell_id)
UnscribeSpell(i, update_client);
}
}

questmgr.h
void unscribespell(int spell_id, bool update_client=true);

perlparser.cpp
XS(XS__unscribespell);
XS(XS__unscribespell)
{
dXSARGS;
if (items != 0)
Perl_croak(aTHX_ "Usage: unscribespell(spell_id)");

int spell_id;

quest_manager.unscribespell(spell_id);

XSRETURN_EMPTY;
}

newXS(strcpy(buf, "unscribespell"), XS__unscribespells, file);

Then, you should be able to just do quest::unscribespell(spell_id); to do it. I think you could even do it without giving the message that they are being removed by using quest::unscribespell(spell_id, false); if I am reading the code correctly.

spider661
11-14-2008, 12:34 PM
errors errors and more errors :P


2>.\questmgr.cpp(1708) : error C2065: 'm_pp' : undeclared identifier

2>.\questmgr.cpp(1708) : error C2228: left of '.spell_book' must have class/struct/union


2>.\questmgr.cpp(1709) : error C3861: 'UnscribeSpell': identifier not found


2>.\perlparser.cpp(2335) : error C2660: 'QuestManager::unscribespell' : function does not take 0 arguments


plus had to change
questmgr.h
void unscribespell(); to void unscribespell(int spell_id, bool update_client);

althogh i think all calls should prob be set to
void unscribespell(int spell_id, bool update_client=true);

trevius
11-14-2008, 05:48 PM
Sorry, wrote that pretty quick just as a possible solution to try. You are right that the questmgr.h line needed to be changed. Also the perlparser.cpp needed an int added to it. I updated the code some to be a bit closer. Though, it still doesn't resolve the error you are getting about m_pp. I think the code would need changes so that it figures out the spell slot for the spell being unscribed. Not sure exactly how to do that. It would probably be easier to just fix #melody. But, the unscribespell would be useful have at some point as well.

spider661
11-15-2008, 04:32 AM
any clue on how to atlest fix #melody so they cant cast disc or maybe even just have it check the spell reuse timer and interrupt the casting if its not time to cast it?

spider661
11-16-2008, 01:04 AM
found another prob with melody that needs a fix bad.

spells don't cost mana with melody.. i have a few bards using there high mana cost aoe and not losing mana.

i had a song i could not cast because i did not have enough mana casted it using #melody command.. this is a big bug.