-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spells] Adds a rule to allow right-click memorize from spell scrolls. #1377
Conversation
08075d2
to
b215fb0
Compare
This comment was marked as abuse.
This comment was marked as abuse.
return false; | ||
} | ||
|
||
if(!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily requesting changes here for this PR but converting the char array to a std::string would make it easy to do a string find and simplify the code a bit
Example
std::string item_name = item->Name;
if (item_name.find("Spell: ") != std::string::npos) {
std::cout << "found!" << '\n';
}
@@ -509,6 +509,87 @@ bool Client::TrainDiscipline(uint32 itemid) { | |||
return(false); | |||
} | |||
|
|||
bool Client::MemorizeSpellFromItem(uint32 item_id) { | |||
const EQ::ItemData *item = database.GetItem(item_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have used auto here; but the explicitness is good too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is really cool and something I'd be excited for running a custom server
Uses similar logic to disciplines with the hardcoded
Tome:
check and stuff, but withSpell:
items here instead. Locked it behind a rule in case people don't want to use it.