Jump to content
  • 0

disable heal on mobs


Napster321

Question

Recommended Posts

  • 0

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(?)

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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 :)

Link to comment
Share on other sites

  • 0

			// 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

Link to comment
Share on other sites

  • 0

			// 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;"

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

// 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;

Link to comment
Share on other sites

  • 0

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;
		}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...