Changeset 168
- Timestamp:
- 11/19/08 13:42:33 (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 22 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/contrib/extractor/libmpq/common.h
r2 r168 50 50 #endif 51 51 52 #ifdef O_LARGEFILE 53 #define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE) 54 #else 55 #define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY) 56 #endif 57 52 58 #ifndef min 53 59 #define min(a, b) ((a < b) ? a : b) -
trunk/contrib/extractor/libmpq/mpq.cpp
r149 r168 60 60 61 61 /* Check if file exists and is readable */ 62 fd = _open((char *)mpq_filename, O_RDONLY | O_BINARY | O_LARGEFILE);62 fd = _open((char *)mpq_filename, MPQ_FILE_OPEN_FLAGS); 63 63 if (fd == LIBMPQ_EFILE) { 64 64 return LIBMPQ_EFILE; -
trunk/src/game/CharacterHandler.cpp
r149 r168 131 131 do 132 132 { 133 sLog.outDetail("Loading char guid %u from account %u.",(*result)[0].GetUInt32(),GetAccountId()); 134 135 if(plr->MinimalLoadFromDB( result, (*result)[0].GetUInt32() )) 133 uint32 guidlow = (*result)[0].GetUInt32(); 134 sLog.outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId()); 135 136 if(plr->MinimalLoadFromDB( result, guidlow )) 136 137 { 137 138 plr->BuildEnumData( result, &data ); … … 156 157 !sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) ? 157 158 // ------- Query Without Declined Names -------- 158 // 0 1 2 159 "SELECT characters. data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, characters.at_login, "160 // 9 10 11161 "character _pet.entry, character_pet.modelid, character_pet.level "159 // 0 1 2 3 4 5 6 7 8 160 "SELECT characters.guid, characters.data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, " 161 // 9 10 11 12 162 "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level " 162 163 "FROM characters LEFT JOIN character_pet ON characters.guid=character_pet.owner AND character_pet.slot='0' " 163 164 "WHERE characters.account = '%u' ORDER BY characters.guid" 164 165 : 165 166 // --------- Query With Declined Names --------- 166 // 0 1 2 167 "SELECT characters. data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, characters.at_login, "168 // 9 10 11 12169 "character _pet.entry, character_pet.modelid, character_pet.level, genitive "167 // 0 1 2 3 4 5 6 7 8 168 "SELECT characters.guid, characters.data, characters.name, characters.position_x, characters.position_y, characters.position_z, characters.map, characters.totaltime, characters.leveltime, " 169 // 9 10 11 12 13 170 "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, genitive " 170 171 "FROM characters LEFT JOIN character_pet ON characters.guid = character_pet.owner AND character_pet.slot='0' " 171 172 "LEFT JOIN character_declinedname ON characters.guid = character_declinedname.guid " -
trunk/src/game/Chat.cpp
r164 r168 232 232 { "trinity_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadTrinityStringCommand, "", NULL }, 233 233 { "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL }, 234 { "npc_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcOptionCommand, "", NULL }, 234 235 { "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL }, 235 236 { "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL }, -
trunk/src/game/Chat.h
r163 r168 192 192 bool HandleReloadTrinityStringCommand(const char* args); 193 193 bool HandleReloadNpcGossipCommand(const char* args); 194 bool HandleReloadNpcOptionCommand(const char* args); 194 195 bool HandleReloadNpcTrainerCommand(const char* args); 195 196 bool HandleReloadNpcVendorCommand(const char* args); -
trunk/src/game/Creature.cpp
r161 r168 288 288 SetAttackTime(RANGED_ATTACK,GetCreatureInfo()->rangeattacktime); 289 289 290 SetUInt32Value(UNIT_FIELD_FLAGS,GetCreatureInfo()-> Flags);290 SetUInt32Value(UNIT_FIELD_FLAGS,GetCreatureInfo()->unit_flags); 291 291 SetUInt32Value(UNIT_DYNAMIC_FLAGS,GetCreatureInfo()->dynamicflags); 292 292 … … 698 698 LoadGossipOptions(); 699 699 700 GossipOption* gso;701 GossipOption* ingso;702 703 700 for( GossipOptionList::iterator i = m_goptions.begin( ); i != m_goptions.end( ); i++ ) 704 701 { 705 gso=&*i;702 GossipOption* gso=&*i; 706 703 if(gso->GossipId == gossipid) 707 704 { … … 775 772 break; 776 773 default: 777 sLog.outErrorDb("Creature %u (entry: %u) have unknown gossip option %u",Get GUIDLow(),GetEntry(),gso->Action);774 sLog.outErrorDb("Creature %u (entry: %u) have unknown gossip option %u",GetDBTableGUIDLow(),GetEntry(),gso->Action); 778 775 break; 779 776 } 780 777 } 781 778 782 if(!gso->Option.empty() && cantalking ) 783 { //note for future dev: should have database fields for BoxMessage & BoxMoney 784 pm->GetGossipMenu().AddMenuItem((uint8)gso->Icon,gso->Option, gossipid,gso->Action,"",0,false); 785 ingso=gso; 779 //note for future dev: should have database fields for BoxMessage & BoxMoney 780 if(!gso->OptionText.empty() && cantalking) 781 { 782 std::string OptionText = gso->OptionText; 783 std::string BoxText = gso->BoxText; 784 int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex(); 785 if (loc_idx >= 0) 786 { 787 NpcOptionLocale const *no = objmgr.GetNpcOptionLocale(gso->Id); 788 if (no) 789 { 790 if (no->OptionText.size() > loc_idx && !no->OptionText[loc_idx].empty()) 791 OptionText=no->OptionText[loc_idx]; 792 if (no->BoxText.size() > loc_idx && !no->BoxText[loc_idx].empty()) 793 BoxText=no->BoxText[loc_idx]; 794 } 795 } 796 pm->GetGossipMenu().AddMenuItem((uint8)gso->Icon,OptionText, gossipid,gso->Action,BoxText,gso->BoxMoney,gso->Coded); 786 797 } 787 798 } … … 836 847 837 848 GossipOption const *gossip=GetGossipOption( action ); 838 uint32 textid;839 849 if(!gossip) 840 850 { … … 844 854 return; 845 855 } 846 textid=GetGossipTextId( action, zoneid);856 uint32 textid=GetGossipTextId( action, zoneid); 847 857 if(textid==0) 848 858 textid=GetNpcTextId(); … … 936 946 uint16 areaflag=map->GetAreaFlag(GetPositionX(),GetPositionY()); 937 947 uint32 zoneid=Map::GetZoneId(areaflag,mapid); 938 std::string areaname= gossip->Option ;948 std::string areaname= gossip->OptionText; 939 949 /* 940 950 uint16 pflag; … … 1041 1051 uint32 npcflags=GetUInt32Value(UNIT_NPC_FLAGS); 1042 1052 1043 QueryResult *result = WorldDatabase.PQuery( "SELECT id,gossip_id,npcflag,icon,action,option_text FROM npc_option WHERE (npcflag & %u)<>0", npcflags ); 1044 1045 if(!result) 1046 return; 1047 1048 GossipOption go; 1049 do 1050 { 1051 Field *fields = result->Fetch(); 1052 go.Id= fields[0].GetUInt32(); 1053 go.GossipId = fields[1].GetUInt32(); 1054 go.NpcFlag=fields[2].GetUInt32(); 1055 go.Icon=fields[3].GetUInt32(); 1056 go.Action=fields[4].GetUInt32(); 1057 go.Option=fields[5].GetCppString(); 1058 addGossipOption(go); 1059 }while( result->NextRow() ); 1060 delete result; 1053 CacheNpcOptionList const& noList = objmgr.GetNpcOptions (); 1054 for (CacheNpcOptionList::const_iterator i = noList.begin (); i != noList.end (); ++i) 1055 if(i->NpcFlag & npcflags) 1056 addGossipOption(*i); 1061 1057 1062 1058 m_gossipOptionLoaded = true; -
trunk/src/game/Creature.h
r135 r168 113 113 uint32 Icon; 114 114 uint32 Action; 115 std::string Option; 115 uint32 BoxMoney; 116 bool Coded; 117 std::string OptionText; 118 std::string BoxText; 116 119 }; 117 120 … … 167 170 uint32 baseattacktime; 168 171 uint32 rangeattacktime; 169 uint32 Flags;172 uint32 unit_flags; // enum UnitFlags mask values 170 173 uint32 dynamicflags; 171 uint32 family; 174 uint32 family; // enum CreatureFamily values for type==CREATURE_TYPE_BEAST, or 0 in another cases 172 175 uint32 trainer_type; 173 176 uint32 trainer_spell; … … 177 180 float maxrangedmg; 178 181 uint32 rangedattackpower; 179 uint32 type; 180 uint32 flag1;182 uint32 type; // enum CreatureType values 183 uint32 type_flags; // enum CreatureTypeFlags mask values 181 184 uint32 lootid; 182 185 uint32 pickpocketLootId; … … 206 209 uint32 GetRandomValidModelId() const; 207 210 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 } 208 226 }; 209 227 … … 212 230 std::vector<std::string> Name; 213 231 std::vector<std::string> SubName; 232 }; 233 234 struct NpcOptionLocale 235 { 236 std::vector<std::string> OptionText; 237 std::vector<std::string> BoxText; 214 238 }; 215 239 … … 474 498 char const* GetScriptName() const; 475 499 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 ); 478 502 void OnGossipSelect(Player* player, uint32 option); 479 503 void OnPoiSelect(Player* player, GossipOption const *gossip); -
trunk/src/game/Level2.cpp
r163 r168 1797 1797 { 1798 1798 accId = objmgr.GetPlayerAccountIdByGUID(targetGUID); 1799 Player plr(m_session); // use current session for temporary load 1799 WorldSession session(0,NULL,SEC_PLAYER,0,0,LOCALE_enUS); 1800 Player plr(&session); // use fake session for temporary load 1800 1801 plr.MinimalLoadFromDB(NULL, targetGUID); 1801 1802 money = plr.GetMoney(); … … 4133 4134 Player *player = m_session->GetPlayer(); 4134 4135 Creature *creatureTarget = getSelectedCreature(); 4136 4137 if(!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) 4138 { 4139 PSendSysMessage(LANG_SELECT_CREATURE); 4140 SetSentErrorMessage(true); 4141 return false; 4142 } 4135 4143 4136 4144 CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creatureTarget->GetEntry()); … … 4149 4157 return false; 4150 4158 } 4151 4152 if(!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)4153 {4154 PSendSysMessage(LANG_SELECT_CREATURE);4155 SetSentErrorMessage(true);4156 return false;4157 }4158 4159 4159 4160 // Everything looks OK, create new pet -
trunk/src/game/NPCHandler.cpp
r102 r168 298 298 { 299 299 _player->TalkedToCreature(unit->GetEntry(),unit->GetGUID()); 300 unit->prepareGossipMenu(_player ,0);301 unit->sendPreparedGossip( _player);300 unit->prepareGossipMenu(_player); 301 unit->sendPreparedGossip(_player); 302 302 } 303 303 } … … 339 339 { 340 340 341 if (!Script->GossipSelectWithCode( _player, unit, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option ), code.c_str()))342 unit->OnGossipSelect ( _player, option);341 if (!Script->GossipSelectWithCode(_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction( option ), code.c_str())) 342 unit->OnGossipSelect (_player, option); 343 343 } 344 344 else 345 345 346 if(!Script->GossipSelect( _player, unit, _player->PlayerTalkClass->GossipOptionSender( option ), _player->PlayerTalkClass->GossipOptionAction( option )) ) 347 unit->OnGossipSelect( _player, option ); 346 { 347 if (!Script->GossipSelect (_player, unit, _player->PlayerTalkClass->GossipOptionSender (option), _player->PlayerTalkClass->GossipOptionAction (option))) 348 unit->OnGossipSelect (_player, option); 349 } 348 350 } 349 351 -
trunk/src/game/ObjectMgr.cpp
r149 r168 623 623 sLog.outString(); 624 624 sLog.outString( ">> Loaded %u creature locale strings", mCreatureLocaleMap.size() ); 625 } 626 627 void ObjectMgr::LoadNpcOptionLocales() 628 { 629 mNpcOptionLocaleMap.clear(); // need for reload case 630 631 QueryResult *result = WorldDatabase.Query("SELECT entry," 632 "option_text_loc1,box_text_loc1,option_text_loc2,box_text_loc2," 633 "option_text_loc3,box_text_loc3,option_text_loc4,box_text_loc4," 634 "option_text_loc5,box_text_loc5,option_text_loc6,box_text_loc6," 635 "option_text_loc7,box_text_loc7,option_text_loc8,box_text_loc8 " 636 "FROM locales_npc_option"); 637 638 if(!result) 639 { 640 barGoLink bar(1); 641 642 bar.step(); 643 644 sLog.outString(""); 645 sLog.outString(">> Loaded 0 npc_option locale strings. DB table `locales_npc_option` is empty."); 646 return; 647 } 648 649 barGoLink bar(result->GetRowCount()); 650 651 do 652 { 653 Field *fields = result->Fetch(); 654 bar.step(); 655 656 uint32 entry = fields[0].GetUInt32(); 657 658 NpcOptionLocale& data = mNpcOptionLocaleMap[entry]; 659 660 for(int i = 1; i < MAX_LOCALE; ++i) 661 { 662 std::string str = fields[1+2*(i-1)].GetCppString(); 663 if(!str.empty()) 664 { 665 int idx = GetOrNewIndexForLocale(LocaleConstant(i)); 666 if(idx >= 0) 667 { 668 if(data.OptionText.size() <= idx) 669 data.OptionText.resize(idx+1); 670 671 data.OptionText[idx] = str; 672 } 673 } 674 str = fields[1+2*(i-1)+1].GetCppString(); 675 if(!str.empty()) 676 { 677 int idx = GetOrNewIndexForLocale(LocaleConstant(i)); 678 if(idx >= 0) 679 { 680 if(data.BoxText.size() <= idx) 681 data.BoxText.resize(idx+1); 682 683 data.BoxText[idx] = str; 684 } 685 } 686 } 687 } while (result->NextRow()); 688 689 delete result; 690 691 sLog.outString(); 692 sLog.outString( ">> Loaded %u npc_option locale strings", mNpcOptionLocaleMap.size() ); 625 693 } 626 694 … … 7077 7145 } 7078 7146 7147 void ObjectMgr::LoadNpcOptions() 7148 { 7149 m_mCacheNpcOptionList.clear(); // For reload case 7150 7151 QueryResult *result = WorldDatabase.Query( 7152 // 0 1 2 3 4 5 6 7 8 7153 "SELECT id,gossip_id,npcflag,icon,action,box_money,coded,option_text,box_text " 7154 "FROM npc_option"); 7155 if( !result ) 7156 { 7157 barGoLink bar( 1 ); 7158 7159 bar.step(); 7160 7161 sLog.outString(); 7162 sLog.outErrorDb(">> Loaded `npc_option`, table is empty!"); 7163 return; 7164 } 7165 7166 barGoLink bar( result->GetRowCount() ); 7167 7168 uint32 count = 0; 7169 7170 do 7171 { 7172 bar.step(); 7173 7174 Field* fields = result->Fetch(); 7175 7176 GossipOption go; 7177 go.Id = fields[0].GetUInt32(); 7178 go.GossipId = fields[1].GetUInt32(); 7179 go.NpcFlag = fields[2].GetUInt32(); 7180 go.Icon = fields[3].GetUInt32(); 7181 go.Action = fields[4].GetUInt32(); 7182 go.BoxMoney = fields[5].GetUInt32(); 7183 go.Coded = fields[6].GetUInt8()!=0; 7184 go.OptionText = fields[7].GetCppString(); 7185 go.BoxText = fields[8].GetCppString(); 7186 7187 m_mCacheNpcOptionList.push_back(go); 7188 7189 ++count; 7190 7191 } while (result->NextRow()); 7192 delete result; 7193 7194 sLog.outString(); 7195 sLog.outString( ">> Loaded %d npc_option entries", count ); 7196 } 7197 7079 7198 void ObjectMgr::AddVendorItem( uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) 7080 7199 { -
trunk/src/game/ObjectMgr.h
r149 r168 76 76 77 77 typedef HM_NAMESPACE::hash_map<uint32, GameTele > GameTeleMap; 78 typedef std::list<GossipOption> CacheNpcOptionList; 78 79 79 80 struct ScriptInfo … … 142 143 typedef HM_NAMESPACE::hash_map<uint32,PageTextLocale> PageTextLocaleMap; 143 144 typedef HM_NAMESPACE::hash_map<uint32,TrinityStringLocale> TrinityStringLocaleMap; 145 typedef HM_NAMESPACE::hash_map<uint32,NpcOptionLocale> NpcOptionLocaleMap; 144 146 145 147 typedef std::multimap<uint32,uint32> QuestRelations; … … 538 540 void LoadNpcTextLocales(); 539 541 void LoadPageTextLocales(); 542 void LoadNpcOptionLocales(); 540 543 void LoadInstanceTemplate(); 541 544 … … 568 571 void LoadGameTele(); 569 572 573 void LoadNpcOptions(); 570 574 void LoadNpcTextId(); 571 575 void LoadVendors(); … … 665 669 return &itr->second; 666 670 } 671 672 NpcOptionLocale const* GetNpcOptionLocale(uint32 entry) const 673 { 674 NpcOptionLocaleMap::const_iterator itr = mNpcOptionLocaleMap.find(entry); 675 if(itr==mNpcOptionLocaleMap.end()) return NULL; 676 return &itr->second; 677 } 667 678 668 679 GameObjectData const* GetGOData(uint32 guid) const … … 743 754 bool AddGameTele(GameTele& data); 744 755 bool DeleteGameTele(std::string name); 756 757 CacheNpcOptionList const& GetNpcOptions() const { return m_mCacheNpcOptionList; } 745 758 746 759 uint32 GetNpcGossip(uint32 entry) const … … 875 888 PageTextLocaleMap mPageTextLocaleMap; 876 889 TrinityStringLocaleMap mTrinityStringLocaleMap; 890 NpcOptionLocaleMap mNpcOptionLocaleMap; 877 891 RespawnTimes mCreatureRespawnTimes; 878 892 RespawnTimes mGORespawnTimes; … … 885 899 ConditionStore mConditions; 886 900 901 CacheNpcOptionList m_mCacheNpcOptionList; 887 902 CacheNpcTextIdMap m_mCacheNpcTextIdMap; 888 903 CacheVendorItemMap m_mCacheVendorItemMap; -
trunk/src/game/OutdoorPvPEP.cpp
r102 r168 704 704 gso.Action = GOSSIP_OPTION_OUTDOORPVP; 705 705 gso.GossipId = 0; 706 gso.Option .assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT));706 gso.OptionText.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT)); 707 707 gso.Id = 50; 708 708 gso.Icon = 0; … … 712 712 gso.Action = GOSSIP_OPTION_OUTDOORPVP; 713 713 gso.GossipId = 0; 714 gso.Option .assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT));714 gso.OptionText.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT)); 715 715 gso.Id = 50; 716 716 gso.Icon = 0; … … 720 720 gso.Action = GOSSIP_OPTION_OUTDOORPVP; 721 721 gso.GossipId = 0; 722 gso.Option .assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT));722 gso.OptionText.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT)); 723 723 gso.Id = 50; 724 724 gso.Icon = 0; -
trunk/src/game/OutdoorPvPZM.cpp
r102 r168 401 401 if(itr->second == ZM_ALLIANCE_FIELD_SCOUT && plr->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A) 402 402 { 403 gso.Option .assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_ALLIANCE));403 gso.OptionText.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_ALLIANCE)); 404 404 return true; 405 405 } 406 406 else if(itr->second == ZM_HORDE_FIELD_SCOUT && plr->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H) 407 407 { 408 gso.Option .assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_HORDE));408 gso.OptionText.assign(objmgr.GetTrinityStringForDBCLocale(LANG_OPVP_ZM_GOSSIP_HORDE)); 409 409 return true; 410 410 } -
trunk/src/game/Player.cpp
r149 r168 1353 1353 // always send the flag if declined names aren't used 1354 1354 // to let the client select a default method of declining the name 1355 if(!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) || (result && result->Fetch()[1 2].GetCppString() != ""))1355 if(!sWorld.getConfig(CONFIG_DECLINED_NAMES_USED) || (result && result->Fetch()[13].GetCppString() != "")) 1356 1356 char_flags |= CHARACTER_FLAG_DECLINED; 1357 1357 … … 1371 1371 Field* fields = result->Fetch(); 1372 1372 1373 uint32 entry = fields[ 9].GetUInt32();1373 uint32 entry = fields[10].GetUInt32(); 1374 1374 CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry); 1375 1375 if(cInfo) 1376 1376 { 1377 petDisplayId = fields[1 0].GetUInt32();1378 petLevel = fields[1 1].GetUInt32();1377 petDisplayId = fields[11].GetUInt32(); 1378 petLevel = fields[12].GetUInt32(); 1379 1379 petFamily = cInfo->family; 1380 1380 } … … 13496 13496 if(!result) 13497 13497 { 13498 // 0 1 2 3 4 5 6 7 813499 result = CharacterDatabase.PQuery("SELECT data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login FROM characters WHERE guid = '%u'",guid);13498 // 0 1 2 3 4 5 6 7 8 9 13499 result = CharacterDatabase.PQuery("SELECT guid, data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login FROM characters WHERE guid = '%u'",guid); 13500 13500 if(!result) return false; 13501 13501 } … … 13504 13504 Field *fields = result->Fetch(); 13505 13505 13506 if(!LoadValues( fields[ 0].GetString()))13506 if(!LoadValues( fields[1].GetString())) 13507 13507 { 13508 13508 sLog.outError("ERROR: Player #%d have broken data in `data` field. Can't be loaded.",GUID_LOPART(guid)); … … 13514 13514 SetUInt64Value(OBJECT_FIELD_GUID, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); 13515 13515 13516 m_name = fields[ 1].GetCppString();13517 13518 Relocate(fields[ 2].GetFloat(),fields[3].GetFloat(),fields[4].GetFloat());13519 SetMapId(fields[ 5].GetUInt32());13516 m_name = fields[2].GetCppString(); 13517 13518 Relocate(fields[3].GetFloat(),fields[4].GetFloat(),fields[5].GetFloat()); 13519 SetMapId(fields[6].GetUInt32()); 13520 13520 // the instance id is not needed at character enum 13521 13521 13522 m_Played_time[0] = fields[ 6].GetUInt32();13523 m_Played_time[1] = fields[ 7].GetUInt32();13524 13525 m_atLoginFlags = fields[ 8].GetUInt32();13522 m_Played_time[0] = fields[7].GetUInt32(); 13523 m_Played_time[1] = fields[8].GetUInt32(); 13524 13525 m_atLoginFlags = fields[9].GetUInt32(); 13526 13526 13527 13527 // I don't see these used anywhere .. -
trunk/src/game/QueryHandler.cpp
r123 r168 182 182 data << SubName; 183 183 data << ci->IconName; // "Directions" for guard, string for Icons 2.3.0 184 data << (uint32)ci-> flag1; // flags wdbFeild7=wad flags1184 data << (uint32)ci->type_flags; // flags wdbFeild7=wad flags1 185 185 data << (uint32)ci->type; 186 186 data << (uint32)ci->family; // family wdbFeild9 -
trunk/src/game/QuestHandler.cpp
r102 r168 106 106 return; 107 107 108 pCreature->prepareGossipMenu(_player ,0);109 pCreature->sendPreparedGossip( _player);108 pCreature->prepareGossipMenu(_player); 109 pCreature->sendPreparedGossip(_player); 110 110 } 111 111 -
trunk/src/game/SharedDefines.h
r139 r168 1601 1601 }; 1602 1602 1603 enum CreatureTypeFlags 1604 { 1605 CREATURE_TYPEFLAGS_TAMEBLE = 0x0001, 1606 CREATURE_TYPEFLAGS_HERBLOOT = 0x0100, 1607 CREATURE_TYPEFLAGS_MININGLOOT = 0x0200, 1608 }; 1609 1603 1610 enum CreatureEliteType 1604 1611 { -
trunk/src/game/Spell.cpp
r157 r168 3670 3670 } 3671 3671 3672 uint32 skill; 3673 if(creature->GetCreatureInfo()->flag1 & 256) 3674 skill = SKILL_HERBALISM; // special case 3675 else if(creature->GetCreatureInfo()->flag1 & 512) 3676 skill = SKILL_MINING; // special case 3677 else 3678 skill = SKILL_SKINNING; // normal case 3672 uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); 3679 3673 3680 3674 int32 skillValue = ((Player*)m_caster)->GetSkillValue(skill); … … 3968 3962 return SPELL_FAILED_HIGHLEVEL; 3969 3963 3970 CreatureInfo const *cinfo = ((Creature*)m_targets.getUnitTarget())->GetCreatureInfo();3971 if( cinfo->type != CREATURE_TYPE_BEAST )3972 return SPELL_FAILED_BAD_TARGETS;3973 3974 3964 // use SMSG_PET_TAME_FAILURE? 3975 if ( !(cinfo->flag1 & 1) || !(cinfo->family))3965 if (!((Creature*)m_targets.getUnitTarget())->GetCreatureInfo()->isTameable ()) 3976 3966 return SPELL_FAILED_BAD_TARGETS; 3977 3967 -
trunk/src/game/SpellEffects.cpp
r162 r168 5556 5556 int32 targetLevel = creature->getLevel(); 5557 5557 5558 uint32 skill; 5559 if(creature->GetCreatureInfo()->flag1 & 256) 5560 skill = SKILL_HERBALISM; // special case 5561 else if(creature->GetCreatureInfo()->flag1 & 512) 5562 skill = SKILL_MINING; // special case 5563 else 5564 skill = SKILL_SKINNING; // normal case 5558 uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); 5565 5559 5566 5560 ((Player*)m_caster)->SendLoot(creature->GetGUID(),LOOT_SKINNING); -
trunk/src/game/World.cpp
r149 r168 983 983 objmgr.LoadNpcTextLocales(); 984 984 objmgr.LoadPageTextLocales(); 985 objmgr.LoadNpcOptionLocales(); 985 986 objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) 986 987 … … 1161 1162 sLog.outString( "Loading Npc Text Id..." ); 1162 1163 objmgr.LoadNpcTextId(); // must be after load Creature and NpcText 1164 1165 sLog.outString( "Loading Npc Options..." ); 1166 objmgr.LoadNpcOptions(); 1163 1167 1164 1168 sLog.outString( "Loading vendors..." ); … … 2473 2477 ///- Delete kicked sessions at add new session 2474 2478 for (std::set<WorldSession*>::iterator itr = m_kicked_sessions.begin(); itr != m_kicked_sessions.end(); ++itr) 2479 { 2480 RemoveQueuedPlayer (*itr); 2475 2481 delete *itr; 2482 } 2476 2483 m_kicked_sessions.clear(); 2477 2484 -
trunk/src/game/WorldSession.cpp
r149 r168 80 80 } 81 81 82 sWorld.RemoveQueuedPlayer(this);83 82 } 84 83 -
trunk/src/trinitycore/trinitycore.conf.dist
r78 r168 245 245 # WorldLogFile 246 246 # Packet logging file for the worldserver 247 # Default: " world.log"247 # Default: "" 248 248 # 249 249 # DBErrorLogFile … … 302 302 LogFilter_CreatureMoves = 1 303 303 LogFilter_VisibilityChanges = 1 304 WorldLogFile = " world.log"304 WorldLogFile = "" 305 305 DBErrorLogFile = "db_errors.log" 306 306 CharLogFile = "characters.log"