Jump to content
  • 0

[SOLVED] Dummy Damage Meter Not Showing


jamesandrew

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.07
  • Content Count:  58
  • Reputation:   3
  • Joined:  06/21/23
  • Last Seen:  

//===== 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,160,184,0	script	PunchingBag#0	844,{
	end;
	
OnMyMobDead:
OnInit:
	getunitdata(getnpcid(0), .@d);
	monster strnpcinfo(4),.@d[UNPC_X],.@d[UNPC_Y],"Punching Bag",1313,1,strnpcinfo(0)+"::OnMyMobDead";
	.@dupid = atoi(strnpcinfo(2));
	.gid[.@dupid] = $@mobid[0];
	.mhp[.@dupid] = strmobinfo(4,2411);
	setunitdata .gid[.@dupid],UMOB_MODE,.@d[UMOB_MODE]|0x4000000|0x0200000; // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
	initnpctimer;
	end;
	
OnTimer5000:
	.@dupid = atoi(strnpcinfo(2));
	if(unitexists(.gid[.@dupid])){
		getunitdata(.gid[.@dupid],.@d);
		.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
		if(.@diff > 0){
			npctalk "Punching Bag : I've taken " + (.@diff/5) + " DPS in last 5 seconds.";
			setunitdata .gid[.@dupid],UMOB_HP,.mhp[.@dupid];
			specialeffect EF_HEAL;
			setmapflag( "prontera",mf_monster_noteleport );
		}
	}
	initnpctimer;
}

//prontera,224,78,0	duplicate(PunchingBag#0)	PunchingBag#1	844
//prontera,224,66,0	duplicate(PunchingBag#0)	PunchingBag#2	844
//prontera,215,66,0	duplicate(PunchingBag#0)	PunchingBag#3	844
//Welgaia,182,143,0	duplicate(PunchingBag#0)	PunchingBag#4	844
//Welgaia,157,143,0	duplicate(PunchingBag#0)	PunchingBag#5	844
//Welgaia,132,143,0	duplicate(PunchingBag#0)	PunchingBag#6	844

// Mapflag
prontera	mapflag	monster_noteleport


I use edited Mobster (changed max HP) as dummy

Spoiler
- Id: 1313
    AegisName: MOBSTER
    Name: Mobster
    Level: 61
    Hp: 79910000
    BaseExp: 4424
    JobExp: 1688
    Attack: 910
    Attack2: 1128
    Defense: 41
    MagicDefense: 37
    Str: 76
    Agi: 46
    Vit: 20
    Int: 35
    Dex: 76
    Luk: 55
    AttackRange: 1
    SkillRange: 10
    ChaseRange: 12
    Size: Medium
    Race: Demihuman
    Element: Neutral
    ElementLevel: 1
    WalkSpeed: 250
    AttackDelay: 1100
    AttackMotion: 560
    DamageMotion: 580
    Ai: 21
    Drops:
      - Item: Poison_Knife
        Rate: 3
      - Item: Blue_Jewel
        Rate: 4559
      - Item: Ring_
        Rate: 1
      - Item: Red_Gemstone
        Rate: 600
      - Item: Zargon
        Rate: 2500
      - Item: Panacea
        Rate: 450
      - Item: Blue_Potion
        Rate: 60
      - Item: Mobster_Card
        Rate: 1
        StealProtected: true

 

npctalk is not working

Edited by jamesandrew
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

2 hours ago, jamesandrew said:
//===== 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,160,184,0	script	PunchingBag#0	844,{
	end;
	
OnMyMobDead:
OnInit:
	getunitdata(getnpcid(0), .@d);
	monster strnpcinfo(4),.@d[UNPC_X],.@d[UNPC_Y],"Punching Bag",1313,1,strnpcinfo(0)+"::OnMyMobDead";
	.@dupid = atoi(strnpcinfo(2));
	.gid[.@dupid] = $@mobid[0];
	.mhp[.@dupid] = strmobinfo(4,2411);
	setunitdata .gid[.@dupid],UMOB_MODE,.@d[UMOB_MODE]|0x4000000|0x0200000; // Set MD_STATUS_IMMUNE (0x4000000) because EDP/burn/%MHP based status can skew the DPS counter so much.
	initnpctimer;
	end;
	
OnTimer5000:
	.@dupid = atoi(strnpcinfo(2));
	if(unitexists(.gid[.@dupid])){
		getunitdata(.gid[.@dupid],.@d);
		.@diff = (.mhp[.@dupid] - .@d[UMOB_HP]);
		if(.@diff > 0){
			npctalk "Punching Bag : I've taken " + (.@diff/5) + " DPS in last 5 seconds.";
			setunitdata .gid[.@dupid],UMOB_HP,.mhp[.@dupid];
			specialeffect EF_HEAL;
			setmapflag( "prontera",mf_monster_noteleport );
		}
	}
	initnpctimer;
}

//prontera,224,78,0	duplicate(PunchingBag#0)	PunchingBag#1	844
//prontera,224,66,0	duplicate(PunchingBag#0)	PunchingBag#2	844
//prontera,215,66,0	duplicate(PunchingBag#0)	PunchingBag#3	844
//Welgaia,182,143,0	duplicate(PunchingBag#0)	PunchingBag#4	844
//Welgaia,157,143,0	duplicate(PunchingBag#0)	PunchingBag#5	844
//Welgaia,132,143,0	duplicate(PunchingBag#0)	PunchingBag#6	844

// Mapflag
prontera	mapflag	monster_noteleport


I use edited Mobster (changed max HP) as dummy

  Hide contents
- Id: 1313
    AegisName: MOBSTER
    Name: Mobster
    Level: 61
    Hp: 79910000
    BaseExp: 4424
    JobExp: 1688
    Attack: 910
    Attack2: 1128
    Defense: 41
    MagicDefense: 37
    Str: 76
    Agi: 46
    Vit: 20
    Int: 35
    Dex: 76
    Luk: 55
    AttackRange: 1
    SkillRange: 10
    ChaseRange: 12
    Size: Medium
    Race: Demihuman
    Element: Neutral
    ElementLevel: 1
    WalkSpeed: 250
    AttackDelay: 1100
    AttackMotion: 560
    DamageMotion: 580
    Ai: 21
    Drops:
      - Item: Poison_Knife
        Rate: 3
      - Item: Blue_Jewel
        Rate: 4559
      - Item: Ring_
        Rate: 1
      - Item: Red_Gemstone
        Rate: 600
      - Item: Zargon
        Rate: 2500
      - Item: Panacea
        Rate: 450
      - Item: Blue_Potion
        Rate: 60
      - Item: Mobster_Card
        Rate: 1
        StealProtected: true

 

npctalk is not working

change this

 

.mhp[.@dupid] = strmobinfo(4,2411); to 
.mhp[.@dupid] = strmobinfo(4,1313);
  • Upvote 1
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...