summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2018-07-17 19:33:32 +0100
committerAsheraf <acheraf1998@gmail.com>2018-07-24 14:21:01 +0100
commit0ad1e08ee15ac0112cad6d94e67584a5ce571c53 (patch)
tree26c5499cd4684f736bf5e8d986ce12d35fe474a2
parent504ad2ca7d6ef4923093f74ac2afd5fc1bd39fd1 (diff)
downloadhercules-0ad1e08ee15ac0112cad6d94e67584a5ce571c53.tar.gz
hercules-0ad1e08ee15ac0112cad6d94e67584a5ce571c53.tar.bz2
hercules-0ad1e08ee15ac0112cad6d94e67584a5ce571c53.tar.xz
hercules-0ad1e08ee15ac0112cad6d94e67584a5ce571c53.zip
Correct wrong attribute used for pet evolution egg hiding
-rw-r--r--sql-files/main.sql1
-rw-r--r--sql-files/upgrades/2018-07-24--03-23.sql22
-rw-r--r--sql-files/upgrades/index.txt1
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/pet.c6
-rw-r--r--src/map/script.c8
-rw-r--r--src/map/skill.c3
7 files changed, 40 insertions, 3 deletions
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 8f7e5355b..d1c6364c6 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -895,6 +895,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1509835214); -- 2017-11-0
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1519671456); -- 2018-02-26--15-57.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1520654809); -- 2018-03-10--04-06.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528180320); -- 2018-06-05--12-02.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1532403228); -- 2018-07-24--03-23.sql
--
-- Table structure for table `storage`
--
diff --git a/sql-files/upgrades/2018-07-24--03-23.sql b/sql-files/upgrades/2018-07-24--03-23.sql
new file mode 100644
index 000000000..64e29996f
--- /dev/null
+++ b/sql-files/upgrades/2018-07-24--03-23.sql
@@ -0,0 +1,22 @@
+#1532403228
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+UPDATE `inventory` SET `identify` = 1, `attribute` = 1 WHERE `card0` = -256 and `identify` = 0
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1532403228);
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index 5a737f93a..c88ba25d4 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -46,3 +46,4 @@
2018-02-26--15-57.sql
2018-03-10--04-06.sql
2018-06-05--12-02.sql
+2018-07-24--03-23.sql
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 79bd92213..3ec709b57 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4222,6 +4222,8 @@ ACMD(repairall)
count = 0;
for (i = 0; i < MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
sd->status.inventory[i].attribute |= ATTR_BROKEN;
sd->status.inventory[i].attribute ^= ATTR_BROKEN;
diff --git a/src/map/pet.c b/src/map/pet.c
index e544905c0..5d0e5b9e3 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -345,7 +345,7 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd)
pd->pet.pet_id == MakeDWord(sd->status.inventory[i].card[1], sd->status.inventory[i].card[2]));
if (i != MAX_INVENTORY) {
- sd->status.inventory[i].identify = 1;
+ sd->status.inventory[i].attribute &= ~ATTR_BROKEN;
sd->status.inventory[i].bound = IBT_NONE;
}
@@ -496,8 +496,8 @@ static int pet_recv_petdata(int account_id, struct s_pet *p, int flag)
if (!pet->birth_process(sd,p)) {
- // Pet Evolution, Hide the egg by setting identify to 0 [Dastgir/Hercules]
- sd->status.inventory[i].identify = 0;
+ // Pet Evolution, Hide the egg by setting broken attribute (0x2) [Asheraf]
+ sd->status.inventory[i].attribute |= ATTR_BROKEN;
// bind the egg to the character to avoid moving it via forged packets [Asheraf]
sd->status.inventory[i].bound = IBT_CHARACTER;
}
diff --git a/src/map/script.c b/src/map/script.c
index 9a5d33604..1e635b622 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9245,6 +9245,8 @@ static BUILDIN(getbrokenid)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
brokencounter++;
if(num==brokencounter) {
@@ -9270,6 +9272,8 @@ static BUILDIN(getbrokencount)
return true;
for (i = 0; i < MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
counter++;
}
@@ -9292,6 +9296,8 @@ static BUILDIN(repair)
num=script_getnum(st,2);
for(i=0; i<MAX_INVENTORY; i++) {
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if ((sd->status.inventory[i].attribute & ATTR_BROKEN) != 0) {
repaircounter++;
if(num==repaircounter) {
@@ -9320,6 +9326,8 @@ static BUILDIN(repairall)
for(i = 0; i < MAX_INVENTORY; i++)
{
+ if (sd->status.inventory[i].card[0] == CARD0_PET)
+ continue;
if (sd->status.inventory[i].nameid && (sd->status.inventory[i].attribute & ATTR_BROKEN) != 0)
{
sd->status.inventory[i].attribute |= ATTR_BROKEN;
diff --git a/src/map/skill.c b/src/map/skill.c
index ed69b8c0f..524769873 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -16106,6 +16106,9 @@ static void skill_repairweapon(struct map_session_data *sd, int idx)
if( item->nameid <= 0 || (item->attribute & ATTR_BROKEN) == 0 )
return; //Again invalid item....
+ if (item->card[0] == CARD0_PET)
+ return;
+
if( sd != target_sd && !battle->check_range(&sd->bl,&target_sd->bl, skill->get_range2(&sd->bl, sd->menuskill_id,sd->menuskill_val2) ) ){
clif->item_repaireffect(sd,idx,1);
return;