Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Serverside Modding => Topic started by: spitfire103 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.
(http://s13.postimage.org/tjfkjmtmb/pic1.jpg) (http://postimage.org/image/tjfkjmtmb/)
(http://s7.postimage.org/qv200adw7/pic2.jpg) (http://postimage.org/image/qv200adw7/)
(http://s13.postimage.org/kpoo2j6nn/pic3.jpg) (http://postimage.org/image/kpoo2j6nn/)
-
You have to assign a value to Exp. Check where are creature_info loaded from DB, and then assign the value to Exp.
-
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.
-
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