Sveiki, reikia pagalbos del mobu. Noriu padaryti jog jei jie nubegs toli nuo savo spawn paskui zaideja bus grazinti atgal. Script isidejau, gal ne i ta vieta dedu, nes mob negali isvis daryt damage, i GS meta eror. Teleportas veikia, bet damage ne.
/**
* Reduce the current HP of the L2Attackable, update its _aggroList and launch the doDie Task if necessary.
* @param attacker The L2Character who attacks
* @param awake The awake state (If True : stop sleeping)
*/
@Override
public void reduceCurrentHp(double damage, L2Character attacker, boolean awake, boolean isDOT, L2Skill skill)
{
if (thisinstanceof L2MonsterInstance)
{
final L2Attackable npc = this;
int mob_lock_range = Config.MOBLOCKRAGE;
if(mob_lock_range!=-1 &&
!npc.isInsideRadius(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), mob_lock_range, true, false))
{
npc.teleToLocation(npc.getSpawn().getLocx(), npc.getSpawn().getLocy(), npc.getSpawn().getLocz(), 0);
npc.stopHating(attacker);
}
L2MonsterInstance master = (L2MonsterInstance) this;
if (master.hasMinions())
master.getMinionList().onAssist(this, attacker);
master = master.getLeader();
if (master != null && master.hasMinions())
master.getMinionList().onAssist(this, attacker);
}
cia ne skriptas, cia funcija/metodas l2attackable klasej ;D tarp jo tau reikia isimest ta koda, kad kai mobas kuris ruosis kazkur judet nukeliautu i spawna. o del override bijau pameluot, bet susije su klasiu paveldimumu. tai reiskia kad vienai klasei abstract/interface tipam extendinant/implementinant persiduoda metodas, o esme tame, kad pagrindinei klasei pasaukus metoda sureguos ir kitos, zinoma, jei neklystu :D
o, kad zinociau, kelintoj eilutej ten pas tave koks kodas, bet galiu tik spet, gali but, kad getSpawn() yra null arba this yra null. betkokiu atveju tikrint reiktu getSpawn() != null && this != null