View Full Version : Need help with C++ changing stamina health bonus, PLS look
Hello again, I need some help... Ok, so I want to make the health bonus from stamina more than just 10hp/STA point I was looking through the scripts in my source and found the C++ file called statsystem.cpp and in it i found the code
float Player::GetHealthBonusFromStamina()
{
float stamina = GetStat(STAT_STAMINA);
float baseStam = stamina < 20 ? stamina : 20;
float moreStam = stamina - baseStam;
return baseStam + (moreStam*10.0f);
I was wondering if it was just a simple edit like
float Player::GetHealthBonusFromStamina()
{
float stamina = GetStat(STAT_STAMINA);
float baseStam = stamina < 20 ? stamina : 20;
float moreStam = stamina - baseStam;
return baseStam + (moreStam*500.0f);
I dont want to have to recompile the core and stuff if i dont have to so if anyone knows please let me know if this is right.
Also, is there any kind of SQL file i could make to change all of the items at once to have like x20 STA and stuff pls let me know
Thanks again,
Kandi
Avidgamer
19-08-10, 08:32 AM
I believe the "moreStam*500.0f);" is the correct section.
However, I'm NOT sure if there is a way to change EVERY item to have 20x more stamina than it has, this would probably need to be an Update MySQL with all the items you want changed (which will be used in your server) rather than all the pointless ones that nobody ever needs nor wants.
Have a look through all the items you'll be using, and try to update them with a SQL file (You may need to make it yourself, however if your having difficulties I'll help)..
Sorry, lol no way i am letting anyone else go through changine every item that I will be using haha, its gonna suck. But I just tested changing the bonuses in the source and it works beautifully so I will just stick with that rather than trying to change all the files in my items table. Thanks for the help...again
Kandi ;D
Avidgamer
19-08-10, 01:48 PM
No problem :) Have fun :P
OK, so I have changed the attack power, stamina and all that sort of stuff. I now need to change the spell power but the values are all wierd and have like ++i and stuff instead of the 0.00f like in the other one, if someone can help with this i would be happy and ill +rep you if i haven't already lol
<3 Kandi
Avidgamer
19-08-10, 09:58 PM
Can you please copy the code you want to change (that being the SP stat) and paste it into a reply.
Makes it easier for us to help :)
OK, well I beleive this is the code
void Player::ApplySpellPowerBonus(int32 amount, bool apply)
{
m_baseSpellPower+=apply?amount:-amount;
// For speed just update for client
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_ POS, amount, apply);
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_P OS+i, amount, apply);;
}
void Player::UpdateSpellDamageAndHealingBonus()
{
// Magic damage modifiers implemented in Unit::SpellDamageBonusDone
// This information for client side use only
// Get healing bonus for all schools
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_PO S, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
// Get damage bonus for all schools
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS +i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)));
}
I just dont know what i have to do with it... I want to make spell power higher using the necessary stats to do so...sorry when it comes to this i have no idea what is going on...kinda just wingin it and trying to learn while I do it
Kandi ;D
MikExV™
20-08-10, 12:17 AM
I'd recommend changing the spell power in the config befor chaning in the core.
Avidgamer
20-08-10, 07:27 AM
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS +i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)));
I believe you would edit that line. Could possibly be the "1" that you'd need to change, but I'm not sure. If you dont want to risk it, leave it as it is.
OK, well i have decided to just change all of the items because i have found that it is fun and relaxing....hahaha, maybe thats why i wanna shoot myself? lol anyways all I had for now was 1 more question is there a way to make an sql file that would change all items in my database to BoE?
P.S. I use Mangos
Kandi;D
Oh and as for changing the core...NO MORE until i learn more haha something went seriously wrong and now its un fixable lol
Avidgamer
20-08-10, 03:00 PM
About the SQL can't be sure, I've not really used Mangos much with DBs. There must be a way, but I'm not 100% sure, I'll have a look if you like.
Sure I mean if you could find something, dont trouble yourself too much on my account lol Ill check around more too.
Kandi
Avidgamer
20-08-10, 04:27 PM
Shouldn't be to hard to find it, I'll google it now quickly.
I think this may work:
UPDATE TABLENAME SET field1=NEWVALUE
Change the "TABLENAME" with I think, "Items" - though I'm not sure what it's
named in Mangos. Then, change "Field1" to whatever the extended cost field
name is, it may be "ExtendedPrice". Then change "NEWVALUE" to the ID of the
token.
e.g.
UPDATE Items SET ExtendedPrice=1234
OMG, worked beautifully every single item in my database is Bind on Equip now thanks you so much...to tell you the truth I was kind of expecting something to go horribly wrong so I created a backup of my mangos DB lol
Thank you so much though, ill rep you when I can...I just need to find someone else that is repworthy first so I can rep you again lol
Kandi <3
Update `item_template` set `type` = ID where `type` = ID;
Replace ID with the value to make an item BoE & change type to the correct column if its not .
Something like that, i dont know the values to make it BoE. Go hunt :D
Avidgamer
20-08-10, 07:57 PM
OMG, worked beautifully every single item in my database is Bind on Equip now thanks you so much...to tell you the truth I was kind of expecting something to go horribly wrong so I created a backup of my mangos DB lol
Thank you so much though, ill rep you when I can...I just need to find someone else that is repworthy first so I can rep you again lol
Kandi <3
Glad it worked :) If you need any more help just ask ^^
yeah so if anyone else wants to know the sql query is
UPDATE Item_template SET bonding = 2
and that will make all of the items in your DB BoE lol its a lot easier then doing every single item you want individually
Credits to AvidGamer for the structure lol
Ok guys, another question, I edited all of the items in my db to have X100 spell power and all that fun stuff, I just made a priest and equipped an Item set (which has a combo of 66400 SP) but even with all that my crits are only 13k... Is there a reason that its doing this?
(I changed all the core stuff back to normal and deleted my WDB from my cache folder)
Kandi
Avidgamer
22-08-10, 06:22 PM
Could just be your core is not very good, you're using arcemu or mangos?
MaNGOS of corse tis the best lol
Avidgamer
23-08-10, 08:48 AM
Don't know for sure, I never really use Mangos, then again, I never really use Private Servers any more.
could there maybe be like a spell power cap somewhere in the core? because its actin all wierd like ill put on a weapon that has 20000 SP and then my sp will go down like 10k so idk lol
Avidgamer
23-08-10, 05:16 PM
Quite possibly there is a spell power cap. You'll need to take a look at your cpp files ^^
haha I fail at C++ so ill look through the files but if i find something ill post the code here to check for sure if its right lol
Also, I have another question where can I find the dodge, parry and critical strike caps? I need to lower them a lot lol
Avidgamer
25-08-10, 10:50 AM
Not 100% sure, not surfed through those files in a while sorry.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.