Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skills/hit miss on *clone/@evilclone summons #2607

Open
worstgamedev opened this issue Jan 8, 2020 · 3 comments
Open

skills/hit miss on *clone/@evilclone summons #2607

worstgamedev opened this issue Jan 8, 2020 · 3 comments

Comments

@worstgamedev
Copy link

@worstgamedev worstgamedev commented Jan 8, 2020

Describe the bug
Using clone script command and @evilclone in game to summon a clone of a player, it can attack, hit but others can't hit it with skills and normal attacks. It will either go miss or dodged.

To Reproduce
Steps to reproduce the behavior:

  1. This is script used
    `prontera,155,95,5 script Shroud#001 4_M_REBELLION,{

    $@clonegid = clone("prontera",158,84,"Shroud#001::OnTrigger",getcharid(0));
    setunitdata $@clonegid,UDT_HAIRCOLOR,rand(1,10);
    setunitdata $@clonegid,UDT_ATKRANGE,10;
    setunitdata $@clonegid,UDT_AI,2;
    setunitdata $@clonegid,UDT_CLASS,2110;
    setunitdata $@clonegid,UDT_HIT,500;
    setunitdata $@clonegid,UDT_FLEE,0;

    announce($@clonegid,bc_all);

    .@atkrange = getunitdata($@clonegid,UDT_ATKRANGE);
    announce(.@atkrange,bc_all);

    .@udthcolor = getunitdata($@clonegid,UDT_HAIRCOLOR);
    announce(.@udthcolor,bc_all);

    .@udtai = getunitdata($@clonegid,UDT_AI);
    announce(.@udtai,bc_all);

    .@udtclass = getunitdata($@clonegid,UDT_CLASS);
    announce(.@udtclass,bc_all);

    .@udthit = getunitdata($@clonegid,UDT_HIT);
    announce(.@udthit,bc_all);

    .@udtflee = getunitdata($@clonegid,UDT_FLEE);
    announce(.@udtflee,bc_all);
    end;

    OnTrigger:
    announce($@clonegid + " clone died.", bc_all);

    OnNPCKillEvent:
    announce(killedrid + " died in a miserable way.", bc_blue|bc_all);

}`

Expected behavior
Summon a clone which can attack players and other clones and also pickup items.
Player and other clones could also attack and damage them.

Screenshots
misss

System specs (please complete the following information):

  • OS: [Windows 10 version 1909]
  • Hercules Version [Release v2019.12.15]
  • Mode: [pre-renewal]
  • Packet version: [20151104]
  • Client type: [2015-11-04aRagexe]

Plugins used or source modifications
None, fresh compile from git. NEMO patch for client.

Additional context
So when I summon clones and attack them with skills or basic attack, it will result to miss, dodge
or no damage at all. I tried to use setunitdata for def mdef flee dodge to lowest number possible to but still not working. I also tried different ai and modes to see if that is the problem still not works.
Im new to scripting and I want to make an event where I summon clone if player is not enough in a room.

@Kenpachi2k13

This comment has been minimized.

Copy link
Member

@Kenpachi2k13 Kenpachi2k13 commented Jan 15, 2020

This is caused by mob_clone_spawn() creating an empty struct mob_db without assigning a value to dmg_taken_rate. Thus dmg_taken_rate is 0 and makes the clone invulnerable.

@Emistry

This comment has been minimized.

Copy link
Member

@Emistry Emistry commented Jan 16, 2020

if i recall correctly, this issue happen way before the DamageTakenRate was implemented.

@Kenpachi2k13

This comment has been minimized.

Copy link
Member

@Kenpachi2k13 Kenpachi2k13 commented Jan 16, 2020

I don't know, but this is definitively the issue.
For example, battle_weapon_attack() applies this rate:

	if (target->type == BL_MOB) {
		struct mob_data *md = BL_CAST(BL_MOB, target);
		if (md != NULL) {
			if (md->db->dmg_taken_rate != 100) {
				if (wd.damage > 0)
					wd.damage = apply_percentrate64(wd.damage, md->db->dmg_taken_rate, 100);
				if (wd.damage2 > 0)
					wd.damage2 = apply_percentrate64(wd.damage2, md->db->dmg_taken_rate, 100);
			}
		}
	}

Since dmg_taken_rate is 0 here, the damage becomes 0, too...
I tested adding db->dmg_taken_rate = 100; to mob_clone_spawn() and the result was, that I was able to hit the clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.