I'm trying to create a custom mob for Punching Bag script by Secret so that it has different attributes, like Demi-Human Punching Bag, Emperium Punching Bag, and so. The custom mob is working, the only problem is the sprite is Poring.
I'm using this version of rAthena 58e82dc14978461268352c3db04a5965ad75d240 and 2015-11-04 client. Here's what I have.
Server side
db\import\mob_db.txt
mob_db.txt
4250,EMP_BAG,Emperium Punching Bag,Emperium Punching Bag,99,668000,0,107250,37895,2,3220,4040,35,45,1,152,96,85,120,95,10,10,2,6,67,0x1973,100,1068,768,576,13000,608,1000,750,400,923,3800,1466,200,2256,200,2607,800,714,500,617,3000,984,4300,985,5600,0,0,0,0,4147,1
4251,DEMIHUMAN_BAG,Demi-Human Punching Bag,Demi-Human Punching Bag,99,668000,0,107250,37895,2,3220,4040,35,45,1,152,96,85,120,95,10,10,2,6,67,0x1973,100,1068,768,576,13000,608,1000,750,400,923,3800,1466,200,2256,200,2607,800,714,500,617,3000,984,4300,985,5600,0,0,0,0,4147,1
src\map\mob.cpp
mob.cpp
#define MIN_MOB_DB 1000
#define MAX_MOB_DB 5000
npc\custom\PunchingBag\Emperium.txt
Emperium.txt
prontera,158,162,0 script EmperiumPunchingBag#0 844,{
end;
OnMyMobDead:
OnInit:
getunitdata(getnpcid(0), .@d);
monster strnpcinfo(4),.@d[UNPC_X],.@d[UNPC_Y],"Emperium Punching Bag",4250,1,strnpcinfo(0)+"::OnMyMobDead";
.@dupid = atoi(strnpcinfo(2));
.gid[.@dupid] = $@mobid[0];
.mhp[.@dupid] = strmobinfo(4,4250);
setunitdata .gid[.@dupid],UMOB_MODE,.@d[UMOB_MODE]|0x4000000|0x0200000; // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
initnpctimer;
end;
OnTimer5000:
.@dupid = atoi(strnpcinfo(2));
if(unitexists(.gid[.@dupid])){
getunitdata(.gid[.@dupid],.@d);
.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
if(.@diff > 0){
npctalk "Emperium Punching Bag: I've taken " + (.@diff/5) + " DPS in last 5 seconds.";
setunitdata .gid[.@dupid],UMOB_HP,.mhp[.@dupid];
specialeffect EF_HEAL;
}
}
initnpctimer;
}
npc\custom\PunchingBag\DemiHuman.txt
DemiHuman.txt
prontera,152,162,0 script Demi-HumanPunchingBag#0 844,{
end;
OnMyMobDead:
OnInit:
getunitdata(getnpcid(0), .@d);
monster strnpcinfo(4),.@d[UNPC_X],.@d[UNPC_Y],"Demi-Human Punching Bag",4251,1,strnpcinfo(0)+"::OnMyMobDead";
.@dupid = atoi(strnpcinfo(2));
.gid[.@dupid] = $@mobid[0];
.mhp[.@dupid] = strmobinfo(4,4251);
setunitdata .gid[.@dupid],UMOB_MODE,.@d[UMOB_MODE]|0x4000000|0x0200000; // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
initnpctimer;
end;
OnTimer5000:
.@dupid = atoi(strnpcinfo(2));
if(unitexists(.gid[.@dupid])){
getunitdata(.gid[.@dupid],.@d);
.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
if(.@diff > 0){
npctalk "Demi-Human Punching Bag: I've taken " + (.@diff/5) + " DPS in last 5 seconds.";
setunitdata .gid[.@dupid],UMOB_HP,.mhp[.@dupid];
specialeffect EF_HEAL;
}
}
initnpctimer;
}
Client side (I still have this files in the folder, not grf)
data\luafiles514\lua files\datainfo\jobname.lub
jobname.lub
[jobtbl.JT_EMP_BAG] = "BARRICADE",
[jobtbl.JT_DEMIHUMAN_BAG] = "BARRICADE",
data\luafiles514\lua files\datainfo\npcidentity.lub
npcidentity.lub
JT_EMP_BAG = 4250,
JT_DEMIHUMAN_BAG = 4251,
diffpatchersetting.log
I've read I think every topic concerning this problem, but no luck. Hoping someone can help me.