Jump to content
  • 0

Punching Bag stack


peculiarro

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  05/17/17
  • Last Seen:  

-	script	Punching Bag	-1,{

OnInit:
	setmapflag("prontera",mf_monster_noteleport);
	setmapflag("morocc",mf_monster_noteleport);
	setmapflag("comodo",mf_monster_noteleport);
	setmapflag("louyang",mf_monster_noteleport);

	monster "comodo",191,141,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "morocc",170,85,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "prontera",136,171,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "louyang",207,48,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";

	end;

OnDummyKill:
	monster "comodo",191,141,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "morocc",170,85,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "prontera",136,171,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "louyang",207,48,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	end;

OnPCAttackEvent:
	if ( !@test_punch ) end;
	@dps_damage += @damage;
	end;

}

When I cast storm gust after killing many punching bags, they stack :(

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

Your script spawns the bags for other towns when a bag is killed, so it's normal that they stack. You need to improve the respawn code.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

2 hours ago, peculiarro said:

-	script	Punching Bag	-1,{

OnInit:
	setmapflag("prontera",mf_monster_noteleport);
	setmapflag("morocc",mf_monster_noteleport);
	setmapflag("comodo",mf_monster_noteleport);
	setmapflag("louyang",mf_monster_noteleport);

	monster "comodo",191,141,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "morocc",170,85,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "prontera",136,171,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "louyang",207,48,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";

	end;

OnDummyKill:
	monster "comodo",191,141,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "morocc",170,85,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "prontera",136,171,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	monster "louyang",207,48,"Punching Bag",1905,1,"Punching Bag::OnDummyKill";
	end;

OnPCAttackEvent:
	if ( !@test_punch ) end;
	@dps_damage += @damage;
	end;

}

When I cast storm gust after killing many punching bags, they stack :(

If I may suggest, you can have more than 1 approach here but I'd have 2 for you

1. Separate each monster script's OnDummyKill. (i.e. comodo -> OnDummyKillComodo, etc.)

2. Use OnNPCKillEvent and do a map check there.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  05/17/17
  • Last Seen:  

22 hours ago, Ninja said:

If I may suggest, you can have more than 1 approach here but I'd have 2 for you

1. Separate each monster script's OnDummyKill. (i.e. comodo -> OnDummyKillComodo, etc.)

2. Use OnNPCKillEvent and do a map check there.

Thank you! Did your 1st solution

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