From d0397b495f1f18b904174f7ee174b75af608cbcc Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 29 Jan 2008 19:26:18 +0000 Subject: - Plagiarize can no longer copy skill levels beyond their max skill_db value. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12151 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/map') diff --git a/src/map/skill.c b/src/map/skill.c index b8107ffaa..d579cff5e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1592,19 +1592,25 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds if ((!tsd->status.skill[skillid].id || tsd->status.skill[skillid].flag >= 13) && can_copy(tsd,skillid)) // Split all the check into their own function [Aru] { + int lv = skilllv; if (tsd->cloneskill_id && tsd->status.skill[tsd->cloneskill_id].flag == 13){ tsd->status.skill[tsd->cloneskill_id].id = 0; tsd->status.skill[tsd->cloneskill_id].lv = 0; tsd->status.skill[tsd->cloneskill_id].flag = 0; } + + if ((type = pc_checkskill(tsd,RG_PLAGIARISM)) < lv) + lv = type; + //kRO Update makes it impossible to copy skills beyond the skill_db max. + if ((type = skill_get_max(RG_PLAGIARISM)) < lv) + lv = type; + tsd->cloneskill_id = skillid; tsd->status.skill[skillid].id = skillid; - tsd->status.skill[skillid].lv = skilllv; - if ((type = pc_checkskill(tsd,RG_PLAGIARISM)) < skilllv) - tsd->status.skill[skillid].lv = type; + tsd->status.skill[skillid].lv = lv; tsd->status.skill[skillid].flag = 13;//cloneskill flag - pc_setglobalreg(tsd, "CLONE_SKILL", tsd->cloneskill_id); - pc_setglobalreg(tsd, "CLONE_SKILL_LV", tsd->status.skill[skillid].lv); + pc_setglobalreg(tsd, "CLONE_SKILL", skillid); + pc_setglobalreg(tsd, "CLONE_SKILL_LV", lv); clif_skillinfoblock(tsd); } } -- cgit v1.2.3-70-g09d2