Habib Posted January 21, 2011 Posted January 21, 2011 how to make on .py files npc to make admin command //setvip
0 Matim Posted January 21, 2011 Posted January 21, 2011 So you need NPC with possibility to confer the status of VIP? Why python? It could be java quest based NPC aswell.
0 Habib Posted January 21, 2011 Author Posted January 21, 2011 yes i want npc to make ppl VIP status .... so how to do that? because i dont find here shared npc like this
0 Habib Posted January 21, 2011 Author Posted January 21, 2011 Give me few min, and I will code it. tnx
0 Matim Posted January 21, 2011 Posted January 21, 2011 Not tested, but should be fine, fast code: package custom.VipManager; 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.model.quest.QuestState; /** * @author Matim * @version 1.0 */ public class VipManager extends Quest { private final static String qn = "VipManager"; private final static int NPC = 50013; public VipManager(int questId, String name, String descr) { super(questId, name, descr); addFirstTalkId(NPC); addStartNpc(NPC); addTalkId(NPC); } @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = ""; String name = player.getName(); if (event.equalsIgnoreCase("1")) { if (player.isVip()) // TODO u need this Cheack! { htmltext = "<html><title>VIP Manager</title><head><body><center>" + "<br>Sorry <font color=\"LEVEL\">" + name + "</font>, but you are already VIP!"; } else { if (player.getInventory().getItemByItemId(6630) == null) { return "error"; } else { if if (player.getLevel() < 80) { player.sendMessage("You need Level 80 or higher!"); } else { player.setIsVip(true); // TODO u need this method to set VIP! htmltext = "<html><title>VIP Manager</title><head><body><center>" + "<br>Congratulations <font color=\"LEVEL\">" + name + "</font>, you are VIP now!"; } } } } else htmltext = "Error, check whole NPC code!"; return htmltext; } @Override public String onFirstTalk(L2Npc npc, L2PcInstance player) { String htmltext = ""; QuestState qs = player.getQuestState(qn); if (qs == null) qs = newQuestState(player); htmltext = "<html><title></title><head><body><center>" + "<br><img src=l2ui.bbs_lineage2 height=16 width=80>" + "<font color=AAAAAA>VIP Manager</font><br>" + "<img src=L2UI_CH3.herotower_deco width=256 height=32>" + "<button value=\"Make me VIP!\" action=\"bypass -h Quest VipManager 1\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" + "<font color=\"cc9900\"><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></font><br1></center></body></head></html>"; return htmltext; } public static void main(String[] args) { new VipManager(-1, qn, "custom"); } } Warning, you need: isVip(); boolean check (check if is/isnt Vip) setIsVip(boolean b); to make player VIP Maybe your pack has support for VIP engine, I guess it has since you need it. I guess you know, how to install it, right?
0 Bobi Posted February 3, 2011 Posted February 3, 2011 how to make it to want for example 100 GB to bet vip status ?
0 An4rchy Posted February 3, 2011 Posted February 3, 2011 matim, on code you write: if if (player.getLevel() < 80) { player.sendMessage("You need Level 80 or higher!"); } i mean the double ifs :D edit: sorry i didn't see date
0 Matim Posted February 4, 2011 Posted February 4, 2011 Oh right, i made it with notepad, thats why there may be some typos .. :)
Question
Habib
how to make on .py files npc to make admin command //setvip
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now