[svn] *** Source Mangos ***

*Load npc_options at server startup, use cached data at creature gossip menu init.
* Also new .reload table command added
*Implement npc_option localization support, also store in DB BoxText/BoxMoney/Coded
* Use characters.guid instead low guid value from characters.data in charcter enum data prepering for client.
* Fixed crash at .pinfo command use from console.
* Fixed windows ad.exe build
*Creature related code and DB cleanups.
* Rename 2 creature_template fields to more clean names and related code update also.
* Use enum values instead raw values for type_flags, use halper functions instead code repeating.
* Move tamed pet creating code to new function.

** Small code changes to make things compliant with above changes.
** Another rev with big changes so test away.

--HG--
branch : trunk
This commit is contained in:
KingPin
2008-11-05 09:22:56 -06:00
parent a1981ecc77
commit 62ed044d08
23 changed files with 301 additions and 106 deletions
+31 -7
View File
@@ -112,7 +112,10 @@ struct GossipOption
uint32 NpcFlag;
uint32 Icon;
uint32 Action;
std::string Option;
uint32 BoxMoney;
bool Coded;
std::string OptionText;
std::string BoxText;
};
enum CreatureFlagsExtra
@@ -166,9 +169,9 @@ struct CreatureInfo
uint32 attackpower;
uint32 baseattacktime;
uint32 rangeattacktime;
uint32 Flags;
uint32 unit_flags; // enum UnitFlags mask values
uint32 dynamicflags;
uint32 family;
uint32 family; // enum CreatureFamily values for type==CREATURE_TYPE_BEAST, or 0 in another cases
uint32 trainer_type;
uint32 trainer_spell;
uint32 classNum;
@@ -176,8 +179,8 @@ struct CreatureInfo
float minrangedmg;
float maxrangedmg;
uint32 rangedattackpower;
uint32 type;
uint32 flag1;
uint32 type; // enum CreatureType values
uint32 type_flags; // enum CreatureTypeFlags mask values
uint32 lootid;
uint32 pickpocketLootId;
uint32 SkinLootId;
@@ -205,6 +208,21 @@ struct CreatureInfo
char const* ScriptName;
uint32 GetRandomValidModelId() const;
uint32 GetFirstValidModelId() const;
SkillType GetRequiredLootSkill() const
{
if(type_flags & CREATURE_TYPEFLAGS_HERBLOOT)
return SKILL_HERBALISM;
else if(type_flags & CREATURE_TYPEFLAGS_MININGLOOT)
return SKILL_MINING;
else
return SKILL_SKINNING; // normal case
}
bool isTameable() const
{
return type == CREATURE_TYPE_BEAST && family != 0 && (type_flags & CREATURE_TYPEFLAGS_TAMEBLE);
}
};
struct CreatureLocale
@@ -213,6 +231,12 @@ struct CreatureLocale
std::vector<std::string> SubName;
};
struct NpcOptionLocale
{
std::vector<std::string> OptionText;
std::vector<std::string> BoxText;
};
struct EquipmentInfo
{
uint32 entry;
@@ -473,8 +497,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
CreatureDataAddon const* GetCreatureAddon() const;
char const* GetScriptName() const;
void prepareGossipMenu( Player *pPlayer,uint32 gossipid );
void sendPreparedGossip( Player* player);
void prepareGossipMenu( Player *pPlayer, uint32 gossipid = 0 );
void sendPreparedGossip( Player* player );
void OnGossipSelect(Player* player, uint32 option);
void OnPoiSelect(Player* player, GossipOption const *gossip);