From e3c680b76bf2d13de6286f3b486d946b25b7bdb1 Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Wed, 6 Jan 2016 16:35:51 +0800 Subject: Add EQP_ = Equipment Position constants --- src/map/script.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/map/script.c b/src/map/script.c index 35a71868a..2cee8855d 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -20898,6 +20898,29 @@ void script_hardcoded_constants(void) script->set_constant("BG_AREA_WOS",BG_AREA_WOS,false, false); script->set_constant("BG_QUEUE",BG_QUEUE,false, false); + /* Equip Position in Bits, use with *getiteminfo type 5, or @inventorylist_equip */ + script->set_constant("EQP_HEAD_LOW", EQP_HEAD_LOW, false, false); + script->set_constant("EQP_HEAD_MID", EQP_HEAD_MID, false, false); + script->set_constant("EQP_HEAD_TOP", EQP_HEAD_TOP, false, false); + script->set_constant("EQP_HAND_R", EQP_HAND_R, false, false); + script->set_constant("EQP_HAND_L", EQP_HAND_L, false, false); + script->set_constant("EQP_ARMOR", EQP_ARMOR, false, false); + script->set_constant("EQP_SHOES", EQP_SHOES, false, false); + script->set_constant("EQP_GARMENT", EQP_GARMENT, false, false); + script->set_constant("EQP_ACC_L", EQP_ACC_L, false, false); + script->set_constant("EQP_ACC_R", EQP_ACC_R, false, false); + script->set_constant("EQP_COSTUME_HEAD_TOP", EQP_COSTUME_HEAD_TOP, false, false); + script->set_constant("EQP_COSTUME_HEAD_MID", EQP_COSTUME_HEAD_MID, false, false); + script->set_constant("EQP_COSTUME_HEAD_LOW", EQP_COSTUME_HEAD_LOW, false, false); + script->set_constant("EQP_COSTUME_GARMENT", EQP_COSTUME_GARMENT, false, false); + script->set_constant("EQP_AMMO", EQP_AMMO, false, false); + script->set_constant("EQP_SHADOW_ARMOR", EQP_SHADOW_ARMOR, false, false); + script->set_constant("EQP_SHADOW_WEAPON", EQP_SHADOW_WEAPON, false, false); + script->set_constant("EQP_SHADOW_SHIELD", EQP_SHADOW_SHIELD, false, false); + script->set_constant("EQP_SHADOW_SHOES", EQP_SHADOW_SHOES, false, false); + script->set_constant("EQP_SHADOW_ACC_R", EQP_SHADOW_ACC_R, false, false); + script->set_constant("EQP_SHADOW_ACC_L", EQP_SHADOW_ACC_L, false, false); + /* Renewal */ #ifdef RENEWAL script->set_constant("RENEWAL", 1, false, false); -- cgit v1.2.3-70-g09d2 From a1310e2d8c098fcbeb485314a4bafa5d6659be7e Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Wed, 6 Jan 2016 16:38:43 +0800 Subject: Remove VAR_ constants - there are 2 same constants for setlook script command, remove the wrong one - VAR_ constant added by lone_wolf is invalid https://github.com/HerculesWS/Hercules/commit/f4278f36db32f35e535a0ea8feb1cf83ca95019e, so use the LOOK_ constant --- db/constants.conf | 47 ++++++++++++++++++++++++++++++++++---------- doc/script_commands.txt | 4 ++-- npc/merchants/hair_dyer.txt | 8 ++++---- npc/merchants/hair_style.txt | 12 +++++------ 4 files changed, 49 insertions(+), 22 deletions(-) diff --git a/db/constants.conf b/db/constants.conf index 0709cd758..790c0ed53 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3678,16 +3678,43 @@ constants_db: { FW_EXTRABOLD: 800 FW_HEAVY: 900 - /** setlook */ - VAR_HEAD: 1 - VAR_WEAPON: 2 - VAR_HEAD_TOP: 3 - VAR_HEAD_MID: 4 - VAR_HEAD_BOTTOM: 5 - VAR_HEADPALETTE: 6 - VAR_BODYPALETTE: 7 - VAR_SHIELD: 8 - VAR_SHOES: 9 + /** old setlook (use LOOK_* constants instead) */ + VAR_HEAD: { + Value: 1 + Deprecated: true // Use LOOK_HAIR + } + VAR_WEAPON: { + Value: 2 + Deprecated: true // Use LOOK_WEAPON + } + VAR_HEAD_TOP: { + Value: 3 + Deprecated: true // Use LOOK_HEAD_TOP + } + VAR_HEAD_MID: { + Value: 4 + Deprecated: true // Use LOOK_HEAD_MID + } + VAR_HEAD_BOTTOM: { + Value: 5 + Deprecated: true // Use LOOK_HEAD_BOTTOM + } + VAR_HEADPALETTE: { + Value: 6 + Deprecated: true // Use LOOK_HAIR_COLOR + } + VAR_BODYPALETTE: { + Value: 7 + Deprecated: true // Use LOOK_CLOTHES_COLOR + } + VAR_SHIELD: { + Value: 8 + Deprecated: true // Use LOOK_SHIELD + } + VAR_SHOES: { + Value: 9 + Deprecated: true // Use LOOK_SHOES + } /** Directions */ DIR_NORTH: 0 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 130e5b5f6..709aa39dd 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4530,13 +4530,13 @@ the look value). // This will change your hair(6), so that it uses palette 8, what ever // your palette 8 is, your hair will use that color. - setlook VAR_HEADPALETTE, 8; + setlook LOOK_HAIR_COLOR, 8; // This will change your clothes(7), so they are using palette 1, // whatever your palette 1 is, your clothes will then use that set of // colors. - setlook VAR_BODYPALETTE,1; + setlook LOOK_CLOTHES_COLOR, 1; Here are the possible look types: diff --git a/npc/merchants/hair_dyer.txt b/npc/merchants/hair_dyer.txt index db261c215..1a786b415 100644 --- a/npc/merchants/hair_dyer.txt +++ b/npc/merchants/hair_dyer.txt @@ -97,7 +97,7 @@ prt_in,243,168,4 script Jovovich 4_F_02,{ close; } - if (.@headpalette == getlook(VAR_HEADPALETTE)) { + if (.@headpalette == getlook(LOOK_HAIR_COLOR)) { mes "[Hairdresser Jovovich]"; mes "Eh? But that's the hair color you already have. Please choose a different color."; next; @@ -130,7 +130,7 @@ prt_in,243,168,4 script Jovovich 4_F_02,{ case 8: delitem Scarlet_Dyestuffs,1; break; } Zeny -= 1000; - setlook VAR_HEADPALETTE,.@headpalette; + setlook LOOK_HAIR_COLOR,.@headpalette; .@choose_success = 1; break; } @@ -275,7 +275,7 @@ lhz_in02,100,134,3 script Hair Dyer#lich 4_F_EINWOMAN,{ } break; } - if (getlook(VAR_HEADPALETTE) == .@headpalette) { + if (getlook(LOOK_HAIR_COLOR) == .@headpalette) { mes "[Rossa]"; mes "Hmm, your hair color"; mes "is still fine, so there's"; @@ -388,7 +388,7 @@ lhz_in02,100,134,3 script Hair Dyer#lich 4_F_EINWOMAN,{ else if (.@headpalette == 6) delitem White_Dyestuffs,1; else if (.@headpalette == 7) delitem Black_Dyestuffs,1; Zeny -= 1000; - setlook VAR_HEADPALETTE,.@headpalette; + setlook LOOK_HAIR_COLOR,.@headpalette; .@choose_success = 1; break; } diff --git a/npc/merchants/hair_style.txt b/npc/merchants/hair_style.txt index 7bfefadf4..2d61d02db 100644 --- a/npc/merchants/hair_style.txt +++ b/npc/merchants/hair_style.txt @@ -995,7 +995,7 @@ lhz_in02,100,143,3 script Hair Dresser#li 2_M_DYEINGER,{ mes "you soooooooo beautiful!"; close; } - else if (getlook(VAR_HEAD) == .@input) { + else if (getlook(LOOK_HAIR) == .@input) { mes "[Prince Shammi]"; mes "Oh dear me, you're not"; mes "going to waste money for"; @@ -1017,7 +1017,7 @@ lhz_in02,100,143,3 script Hair Dresser#li 2_M_DYEINGER,{ next; switch(select("Yes.:No.")) { case 1: - if (getlook(VAR_HEADPALETTE) == 0) { + if (getlook(LOOK_HAIR_COLOR) == 0) { mes "[Prince Shammi]"; mes "Oh, Sweet Christmas,"; mes "I almost forgot! Would"; @@ -1072,8 +1072,8 @@ lhz_in02,100,143,3 script Hair Dresser#li 2_M_DYEINGER,{ delitem Long_Hair,100; delitem Golden_Hair,100; delitem Glossy_Hair,100; - setlook VAR_HEAD,.@input; - setlook VAR_HEADPALETTE,.@headpalette; + setlook LOOK_HAIR,.@input; + setlook LOOK_HAIR_COLOR,.@headpalette; mes "[Prince Shammi]"; mes "Well, we're all finished!"; mes "And my, oh my, you look even"; @@ -1272,8 +1272,8 @@ lhz_in02,91,155,5 script Assistant Beautician#li 4_F_LGTGIRL,{ mes "^333333*Pant Pant Pant*^000000"; next; Zeny -= 250000; - setlook VAR_HEAD,.@style_r; - setlook VAR_HEADPALETTE,.@color_r; + setlook LOOK_HAIR,.@style_r; + setlook LOOK_HAIR_COLOR,.@color_r; mes "[Assistant Beautician]"; mes "Bwahahaha! Success!"; if (.@input == .@style_r) { -- cgit v1.2.3-70-g09d2 From d649659e90cc37e2074eb0238317f9d58f879b2a Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Wed, 6 Jan 2016 16:39:57 +0800 Subject: set_constant the LOOK_ constants --- db/constants.conf | 16 ---------------- src/map/script.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/db/constants.conf b/db/constants.conf index 790c0ed53..98de6ac98 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -777,22 +777,6 @@ constants_db: { EQI_SHADOW_ACC_R: 19 EQI_SHADOW_ACC_L: 20 - /** Look */ - LOOK_BASE: 0 - LOOK_HAIR: 1 - LOOK_WEAPON: 2 - LOOK_HEAD_BOTTOM: 3 - LOOK_HEAD_TOP: 4 - LOOK_HEAD_MID: 5 - LOOK_HAIR_COLOR: 6 - LOOK_CLOTHES_COLOR: 7 - LOOK_SHIELD: 8 - LOOK_SHOES: 9 - LOOK_BODY: 10 - LOOK_FLOOR: 11 - LOOK_ROBE: 12 - LOOK_BODY2: 13 - /** Status effects */ Eff_Stone: 0 Eff_Freeze: 1 diff --git a/src/map/script.c b/src/map/script.c index 2cee8855d..0fd1f0690 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -20898,6 +20898,22 @@ void script_hardcoded_constants(void) script->set_constant("BG_AREA_WOS",BG_AREA_WOS,false, false); script->set_constant("BG_QUEUE",BG_QUEUE,false, false); + /* LOOK_ constants, use in setlook/changelook script commands */ + script->set_constant("LOOK_BASE", LOOK_BASE, false, false); + script->set_constant("LOOK_HAIR", LOOK_HAIR, false, false); + script->set_constant("LOOK_WEAPON", LOOK_WEAPON, false, false); + script->set_constant("LOOK_HEAD_BOTTOM", LOOK_HEAD_BOTTOM, false, false); + script->set_constant("LOOK_HEAD_TOP", LOOK_HEAD_TOP, false, false); + script->set_constant("LOOK_HEAD_MID", LOOK_HEAD_MID, false, false); + script->set_constant("LOOK_HAIR_COLOR", LOOK_HAIR_COLOR, false, false); + script->set_constant("LOOK_CLOTHES_COLOR", LOOK_CLOTHES_COLOR, false, false); + script->set_constant("LOOK_SHIELD", LOOK_SHIELD, false, false); + script->set_constant("LOOK_SHOES", LOOK_SHOES, false, false); + script->set_constant("LOOK_BODY", LOOK_BODY, false, false); + script->set_constant("LOOK_FLOOR", LOOK_FLOOR, false, false); + script->set_constant("LOOK_ROBE", LOOK_ROBE, false, false); + script->set_constant("LOOK_BODY2", LOOK_BODY2, false, false); + /* Equip Position in Bits, use with *getiteminfo type 5, or @inventorylist_equip */ script->set_constant("EQP_HEAD_LOW", EQP_HEAD_LOW, false, false); script->set_constant("EQP_HEAD_MID", EQP_HEAD_MID, false, false); -- cgit v1.2.3-70-g09d2