Issue information

Issue ID
#1071
Status
Confirmed
Severity
Fair
Started
Hercules Elf Bot
Feb 28, 2008 23:29
Last Post
Ind
Apr 16, 2013 6:27
Confirmation
N/A

Hercules Elf Bot - Feb 28, 2008 23:29

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1071

During the development of various features, there was the need to store small bits of persistent information.
And instead of making a new database field somewhere, the developer(s) decided to exploit the script engine's globalreg table.

Currently I've found:
  • jobchange_level - set when changing to 2nd job, only used by custom kafra express script
  • PC_DIE_COUNTER - death count, used for serverside novice stat calculations
  • TK_MISSION_ID and TK_MISSION_COUNT - used for tracking taekwon mission
  • various star gladiator vars - store marked locations / monsters
  • CLONE_SKILL and CLONE_SKILL_LV - the skill id/level of a plagiarized skill
  • PC_LAST_DUEL_TIME - timestamp of last duel
  • killerrid and killedrid - to let scripts know about kills/deaths
  • ZENY_HACKER - some wtf variable

... is this really a good idea?
Some of them needn't be stored between logins at all (killerrid/killedrid).
Some of them are universal and should get a table column instead.
Some of them are only related to a single class, which would probably waste space. Yet, using script variables seems like a very bad design idea to me...

Ind - Apr 16, 2013 6:27

[quote]
Some of them needn't be stored between logins at all (killerrid/killedrid).[/quote]these are no longer stored as global regs.
[hr]
others to the list:
"COOK_MASTERY"
"REPRODUCE_SKILL"
"REPRODUCE_SKILL_LV"
"jobchange_level_3rd"
feel map (star gladiator):[code=auto:0] pc_setglobalreg(sd,sg_info[i].feel_var,sd->feel_map[i].index); [/code][code=auto:0] const struct sg_data sg_info[MAX_PC_FEELHATE] = { { SG_SUN_ANGER, SG_SUN_BLESS, SG_SUN_COMFORT, "PC_FEEL_SUN", "PC_HATE_MOB_SUN", is_day_of_sun }, { SG_MOON_ANGER, SG_MOON_BLESS, SG_MOON_COMFORT, "PC_FEEL_MOON", "PC_HATE_MOB_MOON", is_day_of_moon }, { SG_STAR_ANGER, SG_STAR_BLESS, SG_STAR_COMFORT, "PC_FEEL_STAR", "PC_HATE_MOB_STAR", is_day_of_star } }; [/code]