Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatType mana = 0 #389

Open
Helias opened this issue Feb 24, 2024 · 7 comments
Open

StatType mana = 0 #389

Helias opened this issue Feb 24, 2024 · 7 comments
Labels
AzerothCore issues related to the instance maintained by AzerothCore (https://wowgaming.altervista.org/aowow/) Bug i broke something

Comments

@Helias
Copy link
Contributor

Helias commented Feb 24, 2024

Describe the bug and how to reproduce it
in item.class.php we are considering as statType 0 value the MANA but it's wrong, 0 should be a null/blank value and mana should be 2 (1 is Health, which is correct but Mana should not be 0 but 2).

In includes/types/item.class.php line 746 there is a funny comment // i think i fucked up somewhere mapping item_mods: offsets may be required somewhere I think that this comment refers probably to this error.

Same error is present in locale_enus.php line 1803 where statType 0 is mana and statType 2 is null.

In AzerothCore I can't find in item_template an item with stat_type* = 2, so I can't double-check with wowhead or other sources (it seems unused), but it should not be 0 I guess.

@Helias
Copy link
Contributor Author

Helias commented Feb 24, 2024

I was wrong

@Helias Helias closed this as completed Feb 24, 2024
@Helias Helias reopened this Feb 24, 2024
@Helias
Copy link
Contributor Author

Helias commented Feb 24, 2024

but still, there is something wrong here, mana sometimes is considered as "2" like in g_statToJson or like "1" for ITEM_MOD_MANA in defines.php.

In item.class.php where there is the comment // i think i fucked up somewhere mapping item_mods: offsets may be required somewhere, there is this weird association between mod mana and health (1, 2) with locale_enus.php where Mana is 0 and Health is 1

@Sarjuuk
Copy link
Owner

Sarjuuk commented Feb 25, 2024

So, i'm primarrily going off of enum ItemModType. This is very siminilar to g_statToJson but not quite identical.
My old comment was probably me wracking my brain how to reconcile these two. And since g_statToJson interacts weirdly with the item scaling system i don't know if i can simply move mana to idx 0 where it belongs.

i suppose it is correct to change

// base stat
switch ($type)
{
case ITEM_MOD_MANA:
case ITEM_MOD_HEALTH:
// $type += 1; // i think i fucked up somewhere mapping item_mods: offsets may be required somewhere
case ITEM_MOD_AGILITY:
case ITEM_MOD_STRENGTH:
case ITEM_MOD_INTELLECT:
case ITEM_MOD_SPIRIT:
case ITEM_MOD_STAMINA:
$x .= '<span><!--stat'.$type.'-->'.($qty > 0 ? '+' : '-').abs($qty).' '.Lang::item('statType', $type).'</span><br />';
break;
default: // rating with % for reqLevel
$green[] = $this->parseRating($type, $qty, $interactive, $causesScaling);
}

to

$jsonType = $type;
 // base stat 
 switch ($type) 
 { 
     case ITEM_MOD_MANA: 
         $jsonType = 2;                          // g_statToJson expects mana on idx 2
     case ITEM_MOD_HEALTH: 
     case ITEM_MOD_AGILITY: 
     case ITEM_MOD_STRENGTH: 
     case ITEM_MOD_INTELLECT: 
     case ITEM_MOD_SPIRIT: 
     case ITEM_MOD_STAMINA: 
         $x .= '<span><!--stat'.$jsonType .'-->'.($qty > 0 ? '+' : '-').abs($qty).' '.Lang::item('statType', $type).'</span><br />'; 
         break; 
     default:                                    // rating with % for reqLevel 
         $green[] = $this->parseRating($type, $qty, $interactive, $causesScaling); 
  
 } 

are there even heirlooms that grant a flat increase of mana/health..?

@Helias
Copy link
Contributor Author

Helias commented Feb 25, 2024

I made a quick check and I did not find items with stat type 0, about health you can find some items

@Helias Helias changed the title StatType mana = 0 -> 2, 0 should be null StatType mana = 0 Feb 25, 2024
@Sarjuuk
Copy link
Owner

Sarjuuk commented Feb 25, 2024

https://wowgaming.altervista.org/aowow/?item=6673&xml

in any case, there is a discrepancy between tooltip and json stats

@Sarjuuk Sarjuuk added Bug i broke something AzerothCore issues related to the instance maintained by AzerothCore (https://wowgaming.altervista.org/aowow/) labels Feb 25, 2024
@Sarjuuk
Copy link
Owner

Sarjuuk commented Feb 29, 2024

oh god it's worse....

aowow/includes/defines.php

Lines 777 to 790 in de2fa37

// ItemMod (differ slightly from client, see g_statToJson)
define('ITEM_MOD_WEAPON_DMG', 0); // < custom
define('ITEM_MOD_MANA', 1);
define('ITEM_MOD_HEALTH', 2);
define('ITEM_MOD_AGILITY', 3); // stats v
define('ITEM_MOD_STRENGTH', 4);
define('ITEM_MOD_INTELLECT', 5);
define('ITEM_MOD_SPIRIT', 6);
define('ITEM_MOD_STAMINA', 7);
define('ITEM_MOD_ENERGY', 8); // powers v
define('ITEM_MOD_RAGE', 9);
define('ITEM_MOD_FOCUS', 10);
define('ITEM_MOD_RUNIC_POWER', 11);
define('ITEM_MOD_DEFENSE_SKILL_RATING', 12); // ratings v

@Helias
Copy link
Contributor Author

Helias commented Mar 1, 2024

there is something weird indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AzerothCore issues related to the instance maintained by AzerothCore (https://wowgaming.altervista.org/aowow/) Bug i broke something
Projects
None yet
Development

No branches or pull requests

2 participants