/*
* 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 <http://www.gnu.org/licenses/>.
*/
package custom.BossRespawn;
import javolution.text.TextBuilder;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.datatables.NpcTable;
public class BossRespawn extends Quest
{
private static final int NPC_ID = 93000;
private static final int[] BOSSES = {29001, 29006, 29014, 29019, 29020, 29022, 29028, 29045};
public BossRespawn(int questid, String name, String descr)
{
super(questid, name, descr);
addFirstTalkId(NPC_ID);
}
public String onFirstTalk(L2Npc npc, L2PcInstance pc)
{
if(npc == null || pc == null)
return null;
if(npc.getNpcId() == NPC_ID)
{
sendInfo(pc);
}
return null;
}
private void sendInfo(L2PcInstance activeChar)
{
TextBuilder tb = new TextBuilder();
tb.append("<html><title>Grand Boss Info By Dleogr</title><body><br><center>");
tb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>");
for(int boss : BOSSES)
{
String name = NpcTable.getInstance().getTemplate(boss).getName();
long delay = GrandBossManager.getInstance().getStatsSet(boss).getLong("respawn_time");
if (delay <= System.currentTimeMillis())
{
tb.append("<font color=\"00C3FF\">" + name + "</color>: " + "<font color=\"9CC300\">Is Alive</color>"+"<br1>");
}
else
{
int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
int seconts = (int) (((delay - ((hours * 60 * 60 * 1000) + (mins * 60 * 1000))) - System.currentTimeMillis()) / 1000);
tb.append("<font color=\"00C3FF\">" + name + "</color>" + "<font color=\"FFFFFF\">" +" " + "Respawn in :</color>" + " " + " <font color=\"32C332\">" + hours + " : " + mins + " : " + seconts + "</color><br1>");
}
}
tb.append("<br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
tb.append("</center></body></html>");
NpcHtmlMessage msg = new NpcHtmlMessage(NPC_ID);
msg.setHtml(tb.toString());
activeChar.sendPacket(msg);
}
public static void main(String[] args)
{
new BossRespawn(-1, "BossRespawn", "custom");
}
}
the script works on NPC but he only show's "ALIVE" :S
if you kill the Grand Boss like Baium etc. he always show alive.
Since last massive leak as explained as 07/09 (notably all development branches), I don't accept anymore financial newcomers that easily. People will have to contribute 100 cookies worth of contributions (bug reports/fixes) as a first step to be accepted as Donator. Free user can join after sharing over 200 cookies out of contributions, compared to 100 cookies before.
You can say thanks to RusAcis, and notably his worthless leader, UnleashedForce.
The size of users will continue to shrink if more leaks occur, until true helpers only will be left.
New prices are as following :
Joining price: 200€ + 100 cookies, or 200 cookies
This fee has to be paid if you are joining aCis project. Next month, and all other months, you will have to donate only basic monthly donation.
Monthly price: 10€ / 10 cookies
This fee has to be paid every month.
I won't accept any new join fee before the 100 cookies contribution. Your money will be instantly sent back.
Also, in the same shape of idea, actual supporters/donators have to be active to stay in sources. It doesn't have to be a particular amount, you just have to share from time to time *anything*. I don't accept anymore silent ppl. Only useful people will be kept.
Question
mrnapz
the script works on NPC but he only show's "ALIVE" :S
if you kill the Grand Boss like Baium etc. he always show alive.
Link to comment
Share on other sites
9 answers to this question
Recommended Posts