Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Can I try to rack the brain of someone who is more familiar with Eluna scripting than I am? I'm new

[DiscordArchive] Can I try to rack the brain of someone who is more familiar with Eluna scripting than I am? I'm new

[DiscordArchive] Can I try to rack the brain of someone who is more familiar with Eluna scripting than I am? I'm new

rektbyfaith
Administrator
0
03-18-2024, 07:00 PM
#1
Archived author: Aldori • Posted: 2024-03-18T19:00:39.899000+00:00
Original source

Can I try to rack the brain of someone who is more familiar with Eluna scripting than I am? I'm new to it so I apologize if it's not the cleanest approach, but I'm trying to implement an eluna script for reputation sharing across all characters on the same account.

I have 3 events: Character Creation, Login, Reputation Change. The first two events for Character Creation and Login seem to work flawlessly where when those 2 respective events occur, character_reputation gets updated to sync the standing of each distinct factionId. In other words, shared/accountwide reputation.

However, I'm having issues with the Reputation Change event which is why I'm reaching out for help or if anyone has any ideas. I've already done the research and figured out exactly what is happening, but I can't figure out WHY it's happening or HOW it's even behaving this way. Let me explain more detail:
- Using event 15 (EVENT_PLAYER_REPUTATION_CHANGE) to update the reputation of all characters on the account to "set standing = standing + value", which value is passed in during the event 15.
- I was testing with Undercity (Faction 68) and started with a clean slate where standing was 0 for all of my characters. I made a brand new undead character and completed the first quest which awared 75 Undercity reputation. Using this formula (newRep = currentRep + awardedRep), that character was updated correctly in character_reputation (75 = 0 + 75). But all of the other characters on my account somehow ended up with 4075 rep (4075 = 0 + 75).
- I then made another new Undead character and completed the first quest again. The rep was updated correctly for this character, but now all of my other characters in character_reputation were at 12,225 rep (12225 = (4075 * 2) + (4000 + 75)
- For some reason all other characters are multiplying itself by 2, then adding (4000 + repAwarded)

I have no idea where the 4000 is coming from or why it's multiplying itelf by 2 first. Does anyone have any ideas?
AccountWideReputation.lua
rektbyfaith
03-18-2024, 07:00 PM #1

Archived author: Aldori • Posted: 2024-03-18T19:00:39.899000+00:00
Original source

Can I try to rack the brain of someone who is more familiar with Eluna scripting than I am? I'm new to it so I apologize if it's not the cleanest approach, but I'm trying to implement an eluna script for reputation sharing across all characters on the same account.

I have 3 events: Character Creation, Login, Reputation Change. The first two events for Character Creation and Login seem to work flawlessly where when those 2 respective events occur, character_reputation gets updated to sync the standing of each distinct factionId. In other words, shared/accountwide reputation.

However, I'm having issues with the Reputation Change event which is why I'm reaching out for help or if anyone has any ideas. I've already done the research and figured out exactly what is happening, but I can't figure out WHY it's happening or HOW it's even behaving this way. Let me explain more detail:
- Using event 15 (EVENT_PLAYER_REPUTATION_CHANGE) to update the reputation of all characters on the account to "set standing = standing + value", which value is passed in during the event 15.
- I was testing with Undercity (Faction 68) and started with a clean slate where standing was 0 for all of my characters. I made a brand new undead character and completed the first quest which awared 75 Undercity reputation. Using this formula (newRep = currentRep + awardedRep), that character was updated correctly in character_reputation (75 = 0 + 75). But all of the other characters on my account somehow ended up with 4075 rep (4075 = 0 + 75).
- I then made another new Undead character and completed the first quest again. The rep was updated correctly for this character, but now all of my other characters in character_reputation were at 12,225 rep (12225 = (4075 * 2) + (4000 + 75)
- For some reason all other characters are multiplying itself by 2, then adding (4000 + repAwarded)

I have no idea where the 4000 is coming from or why it's multiplying itelf by 2 first. Does anyone have any ideas?
AccountWideReputation.lua

rektbyfaith
Administrator
0
03-18-2024, 07:01 PM
#2
Archived author: Aldori • Posted: 2024-03-18T19:01:25.229000+00:00
Original source

A little more backstory. The reason I have both a Character creation and Login event is because when testing with only the Login event initially, the rep was getting set in the database, but I had to log the character out and back in again to display in the game. So that was my little "hacky" approach of getting the rep to display when logging in. I'm not sure if there's a way to force refresh the client display without logging out and back in again.

So that's why i did character creation so new characters get the rep before they log in. And then I tried to expand on it more with the on reputation changed event so the values are updated in the database when the rep change happens. That was my idea of bypassing the client display issue since idk if there's a way to force refresh it. BUT if anyone knows of a way to force refresh the client reputation display, that would eliminate the need to use the reputation changed event since the info will be updated at login and player wouldn't need to log out and back in for it to display

I also tried using the eluna Player:SetReputation(factionId, reputation) method but it was crashing my worldserver upon logging in. So I tried to find a hacky approach/workaround using Db modifications.

I'm open to any suggestions or help.
rektbyfaith
03-18-2024, 07:01 PM #2

Archived author: Aldori • Posted: 2024-03-18T19:01:25.229000+00:00
Original source

A little more backstory. The reason I have both a Character creation and Login event is because when testing with only the Login event initially, the rep was getting set in the database, but I had to log the character out and back in again to display in the game. So that was my little "hacky" approach of getting the rep to display when logging in. I'm not sure if there's a way to force refresh the client display without logging out and back in again.

So that's why i did character creation so new characters get the rep before they log in. And then I tried to expand on it more with the on reputation changed event so the values are updated in the database when the rep change happens. That was my idea of bypassing the client display issue since idk if there's a way to force refresh it. BUT if anyone knows of a way to force refresh the client reputation display, that would eliminate the need to use the reputation changed event since the info will be updated at login and player wouldn't need to log out and back in for it to display

I also tried using the eluna Player:SetReputation(factionId, reputation) method but it was crashing my worldserver upon logging in. So I tried to find a hacky approach/workaround using Db modifications.

I'm open to any suggestions or help.

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)