- 0
-
Quem Está Navegando
- Nenhum usuário registrado visualizando esta página.
-
Posts
-
Boa Noite Galera o @Mr.Kadu postou o link do projeto mas eu fiz um erro e estarei postando a correção. aqueles que baixou o projeto e tentou ligar e deu erro e por causa do java que foi copilado eu copilei no java 22 e o projeto e no java 17 vou postar o link aqui para vcs, vai incluso a Geodata O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
Nova Revisão com AutoFarm e .Menu O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
alguem tambem esta tendo problemas com email ? quando vc loga com a conta e nao tem email cadastrado. eu levo erro 500
-
muito bom meu amigo. vou começar os testes........
-
@Mr.Kadu VOU COMEÇA OS TESTES AGORA MESMO. VOU VER SE COLOCO UM PROJETO ONLINE. USANDO SUA BASE, AI SERÁ MUITO BOM PRA REPORTAR. abraços mano e muito boa iniciativa com esse projeto, que muitos usaram.
-
Por Gabrieljdb · Postado
Falta arquivo "armorgrp.dat" alguém poderia postar. Grato! -
Também to querendo só a textura do drop no chão, se alguém tiver.
-
Opa Obrigado amigo e aguarde que vamos tentar por todas as quests 99,9% funcional principalemnte porque projeto acis nao vi ate agora com quest 90%
-
O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se Nova Revisão 1.0 O conteúdo está oculto, favor efetuar login ou se cadastrar! Entre ou Cadastre-se
-
Pergunta
viniciusserrao
Boa Tarde a Todos Eu Estou Com Uma Rev GOD Lindvior E Nessa Rev Não Estou Conseguindo Editar Os NPCs Dentro do Jogo. Me Sugeriram Para Mim Ir Colocando as Drops Pelo Navicat ou Nas Htmls dos Mobs Mas Assim Vai Demorar Muito Pra Mim Editar Todos os Mobs Que Eu Estou Querendo Mexer. Então Eu Estava Querendo Colocar Aquele Sistema Que Tem no Interlude e H5 De Clicar no NPC e Ter o Botão "Edit DropList" e "Edit Stats"
Segue Abaixo Imagens, Html e Arquivo JAVA.
Desde Já Agradeço a Todos Que Puderem Me Ajudar.
Imagem Do HTML Que Mostra as Informações do NPC
Imagens Da Janela Que Quero Colocar O Botão de Editar o NPC a DropList e os Stats
Eu Encontrei Esse Arquivo JAVA Sobre as Condições do Comando "Shift + Mouse 1"
OnActionShift.Java
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package actions;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import lineage2.gameserver.Config;
import lineage2.gameserver.data.htm.HtmCache;
import lineage2.gameserver.handler.admincommands.impl.AdminEditChar;
import lineage2.gameserver.model.AggroList.HateComparator;
import lineage2.gameserver.model.AggroList.HateInfo;
import lineage2.gameserver.model.Effect;
import lineage2.gameserver.model.GameObject;
import lineage2.gameserver.model.GameObjectsStorage;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.Skill;
import lineage2.gameserver.model.base.Element;
import lineage2.gameserver.model.entity.events.GlobalEvent;
import lineage2.gameserver.model.instances.DoorInstance;
import lineage2.gameserver.model.instances.NpcInstance;
import lineage2.gameserver.model.instances.PetInstance;
import lineage2.gameserver.model.items.ItemInstance;
import lineage2.gameserver.model.quest.Quest;
import lineage2.gameserver.model.quest.QuestEventType;
import lineage2.gameserver.network.serverpackets.components.NpcString;
import lineage2.gameserver.scripts.Functions;
import lineage2.gameserver.stats.Stats;
import lineage2.gameserver.utils.HtmlUtils;
import lineage2.gameserver.utils.PositionUtils;
import lineage2.gameserver.utils.Util;
import org.apache.commons.lang3.StringUtils;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public final class OnActionShift extends Functions
{
/**
* Method OnActionShift_NpcInstance.
* @param player Player
* @param object GameObject
* @return boolean
*/
public boolean OnActionShift_NpcInstance(Player player, GameObject object)
{
if ((player == null) || (object == null))
{
return false;
}
if (!Config.ALLOW_NPC_SHIFTCLICK && !player.isGM())
{
return false;
}
if (Config.ALT_GAME_SHOW_DROPLIST && object.isNpc())
{
NpcInstance npc = (NpcInstance) object;
if (npc.isDead())
{
return false;
}
droplist(player, npc);
}
if (object.isNpc())
{
NpcInstance npc = (NpcInstance) object;
if (npc.isDead())
{
return false;
}
String dialog;
if (player.isGM())
{
dialog = HtmCache.getInstance().getNotNull("scripts/actions/admin.L2NpcInstance.onActionShift.htm", player);
dialog = dialog.replaceFirst("%name%", npc.getName());
dialog = dialog.replaceFirst("%id%", String.valueOf(npc.getNpcId()));
dialog = dialog.replaceFirst("%lvl%", String.valueOf(npc.getLevel()));
dialog = dialog.replaceFirst("%objid%", String.valueOf(npc.getObjectId()));
dialog = dialog.replaceFirst("%class%", String.valueOf(npc.getClass().getSimpleName().replaceFirst("L2", "").replaceFirst("Instance", "")));
dialog = dialog.replaceFirst("%race%", getNpcRaceById(npc.getTemplate().getRace()));
dialog = dialog.replaceFirst("%territory%", npc.getCastle() != null ? HtmlUtils.htmlResidenceName(npc.getCastle().getId()) : "None");
dialog = dialog.replaceFirst("%spawn%", npc.getSpawnedLoc().x + " " + npc.getSpawnedLoc().y + " " + npc.getSpawnedLoc().z);
dialog = dialog.replaceFirst("%loc%", npc.getLoc().x + " " + npc.getLoc().y + " " + npc.getLoc().z);
dialog = dialog.replaceFirst("%heading%", String.valueOf(npc.getLoc().h));
dialog = dialog.replaceFirst("%collision_radius%", String.valueOf(npc.getTemplate().getCollisionRadius()));
dialog = dialog.replaceFirst("%collision_height%", String.valueOf(npc.getTemplate().getCollisionHeight()));
dialog = dialog.replaceFirst("%loc2d%", String.valueOf((long) npc.getDistance(player)));
dialog = dialog.replaceFirst("%loc3d%", String.valueOf((long) npc.getDistance3D(player)));
dialog = dialog.replaceFirst("%resp%", String.valueOf((npc.getSpawn() != null) ? Util.formatTime(npc.getSpawn().getRespawnDelay()) : "0"));
dialog = dialog.replaceFirst("%aggro%", String.valueOf(String.valueOf(npc.getAggroRange())));
dialog = dialog.replaceFirst("%hp%", String.valueOf(npc.getCurrentHp()));
dialog = dialog.replaceFirst("%hpmax%", String.valueOf(npc.getTemplate().getBaseHpMax()));
dialog = dialog.replaceFirst("%mp%", String.valueOf(npc.getCurrentMp()));
dialog = dialog.replaceFirst("%mpmax%", String.valueOf(npc.getTemplate().getBaseMpMax()));
dialog = dialog.replaceFirst("%ai_intention%", npc.getAI().getIntention().name());
dialog = dialog.replaceFirst("%ai_clan%", npc.getClan() != null ? npc.getClan().getName() : "None");
dialog = dialog.replaceFirst("%patk%", String.valueOf(npc.getPAtk(null)));
dialog = dialog.replaceFirst("%matk%", String.valueOf(npc.getMAtk(null, null)));
dialog = dialog.replaceFirst("%pdef%", String.valueOf(npc.getPDef(null)));
dialog = dialog.replaceFirst("%mdef%", String.valueOf(npc.getMDef(null, null)));
dialog = dialog.replaceFirst("¬c*%", String.valueOf(npc.getAccuracy()));
dialog = dialog.replaceFirst("%evas%", String.valueOf(npc.getEvasionRate(null)));
dialog = dialog.replaceFirst("%crit%", String.valueOf(npc.isMageClass() ? (int) npc.getMagicCriticalRate(null, null) : (int) npc.getCriticalHit(null, null)));
dialog = dialog.replaceFirst("%rspd%", String.valueOf(npc.getRunSpeed()));
dialog = dialog.replaceFirst("%aspd%", String.valueOf((int) npc.getAttackSpeedMultiplier()));
dialog = dialog.replaceFirst("%cspd%", String.valueOf(npc.getMAtkSpd()));
dialog = dialog.replaceFirst("%atkType%", String.valueOf(npc.getTemplate().getBaseAttackType().name()));
dialog = dialog.replaceFirst("%atkRng%", String.valueOf(npc.getTemplate().getBaseAtkRange()));
dialog = dialog.replaceFirst("%str%", String.valueOf(npc.getSTR()));
dialog = dialog.replaceFirst("Þx%", String.valueOf(npc.getDEX()));
dialog = dialog.replaceFirst("%con%", String.valueOf(npc.getCON()));
dialog = dialog.replaceFirst("%int%", String.valueOf(npc.getINT()));
dialog = dialog.replaceFirst("%wit%", String.valueOf(npc.getWIT()));
dialog = dialog.replaceFirst("%men%", String.valueOf(npc.getMEN()));
dialog = dialog.replaceFirst("%ele_dfire%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_FIRE, 0, null, null)));
dialog = dialog.replaceFirst("%ele_dwater%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_WATER, 0, null, null)));
dialog = dialog.replaceFirst("%ele_dwind%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_WIND, 0, null, null)));
dialog = dialog.replaceFirst("%ele_dearth%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_EARTH, 0, null, null)));
dialog = dialog.replaceFirst("%ele_dholy%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_HOLY, 0, null, null)));
dialog = dialog.replaceFirst("%ele_ddark%", String.valueOf((int) npc.calcStat(Stats.DEFENCE_UNHOLY, 0, null, null)));
show(dialog, player, npc);
return true;
}
if (Config.ALT_FULL_NPC_STATS_PAGE)
{
dialog = HtmCache.getInstance().getNotNull("scripts/actions/player.L2NpcInstance.onActionShift.full.htm", player);
dialog = dialog.replaceFirst("%class%", String.valueOf(npc.getClass().getSimpleName().replaceFirst("L2", "").replaceFirst("Instance", "")));
dialog = dialog.replaceFirst("%id%", String.valueOf(npc.getNpcId()));
dialog = dialog.replaceFirst("%respawn%", String.valueOf((npc.getSpawn() != null) ? Util.formatTime(npc.getSpawn().getRespawnDelay()) : "0"));
dialog = dialog.replaceFirst("%walkSpeed%", String.valueOf(npc.getWalkSpeed()));
dialog = dialog.replaceFirst("%evs%", String.valueOf(npc.getEvasionRate(null)));
dialog = dialog.replaceFirst("¬c%", String.valueOf(npc.getAccuracy()));
dialog = dialog.replaceFirst("%crt%", String.valueOf(npc.getCriticalHit(null, null)));
dialog = dialog.replaceFirst("%aspd%", String.valueOf(npc.getPAtkSpd()));
dialog = dialog.replaceFirst("%cspd%", String.valueOf(npc.getMAtkSpd()));
dialog = dialog.replaceFirst("%currentMP%", String.valueOf(npc.getCurrentMp()));
dialog = dialog.replaceFirst("%currentHP%", String.valueOf(npc.getCurrentHp()));
dialog = dialog.replaceFirst("%loc%", "");
dialog = dialog.replaceFirst("%dist%", String.valueOf((int) npc.getDistance3D(player)));
dialog = dialog.replaceFirst("%killed%", String.valueOf(0));
dialog = dialog.replaceFirst("%spReward%", String.valueOf(npc.getSpReward()));
dialog = dialog.replaceFirst("%xyz%", npc.getLoc().x + " " + npc.getLoc().y + " " + npc.getLoc().z);
dialog = dialog.replaceFirst("%ai_type%", npc.getAI().getClass().getSimpleName());
dialog = dialog.replaceFirst("%direction%", PositionUtils.getDirectionTo(npc, player).toString().toLowerCase());
StringBuilder b = new StringBuilder("");
for (GlobalEvent e : npc.getEvents())
{
b.append(e.toString()).append(';');
}
dialog = dialog.replaceFirst("%event%", b.toString());
}
else
{
dialog = HtmCache.getInstance().getNotNull("scripts/actions/player.L2NpcInstance.onActionShift.htm", player);
}
dialog = dialog.replaceFirst("%name%", nameNpc(npc));
dialog = dialog.replaceFirst("%id%", String.valueOf(npc.getNpcId()));
dialog = dialog.replaceFirst("%level%", String.valueOf(npc.getLevel()));
dialog = dialog.replaceFirst("%respawn%", String.valueOf((npc.getSpawn() != null) ? Util.formatTime(npc.getSpawn().getRespawnDelay()) : "0"));
dialog = dialog.replaceFirst("úctionId%", String.valueOf(npc.getFaction()));
dialog = dialog.replaceFirst("%aggro%", String.valueOf(npc.getAggroRange()));
dialog = dialog.replaceFirst("%maxHp%", String.valueOf(npc.getMaxHp()));
dialog = dialog.replaceFirst("%maxMp%", String.valueOf(npc.getMaxMp()));
dialog = dialog.replaceFirst("%pDef%", String.valueOf(npc.getPDef(null)));
dialog = dialog.replaceFirst("%mDef%", String.valueOf(npc.getMDef(null, null)));
dialog = dialog.replaceFirst("%pAtk%", String.valueOf(npc.getPAtk(null)));
dialog = dialog.replaceFirst("%mAtk%", String.valueOf(npc.getMAtk(null, null)));
dialog = dialog.replaceFirst("%expReward%", String.valueOf(npc.getExpReward()));
dialog = dialog.replaceFirst("%spReward%", String.valueOf(npc.getSpReward()));
dialog = dialog.replaceFirst("%runSpeed%", String.valueOf(npc.getRunSpeed()));
dialog = dialog.replaceFirst("%AI%", "");
show(dialog, player, npc);
}
return true;
}
/**
* Method getNpcRaceById.
* @param raceId int
* @return String
*/
public String getNpcRaceById(int raceId)
{
switch (raceId)
{
case 1:
return "Undead";
case 2:
return "Magic Creatures";
case 3:
return "Beasts";
case 4:
return "Animals";
case 5:
return "Plants";
case 6:
return "Humanoids";
case 7:
return "Spirits";
case 8:
return "Angels";
case 9:
return "Demons";
case 10:
return "Dragons";
case 11:
return "Giants";
case 12:
return "Bugs";
case 13:
return "Fairies";
case 14:
return "Humans";
case 15:
return "Elves";
case 16:
return "Dark Elves";
case 17:
return "Orcs";
case 18:
return "Dwarves";
case 19:
return "Others";
case 20:
return "Non-living Beings";
case 21:
return "Siege Weapons";
case 22:
return "Defending Army";
case 23:
return "Mercenaries";
case 24:
return "Unknown Creature";
case 25:
return "Kamael";
default:
return "Not defined";
}
}
/**
* Method droplist.
*/
public void droplist()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
droplist(player, npc);
}
/**
* Method droplist.
* @param player Player
* @param npc NpcInstance
*/
public void droplist(Player player, NpcInstance npc)
{
if ((player == null) || (npc == null))
{
return;
}
if (Config.ALT_GAME_SHOW_DROPLIST)
{
RewardListInfo.showInfo(player, npc);
}
}
/**
* Method quests.
*/
public void quests()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
StringBuilder dialog = new StringBuilder("
");
dialog.append(nameNpc(npc)).append("
");
Map list = npc.getTemplate().getQuestEvents();
for (Map.Entry entry : list.entrySet())
{
for (Quest q : entry.getValue())
{
dialog.append(entry.getKey()).append(' ').append(q.getClass().getSimpleName()).append("");
}
}
dialog.append("");
show(dialog.toString(), player, npc);
}
/**
* Method skills.
*/
public void skills()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
StringBuilder dialog = new StringBuilder("
");
dialog.append(nameNpc(npc)).append("
");
Collection list = npc.getAllSkills();
if ((list != null) && !list.isEmpty())
{
dialog.append("
Active:
");
for (Skill s : list)
{
if (s.isActive())
{
dialog.append(s.getName()).append("");
}
}
dialog.append("
Passive:
");
for (Skill s : list)
{
if (!s.isActive())
{
dialog.append(s.getName()).append("");
}
}
}
dialog.append("");
show(dialog.toString(), player, npc);
}
/**
* Method effects.
*/
public void effects()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
StringBuilder dialog = new StringBuilder("
");
dialog.append(nameNpc(npc)).append("
");
List list = npc.getEffectList().getAllEffects();
if ((list != null) && !list.isEmpty())
{
for (Effect e : list)
{
dialog.append(e.getSkill().getName()).append("");
}
}
dialog.append("
dialog.append("Refresh");
dialog.append("\" action=\"bypass -h scripts_actions.OnActionShift:effects\" width=100 height=21 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" />
");
show(dialog.toString(), player, npc);
}
/**
* Method stats.
*/
public void stats()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
String dialog = HtmCache.getInstance().getNotNull("scripts/actions/player.L2NpcInstance.stats.htm", player);
dialog = dialog.replaceFirst("%name%", nameNpc(npc));
dialog = dialog.replaceFirst("%level%", String.valueOf(npc.getLevel()));
dialog = dialog.replaceFirst("úctionId%", String.valueOf(npc.getFaction()));
dialog = dialog.replaceFirst("%aggro%", String.valueOf(npc.getAggroRange()));
dialog = dialog.replaceFirst("%race%", getNpcRaceById(npc.getTemplate().getRace()));
dialog = dialog.replaceFirst("%maxHp%", String.valueOf(npc.getMaxHp()));
dialog = dialog.replaceFirst("%maxMp%", String.valueOf(npc.getMaxMp()));
dialog = dialog.replaceFirst("%pDef%", String.valueOf(npc.getPDef(null)));
dialog = dialog.replaceFirst("%mDef%", String.valueOf(npc.getMDef(null, null)));
dialog = dialog.replaceFirst("%pAtk%", String.valueOf(npc.getPAtk(null)));
dialog = dialog.replaceFirst("%mAtk%", String.valueOf(npc.getMAtk(null, null)));
dialog = dialog.replaceFirst("¬curacy%", String.valueOf(npc.getAccuracy()));
dialog = dialog.replaceFirst("%evasionRate%", String.valueOf(npc.getEvasionRate(null)));
dialog = dialog.replaceFirst("%criticalHit%", String.valueOf(npc.getCriticalHit(null, null)));
dialog = dialog.replaceFirst("%runSpeed%", String.valueOf(npc.getRunSpeed()));
dialog = dialog.replaceFirst("%walkSpeed%", String.valueOf(npc.getWalkSpeed()));
dialog = dialog.replaceFirst("%pAtkSpd%", String.valueOf(npc.getPAtkSpd()));
dialog = dialog.replaceFirst("%mAtkSpd%", String.valueOf(npc.getMAtkSpd()));
show(dialog, player, npc);
}
/**
* Method resists.
*/
public void resists()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
StringBuilder dialog = new StringBuilder("
");
dialog.append(nameNpc(npc)).append("
");
boolean hasResist;
hasResist = addResist(dialog, "Fire", npc.calcStat(Stats.DEFENCE_FIRE, 0, null, null));
hasResist |= addResist(dialog, "Wind", npc.calcStat(Stats.DEFENCE_WIND, 0, null, null));
hasResist |= addResist(dialog, "Water", npc.calcStat(Stats.DEFENCE_WATER, 0, null, null));
hasResist |= addResist(dialog, "Earth", npc.calcStat(Stats.DEFENCE_EARTH, 0, null, null));
hasResist |= addResist(dialog, "Light", npc.calcStat(Stats.DEFENCE_HOLY, 0, null, null));
hasResist |= addResist(dialog, "Darkness", npc.calcStat(Stats.DEFENCE_UNHOLY, 0, null, null));
hasResist |= addResist(dialog, "Bleed", npc.calcStat(Stats.BLEED_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Poison", npc.calcStat(Stats.POISON_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Stun", npc.calcStat(Stats.STUN_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Root", npc.calcStat(Stats.ROOT_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Sleep", npc.calcStat(Stats.SLEEP_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Paralyze", npc.calcStat(Stats.PARALYZE_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Mental", npc.calcStat(Stats.MENTAL_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Debuff", npc.calcStat(Stats.DEBUFF_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Cancel", npc.calcStat(Stats.CANCEL_RESIST, 0, null, null));
hasResist |= addResist(dialog, "Sword", 100 - npc.calcStat(Stats.SWORD_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Dual Sword", 100 - npc.calcStat(Stats.DUAL_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Blunt", 100 - npc.calcStat(Stats.BLUNT_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Dagger", 100 - npc.calcStat(Stats.DAGGER_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Bow", 100 - npc.calcStat(Stats.BOW_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Crossbow", 100 - npc.calcStat(Stats.CROSSBOW_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Polearm", 100 - npc.calcStat(Stats.POLE_WPN_VULNERABILITY, null, null));
hasResist |= addResist(dialog, "Fist", 100 - npc.calcStat(Stats.FIST_WPN_VULNERABILITY, null, null));
if (!hasResist)
{
dialog.append("
No resists");
}
else
{
dialog.append("");
}
show(dialog.toString(), player, npc);
}
/**
* Method addResist.
* @param dialog StringBuilder
* @param name String
* @param val double
* @return boolean
*/
private boolean addResist(StringBuilder dialog, String name, double val)
{
if (val == 0)
{
return false;
}
dialog.append("").append(name).append("");
if (val == Double.POSITIVE_INFINITY)
{
dialog.append("MAX");
}
else if (val == Double.NEGATIVE_INFINITY)
{
dialog.append("MIN");
}
else
{
dialog.append(String.valueOf((int) val));
dialog.append("");
return true;
}
dialog.append("");
return true;
}
/**
* Method aggro.
*/
public void aggro()
{
Player player = getSelf();
NpcInstance npc = getNpc();
if ((player == null) || (npc == null))
{
return;
}
StringBuilder dialog = new StringBuilder("");
Set set = new TreeSet<>(HateComparator.getInstance());
set.addAll(npc.getAggroList().getCharMap().values());
for (HateInfo aggroInfo : set)
{
dialog.append("");
}
dialog.append("
Attacker
Damage
Hate
" + aggroInfo.attacker.getName() + "
" + aggroInfo.damage + "
" + aggroInfo.hate + "
dialog.append("Refresh");
dialog.append("\" action=\"bypass -h scripts_actions.OnActionShift:aggro\" width=100 height=21 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" />
");
show(dialog.toString(), player, npc);
}
/**
* Method OnActionShift_DoorInstance.
* @param player Player
* @param object GameObject
* @return boolean
*/
public boolean OnActionShift_DoorInstance(Player player, GameObject object)
{
if ((player == null) || (object == null) || !player.getPlayerAccess().Door || !object.isDoor())
{
return false;
}
String dialog;
DoorInstance door = (DoorInstance) object;
dialog = HtmCache.getInstance().getNotNull("scripts/actions/admin.L2DoorInstance.onActionShift.htm", player);
dialog = dialog.replaceFirst("%CurrentHp%", String.valueOf((int) door.getCurrentHp()));
dialog = dialog.replaceFirst("%MaxHp%", String.valueOf(door.getMaxHp()));
dialog = dialog.replaceAll("%ObjectId%", String.valueOf(door.getObjectId()));
dialog = dialog.replaceFirst("%doorId%", String.valueOf(door.getDoorId()));
dialog = dialog.replaceFirst("%pdef%", String.valueOf(door.getPDef(null)));
dialog = dialog.replaceFirst("%mdef%", String.valueOf(door.getMDef(null, null)));
dialog = dialog.replaceFirst("%type%", door.getDoorType().name());
dialog = dialog.replaceFirst("%upgradeHP%", String.valueOf(door.getUpgradeHp()));
dialog = dialog.replaceFirst("%geoIndex%", String.valueOf(door.getGeoIndex()));
StringBuilder b = new StringBuilder("");
for (GlobalEvent e : door.getEvents())
{
b.append(e.toString()).append(';');
}
dialog = dialog.replaceFirst("%event%", b.toString());
show(dialog, player);
player.sendActionFailed();
return true;
}
/**
* Method OnActionShift_Player.
* @param player Player
* @param object GameObject
* @return boolean
*/
public boolean OnActionShift_Player(Player player, GameObject object)
{
if ((player == null) || (object == null) || !player.getPlayerAccess().CanViewChar)
{
return false;
}
if (object.isPlayer())
{
AdminEditChar.showCharacterList(player, (Player) object);
}
return true;
}
/**
* Method OnActionShift_PetInstance.
* @param player Player
* @param object GameObject
* @return boolean
*/
public boolean OnActionShift_PetInstance(Player player, GameObject object)
{
if ((player == null) || (object == null) || !player.getPlayerAccess().CanViewChar)
{
return false;
}
if (object.isPet())
{
PetInstance pet = (PetInstance) object;
String dialog;
dialog = HtmCache.getInstance().getNotNull("scripts/actions/admin.L2PetInstance.onActionShift.htm", player);
dialog = dialog.replaceFirst("%name%", HtmlUtils.htmlNpcName(pet.getNpcId()));
dialog = dialog.replaceFirst("%title%", String.valueOf(StringUtils.isEmpty(pet.getTitle()) ? "Empty" : pet.getTitle()));
dialog = dialog.replaceFirst("%level%", String.valueOf(pet.getLevel()));
dialog = dialog.replaceFirst("%class%", String.valueOf(pet.getClass().getSimpleName().replaceFirst("L2", "").replaceFirst("Instance", "")));
dialog = dialog.replaceFirst("%xyz%", pet.getLoc().x + " " + pet.getLoc().y + " " + pet.getLoc().z);
dialog = dialog.replaceFirst("%heading%", String.valueOf(pet.getLoc().h));
dialog = dialog.replaceFirst("%owner%", String.valueOf(pet.getPlayer().getName()));
dialog = dialog.replaceFirst("%ownerId%", String.valueOf(pet.getPlayer().getObjectId()));
dialog = dialog.replaceFirst("%npcId%", String.valueOf(pet.getNpcId()));
dialog = dialog.replaceFirst("%controlItemId%", String.valueOf(pet.getControlItem().getItemId()));
dialog = dialog.replaceFirst("%exp%", String.valueOf(pet.getExp()));
dialog = dialog.replaceFirst("%sp%", String.valueOf(pet.getSp()));
dialog = dialog.replaceFirst("%maxHp%", String.valueOf(pet.getMaxHp()));
dialog = dialog.replaceFirst("%maxMp%", String.valueOf(pet.getMaxMp()));
dialog = dialog.replaceFirst("%currHp%", String.valueOf((int) pet.getCurrentHp()));
dialog = dialog.replaceFirst("%currMp%", String.valueOf((int) pet.getCurrentMp()));
dialog = dialog.replaceFirst("%pDef%", String.valueOf(pet.getPDef(null)));
dialog = dialog.replaceFirst("%mDef%", String.valueOf(pet.getMDef(null, null)));
dialog = dialog.replaceFirst("%pAtk%", String.valueOf(pet.getPAtk(null)));
dialog = dialog.replaceFirst("%mAtk%", String.valueOf(pet.getMAtk(null, null)));
dialog = dialog.replaceFirst("¬curacy%", String.valueOf(pet.getAccuracy()));
dialog = dialog.replaceFirst("%evasionRate%", String.valueOf(pet.getEvasionRate(null)));
dialog = dialog.replaceFirst("%crt%", String.valueOf(pet.getCriticalHit(null, null)));
dialog = dialog.replaceFirst("%runSpeed%", String.valueOf(pet.getRunSpeed()));
dialog = dialog.replaceFirst("%walkSpeed%", String.valueOf(pet.getWalkSpeed()));
dialog = dialog.replaceFirst("%pAtkSpd%", String.valueOf(pet.getPAtkSpd()));
dialog = dialog.replaceFirst("%mAtkSpd%", String.valueOf(pet.getMAtkSpd()));
dialog = dialog.replaceFirst("%dist%", String.valueOf((int) pet.getRealDistance(player)));
dialog = dialog.replaceFirst("%STR%", String.valueOf(pet.getSTR()));
dialog = dialog.replaceFirst("ÞX%", String.valueOf(pet.getDEX()));
dialog = dialog.replaceFirst("%CON%", String.valueOf(pet.getCON()));
dialog = dialog.replaceFirst("%INT%", String.valueOf(pet.getINT()));
dialog = dialog.replaceFirst("%WIT%", String.valueOf(pet.getWIT()));
dialog = dialog.replaceFirst("%MEN%", String.valueOf(pet.getMEN()));
show(dialog, player);
}
return true;
}
/**
* Method OnActionShift_ItemInstance.
* @param player Player
* @param object GameObject
* @return boolean
*/
public boolean OnActionShift_ItemInstance(Player player, GameObject object)
{
if ((player == null) || (object == null) || !player.getPlayerAccess().CanViewChar)
{
return false;
}
if (object.isItem())
{
String dialog;
ItemInstance item = (ItemInstance) object;
dialog = HtmCache.getInstance().getNotNull("scripts/actions/admin.L2ItemInstance.onActionShift.htm", player);
dialog = dialog.replaceFirst("%name%", String.valueOf(item.getTemplate().getName()));
dialog = dialog.replaceFirst("%objId%", String.valueOf(item.getObjectId()));
dialog = dialog.replaceFirst("%itemId%", String.valueOf(item.getItemId()));
dialog = dialog.replaceFirst("%grade%", String.valueOf(item.getCrystalType()));
dialog = dialog.replaceFirst("%count%", String.valueOf(item.getCount()));
Player owner = GameObjectsStorage.getPlayer(item.getOwnerId());
dialog = dialog.replaceFirst("%owner%", String.valueOf(owner == null ? "none" : owner.getName()));
dialog = dialog.replaceFirst("%ownerId%", String.valueOf(item.getOwnerId()));
for (Element e : Element.VALUES)
{
dialog = dialog.replaceFirst("%" + e.name().toLowerCase() + "Val%", String.valueOf(item.getAttributeElementValue(e, true)));
}
dialog = dialog.replaceFirst("%attrElement%", String.valueOf(item.getAttributeElement()));
dialog = dialog.replaceFirst("%attrValue%", String.valueOf(item.getAttributeElementValue()));
dialog = dialog.replaceFirst("%enchLevel%", String.valueOf(item.getEnchantLevel()));
dialog = dialog.replaceFirst("%type%", String.valueOf(item.getItemType()));
dialog = dialog.replaceFirst("%dropTime%", String.valueOf(item.getDropTimeOwner()));
show(dialog, player);
player.sendActionFailed();
}
return true;
}
/**
* Method nameNpc.
* @param npc NpcInstance
* @return String
*/
private String nameNpc(NpcInstance npc)
{
if (npc.getNameNpcString() == NpcString.NONE)
{
return HtmlUtils.htmlNpcName(npc.getNpcId());
}
return HtmlUtils.htmlNpcString(npc.getNameNpcString().getId(), npc.getName());
}
}
Link para o comentário
Compartilhar em outros sites
3 respostass a esta questão
Posts recomendados