Page 1 of 1

locking/unlocking spells

Posted: Thu Aug 24, 2017 12:25 pm
by Ememjr
right now in emu when crafting it unlocks all trasdeskill spells , but it should only unlock the 6 abilities that are used for that recipe (technique)

i wanted to change the type== to technique== and add a technique parameter as i put below
since technique is currently not in spellbookentry class do you have a problem with me adding it or is there an already easier way to get the technique

Code: Select all

void Player::UnlockTSSpells(int32 technique) {
	vector<SpellBookEntry*>::iterator itr;

	MSpellsBook.writelock(__FUNCTION__, __LINE__);
	for (itr = spells.begin(); itr != spells.end(); itr++) {
		if ((*itr)->type == SPELL_BOOK_TYPE_TRADESKILL)
			ModifySpellStatus(*itr, 66);
	}

	MSpellsBook.releasewritelock(__FUNCTION__, __LINE__);
	// Lock all other types
	LockAllSpells();
}
also one other thing to go along with this, is spells/abilities that have a similar spell/ability that you can only use one or the other and it disables the other till they are reusuble in crafting you cannot use ability 1 and 3 together for instance becuase they are the opposite how is that handled currently

Re: locking/unlocking spells

Posted: Thu Aug 24, 2017 3:23 pm
by Jabantiz
It has been a while since I worked with spells but you should be able to get the spell from the book entry struct and then check the technique from that.

There is also a linked timer id, any spell with the same id will share the recast so none can be used. The id can be anything but to keep it simple we had been using the id of the first spell in the spell line.