Jump to content
  • 0

Triggering skill from script.


SOSKaito

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  08/27/19
  • Last Seen:  

Hello everyone.

I've tried for like 8 hours now to make this work, but i've only had partial success.

 

What I'm trying to do is implementing the 2019 Warlock update, which makes Reading Spellbook a passive skill and transfers the effect to the spellbooks themselves, also eliminating the choice menu in the process.

 

What I did is :

I turned WL_READING_SB into a passive skill in the skill_db

I modified the case for WL_READING_SB in skill_castend_nodamage_id as follows
 

case WL_READING_SB:
		if (sd) {
			struct status_change *sc = status_get_sc(bl);

			for (i = SC_SPELLBOOK1; i <= SC_MAXSPELLBOOK; i++)
				if (sc && !sc->data[i])
					break;
			if (i == SC_MAXSPELLBOOK) {
				clif_skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0);
				break;
			}

			skill_spellbook(sd,flag);
			
			clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
		}
		break;

so it no longer pops open a menu and instead directly goes into skill_spellbook using the flag to store the Spellbook ID

This works wonderful if executed in an AtCommand as follows

ACMD_FUNC(spellbookcast)
{
	nullpo_retr(-1,sd);

	skill_castend_nodamage_id(&sd->bl,&sd->bl,WL_READING_SB,1,gettick(),atoi(message));
	return 0;
}

This command functions with the syntax "@spellbookcast <BookItemID>" and will successfully memorize the spellbook that is submitted.

 

Now i've tried to make a script command "memorizeskill" that works the same. The Spellbook should remain in the Inventory and execute the Skill WL_READING_SB with flag = BookItemID

My Code :

BUILDIN_FUNC(memorizeskill)
{
	TBL_PC* sd;

	if(!(script_rid2sd(sd)))
		return SCRIPT_CMD_FAILURE;

	skill_castend_nodamage_id(&sd->bl,&sd->bl,WL_READING_SB,1,gettick(),script_getnum(st,2));
	return SCRIPT_CMD_SUCCESS;
}

This however, does not work.

Edit: To clarify, this script command would later be used in the script of the Spellbooks themselves. Example : Fire Bolt Spellbook (ItemID : 6189) has the script "memorizeskill 6189;" and the script command should give the ItemID to the skill logic to memorize the spell. Just like the AtCommand.

Any help would be appreciated.

 

Edit2: This can be closed, the problem was something very dumb (If you change existing speelbooks into usable items make sure to actually set the equipable jobs field to warlock and the gender field to 2). Hope you had a good laugh, because i sure am.

Edited by SOSKaito
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...