Адаптация кода

citadel

Heir
Подскажите что не так, пытаюсь адаптировать код:
package ai.locations.toi;

import l2.gameserver.ai.Mystic;
import l2.gameserver.model.Creature;
import l2.gameserver.model.Skill;
import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.skills.AbnormalEffect;

public class Ledi extends Mystic
{
public Ledi(NpcInstance actor)
{
super(actor);
}

@Override
protected void onEvtSpawn()
{
super.onEvtSpawn();
getActor().startAbnormalEffect(AbnormalEffect.ULTIMATE_DEFENCE);
getActor().getFlag().getDamageBlocked().start(this);
}

@Override
protected void onEvtPartyDied(NpcInstance minion, Creature killer)
{
super.onEvtPartyDied(minion, killer);

NpcInstance actor = getActor();
if (!actor.getMinionList().hasAliveMinions())
{
actor.stopAbnormalEffect(AbnormalEffect.ULTIMATE_DEFENCE);
actor.getFlag().getDamageBlocked().stop(this);
}
}

@Override
protected void onEvtAttacked(Creature attacker, Skill skill, int damage)
{
NpcInstance actor = getActor();
if (actor.getMinionList().hasAliveMinions() && !actor.getFlag().getDamageBlocked().get())
{
actor.startAbnormalEffect(AbnormalEffect.ULTIMATE_DEFENCE);
actor.getFlag().getDamageBlocked().start(this);
}
super.onEvtAttacked(attacker, skill, damage);
}
}
При бильде ругается на следующее:
Error:(21, 19) java: cannot find symbol
symbol: method getFlag()
location: class l2.gameserver.model.instances.NpcInstance

Error:(27, 14) java: cannot find symbol
symbol: method onEvtPartyDied(l2.gameserver.model.instances.NpcInstance,l2.gameserver.model.Creature)

Error:(24, 5) java: method does not override or implement a method from a supertype

Error:(33, 18) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance

Error:(37, 5) java: method does not override or implement a method from a supertype

Error:(41, 62) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance

Error:(44, 18) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance
Error:(46, 14) java: no suitable method found for onEvtAttacked(l2.gameserver.model.Creature,l2.gameserver.model.Skill,int)
method l2.gameserver.ai.AbstractAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
method l2.gameserver.ai.CharacterAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
method l2.gameserver.ai.DefaultAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
 
Подскажите что не так, пытаюсь адаптировать код:

При бильде ругается на следующее:
Error:(21, 19) java: cannot find symbol
symbol: method getFlag()
location: class l2.gameserver.model.instances.NpcInstance

Error:(27, 14) java: cannot find symbol
symbol: method onEvtPartyDied(l2.gameserver.model.instances.NpcInstance,l2.gameserver.model.Creature)

Error:(24, 5) java: method does not override or implement a method from a supertype

Error:(33, 18) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance

Error:(37, 5) java: method does not override or implement a method from a supertype

Error:(41, 62) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance

Error:(44, 18) java: cannot find symbol
symbol: method getFlag()
location: variable actor of type l2.gameserver.model.instances.NpcInstance
Error:(46, 14) java: no suitable method found for onEvtAttacked(l2.gameserver.model.Creature,l2.gameserver.model.Skill,int)
method l2.gameserver.ai.AbstractAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
method l2.gameserver.ai.CharacterAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
method l2.gameserver.ai.DefaultAI.onEvtAttacked(l2.gameserver.model.Creature,int) is not applicable
(actual and formal argument lists differ in length)
Нету таких методов или по другому у нас прописаны. Смотри как у нас и меняй пути ссылок на методы
 
getFlag нет такого метода у NpcIntstance
Так же нет onEvtPartyDied у АИ
onEvtAttacked принимает только Creature и Int

Короче ты ничего по сути еще не сделал, для адаптации.
Смотри класс который екстендишь и там методы и перменные которые принимают
плюс NpcInstance getFlag ищи аналог( но я хз что это вообще)
 
Back
Top