Ir para conteúdo
  • Cadastre-se
  • 0

Preciso De Ajuda Para Editar NPC


viniciusserrao

Pergunta

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

http://s1.postimg.org/t8quhugv3/Sem_t_tulo.jpg

Imagens Da Janela Que Quero Colocar O Botão de Editar o NPC a DropList e os Stats

http://s1.postimg.org/5mv89enz3/Shot00000.png
http://s1.postimg.org/v4dmt05pb/Shot00002.png
http://s1.postimg.org/es3l39rdr/Shot00001.png



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());
}
}

 

 

 

Editado por viniciusserrao
Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts recomendados

tens que ir na tabela NPC do navicat e procurar esse npc ai para editar!

 

Aquele que aprendeu e reviveu aqui na l2jbrasil

Faço muitos trabalhos para esta comunidade, assim como tambem ajudo aos que precisão.

A VIDA E UMA CAIXINHA DE SUPRESAS, NAO DEIXE PARA DEPOIS O QUE PODES FAZER AGORA!

 

Link para o comentário
Compartilhar em outros sites


A Minha Rev Não Tem a Tabela NPC. Ela Não Vem Com a Database Eu Instalei a que Vem na Pasta Tools Pelo Installer.

Na Pasta do Admin Access Level Tem Dizendo Que Posso Editar o NPC Veja na Imagem Abaixo.

 

Alguém Sabem Onde Posso Encontrar o Html ou Java Dessa Janela Para Mim Ver. A Janela Que Aparece Quando Clicamos No NPC?

Eu Estava Querendo Tipo o Sistema do Interlude ou H5 Que Tem as Opções de Editar o NPC, a DropList.

 

Mais Uma Vez Obrigado Se Alguém Puder Me Ajudar Agradeço Muito.

 

