Jump to content
  • 0
Sign in to follow this  
deviruzy

Plagiarism source and script from eathena gave me a map-crash!

Question

I found custom source and script for making plagiarism NPC but it was only tested on eathena. When I applied it on Hercules the script worked but when I actually tested it map server crashed! Would you take a look and see if this source needs to be modified in order to make it work on Hercules? or is the problem because of me using Hercules with custom plugins?

 

 

script.c
 

 


BUILDIN(plagiarism)
{
int type;
int skillid = script_getnum(st,2);
int idx = 0, cidx = 0;
int skilllv = script_getnum(st,3);
struct map_session_data *sd = map->id2sd(st->rid);

nullpo_retr(-1, sd);

if (skillid <= 0 || skilllv <= 0) {
ShowError("스킬id나 스킬lv은 1보다 작을 수 없습니다.n", skillid, skilllv);
script->reportsrc(st);
script_pushint (st, -1);
return false;
}
if (script_hasdata(st, 4) && ((type = pc->checkskill (sd, SC_REPRODUCE)) > 0)) {

if (sd->reproduceskill_id) {
idx = skill->get_index(sd->reproduceskill_id);
if(sd->status.skill[idx].flag == SKILL_FLAG_PLAGIARIZED ) {
sd->status.skill[idx].id = 0;
sd->status.skill[idx].lv = 0;
sd->status.skill[idx].flag = 0;
clif->deleteskill(sd,sd->reproduceskill_id);
}
}

skilllv = (type < skilllv ? type : skilllv);
cidx = skill->get_index(skillid);

sd->reproduceskill_id = skillid;
pc_setglobalreg(sd, "REPRODUCE_SKILL", skillid);
pc_setglobalreg(sd, "REPRODUCE_SKILL_LV", skilllv);

sd->status.skill[cidx].id = skillid;
sd->status.skill[cidx].lv = skilllv;
sd->status.skill[cidx].flag = SKILL_FLAG_PLAGIARIZED;
clif->addskill(sd,skillid);
}
else if ((type = pc->checkskill (sd,RG_PLAGIARISM)) > 0) {
if (sd->cloneskill_id){
idx = skill->get_index(sd->cloneskill_id);
if(sd->status.skill[sd->cloneskill_id].flag == SKILL_FLAG_PLAGIARIZED) {
sd->status.skill[idx].id = 0;
sd->status.skill[idx].lv = 0;
sd->status.skill[idx].flag = 0;
}
}

skilllv = (type < skilllv ? type : skilllv);
cidx = skill->get_index(sd->cloneskill_id);

sd->cloneskill_id = skillid;
pc_setglobalreg(sd, "CLONE_SKILL", skillid);
pc_setglobalreg(sd, "CLONE_SKILL_LV", skilllv);

sd->status.skill[cidx].id = skillid;
sd->status.skill[cidx].lv = skilllv;
sd->status.skill[cidx].flag = SKILL_FLAG_PLAGIARIZED;
clif->skillinfoblock(sd);
} else {
script_pushint (st, 1);
script->reportsrc(st);
return false;
}
script_pushint (st, 0);
return true;
}


BUILDIN_DEF(plagiarism, "ii?"), // 패드곰님의 스크립트입니다.
 

 

 

 

Script part

 

 

prontera.gat,166,198,3 script rogue 747,{ 

 plagiarism "5",GetSkilllv(225);
 close;

}

 

 

Turns out the custom plug-in I had, had a compatability problem with pre-re setup. By directly moving plugins into trunk It worked perfectly fine.

Edited by deviruzy

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Turns out the Hercules I had, had a custom plug-in, so I had to ask the person who made it. He or She touched a few things for me and now it works. According to his or her words, plug-in he put in wasn't applied to pre-re version of it. Now it does and everything is fine.

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.