This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Static Xp for Creatures  (Read 1726 times)

spitfire103

  • Registred Member
  • MS Paint Freak
  • *****
  • Posts: 4
    • View Profile
[QUESTION] Static Xp for Creatures
« on: February 08, 2012, 05:41:29 am »
I'm trying to get each creature to give a set amount of Xp per kill instead of calculating the Xp based on levels.

I've already found out how to modify the amount of Xp for any kill. I changed it to 10,000 in the code, I ran it and it worked.

 Plus I tested to see if It would reference the variable "Type" under the "Creature.h" which would then lead to my "creature_names" database on my server. I ran it and that also worked. Wolves were worth 1xp and Kobold Miners were worth 7xp.

The Part I am hung up on is when I add the new variable "Exp"

creature_names
-I add a new row, Datatype Int, Length 10, Unsigned, Default 0

Creature.h
-I add "uint32 Exp;"

Stats.cpp
-I change "Type" to "Exp" in "xp = (victimI->Exp)"

I don't know why it doesn't want to reference my new variable. All I can do is speculate, is there a different part of Arcemu's code that registers the variables for "CreatureInfo"?

I would greatly appreciate any help with my issue.





« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Garthog

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 56
    • View Profile
Re: [QUESTION] Static Xp for Creatures
« Reply #1 on: February 08, 2012, 06:26:09 pm »
You have to assign a value to Exp. Check where are creature_info loaded from DB, and then assign the value to Exp.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

spitfire103

  • Registred Member
  • MS Paint Freak
  • *****
  • Posts: 4
    • View Profile
Re: [QUESTION] Static Xp for Creatures
« Reply #2 on: February 08, 2012, 11:40:14 pm »
I did assign values to Exp in creature_names

Other than creature.cpp I don't know another place where the variable would reference my new line in creature_names.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Rimewynd

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 20
    • View Profile
Re: [QUESTION] Static Xp for Creatures
« Reply #3 on: March 11, 2012, 09:54:19 pm »
This... May or may not be unrelated.

The following applies to Trinity. I dunno if Arcemu's the same, although MaNGOs probably is.

I was trying to do something similar once, and I discovered that only part of the XP given comes from the DBs (DataBases) .

There's a curious bit of code in player.cpp that may also be hamstringing you.

It starts around line 387, with the heading:

"// == KillRewarder ===================================================="

Part of the section's function is actually adjusting the amount of XP the player receives based on the difference in levels.  I'm not really sure how to disable it so I can't give you any more help than that on that end, but even if you're doing everything else right, that bit of code might still be re-balancing how your XP is distributed.

Good luck!
-Rimewynd
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
“The major problem—one of the major problems, for there are several—one of the many major problems..."
 ~ A quote that roughly summarizes my attempts at WoW-modding.