Jump to content
  • 0
Kuroyama

Punching Bag

Question

-	script	Punching Bag	-1,{
OnInit:
OnDummyKill:
    monster "prontera",118,153,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
    end;
}

I got this one but it's not spawning after getting killed. And when you constantly kill this punching bag, it'll not respawn sooner.

What I want is a permanent punching bag that always spawned after killed.

Anyone mind to help with this?

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

no idea why that script doesn't work, it works fine in my test server

but if you want a punching bag that can never be kill, then use setunitdata and make it crazy high hp

-	script	Punching Bag	FAKE_NPC,{
OnInit:
	.mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit");
	setunitdata .mobid, UDT_MAXHP, 2000000000;
OnTimer10000:
	setunitdata .mobid, UDT_HP, 2000000000;
	initnpctimer;
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0
On 10/21/2020 at 4:40 AM, AnnieRuru said:

no idea why that script doesn't work, it works fine in my test server

but if you want a punching bag that can never be kill, then use setunitdata and make it crazy high hp

- script Punching Bag FAKE_NPC,{ OnInit: .mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit"); setunitdata .mobid, UDT_MAXHP, 2000000000; OnTimer10000: setunitdata .mobid, UDT_HP, 2000000000; initnpctimer; end; }


-	script	Punching Bag	FAKE_NPC,{
OnInit:
	.mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit");
	setunitdata .mobid, UDT_MAXHP, 2000000000;
OnTimer10000:
	setunitdata .mobid, UDT_HP, 2000000000;
	initnpctimer;
	end;
}

 

Screenshot_6.png.42275ccdacf368e681523f0ef1d92aca.png

Share this post


Link to post
Share on other sites
  • 0

uhm weird, did you kill the mob for some reason?, the warning that you have is telling you that the previous object was lost.

Share this post


Link to post
Share on other sites
  • 0

must be caused by `@killmonster` or something like that

just tested `@killmonster` or `@killmonster2` will trigger the monster label, so ... shouldn't happen this way

script `*killmonster` or `*killmonsterall` ??
then there's the problem .....

 

-	script	Punching Bag	FAKE_NPC,{
OnInit:
	.mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit");
	setunitdata .mobid, UDT_MAXHP, 2000000000;
OnTimer10000:
	if (getunittype(.mobid) == -1) end;
	setunitdata .mobid, UDT_HP, 2000000000;
	initnpctimer;
	end;
}

I thought the *unitexists script command is useless so I never made a pull request for it

but in this case ... we really need a console warning to tell that barricade is gone so ....

 

I also wonder how this barricade can go missing in the first place

 

Share this post


Link to post
Share on other sites
  • 0
On 11/20/2020 at 11:05 AM, AnnieRuru said:

must be caused by `@killmonster` or something like that

just tested `@killmonster` or `@killmonster2` will trigger the monster label, so ... shouldn't happen this way

script `*killmonster` or `*killmonsterall` ??
then there's the problem .....

 

- script Punching Bag FAKE_NPC,{ OnInit: .mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit"); setunitdata .mobid, UDT_MAXHP, 2000000000; OnTimer10000: if (getunittype(.mobid) == -1) end; setunitdata .mobid, UDT_HP, 2000000000; initnpctimer; end; }


-	script	Punching Bag	FAKE_NPC,{
OnInit:
	.mobid = monster("prontera",158,183, "Punching Bag", BARRICADE, 1, "Punching Bag::OnInit");
	setunitdata .mobid, UDT_MAXHP, 2000000000;
OnTimer10000:
	if (getunittype(.mobid) == -1) end;
	setunitdata .mobid, UDT_HP, 2000000000;
	initnpctimer;
	end;
}

I thought the *unitexists script command is useless so I never made a pull request for it

but in this case ... we really need a console warning to tell that barricade is gone so ....

 

I also wonder how this barricade can go missing in the first place

 

image.png.6fd20ddf4f31bd4d1ecca12d583754ac.png

Is this a warm warning ms. @AnnieRuru?

Share this post


Link to post
Share on other sites
  • 0
On 10/21/2020 at 2:55 AM, fiction said:

i think this one is more complete, https://rathena.org/board/files/file/3445-punching-bag-with-dps-counter/

 

need to be convert to herc

Spoiler

//===== rAthena Script =============================================
//= Punching Bag NPC
//===== By: ========================================================
//= Secretdataz
//===== Current Version: ===========================================
//= 0.2
//===== Changelog: =================================================
//= 0.1 Initial commit
//= 0.2 Add MD_KNOCKBACK_IMMUNE
//===== Compatible With: ===========================================
//= rAthena Project
//===== Additional Comments: =======================================
//= When duplicating this NPC. Only use NUMBER after the # [secret]
//==================================================================
prontera,224,79,0    script    PunchingBag#0    HIDDEN_NPC,{
    end;
    
OnMyMobDead:
OnInit:
    killmonster("prontera",strnpcinfo(NPC_NAME)+"::OnMyMobDead");
    getmapxy(.map$,.mapx,.mapy,UNITTYPE_NPC,strnpcinfo(NPC_NAME));
    .mobid = monster(strnpcinfo(NPC_MAP),.mapx,.mapy,"Punching Bag",1905,1,strnpcinfo(NPC_NAME)+"::OnMyMobDead");
    .@dupid = atoi(strnpcinfo(NPC_NAME_HIDDEN));
    .gid[.@dupid] = .mobid;
    setunitdata(.gid[.@dupid],UDT_MODE,UDT_MODE|0x00020|0x08000); // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
    setunitdata(.gid[.@dupid],UDT_MAXHP,99999999);
    setunitdata(.gid[.@dupid],UDT_HP,99999999);
    .mhp[.@dupid] = getunitdata(.gid[.@dupid],UDT_MAXHP);
    initnpctimer();
    end;
    
OnTimer5000:
    .@dupid = atoi(strnpcinfo(NPC_NAME_HIDDEN));
    if(getunittype(.gid[.@dupid]) == 3){
        .@mhp = getunitdata(.gid[.@dupid],UDT_HP);
        .@diff = (.mhp[.@dupid] - .@mhp);
        if(.@diff > 0){
            npctalk "J'ai pris " + (.@diff/5) + " de DPS en 5 secondes.";
            setunitdata(.gid[.@dupid],UDT_HP,.mhp[.@dupid]);
            specialeffect EF_HEAL;
        }
    }
    initnpctimer;
    end;

}

prontera,216,79,0    duplicate(PunchingBag#0)    PunchingBag#1    HIDDEN_NPC
prontera,224,70,0    duplicate(PunchingBag#0)    PunchingBag#2    HIDDEN_NPC
prontera,216,58,0    duplicate(PunchingBag#0)    PunchingBag#3    HIDDEN_NPC
prontera,224,58,0    duplicate(PunchingBag#0)    PunchingBag#4    HIDDEN_NPC
prontera,216,46,0    duplicate(PunchingBag#0)    PunchingBag#5    HIDDEN_NPC
prontera,224,46,0    duplicate(PunchingBag#0)    PunchingBag#6    HIDDEN_NPC

prontera,252,80,0    duplicate(PunchingBag#0)    PunchingBag#7    HIDDEN_NPC
prontera,260,80,0    duplicate(PunchingBag#0)    PunchingBag#8    HIDDEN_NPC
prontera,252,70,0    duplicate(PunchingBag#0)    PunchingBag#9    HIDDEN_NPC
prontera,260,70,0    duplicate(PunchingBag#0)    PunchingBag#10    HIDDEN_NPC
prontera,252,58,0    duplicate(PunchingBag#0)    PunchingBag#11    HIDDEN_NPC
prontera,260,58,0    duplicate(PunchingBag#0)    PunchingBag#12    HIDDEN_NPC
prontera,252,46,0    duplicate(PunchingBag#0)    PunchingBag#13    HIDDEN_NPC
prontera,260,46,0    duplicate(PunchingBag#0)    PunchingBag#14    HIDDEN_NPC
 

Doing it like this, they work perfectly.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.