summaryrefslogblamecommitdiff
path: root/npc/magic/study.txt
blob: 71beded64dc6c3dc8346b67b2d93a3395f5463b8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                         
                       

                                                








                                                  

                                                                   



                                                                        





                                    


               
// TMW2 script
// Author: Jesusalva <admin@tmw2.org>
//
// Magic Script: TMW2_STUDY
//
// Skill to study a target monster
// Will report the monster exact current stats, and is part of research

function	script	SK_study	{
	.@mobGD=getarg(0);
	if (getunittype(.@mobGD) != UNITTYPE_MOB) {
		dispbottom l("This skill can only be used on monsters!");
		return;
	}
	.@mobID=getunitdata(.@mobGD, UDT_CLASS);

    // Research Points
    if (array_rfind(@study, @mobGD) < 0) {
        .@rp=getmonsterinfo(MOB_LV)/10+1;
        array_push(@study, @mobGD);
        dispbottom l("Research Points +%d", .@rp);
    }

    // Report
	dispbottom l("%s - %d/%d HP, %d/%d MP",
				 getmonsterinfo(.@mobID, MOB_NAME),
				 fnum(getunitdata(.@mobGD, UDT_HP)),
				 fnum(getunitdata(.@mobGD, UDT_MAXHP)),
				 fnum(getunitdata(.@mobGD, UDT_SP)),
				 fnum(getunitdata(.@mobGD, UDT_MAXSP)));

    // Truncate
    if (getarraysize(@study) > 99) {
        //array_shift(@study);
        deletearray(@study, 30);
    }
	return;
}