Show
Ignore:
Timestamp:
11/19/08 13:42:33 (17 years ago)
Author:
yumileroy
Message:

[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.

Original author: KingPin?
Date: 2008-11-05 09:22:56-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Creature.h

    r135 r168  
    113113    uint32 Icon; 
    114114    uint32 Action; 
    115     std::string Option; 
     115    uint32 BoxMoney; 
     116    bool Coded; 
     117    std::string OptionText; 
     118    std::string BoxText; 
    116119}; 
    117120 
     
    167170    uint32  baseattacktime; 
    168171    uint32  rangeattacktime; 
    169     uint32  Flags; 
     172    uint32  unit_flags;                                     // enum UnitFlags mask values 
    170173    uint32  dynamicflags; 
    171     uint32  family; 
     174    uint32  family;                                         // enum CreatureFamily values for type==CREATURE_TYPE_BEAST, or 0 in another cases 
    172175    uint32  trainer_type; 
    173176    uint32  trainer_spell; 
     
    177180    float   maxrangedmg; 
    178181    uint32  rangedattackpower; 
    179     uint32  type; 
    180     uint32  flag1; 
     182    uint32  type;                                           // enum CreatureType values 
     183    uint32  type_flags;                                     // enum CreatureTypeFlags mask values 
    181184    uint32  lootid; 
    182185    uint32  pickpocketLootId; 
     
    206209    uint32 GetRandomValidModelId() const; 
    207210    uint32 GetFirstValidModelId() const; 
     211     
     212    SkillType GetRequiredLootSkill() const 
     213    { 
     214        if(type_flags & CREATURE_TYPEFLAGS_HERBLOOT) 
     215            return SKILL_HERBALISM; 
     216        else if(type_flags & CREATURE_TYPEFLAGS_MININGLOOT) 
     217            return SKILL_MINING; 
     218        else 
     219            return SKILL_SKINNING;                          // normal case 
     220    } 
     221     
     222    bool isTameable() const 
     223    { 
     224        return type == CREATURE_TYPE_BEAST && family != 0 && (type_flags & CREATURE_TYPEFLAGS_TAMEBLE); 
     225    } 
    208226}; 
    209227 
     
    212230    std::vector<std::string> Name; 
    213231    std::vector<std::string> SubName; 
     232}; 
     233 
     234struct NpcOptionLocale 
     235{ 
     236    std::vector<std::string> OptionText; 
     237    std::vector<std::string> BoxText; 
    214238}; 
    215239 
     
    474498        char const* GetScriptName() const; 
    475499 
    476         void prepareGossipMenu( Player *pPlayer,uint32 gossipid ); 
    477         void sendPreparedGossip( Player* player); 
     500        void prepareGossipMenu( Player *pPlayer, uint32 gossipid = 0 ); 
     501        void sendPreparedGossip( Player* player ); 
    478502        void OnGossipSelect(Player* player, uint32 option); 
    479503        void OnPoiSelect(Player* player, GossipOption const *gossip);