rootKid Posted January 17, 2017 Group: Members Topic Count: 24 Topics Per Day: 0.00 Content Count: 83 Reputation: 11 Joined: 11/28/11 Last Seen: March 31, 2024 Share Posted January 17, 2017 Plagiarize a Skill [Script Command] View File { plagiarize <skill>,<lv>; Sets the invoking player's plagiarised skill and the desired lv. } by rootKid INSTALLATION [in src/map/script.c] Find: // declarations that were supposed to be exported from npc_chat.c #ifdef PCRE_SUPPORT BUILDIN(defpattern); BUILDIN(activatepset); BUILDIN(deactivatepset); BUILDIN(deletepset); Add above: /*=========================================== * Plagiarize a Skill * plagiarize <skill>,<lv>; * Sets the invoking player's plagiarised skill and the desired lv. * by rootKid *-------------------------------------------*/ BUILDIN_FUNC(plagiarize) { int skillid, lv; struct map_session_data * sd = script_rid2sd(st); skillid=( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) ); lv=script_getnum(st,3); if (sd->cloneskill_idx && sd->status.skill[sd->cloneskill_idx].flag == 13){ sd->status.skill[sd->cloneskill_idx].id = 0; sd->status.skill[sd->cloneskill_idx].lv = 0; sd->status.skill[sd->cloneskill_idx].flag = 0; } if (pc_checkskill(sd,RG_PLAGIARISM)) { sd->cloneskill_idx = skillid; sd->status.skill[sd->cloneskill_idx].id = skillid; sd->status.skill[sd->cloneskill_idx].lv = lv; sd->status.skill[sd->cloneskill_idx].flag = 13;//cloneskill flag pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM), skillid); pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM_LV), lv); clif_skillinfoblock(sd); } return 0; } Find: BUILDIN_DEF(_,"s"), Add above: BUILDIN_DEF(plagiarize,"ii"), END OF INSTALLATION I have attached an unfinished function-based script using this script command as a reference. Submitter rootKid Submitted 01/17/2017 Category Utilities Content Author 1 Quote Link to comment Share on other sites More sharing options...
Felten Posted January 22, 2017 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 104 Reputation: 15 Joined: 01/18/16 Last Seen: July 15, 2024 Share Posted January 22, 2017 (edited) Hey Rootkid, first of all thank your for sharing this command ^.^ I try to use, check my issue ^.^ Edited January 22, 2017 by Felten Quote Link to comment Share on other sites More sharing options...
Deleted User Posted May 11, 2017 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted May 11, 2017 (edited) On 1/22/2017 at 11:53 AM, Felten said: Hey Rootkid, first of all thank your for sharing this command ^.^ I try to use, check my issue ^.^ (1.) Find: int skillid, lv; Replaced: int skill_id, lv; (2.) Find skillid=( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) ); Replaced: skill_id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) ); (3.) Find: if (pc_checkskill(sd,RG_PLAGIARISM)) { sd->cloneskill_idx = skillid; sd->status.skill[sd->cloneskill_idx].id = skillid; sd->status.skill[sd->cloneskill_idx].lv = lv; sd->status.skill[sd->cloneskill_idx].flag = 13;//cloneskill flag pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM), skillid); pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM_LV), lv); clif_skillinfoblock(sd); } return 0; } Replaced: if (pc_checkskill(sd,RG_PLAGIARISM)) { sd->cloneskill_idx = skill_id; sd->status.skill[sd->cloneskill_idx].id = skill_id; sd->status.skill[sd->cloneskill_idx].lv = lv; sd->status.skill[sd->cloneskill_idx].flag = 13;//cloneskill flag pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM), skill_id); pc_setglobalreg(sd, add_str(SKILL_VAR_PLAGIARISM_LV), lv); clif_skillinfoblock(sd); } return 0; } Then recompile your Emulator. PS: The source is written in Hercules, so it requires a little edits. Edited May 11, 2017 by Kaze 1 Quote Link to comment Share on other sites More sharing options...
Ice Bear Posted September 12, 2020 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 166 Reputation: 27 Joined: 11/20/11 Last Seen: 3 hours ago Share Posted September 12, 2020 this part still producing errors @rootKid struct map_session_data * sd = script_rid2sd(st); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.