Skip to content

Commit

Permalink
[9752] Add storage for min/maxgold of gameobject
Browse files Browse the repository at this point in the history
Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Apr 16, 2010
1 parent 087eded commit eeb51e5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion sql/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0',
`required_9747_01_mangos_battleground_template` bit(1) default NULL
`required_9752_01_mangos_gameobject_template` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -1902,6 +1902,8 @@ CREATE TABLE `gameobject_template` (
`data21` int(10) unsigned NOT NULL default '0',
`data22` int(10) unsigned NOT NULL default '0',
`data23` int(10) unsigned NOT NULL default '0',
`mingold` mediumint(8) unsigned NOT NULL default '0',
`maxgold` mediumint(8) unsigned NOT NULL default '0',
`ScriptName` varchar(64) NOT NULL default '',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System';
Expand Down
4 changes: 4 additions & 0 deletions sql/updates/9752_01_mangos_gameobject_template.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE db_version CHANGE COLUMN required_9747_01_mangos_battleground_template required_9752_01_mangos_gameobject_template bit;

ALTER TABLE gameobject_template ADD COLUMN mingold MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER data23;
ALTER TABLE gameobject_template ADD COLUMN maxgold MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER mingold;
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pkgdata_DATA = \
9747_01_mangos_battleground_template.sql \
9748_01_realmd_realmlist.sql \
9751_01_characters.sql \
9752_01_mangos_gameobject_template.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -224,4 +225,5 @@ EXTRA_DIST = \
9747_01_mangos_battleground_template.sql \
9748_01_realmd_realmlist.sql \
9751_01_characters.sql \
9752_01_mangos_gameobject_template.sql \
README
3 changes: 3 additions & 0 deletions src/game/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ struct GameObjectInfo
uint32 data[24];
} raw;
};

uint32 MinMoneyLoot;
uint32 MaxMoneyLoot;
uint32 ScriptId;

// helpers
Expand Down
1 change: 1 addition & 0 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7652,6 +7652,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
sLog.outDebug(" if(lootid)");
loot->clear();
loot->FillLoot(lootid, LootTemplates_Gameobject, this, false);
loot->generateMoneyLoot(go->GetGOInfo()->MinMoneyLoot, go->GetGOInfo()->MaxMoneyLoot);
}

if (loot_type == LOOT_FISHING)
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Database/SQLStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const char CreatureDataAddonInfofmt[]="iiiiiis";
const char CreatureModelfmt[]="iffbi";
const char CreatureInfoAddonInfofmt[]="iiiiiis";
const char EquipmentInfofmt[]="iiii";
const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis";
const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis";
const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiiii";
const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiii";
const char PageTextfmt[]="isi";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9751"
#define REVISION_NR "9752"
#endif // __REVISION_NR_H__
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_9751_01_characters"
#define REVISION_DB_MANGOS "required_9747_01_mangos_battleground_template"
#define REVISION_DB_MANGOS "required_9752_01_mangos_gameobject_template"
#define REVISION_DB_REALMD "required_9748_01_realmd_realmlist"
#endif // __REVISION_SQL_H__

3 comments on commit eeb51e5

@waza123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can some one explain, what the hell is this lines:
"iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis";
"iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiii";

and how do you know what to put there ?

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, same as for DBC

@alexrp
Copy link

@alexrp alexrp commented on eeb51e5 Apr 16, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please know what the hell you're talking about before claiming something is bad design.

Please sign in to comment.