Jump to content
  • 0

Max Damage


Variant

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

I've been trying to figure out 'clif_skill_damage' and 'clif_damage' in src\map\clif.c and was wondering if it's possible for it to show damage above 999,999 by showing damage/1000 + "k"

So 1,020,342 damage would show up as 1020k.

Just having it display the number is easy enough, and I just made it show an effect whenever the damage exceeds 1 million, but if anyone knows how I could get it to show the letter at the end, that'd be much appreciated! Or even how I could change the color of the numbers shown.

For reference, I'm using rAthena rev. 15399 and the 2011-06-14b RagexeRE client.

  • Upvote 1
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

Uh, bump again, but this time with a reason.

I couldn't figure out how to display the 'k', but I did figure out how to display up to 9 digits. Using OllyDbg, with a lot of guidance from Ai4rei, I managed to rewrite the routine for how the client displays the digits (simplified the ridiculous mess of lines into one loop).

For those interested, search for CMP ECX,0F423F in the main module, and read on from there. The digits are all stored in an array, and the usual method of extracting digits is

00785BC4	 B8 67666666	MOV EAX,66666667
00785BC9	 F7E9		   IMUL ECX
00785BCB	 C1FA 02		SAR EDX,2
00785BCE	 8BC2		   MOV EAX,EDX
00785BD0	 C1E8 1F		SHR EAX,1F
00785BD3	 03C2		   ADD EAX,EDX
00785BD5	 8D1480		 LEA EDX,DWORD PTR DS:[EAX+EAX*4]
00785BD8	 03D2		   ADD EDX,EDX
00785BDA	 2BCA		   SUB ECX,EDX
00785BDC	 894C24 40	  MOV WHATEVERYOURARRAYIS,ECX
00785BE0	 8BC8		   MOV ECX,EAX

Which can be rewritten pretty easily, since all it does is divide the damage by 10 and store the remainder in an array (in my case, where ESP+20 + 4xDigit# was pointing).

IDIV 0A does the same thing, I just wrote a loop to save space, whether or not it's faster or slower... well, it's less instructions.. right? Haha, it's negligible either way I suppose. I guess theoretically you could go up to even higher values... I'll pass on ever having players deal 2 billion damage though.

For reference, I used the 06-14-11 client, your addresses probably won't be the same because my client was already edited elsewhere, but it's the same concept.

Edit:

Since this problem is solved, I guess this topic can be closed? I don't know the policy.

Edit2:

I think this also should go into client support.

Edited by Variant
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   33
  • Joined:  12/24/11
  • Last Seen:  

I've been trying to figure out 'clif_skill_damage' and 'clif_damage' in srcmapclif.c and was wondering if it's possible for it to show damage above 999,999 by showing damage/1000 + "k"

So 1,020,342 damage would show up as 1020k.

Just having it display the number is easy enough, and I just made it show an effect whenever the damage exceeds 1 million, but if anyone knows how I could get it to show the letter at the end, that'd be much appreciated! Or even how I could change the color of the numbers shown.

For reference, I'm using rAthena rev. 15399 and the 2011-06-14b RagexeRE client.

Afaik, it only sends over the number and the client automatically formats the string with dots. So you can't send over letters. If somebody proves me wrong, pease tell me!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

Afaik, it only sends over the number and the client automatically formats the string with dots. So you can't send over letters. If somebody proves me wrong, pease tell me!

That's the conclusion I came to also, even if I tried to send over a string, one way or another it'd just become a large number. I guess it really isn't possible, oh well, thanks for verifying that for me.

Is there anyway to change the color? Or maybe make it have the double attack yellow 'floating' letter? In 'clif_skill_damage' that is.

Edited by Variant
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

*Bump*

(I read the rules and it said not to bump repetitively, so just once is fine, right? Sorry if I misunderstood!)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   3
  • Joined:  04/02/12
  • Last Seen:  

can you make a step by step guide :D im lost /sob

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

Hard Code

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  402
  • Reputation:   89
  • Joined:  02/07/13
  • Last Seen:  

*Bump*

 

 

Hi,

 

I have some trouble to make it work.

I searched CMP ECX,0F423F and found it.

But then, have i to add your sequence or to remplace the sequence in main module by begin at the line where i found CMP ECX,0F423F

And finally MOV WHATEVERYOURARRAYIS,ECX 

this sequence doesn't work, it says : identifier not found

 

Thanks

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