Jump to content
  • 0

disable heal on mobs


Question

Recommended Posts

  • 0
Posted

Index: com/l2jfrozen/gameserver/handler/skillhandlers/Heal.java
===================================================================
--- com/l2jfrozen/gameserver/handler/skillhandlers/Heal.java	(revision 948)
+++ com/l2jfrozen/gameserver/handler/skillhandlers/Heal.java	(working copy)
@@ -25,8 +25,11 @@
import com.l2jfrozen.gameserver.model.L2Object;
import com.l2jfrozen.gameserver.model.L2Skill;
import com.l2jfrozen.gameserver.model.L2Skill.SkillType;
+import com.l2jfrozen.gameserver.model.actor.instance.L2GrandBossInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2DoorInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.model.actor.instance.L2RaidBossInstance;
import com.l2jfrozen.gameserver.network.SystemMessageId;
import com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate;
import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
@@ -90,6 +93,13 @@
			// We should not heal walls and door
			if(target instanceof L2DoorInstance)
				continue;
+				
+            if (target instanceof L2RaidBossInstance) 
+                continue; 
+            if (target instanceof L2GrandBossInstance) 
+                continue; 
+            if (target instanceof L2MonsterInstance) 
+                continue; 				

			// Player holding a cursed weapon can't be healed and can't heal
			if(target != activeChar)

 

If the guy tried this, but he still can heal mobs then:

1.He does something wrong appling the patch.

2.There are maybe more mob instances that you didnt add.

3.He haven't test without gm access.

 

or

 

4.The healing skills listen to a different file(?)

  • 0
Posted

If the guy tried this, but he still can heal mobs then:

1.He does something wrong appling the patch.

2.There are maybe more mob instances that you didnt add.

3.He haven't test without gm access.

 

or

 

4.The healing skills listen to a different file(?)

you can try to apply it on l2jfrozen and then tell me for the 1,2,3

  • 0
Posted

that's what i think....but it doesnt work try it if you don't believe me

 

try this and think before do something

if(player != null && target instanceof L2MonsterInstance)
		{
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}

 

and add the other shits too instanceof L2GrandBossInstance bla bla :)

  • 0
Posted

			// We should not heal walls and door
		if(target instanceof L2DoorInstance)
			continue;

		+if(player != null && target instanceof L2MonsterInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
		+
		+if(player != null && target instanceof L2RaidBossInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
		+
		+if(player != null && target instanceof L2GrandBossInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
                        +if(player != null && target instanceof L2NpcInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}

		// Player holding a cursed weapon can't be healed and can't heal
		if(target != activeChar)

 

is this the right place to put the code? if it is it doesnt work

  • 0
Posted

			// We should not heal walls and door
		if(target instanceof L2DoorInstance)
			continue;

		+if(player != null && target instanceof L2MonsterInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
		+
		+if(player != null && target instanceof L2RaidBossInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
		+
		+if(player != null && target instanceof L2GrandBossInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}
                        +if(player != null && target instanceof L2NpcInstance)
		+{
		+	player.sendPacket(ActionFailed.STATIC_PACKET);
		+}

		// Player holding a cursed weapon can't be healed and can't heal
		if(target != activeChar)

 

is this the right place to put the code? if it is it doesnt work

yes you can put it there... but if you want you can make it better for example:

 

i don't remember now if the method is boolean or void... to add a return method and make it something like this :

if(player != null && target instanceof L2MonsterInstance || target instanceof L2RaidBossInstance || target instanceof L2GrandBossInstance || target instanceof L2NpcInstance)
{
		player.sendPacket(ActionFailed.STATIC_PACKET);
return false;//if is boolean 
return; //if is void 
}

about the return add it as i say in the code if its boolean add "rerutn false;" if its void add "return;"

  • 0
Posted

yes you can put it there... but if you want you can make it better for example:

 

i don't remember now if the method is boolean or void... to add a return method and make it something like this :

if(player != null && target instanceof L2MonsterInstance || target instanceof L2RaidBossInstance || target instanceof L2GrandBossInstance || target instanceof L2NpcInstance)
{
		player.sendPacket(ActionFailed.STATIC_PACKET);
return false;//if is boolean 
return; //if is void 
}

about the return add it as i say in the code if its boolean add "rerutn false;" if its void add "return;"

It's Void
  • 0
Posted

// We should not heal Npcs
					if(target instanceof L2NpcInstance)
						continue;

		// We should not heal Monsters
					if(target instanceof L2MonsterInstance)
						continue;	

		// We should not heal Raidboss
					if(target instanceof L2RaidBossInstance)
						continue;	

		// We should not heal Grandboss
					if(target instanceof L2GrandBossInstance)
						continue;	

 

I added that after

for(L2Object target2 : targets)
	{
		target = (L2Character) target2;

And it doesnt work

Do the simple way, instead of those all checks, do only 1

if(target instanceof L2Attackable)
						continue;

  • 0
Posted

in

com.l2jfrozen.gameserver.network.clientpackets.RequestMagicSkillUse

before this line:

activeChar.useMagic(skill, _ctrlPressed, _shiftPressed);

write this:

			if ((skill.getSkillType() == SkillType.HEAL || skill.getSkillType() == SkillType.HEAL_PERCENT || skill.getSkillType() == SkillType.HEAL_STATIC) && activeChar.getTarget() instanceof L2Attackable) {
			activeChar.sendMessage("You can't heal monsters!");
			return;
		}

Guest
This topic is now closed to further replies.


×
×
  • Create New...