ArcEmu: [project] Arcscripts2 - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Labels

Make sure when posting a help or release topic you put [c++] or [lua] BEFORE your topic title!
  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

[project] Arcscripts2 new development of c++ scripts

#21 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 06:04 AM

base can't fully give an example at this moment, but by percent meaning, it should be as float...

and just stop asking about it, because don't know, i answered much enought for it

currently i'm working on classic instances, so busy anyway.
Posted Image
Posted Image
Sorry for my bad english
0

#22 User is offline   aaron02 

  • Member
  • Pip
  • Group: Members
  • Posts: 35
  • Joined: 04-February 09
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 09 December 2011 - 06:48 AM

how can i use it

sry for bad english i am german
0

#23 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 06:58 AM

donwload it in arcemu_source/src (git repository url is git://github.com/arcscripts2/arcscripts2.git) to arcscripts2 folder command:
git clone git://github.com/arcscripts2/arcscripts2.git arcscripts2

go to main source dir and by use this command, ps, you need to apply it only once
git apply src/arcscripts2/patches/arcscripts2_patch.patch


and compile by using arcemu compile guide (can be founded in arcemu wiki).
sorry for bad english, anyway, latelly when i'll get free time, i'll make video tutorial maybe...
Posted Image
Posted Image
Sorry for my bad english
0

#24 User is offline   THCSphere 

  • Member
  • Pip
  • Group: Members
  • Posts: 25
  • Joined: 20-October 09

Posted 09 December 2011 - 08:45 AM

View Postjackpoz, on 09 December 2011 - 04:23 AM, said:

Could you provide an example where you needed it to be float instead of integer?


In another dimension, it could be possible.
0

#25 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 10:47 AM

View PostTHCSphere, on 09 December 2011 - 08:45 AM, said:

In another dimension, it could be possible.


if you have'nt to say something, just do not post... clear?
Posted Image
Posted Image
Sorry for my bad english
0

#26 User is offline   THCSphere 

  • Member
  • Pip
  • Group: Members
  • Posts: 25
  • Joined: 20-October 09

Posted 09 December 2011 - 11:19 AM

View Postsanctum32, on 09 December 2011 - 10:47 AM, said:

if you have'nt to say something, just do not post... clear?


Neither of us have received a response on why you changed it to a float value or why percentages need to be float, on a unsigned int.
0

#27 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 12:16 PM

View PostTHCSphere, on 09 December 2011 - 11:19 AM, said:

Neither of us have received a response on why you changed it to a float value or why percentages need to be float, on a unsigned int.

http://www.wowwiki.com/Base_health
game client rounds health, but by server side i'm sure, that it is float, because look http://old.wowhead.com/spell=66188, for example it does 150% weapon damage on hostile unit, ok, we're taking http://www.wowhead.com/item=51833, this item deals 825-1239 dmg, so, 1239*1.5=1858.5 damage

http://www.wowwiki.com/Spell_damage ... -

now i'm busy with shadowfang keep...
Posted Image
Posted Image
Sorry for my bad english
0

#28 User is offline   THCSphere 

  • Member
  • Pip
  • Group: Members
  • Posts: 25
  • Joined: 20-October 09

Posted 09 December 2011 - 12:30 PM

UNIT_FIELD_HEALTH                         = OBJECT_END + 0x0010, // Size: 1, Type: INT, Flags: DYNAMIC
UNIT_FIELD_MAXHEALTH                      = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: DYNAMIC
UNIT_FIELD_BASE_HEALTH                    = OBJECT_END + 0x009D, // Size: 1, Type: INT, Flags: PRIVATE, OWNER_ONLY


Now, ignore the actual IDs, because I pulled this from my 1.12 server, but notice they are all ints? Health is always handled as an int.

Now take a look at GetHealthPct() (Unit.h)
GetHealthPct() { return (int)((GetUInt32Value(UNIT_FIELD_HEALTH)+1) * 100 / (GetUInt32Value(UNIT_FIELD_MAXHEALTH)+1)); };



Notice it's an int?

You may think that it's a float, but updatefields don't lie. Health is handled as an int and should be managed as one.
0

#29 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 12:31 PM

i have updated GetHealthPercent function..., it does not uses GetHealthPct

EDIT:
damn, true... forgot one more small change.

EDIT2: updated
Posted Image
Posted Image
Sorry for my bad english
0

#30 User is offline   THCSphere 

  • Member
  • Pip
  • Group: Members
  • Posts: 25
  • Joined: 20-October 09

Posted 09 December 2011 - 01:04 PM

View Postsanctum32, on 09 December 2011 - 12:31 PM, said:

i have updated GetHealthPercent function..., it does not uses GetHealthPct

EDIT:
damn, true... forgot one more small change.

EDIT2: updated


Yes, but you don't get it. Changing a function to use a float does not negate the fact health is int, not float. Why are you changing things that have no reason to be changed? They're useless changes that cause scripts to differ from core functions, and it just makes things more difficult.
0

#31 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 01:47 PM

i have answered already... percentage word meaning, spell dmg calculation... and btw, it does not makes it very difficult...

just to another questions related to this function, i'm not going to answer, tired...
Posted Image
Posted Image
Sorry for my bad english
0

#32 User is offline   THCSphere 

  • Member
  • Pip
  • Group: Members
  • Posts: 25
  • Joined: 20-October 09

Posted 09 December 2011 - 01:48 PM

View Postsanctum32, on 09 December 2011 - 01:47 PM, said:

i have answered already...


But you say you're sure it's held as a float.... when I just showed you it's held as an int.
0

#33 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 02:11 PM

if someone has some simple content, which requires scripting, post entries here or on github repo by creating ticket in repository issues section, like as gossips, misc world creatures or just suggestions, which may improve script library.
about instances/raids i can say, that all requires redone... no need to spam about it, report only issues of them atm.

if sometimes someone made addition, make pull request or past it on gist and post it like as "addition" or "fix/correction" on github repo by creating ticket in repository issues section

thanks
Posted Image
Posted Image
Sorry for my bad english
0

#34 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 December 2011 - 05:46 PM

View Postsanctum32, on 09 December 2011 - 12:16 PM, said:

this item deals 825-1239 dmg, so, 1239*1.5=1858.5 damage

Any kind of damage (melee/ranged/spell) is rounded to integer before being applied to Unit (or any other Zobject with health points). This means the possible values in your example could be 1858 or 1859 based on rounding rules of the way the floats are cast to integer but it will surely never be 1858.5 .
If you don't like others to point out your mistakes (which are intended to improve your knowledge and help you, just like what happened at http://arcemu.org/fo...showtopic=25869 , with a developer claiming ArcEmu was bugged just because he didn't know how the used hook wasn't working. I told him what was wrong and he thanked me for the explaination), why did you even put this project public? And I thought that reviewing your code would have made you think "hey, an ArcEmu dev spending time on my changes, I feel proud of my work, let's see if he has some tips and suggestions on what I did". Silly me.

Also about https://github.com/a...57014b8f6e5e001 are you aware that Object have 2 arrays, one storing uint32 values and one storing float values and that the values stored in one array are unrelated to the one stored in the other? I wonder what GetFloatValue(UNIT_FIELD_HEALTH) would return, surely not the health.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#35 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 05:54 PM

nice no one don't know about percentage... jackpoz, i almost always want to say "that you're d***", but probably i'll get ban here if i will write it fully.
i answered here how it should be many times and go to clame trinity and mangos too, because they also got same as i.
i don't want to get applauds or similar like you say, but want to improve, not like you, sitting around and thats it.
Posted Image
Posted Image
Sorry for my bad english
0

#36 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 December 2011 - 06:09 PM

*points at the GetFloatValue(UNIT_FIELD_HEALTH) part*

And you still can't see the difference between the real world math and the WoW-related math. If Blizz decided HP to be an integer, then ArcEmu handles it as integer and it will NEVER hold decimal values, like the .5 in your example.

My Ohloh signature says I committed quite a lot while "sitting" around here and I started as user, like you. Reading your code I doubt you'll end up doing anything remotely similar.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#37 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 06:14 PM

if you don't like, just do not look :)
Posted Image
Posted Image
Sorry for my bad english
0

#38 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 December 2011 - 06:22 PM

Did you mean "if it's plain wrong, just do not look" ?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#39 User is offline   sanctum32 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 118
  • Joined: 28-November 10
  • Gender:Male

Posted 09 December 2011 - 06:43 PM

ah... by you wrong, by me and few other projects this calculation is ok... last my post about it, tired to discuss about same and same, answer same and same answers, and your ignorance... i'm letting to post there what you want, ignoring... i'm using information from wowwiki and some onother...

this topic is just full of fu***** flood... probably arc devs will start work on scripts after 10 or more years... because 2 - 3 years they're not developing, just small touches of crash or stability of scripts sometimes, but no more improvements.

ignoring you "ELITES" and thats it.
Posted Image
Posted Image
Sorry for my bad english
0

#40 User is offline   Notthecrow 

  • Member
  • Pip
  • Group: Members
  • Posts: 30
  • Joined: 27-June 10
  • Gender:Male
  • Server OS:Windows

Posted 09 December 2011 - 07:05 PM

View Postjackpoz, on 09 December 2011 - 04:23 AM, said:

Could you provide an example where you needed it to be float instead of integer?

Maybe when you're looking for 24.79135225 percent instead of 24 percent, or 25 for that matter, since it rounds up unless you use floor right? :)

All in all, this makes me very sad, and the fact that I posted without realizing there are 2 pages makes me a bit embarrassed :P
Ghost in my mind, you used to be, so alive...
1

Share this topic:


  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users