npc.jpg

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.





  • Patrocinadores

  • Quem Está Navegando

    • Nenhum usuário registrado visualizando esta página.
  • Posts

    • Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?    
    • muchas gracias muy lindos NPC 🙂
    • relaxa jovem gafanhoto, testa as quests. e posTa os erros indesejaveis.  
    • Se alguém pudesse me ensinar como codificar as missões, eu ficaria feliz em fazer isso sozinho ou pelo menos ajudar. Eu realmente quero jogar em um servidor onde todas as quests funcionem bem e melhor ainda se você puder fazer quests customizadas!
    • mas no interlude, nem todas as quests de class,  vai mostrar onde tem que ir, ate o reborn nao mostrava quando era interlude, só mostrou depois que eles colocaram client classic pra rodar, e ficou melhor ainda quando virou hellbound em diante, mas ha sim alguma chance de modificar isso direto no script para fazer igualmente, só basta te um pouco de paciencia e persistencia exato
    • 408_PathToElvenwizard dá Orion eu tive que mexer tbm, até modifiquei e consegui deixar ela igual do Classic, com a seta e a marcação no mapa. (não retail IL) Dá pra importar py de várias revs, o foda é que não da regular as quest py através do debug em tempo real, pelo menos eu não consegui rsrs
    • Hasta el momento todas las QUESTS son completables si te guias con un tutorial de youtube. El problema es que tienen bugs de locacion y de subquests que no avanzan o no te marcan correctamente a donde ir en el mapa, cosa que en Retail si se ve como corresponde.
    • estranho, mas pelo menos a galera nunca reclamo das quests quando tinha aberto 5x, geral fez class primeira e segunda job, poucos que compraram a class
    • en RUSaCis-3.5 data pack, las Quests estan en formato .java y son diferentes a como estan redactadas en jOrion y jFrozen 1.5 (ProyectX) package net.sf.l2j.gameserver.scripting.quest; import net.sf.l2j.commons.random.Rnd; import net.sf.l2j.gameserver.enums.Paperdoll; import net.sf.l2j.gameserver.enums.QuestStatus; import net.sf.l2j.gameserver.enums.actors.ClassId; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.Npc; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.network.serverpackets.SocialAction; import net.sf.l2j.gameserver.scripting.QuestState; public class Q224_TestOfSagittarius extends SecondClassQuest { private static final String QUEST_NAME = "Q224_TestOfSagittarius"; // Items private static final int BERNARD_INTRODUCTION = 3294; private static final int HAMIL_LETTER_1 = 3295; private static final int HAMIL_LETTER_2 = 3296; private static final int HAMIL_LETTER_3 = 3297; private static final int HUNTER_RUNE_1 = 3298; private static final int HUNTER_RUNE_2 = 3299; private static final int TALISMAN_OF_KADESH = 3300; private static final int TALISMAN_OF_SNAKE = 3301; private static final int MITHRIL_CLIP = 3302; private static final int STAKATO_CHITIN = 3303; private static final int REINFORCED_BOWSTRING = 3304; private static final int MANASHEN_HORN = 3305; private static final int BLOOD_OF_LIZARDMAN = 3306; private static final int CRESCENT_MOON_BOW = 3028; private static final int WOODEN_ARROW = 17; // Rewards private static final int MARK_OF_SAGITTARIUS = 3293; // NPCs private static final int BERNARD = 30702; private static final int HAMIL = 30626; private static final int SIR_ARON_TANFORD = 30653; private static final int VOKIAN = 30514; private static final int GAUEN = 30717; // Monsters private static final int ANT = 20079; private static final int ANT_CAPTAIN = 20080; private static final int ANT_OVERSEER = 20081; private static final int ANT_RECRUIT = 20082; private static final int ANT_PATROL = 20084; private static final int ANT_GUARD = 20086; private static final int NOBLE_ANT = 20089; private static final int NOBLE_ANT_LEADER = 20090; private static final int BREKA_ORC_SHAMAN = 20269; private static final int BREKA_ORC_OVERLORD = 20270; private static final int MARSH_STAKATO_WORKER = 20230; private static final int MARSH_STAKATO_SOLDIER = 20232; private static final int MARSH_STAKATO_DRONE = 20234; private static final int MARSH_SPIDER = 20233; private static final int ROAD_SCAVENGER = 20551; private static final int MANASHEN_GARGOYLE = 20563; private static final int LETO_LIZARDMAN = 20577; private static final int LETO_LIZARDMAN_ARCHER = 20578; private static final int LETO_LIZARDMAN_SOLDIER = 20579; private static final int LETO_LIZARDMAN_WARRIOR = 20580; private static final int LETO_LIZARDMAN_SHAMAN = 20581; private static final int LETO_LIZARDMAN_OVERLORD = 20582; private static final int SERPENT_DEMON_KADESH = 27090; public Q224_TestOfSagittarius() { super(224, "Test Of Sagittarius"); setItemsIds(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW); addQuestStart(BERNARD); addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN); addMyDying(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH); } @Override public String onAdvEvent(String event, Npc npc, Player player) { String htmltext = event; QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; // BERNARD if (event.equalsIgnoreCase("30702-04.htm")) { st.setState(QuestStatus.STARTED); st.setCond(1); playSound(player, SOUND_ACCEPT); giveItems(player, BERNARD_INTRODUCTION, 1); if (giveDimensionalDiamonds39(player)) htmltext = "30702-04a.htm"; } // HAMIL else if (event.equalsIgnoreCase("30626-03.htm")) { st.setCond(2); playSound(player, SOUND_MIDDLE); takeItems(player, BERNARD_INTRODUCTION, 1); giveItems(player, HAMIL_LETTER_1, 1); } else if (event.equalsIgnoreCase("30626-07.htm")) { st.setCond(5); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_1, 10); giveItems(player, HAMIL_LETTER_2, 1); } // SIR_ARON_TANFORD else if (event.equalsIgnoreCase("30653-02.htm")) { st.setCond(3); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_1, 1); } // VOKIAN else if (event.equalsIgnoreCase("30514-02.htm")) { st.setCond(6); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_2, 1); } return htmltext; } @Override public String onTalk(Npc npc, Player player) { String htmltext = getNoQuestMsg(); QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; switch (st.getState()) { case CREATED: if (player.getClassId() != ClassId.ROGUE && player.getClassId() != ClassId.ELVEN_SCOUT && player.getClassId() != ClassId.ASSASSIN) htmltext = "30702-02.htm"; else if (player.getStatus().getLevel() < 39) htmltext = "30702-01.htm"; else htmltext = "30702-03.htm"; break; case STARTED: int cond = st.getCond(); switch (npc.getNpcId()) { case BERNARD: htmltext = "30702-05.htm"; break; case HAMIL: if (cond == 1) htmltext = "30626-01.htm"; else if (cond == 2 || cond == 3) htmltext = "30626-04.htm"; else if (cond == 4) htmltext = "30626-05.htm"; else if (cond > 4 && cond < 8) htmltext = "30626-08.htm"; else if (cond == 8) { htmltext = "30626-09.htm"; st.setCond(9); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_2, 10); giveItems(player, HAMIL_LETTER_3, 1); } else if (cond > 8 && cond < 12) htmltext = "30626-10.htm"; else if (cond == 12) { htmltext = "30626-11.htm"; st.setCond(13); playSound(player, SOUND_MIDDLE); } else if (cond == 13) htmltext = "30626-12.htm"; else if (cond == 14) { htmltext = "30626-13.htm"; takeItems(player, BLOOD_OF_LIZARDMAN, -1); takeItems(player, CRESCENT_MOON_BOW, 1); takeItems(player, TALISMAN_OF_KADESH, 1); giveItems(player, MARK_OF_SAGITTARIUS, 1); rewardExpAndSp(player, 54726, 20250); player.broadcastPacket(new SocialAction(player, 3)); playSound(player, SOUND_FINISH); st.exitQuest(false); } break; case SIR_ARON_TANFORD: if (cond == 2) htmltext = "30653-01.htm"; else if (cond > 2) htmltext = "30653-03.htm"; break; case VOKIAN: if (cond == 5) htmltext = "30514-01.htm"; else if (cond == 6) htmltext = "30514-03.htm"; else if (cond == 7) { htmltext = "30514-04.htm"; st.setCond(8); playSound(player, SOUND_MIDDLE); takeItems(player, TALISMAN_OF_SNAKE, 1); } else if (cond > 7) htmltext = "30514-05.htm"; break; case GAUEN: if (cond == 9) { htmltext = "30717-01.htm"; st.setCond(10); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_3, 1); } else if (cond == 10) htmltext = "30717-03.htm"; else if (cond == 11) { htmltext = "30717-02.htm"; st.setCond(12); playSound(player, SOUND_MIDDLE); takeItems(player, MANASHEN_HORN, 1); takeItems(player, MITHRIL_CLIP, 1); takeItems(player, REINFORCED_BOWSTRING, 1); takeItems(player, STAKATO_CHITIN, 1); giveItems(player, CRESCENT_MOON_BOW, 1); giveItems(player, WOODEN_ARROW, 10); } else if (cond > 11) htmltext = "30717-04.htm"; break; } break; case COMPLETED: htmltext = getAlreadyCompletedMsg(); break; } return htmltext; } @Override public void onMyDying(Npc npc, Creature killer) { final Player player = killer.getActingPlayer(); final QuestState st = checkPlayerState(player, npc, QuestStatus.STARTED); if (st == null) return; switch (npc.getNpcId()) { case ANT: case ANT_CAPTAIN: case ANT_OVERSEER: case ANT_RECRUIT: case ANT_PATROL: case ANT_GUARD: case NOBLE_ANT: case NOBLE_ANT_LEADER: if (st.getCond() == 3 && dropItems(player, HUNTER_RUNE_1, 1, 10, 500000)) st.setCond(4); break; case BREKA_ORC_SHAMAN: case BREKA_ORC_OVERLORD: if (st.getCond() == 6 && dropItems(player, HUNTER_RUNE_2, 1, 10, 500000)) { st.setCond(7); giveItems(player, TALISMAN_OF_SNAKE, 1); } break; case MARSH_STAKATO_WORKER: case MARSH_STAKATO_SOLDIER: case MARSH_STAKATO_DRONE: if (st.getCond() == 10 && dropItems(player, STAKATO_CHITIN, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING)) st.setCond(11); break; case MARSH_SPIDER: if (st.getCond() == 10 && dropItems(player, REINFORCED_BOWSTRING, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case ROAD_SCAVENGER: if (st.getCond() == 10 && dropItems(player, MITHRIL_CLIP, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN)) st.setCond(11); break; case MANASHEN_GARGOYLE: if (st.getCond() == 10 && dropItems(player, MANASHEN_HORN, 1, 1, 100000) && player.getInventory().hasItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case LETO_LIZARDMAN: case LETO_LIZARDMAN_ARCHER: case LETO_LIZARDMAN_SOLDIER: case LETO_LIZARDMAN_WARRIOR: case LETO_LIZARDMAN_SHAMAN: case LETO_LIZARDMAN_OVERLORD: if (st.getCond() == 13) { if (((player.getInventory().getItemCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100)) { playSound(player, SOUND_BEFORE_BATTLE); takeItems(player, BLOOD_OF_LIZARDMAN, -1); addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } else dropItemsAlways(player, BLOOD_OF_LIZARDMAN, 1, 0); } break; case SERPENT_DEMON_KADESH: if (st.getCond() == 13) { if (player.getInventory().getItemIdFrom(Paperdoll.RHAND) == CRESCENT_MOON_BOW) { st.setCond(14); playSound(player, SOUND_MIDDLE); giveItems(player, TALISMAN_OF_KADESH, 1); } else addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } break; } } }  
×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.