Jump to content

Chakl22

Members
  • Posts

    107
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Chakl22

  1. i have this code right now: if npcId == SENTRY1 : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.playSound("ItemSound.quest_middle") partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck...")) st.giveItems(E_APIGA,1) elif npcId == SENTRY2 : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.playSound("ItemSound.quest_middle") partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!")) st.giveItems(E_APIGA,1) openDoor(DOOR1,npc.instanceId) openDoor(DOOR2,npc.instanceId) This is the first room of 3 in the instance so the players are ported there and fight vs 2 mobs. Right now the players can kill Sentry 2 first and the Door will open, i wanna the players need kill the 2 MOBS and later of this the door get opened. thx.
  2. I really don't get this, you want a guard for make players keep the spawns location in a TVT?
  3. For Crossbow should be like this?: if (target instanceof L2PcInstance && weapon != null && weapon.getItemType() == L2WeaponType.CROSSBOW && skill != null) + { + L2Armor armor = ((L2PcInstance) target).getActiveChestArmorItem(); + if (armor != null) + { + if (((L2PcInstance) target).isWearingHeavyArmor()) + damage /= Config.CROSSBOW_VS_HEAVY; + if (((L2PcInstance) target).isWearingLightArmor()) + damage /= Config.CROSSBOW_VS_LIGHT; + if (((L2PcInstance) target).isWearingMagicArmor()) + damage /= Config.CROSSBOW_VS_ROBE; + } + } Or crossbow is affected from ARCHER class?
  4. For Crossbow should be like this?: if (target instanceof L2PcInstance && weapon != null && weapon.getItemType() == L2WeaponType.CROSSBOW && skill != null) + { + L2Armor armor = ((L2PcInstance) target).getActiveChestArmorItem(); + if (armor != null) + { + if (((L2PcInstance) target).isWearingHeavyArmor()) + damage /= Config.CROSSBOW_VS_HEAVY; + if (((L2PcInstance) target).isWearingLightArmor()) + damage /= Config.CROSSBOW_VS_LIGHT; + if (((L2PcInstance) target).isWearingMagicArmor()) + damage /= Config.CROSSBOW_VS_ROBE; + } + } Or crossbow is affected from ARCHER class?
  5. For Crossbow should be like this?: if (target instanceof L2PcInstance && weapon != null && weapon.getItemType() == L2WeaponType.CROSSBOW && skill != null) + { + L2Armor armor = ((L2PcInstance) target).getActiveChestArmorItem(); + if (armor != null) + { + if (((L2PcInstance) target).isWearingHeavyArmor()) + damage /= Config.CROSSBOW_VS_HEAVY; + if (((L2PcInstance) target).isWearingLightArmor()) + damage /= Config.CROSSBOW_VS_LIGHT; + if (((L2PcInstance) target).isWearingMagicArmor()) + damage /= Config.CROSSBOW_VS_ROBE; + } + } Or crossbow is affected from ARCHER class?
  6. yeah works nice but the guy put all vsHeavy xD
  7. I wanna modify the power (daamge) of Death Spike skill, this skill make 108 dmg by default so i wanna modify this for less dmg but i don't find the option for modify the power like in other skills for ex, hurricane, vampiric claw etc.. <skill id="1530" levels="13" name="Death Spike" enchantGroup1="2" enchantGroup2="2" enchantGroup3="2"> <table name="#enchantMagicLvl"> 76 76 76 77 77 77 78 78 78 79 79 79 80 80 80 81 81 81 82 82 82 82 83 83 83 84 84 85 85 85 </table> <table name="#mpConsume_Init"> 4 5 6 7 7 7 8 8 8 9 9 9 10 </table> <table name="#mpConsume"> 19 22 24 28 29 31 32 33 35 36 37 38 40 </table> <table name="#magicLvl"> 44 48 52 56 58 60 62 64 66 68 70 72 74 </table> <table name="#power"> 35 39 43 47 49 51 53 56 58 59 61 63 65 </table> <table name="#ench1Power"> 66 66 67 68 69 70 70 71 72 73 73 74 75 76 76 77 78 79 79 80 81 82 82 83 84 85 86 86 87 88 </table> <table name="#enchElementPower"> 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 </table> <table name="#enchDuel"> 66 68 69 71 73 74 76 78 79 81 83 84 86 88 89 91 92 94 96 97 99 101 102 104 106 107 109 111 112 114 </table> <set name="mpInitialConsume" val="#mpConsume_Init" /> <set name="mpConsume" val="#mpConsume" /> <set name="itemConsumeId" val="2508" /> <set name="itemConsumeCount" val="1" /> <set name="magicLvl" val="#magicLvl" /> <set name="power" val="#power" /> <set name="target" val="TARGET_ONE" /> <set name="element" val="5" /> <!-- Dark --> <set name="elementPower" val="20" /> <set name="reuseDelay" val="1000" /> <set name="hitTime" val="4000" /> <set name="skillType" val="MDAM" /> <set name="isMagic" val="true" /> <set name="operateType" val="OP_ACTIVE" /> <set name="castRange" val="900" /> <set name="effectRange" val="1400" /> <enchant1 name="magicLvl" val="#enchantMagicLvl" /> <enchant2 name="magicLvl" val="#enchantMagicLvl" /> <enchant2 name="elementPower" val="#enchElementPower" /> <enchant3 name="magicLvl" val="#enchantMagicLvl" /> <enchant3 name="pvpPower" val="#enchDuel" /> <table name="#power"> 35 39 43 47 49 51 53 56 58 59 61 63 65 </table> i try this line but don't do ant change, and don't should say 108 dmg in the last number? well if someone can tell me how i can modify the dmg of this skills, will really help.
  8. The Info Server NPC don't looks like in the screen you post... <.<
  9. Finally someone help me: Here the script: Index: data/scripts/custom/SpawnNPC/SpawnNPC.java =================================================================== --- data/scripts/custom/SpawnNPC/SpawnNPC.java (revision 0) +++ data/scripts/custom/SpawnNPC/SpawnNPC.java (revision 0) @@ -0,0 +1,97 @@ +/* + * 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.SpawnNPC; + +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.util.Broadcast; +import com.l2jserver.util.Rnd; + +/** + * This script automatically spawns, despawns and respawns an NPC of your choice at your desired location + * as well as announces the spawn location and despawn/respawn time. + * FIXME the current coordinates are from all the Newbie Guides in starting villages. Change them to your desired locations. + * @author jurchiks + */ +public class SpawnNPC extends Quest +{ + private static final int NPC = 32349; // the ID of the NPC to spawn + private static final int INITIAL_TIME = 60; // spawn 1 hour after server has started + private static final int DESPAWN_TIME = 120; // despawn 2 hours after spawned + private static final int RESPAWN_TIME = 120; // respawn 2 hours after despawned + private static final boolean RANDOM_SPAWN = false; // if true, NPC will spawn in random places, otherwise only the FIRST coordinates will be used + + //@formatter:off + private static final int[][] COORDS = + { + { -84081, 243227, -3728, 0 }, // Talking Island + { 45475, 48359, -3056, 0 }, // Elven Village + { 17024, 13296, -3736, 0 }, // Dark Elf Village + { 115632, -177996, -896, 0 }, // Dwarven Village + { -45032, -113598, -192, 0 }, // Orc Village + { -119692, 44504, 360, 0 } // Kamael Village + }; // X, Y, Z, heading + //@formatter:on + + public SpawnNPC(int id, String name, String descr) + { + super(id, name, descr); + startQuestTimer("spawn", 60000 * INITIAL_TIME, null, null); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (event.equalsIgnoreCase("spawn")) + { + int loc = RANDOM_SPAWN ? Rnd.get(COORDS.length) : 0; + npc = addSpawn(NPC, COORDS[loc][0], COORDS[loc][1], COORDS[loc][2], COORDS[loc][3], false, 0); + startQuestTimer("despawn", 60000 * DESPAWN_TIME, npc, null); + Broadcast.announceToOnlinePlayers("Your NPC has spawned at " + COORDS[loc][0] + " " + COORDS[loc][1] + " " + COORDS[loc][2]); + Broadcast.announceToOnlinePlayers("It will disappear in " + calcAnnounce(DESPAWN_TIME)); + } + else if (event.equalsIgnoreCase("despawn")) + { + npc.deleteMe(); + startQuestTimer("spawn", 60000 * RESPAWN_TIME, npc, null); + Broadcast.announceToOnlinePlayers("Your NPC has disappeared."); + Broadcast.announceToOnlinePlayers("It will respawn in " + calcAnnounce(RESPAWN_TIME)); + } + return null; + } + + String calcAnnounce(int time) + { + String announce = ""; + int minutes = time % 60; + if (time / 60 > 0) // if at least 1 hour + { + announce += time / 60 + " hour(s)"; + if (minutes > 0) // not exact hours, add minutes to announcement + announce += " and " + minutes + " minute(s)"; + } + else if (minutes > 0) // less than 1 hour, add minutes to announcement + announce += minutes + " minute(s)"; + if (announce.isEmpty()) // time <= 0? + announce = "!wrong time set, check your settings!"; + return announce; + } + + public static void main(String[] args) + { + new SpawnNPC(-1, "SpawnNPC", "custom"); + } +} \ No newline at end of file Tested & Working. Credits To: jurchiks from L2J Forum.
  10. Not working in last Freya Rev. I change the imports to correct ones for L2J and if (onlinePlayer.isOnline() == 1) for if (onlinePlayer.isOnline() == true) so no errors when compile in eclipse, and yes put the files sound in the client, but not sounds in game for the killssprees what is wrong? EDIT: Working now, it was couse i have Music muted in l2 settings lol! i forget the sounds come from MUSIC folder not from SOUNDS.
  11. Thx, attribute system sucks. =)
  12. Download with Eclipse. http://svn.l2jdp.com/trunk/L2J_DataPack http://svn.l2jserver.com/trunk/L2J_Server
  13. I need a Script for do the next: Spawn a NPC, (with announce x NPC has spawned in x location) and will disapear in x hours (configurable time and coords, for spawn), Despawn NPC after the pre-config time (With announce x NPC has disapear, and will be spwned again in x time), PD: No reward, no drop, only spawn a NPC. Hope somone can help.
  14. Well right now i make like this: in NPCAIDATA i put MOBS "ISCHAOS" 1 (this is like when you have Karma but for mobs), so later i make the MOB HELPER TYPE "L2GUARD", so of this way i don't have the risk the mob will attack the Player who spawn him, for now is working. About the FACTION, where is? i search in NPCAIDATA and normal NPC tables but didn't see it.
  15. Now i m getting this error only: */ package com.l2jserver.gameserver.handler.itemhandlers; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.datatables.NpcTable; import com.l2jserver.gameserver.handler.IItemHandler; import com.l2jserver.gameserver.idfactory.IdFactory; import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.L2Playable; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.serverpackets.SystemMessage; import com.l2jserver.gameserver.templates.L2NpcTemplate; /** * @author x.v3ndetta@yahoo.com * */ public class VendettaItem implements IItemHandler and i register this in Masterhadler ItemHandler.getInstance().registerItemHandler(new EventItem()); ItemHandler.getInstance().registerItemHandler(new VendettaItem()); _log.config("Loaded " + ItemHandler.getInstance().size() + " ItemHandlers"); Why the -beep- say can't resolve the type????? EDIT: FIXED.
  16. I can't make it work i follow this steps: Copy the code and put VendettaItem.java inside of C:\server\gameserver\data\scripts\handlers\itemhandlers i change the imports to com.l2jserver NO ERRORS but when i press the item in game nothing happend why? Maybe i need registrer the item in MasterHandler.java? if yes how? i mean import handlers.itemhandlers.VendettaItem; if i make this i get Error in Console: So how i an get this working? Thx.
  17. well i have a "Solo Instance Event" and this work perfect with Check for Rojin Time. So other guy modify this same code for make this a "Instance Party Event" but without Rejoining Time, so since the code is very similar i try to copy the Time Part from the Solo Event and put this on the Party Event, but give me error. Solo Event: (Working Perfect With Rejoin Timer). #Instance Engine by Bloodshed, Fixed by Sakretsu from java.lang import System from java.sql import Connection from java.sql import PreparedStatement from java.sql import ResultSet from java.util.logging import Level from java.util.logging import Logger from com.l2jserver import L2DatabaseFactory from com.l2jserver.gameserver.instancemanager import InstanceManager from com.l2jserver.gameserver.instancemanager.InstanceManager import InstanceWorld from com.l2jserver.gameserver.model import L2ItemInstance from com.l2jserver.gameserver.model import L2Object from com.l2jserver.gameserver.model import L2World from com.l2jserver.gameserver.model.actor import L2Character from com.l2jserver.gameserver.model.actor import L2Summon from com.l2jserver.gameserver.model.entity import Instance from com.l2jserver.gameserver.model.itemcontainer import PcInventory from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.quest import QuestState from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jserver.gameserver.network.serverpackets import CreatureSay from com.l2jserver.gameserver.network.serverpackets import InventoryUpdate from com.l2jserver.gameserver.network.serverpackets import MagicSkillUse from com.l2jserver.gameserver.network.serverpackets import SystemMessage from com.l2jserver.gameserver.network.serverpackets import ExShowScreenMessage from com.l2jserver.gameserver.network.serverpackets import Earthquake from com.l2jserver.gameserver.network import SystemMessageId from com.l2jserver.gameserver.util import Util from com.l2jserver.util import Rnd qn = "Bloodshed" #Items E_APIGA = 14720 ADENA = 57 STONE = 9576 SCROLL = 960 #NPCs ROSE = 40000 CHEST = 40001 #Monsters NAGLFAR = 40002 SENTRY1 = 40003 BRAVERY = 40005 #Timelimit TIMELIMIT = 2400000 #Instance Id INSTANCEID = 500000 #Doors DOOR1 = 12240001 DOOR2 = 12240002 class PyObject: pass def openDoor(doorId,instanceId): for door in InstanceManager.getInstance().getInstance(instanceId).getDoors(): if door.getDoorId() == doorId: door.openMe() def closeDoor(doorId,instanceId): for door in InstanceManager.getInstance().getInstance(instanceId).getDoors(): if door.getDoorId() == doorId: door.closeMe() def checkConditions(player, new): st = player.getQuestState(qn) reentertime = InstanceManager.getInstance().getInstanceTime(player.getObjectId(), INSTANCEID); party = player.getParty() if party: player.sendPacket(SystemMessage.sendString("You may not enter with a party.")) return False if not player.getLevel() >= 80: player.sendPacket(SystemMessage.sendString("You must be level 80 or higher to enter.")) return False if System.currentTimeMillis() < reentertime : InstanceManager.getInstance().getInstanceTime(player.getObjectId(), INSTANCEID) hours = (reentertime-System.currentTimeMillis())/3600000 minutes = ((reentertime-System.currentTimeMillis())%3600000)/60000 seconds = ((reentertime-System.currentTimeMillis())%60000)/1000 player.sendPacket(SystemMessage.sendString("Solo Instance will be available to re-use in " + str(hours) + " hours " + str(minutes) + " minutes and " + str(seconds) + " seconds.")) return False if not party: return True return False def teleportplayer(self,player,teleto): player.setInstanceId(teleto.instanceId) player.teleToLocation(teleto.x, teleto.y, teleto.z) pet = player.getPet() if pet != None : pet.setInstanceId(teleto.instanceId) pet.teleToLocation(teleto.x, teleto.y, teleto.z) return def enterInstance(self,player,template,teleto): instanceId = 0 party = player.getParty() if party : for partyMember in party.getPartyMembers().toArray(): st = partyMember.getQuestState(qn) if not st : st = self.newQuestState(partyMember) if partyMember.getInstanceId()!=0: instanceId = partyMember.getInstanceId() else : if player.getInstanceId()!=0: instanceId = player.getInstanceId() if instanceId != 0: if not checkConditions(player,False): return 0 foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket(SystemMessage.sendString("You have entered another zone, therefore you cannot enter this one.")) return 0 teleto.instanceId = instanceId teleportplayer(self,player,teleto) return instanceId else: if not checkConditions(player,True): return 0 instanceId = InstanceManager.getInstance().createDynamicInstance(template) if not instanceId in self.world_ids: world = PyObject() world.rewarded=[] world.instanceId = instanceId world.templateId = INSTANCEID self.worlds[instanceId]=world self.world_ids.append(instanceId) print "Instance Bloodshed.xml Started: " +str(instanceId) + " created by " + str(player.getName()) st = player.getQuestState(qn) InstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + TIMELIMIT))) teleto.instanceId = instanceId teleportplayer(self,player,teleto) return instanceId return instanceId def exitInstance(player,tele): player.setInstanceId(0) player.teleToLocation(tele.x, tele.y, tele.z) pet = player.getPet() if pet != None : pet.setInstanceId(0) pet.teleToLocation(tele.x, tele.y, tele.z) class Bloodshed(JQuest): def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.worlds = {} self.world_ids = [] def onTalk (self,npc,player): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == ROSE : tele = PyObject() tele.x = -238599 tele.y = 219983 tele.z = -10144 enterInstance(self, player, "Bloodshed.xml", tele) st.playSound("ItemSound.quest_middle") elif npcId == CHEST : npc.decayMe() tele = PyObject() tele.x = 83279 tele.y = 148011 tele.z = -3404 exitInstance(player,tele) st.giveItems(ADENA,2750000) st.giveItems(STONE,1) st.giveItems(SCROLL,1) st.playSound("ItemSound.quest_finish") player.sendPacket(ExShowScreenMessage("Solo Instance Event (80+): Completed", 8000)) return def onKill(self,npc,player,isPet): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == SENTRY1 : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] st.playSound("ItemSound.quest_middle") player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Master, Forgive Me!")) st.giveItems(E_APIGA,1) openDoor(DOOR1,npc.instanceId) openDoor(DOOR2,npc.instanceId) elif npcId == BRAVERY : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] st.playSound("ItemSound.quest_middle") st.giveItems(E_APIGA,2) player.sendPacket(ExShowScreenMessage("Demonic Lord Naglfar Has Appeared!", 8000)) newNpc = self.addSpawn(NAGLFAR,-242754,219982,-9985,306,False,0,False,npc.instanceId) player.sendPacket(Earthquake(240826,219982,-9985,20,10)) elif npcId == NAGLFAR : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Ugh.... Defeated.. How!?")) player.sendPacket(ExShowScreenMessage("Congratulations! You Have Defeated Demonic Lord Naglfar.", 12000)) st.playSound("ItemSound.quest_fanfare_2") st.giveItems(E_APIGA,10) newNpc = self.addSpawn(CHEST,-242754,219982,-9985,306,False,0,False,npc.instanceId) return QUEST = Bloodshed(-1, qn, "Bloodshed") QUEST.addStartNpc(ROSE) QUEST.addTalkId(ROSE) QUEST.addTalkId(CHEST) QUEST.addKillId(NAGLFAR) QUEST.addKillId(BRAVERY) QUEST.addKillId(SENTRY1) Party Event, (Trying to put a Rejoin Time taking like a example the Code of Solo Event but i get Error.) #Instance Event by Bloodshedparty from com.l2jserver.gameserver.instancemanager import InstanceManager from com.l2jserver.gameserver.model import L2ItemInstance from com.l2jserver.gameserver.model.actor import L2Summon from com.l2jserver.gameserver.model.entity import Instance from com.l2jserver.gameserver.model.itemcontainer import PcInventory from com.l2jserver.gameserver.model.quest import State from com.l2jserver.gameserver.model.quest import QuestState from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jserver.gameserver.network.serverpackets import CreatureSay from com.l2jserver.gameserver.network.serverpackets import InventoryUpdate from com.l2jserver.gameserver.network.serverpackets import MagicSkillUse from com.l2jserver.gameserver.network.serverpackets import SystemMessage from com.l2jserver.gameserver.network.serverpackets import ExShowScreenMessage from com.l2jserver.gameserver.network.serverpackets import Earthquake from com.l2jserver.gameserver.network import SystemMessageId from com.l2jserver.gameserver.util import Util from com.l2jserver.util import Rnd qn = "Bloodshedparty" #Items E_APIGA = 14720 ADENA = 57 STONE = 9576 STONE82 = 10486 STONE84 = 14169 SCROLL = 960 SCROLLB = 6577 #NPCs ROSE = 50000 CHEST = 50001 #Monsters NAGLFAR = 50002 SENTRY1 = 50003 SENTRY2 = 50004 HOUND = 50005 #Doors DOOR1 = 12240001 DOOR2 = 12240002 class PyObject: pass def openDoor(doorId,instanceId): for door in InstanceManager.getInstance().getInstance(instanceId).getDoors(): if door.getDoorId() == doorId: door.openMe() def closeDoor(doorId,instanceId): for door in InstanceManager.getInstance().getInstance(instanceId).getDoors(): if door.getDoorId() == doorId: door.closeMe() def checkConditions(player, new): party = player.getParty() if not party: player.sendPacket(SystemMessage.sendString("You are not currently in a party, so you cannot enter.")) return False if party and party.getMemberCount() < 2: player.sendPacket(SystemMessage.sendString("You cannot enter because there not enough people in your party. Minimum is 2 people.")) return False if System.currentTimeMillis() < reentertime : InstanceManager.getInstance().getInstanceTime(player.getObjectId(), INSTANCEID) hours = (reentertime-System.currentTimeMillis())/3600000 minutes = ((reentertime-System.currentTimeMillis())%3600000)/60000 seconds = ((reentertime-System.currentTimeMillis())%60000)/1000 player.sendPacket(SystemMessage.sendString("Solo Instance will be available to re-use in " + str(hours) + " hours " + str(minutes) + " minutes and " + str(seconds) + " seconds.")) return False if party and party.getLeader() != player: player.sendPacket(SystemMessage.sendString("Only the party leader can begin the Event.")) return False for partyMember in party.getPartyMembers().toArray(): if partyMember.getLevel() < 78: player.sendPacket(SystemMessage.sendString(partyMember.getName()+"s level is below 78 and cannot enter.")) return False if not Util.checkIfInRange(1000, player, partyMember, True) and new: player.sendPacket(SystemMessage.sendString(partyMember.getName()+" is too far away, ask them to come here.")) return False return True def teleportplayer(self,player,teleto): player.setInstanceId(teleto.instanceId) player.teleToLocation(teleto.x, teleto.y, teleto.z) pet = player.getPet() if pet != None : pet.setInstanceId(teleto.instanceId) pet.teleToLocation(teleto.x, teleto.y, teleto.z) return def enterInstance(self,player,template,teleto): instanceId = 0 party = player.getParty() if party : for partyMember in party.getPartyMembers().toArray(): st = partyMember.getQuestState(qn) if not st: st = self.newQuestState(partyMember) if partyMember.getInstanceId()!=0: instanceId = partyMember.getInstanceId() else : if player.getInstanceId()!=0: instanceId = player.getInstanceId() if instanceId != 0: if not checkConditions(player,False): return 0 foundworld = False for worldid in self.world_ids: if worldid == instanceId: foundworld = True if not foundworld: player.sendPacket(SystemMessage.sendString("You have entered another zone, therefore you cannot enter this one.")) return 0 teleto.instanceId = instanceId teleportplayer(self,player,teleto) #added for partyMember in party.getPartyMembers().toArray(): partyMember.stopAllEffects() return instanceId else: if not checkConditions(player,True): return 0 instanceId = InstanceManager.getInstance().createDynamicInstance(template) if not instanceId in self.world_ids: world = PyObject() world.rewarded=[] world.instanceId = instanceId self.worlds[instanceId]=world self.world_ids.append(instanceId) print "Instance: Started " + template + " Instance: " +str(instanceId) + " created by " + str(player.getName()) st = player.getQuestState(qn) InstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + TIMELIMIT))) teleto.instanceId = instanceId for partyMember in party.getPartyMembers().toArray(): teleportplayer(self,partyMember,teleto) #added for partyMember in party.getPartyMembers().toArray(): partyMember.stopAllEffects() return instanceId return instanceId def exitInstance(player,tele): party = player.getParty() instanceId = player.getInstanceId() if party : for partyMember in party.getPartyMembers().toArray(): partyMember.setInstanceId(0) partyMember.teleToLocation(tele.x, tele.y, tele.z) pet = partyMember.getPet() if pet != None : pet.setInstanceId(0) pet.teleToLocation(tele.x, tele.y, tele.z) InstanceManager.getInstance().destroyInstance(instanceId) return class Bloodshedparty(JQuest): def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.worlds = {} self.world_ids = [] def onTalk (self,npc,player): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == ROSE : tele = PyObject() tele.x = -238599 tele.y = 219983 tele.z = -10144 enterInstance(self, player, "Bloodshedparty.xml", tele) elif npcId == CHEST : party = player.getParty() if not party: player.sendPacket(SystemMessage.sendString("Get out of here you noob!")) return if party and party.getLeader() != player: player.sendPacket(SystemMessage.sendString("Your party leader must claim the treasure!")) return npc.decayMe() tele = PyObject() tele.x = 82200 tele.y = 148347 tele.z = -3467 for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.giveItems(ADENA,10000) st1.giveItems(STONE84,1) st1.giveItems(STONE82,1) st1.giveItems(STONE,1) st1.giveItems(SCROLLB,1) st1.giveItems(SCROLL,1) exitInstance(partyMember,tele) st1.playSound("ItemSound.quest_finish") partyMember.sendPacket(ExShowScreenMessage("You have Completed the Party Event!", 8000)) return def onKill(self,npc,player,isPet): party = player.getParty() st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == SENTRY1 : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.playSound("ItemSound.quest_middle") partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck...")) st.giveItems(E_APIGA,1) openDoor(DOOR1,npc.instanceId) elif npcId == SENTRY2 : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.playSound("ItemSound.quest_middle") partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!")) st.giveItems(E_APIGA,1) openDoor(DOOR2,npc.instanceId) elif npcId == HOUND : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) st1.playSound("ItemSound.quest_middle") partyMember.sendPacket(ExShowScreenMessage("Demonic Lord Naglfar Has Appeared!", 8000)) partyMember.sendPacket(Earthquake(240826,219982,-9985,20,10)) newNpc = self.addSpawn(NAGLFAR,-242754,219982,-9985,306,False,0,False,npc.instanceId) st.giveItems(E_APIGA,2) elif npcId == NAGLFAR : if npc.getInstanceId() in self.worlds: world = self.worlds[npc.getInstanceId()] for partyMember in party.getPartyMembers().toArray(): st1 = partyMember.getQuestState("Bloodshedparty") if not st1: st1 = self.newQuestState(partyMember) partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Hax!! GM GM GM!! WtF!?")) partyMember.sendPacket(ExShowScreenMessage("Congratulations! You Have Defeated Demonic Lord Naglfar.", 12000)) st1.playSound("ItemSound.quest_finish") st.giveItems(E_APIGA,4) newNpc = self.addSpawn(CHEST,-242754,219982,-9985,306,False,0,False,npc.instanceId) return QUEST = Bloodshedparty(-1, qn, "Bloodshedparty") QUEST.addStartNpc(ROSE) QUEST.addTalkId(ROSE) QUEST.addTalkId(CHEST) QUEST.addKillId(NAGLFAR) QUEST.addKillId(HOUND) QUEST.addKillId(SENTRY1) QUEST.addKillId(SENTRY2) if System.currentTimeMillis() < reentertime : InstanceManager.getInstance().getInstanceTime(player.getObjectId(), INSTANCEID) hours = (reentertime-System.currentTimeMillis())/3600000 minutes = ((reentertime-System.currentTimeMillis())%3600000)/60000 seconds = ((reentertime-System.currentTimeMillis())%60000)/1000 player.sendPacket(SystemMessage.sendString("Solo Instance will be available to re-use in " + str(hours) + " hours " + str(minutes) + " minutes and " + str(seconds) + " seconds.")) return False st = player.getQuestState(qn) InstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + TIMELIMIT))) This the Code i added to Party Event for try to get Rejoin Time but get this error: Error on: C:\server\gameserver\data\scripts\instances\Bloodshedparty\__init__.py.error.log Line: -1 - Column: -1 Traceback (innermost last): (no code object) at line 0 SyntaxError: ('invalid syntax', ('__init__.py', 262, 17, '\t\tInstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + TIMELIMIT)))')) I hope someone can help with this, ty.
  18. I don't wanna commands. The situation should be like this: For ex, a player teleport to a special location and there are a mini raid boss, so the player make Double Click in a item and spawn a "Helper" Mob who will hit the Raid Boss to, so this will be Player+Helper Mob Vs Raid. My first idea was: Now i will like to know if for example in "NPCAIDATA" i see there is a celd for "Clan" and "Enemy Clan" so based on this i can make a MOB Enemie of the other Clan fight against each other in this way? But i wonder if the Mob HLPER spawned will hit the Raid or will start hiting the Playerlol, maybe I can Put AGRESSION like you say on the Raid so i think when he land that skill this will affect the HELPER MOB since he will be from a enemie FACTION, i don't try this yet.
  19. Well i would like to have ETCITEMS, WEAPONS and ARMORS like in the olds databases before freya, but update to freya. or almost up to vesper items. If you have this 3 SQL's of a previews version of freya please post here or via PM. =)
  20. I know in last Rev Freya all this move to XML, but if someone have the 3 table in a SQL format will be great for me. Thx in advance. PD: I need use a program for make shop that only work taking the item from the Navicat Database so i need this 3 tables.
  21. With percent and: Reloading the fake pcs: // reload fakenpc To see your changes the the concerned NPCs have to be respawned. http://www.l2jserver.com/forum/download/file.php?id=2487 I have this working perfect with Last Rev for Freya downloaded yesterday from SVN. Credits to LJForum.
  22. FIXED! I need leave loginserver.properties by default and only put the IP in the XML, now server launch perfect.
×
×
  • Create New...