Page 2 of 4

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 1:04 pm
by momo61
bug report:

If you log in for the first time, you can recieve buffs with no problem. if you relog, you can recieve buffs with no problem.

But, if you press on player or pet one time and then relog, you will not recieve buffs on your player by default. The npc will take the Adena, but you wont recieve buffs. You must press player or pet and then buff again.

SO: If you never press player/pet option, you wont have problems. BUT if you do press player/pet once, you will not recieve buffs once you relog again, unless you press Player/pet again.

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 1:07 pm
by janiii
imo an own bypass should be done for pet buffs.

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 2:25 pm
by momo61
it'd be cool if it were to get committed, since it's really useful :)

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 7:19 pm
by Probe
Actually I was thinking something better, a new instance L2NpcPetBuffer inhereting L2NpcBuffer,
and simply using same bypasses on the player's getPet() always, and not on player

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 7:22 pm
by JIV
and spawning two npc for buffs?

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 7:23 pm
by Probe
yes, one for players one for pets, less confusing imo

Re: Pet Core NPC Buffer?

Posted: Fri Jan 22, 2010 10:15 pm
by momo61
nah, imo 1 npc is more than enough. looks more professional.

Re: Pet Core NPC Buffer?

Posted: Sat Jan 23, 2010 12:51 am
by Copyleft
can be done easier...

leave everything as it was before, but instead of applying effect on player, apply it on player's target. If player's target is not his pet, he will buff himself. If player's target is the pet, he will buff the pet. :D

Re: Pet Core NPC Buffer?

Posted: Sat Jan 23, 2010 6:13 am
by Probe
pretty sure the player has to be targetting npc for the menus etc :p

Re: Pet Core NPC Buffer?

Posted: Sat Jan 23, 2010 8:14 am
by denser
i done remake scheme buffer by House - for pet and for player, with auto icons for buffs, command for reload buffs for editing. try to as soon as possible share it on your eyes) may be you interesting in it)

you can test it on my PvP server if you want) but it on russian, http://la2s.a42.ru - link)

Re: Pet Core NPC Buffer?

Posted: Sat Jan 23, 2010 12:47 pm
by momo61
uhm... well the thing is ... the current core npc buffer is kinda outdated and needs some cleanup :)

Re: Pet Core NPC Buffer?

Posted: Sat Jan 23, 2010 3:36 pm
by Probe
feel free to post a new version :) html editting isn't hard

Re: Pet Core NPC Buffer?

Posted: Sun Jan 24, 2010 7:42 pm
by momo61
come on guys, pay some attention to this.

i vote for a committ if its working properly. I tested it and it works properly.

Re: Pet Core NPC Buffer?

Posted: Sun Jan 24, 2010 9:05 pm
by janiii
I dont like the target thingie. I would be more for new own bypass for pet buff/heal/remove.

Code: Select all

Index: java/com/l2jserver/gameserver/model/actor/instance/L2NpcBufferInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2NpcBufferInstance.java	(revision 4293)+++ java/com/l2jserver/gameserver/model/actor/instance/L2NpcBufferInstance.java	(working copy)@@ -23,7 +23,9 @@ import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.model.L2ItemInstance; import com.l2jserver.gameserver.model.L2Skill;+import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc;+import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.network.SystemMessageId; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;@@ -31,7 +33,6 @@ import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager; import com.l2jserver.gameserver.templates.chars.L2NpcTemplate; - public class L2NpcBufferInstance extends L2Npc { 	static final Logger _log = Logger.getLogger(L2NpcBufferInstance.class.getName());@@ -74,6 +75,20 @@ 		if (player == null || player.getLastFolkNPC() == null || player.getLastFolkNPC().getObjectId() != this.getObjectId()) 			return; +		L2Character target = player;+		+		if (command.startsWith("Pet"))+		{+			L2Summon pet = player.getPet();+			if (pet == null)+			{+				player.sendMessage("You do not have your pet summoned.");+				showChatWindow(player, 0); // 0 = main window+				return;+			}+			target = pet;+		}+		 		int npcId = getNpcId();  		if (command.startsWith("Chat"))@@ -84,9 +99,9 @@  			showChatWindow(player, val); 		}-		else if (command.startsWith("Buff"))+		else if (command.startsWith("Buff") || command.startsWith("PetBuff")) 		{-			String[] buffGroupArray = command.substring(5).split(" ");+			String[] buffGroupArray = command.substring(command.indexOf(" ") + 1).split(" ");  			for (String buffGroupList : buffGroupArray) 			{@@ -144,43 +159,43 @@ 				skill = SkillTable.getInstance().getInfo(skillId, skillLevel);  				if (skill != null)-					skill.getEffects(player, player);+					skill.getEffects(player, target); 			}-+			 			showChatWindow(player, pageVal.get(player.getObjectId())); 		}-		else if (command.startsWith("Heal"))+		else if (command.startsWith("Heal") || command.startsWith("PetHeal")) 		{-			if (!player.isInCombat() && !AttackStanceTaskManager.getInstance().getAttackStanceTask(player))+			if (!target.isInCombat() && !AttackStanceTaskManager.getInstance().getAttackStanceTask(target)) 			{-				String[] healArray = command.substring(5).split(" ");+				String[] healArray = command.substring(command.indexOf(" ") + 1).split(" ");  				for (String healType : healArray) 				{ 					if (healType.equalsIgnoreCase("HP")) 					{-						player.setCurrentHp(player.getMaxHp());+						target.setCurrentHp(target.getMaxHp()); 					} 					else if (healType.equalsIgnoreCase("MP")) 					{-						player.setCurrentMp(player.getMaxMp());+						target.setCurrentMp(target.getMaxMp()); 					} 					else if (healType.equalsIgnoreCase("CP")) 					{-						player.setCurrentCp(player.getMaxCp());+						target.setCurrentCp(target.getMaxCp()); 					} 				} 			}-			showChatWindow(player, 0); // 0 = main window+			showChatWindow(player, pageVal.get(player.getObjectId())); 		}-		else if (command.startsWith("RemoveBuffs"))+		else if (command.startsWith("RemoveBuffs") || command.startsWith("PetRemoveBuffs")) 		{-			player.stopAllEffectsExceptThoseThatLastThroughDeath();-			showChatWindow(player, 0); // 0 = main window+			target.stopAllEffectsExceptThoseThatLastThroughDeath();+			showChatWindow(player, pageVal.get(player.getObjectId())); 		} 		else 		{ 			super.onBypassFeedback(player, command); 		} 	}-}\ No newline at end of file+}

Re: Pet Core NPC Buffer?

Posted: Sun Jan 24, 2010 11:06 pm
by momo61
shall I test your patch janiii ?