Changeset 28 for trunk/src/game
- Timestamp:
- 11/19/08 13:24:39 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 39 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/AggressorAI.cpp
r6 r28 48 48 return; 49 49 50 if( !i_creature.getVictim() && !i_creature.hasUnitState(UNIT_STAT_STUN DED) && u->isTargetableForAttack() &&50 if( !i_creature.getVictim() && !i_creature.hasUnitState(UNIT_STAT_STUNNED) && u->isTargetableForAttack() && 51 51 ( i_creature.IsHostileTo( u ) /*|| u->getVictim() && i_creature.IsFriendlyTo( u->getVictim() )*/ ) && 52 52 u->isInAccessablePlaceFor(&i_creature) ) -
trunk/src/game/ArenaTeamHandler.cpp
r2 r28 26 26 #include "World.h" 27 27 #include "SocialMgr.h" 28 #include "Language.h" 28 29 29 30 void WorldSession::HandleInspectArenaStatsOpcode(WorldPacket & recv_data) … … 118 119 //SendArenaTeamCommandResult(ARENA_TEAM_INVITE_SS,"",Invitedname,ARENA_TEAM_PLAYER_NOT_FOUND_S); 119 120 // can't find related opcode 120 SendNotification( "%s is not high enough level to join your team", player->GetName());121 SendNotification(LANG_HIS_ARENA_LEVEL_REQ_ERROR, player->GetName()); 121 122 return; 122 123 } … … 155 156 // should send an "arena team is full" or the likes message, I just don't know the proper values so... ERR_INTERNAL 156 157 // SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_INTERNAL); 157 SendNotification( "Your arena team is full, %s cannot join it.", player->GetName());158 SendNotification(LANG_YOUR_ARENA_TEAM_FULL, player->GetName()); 158 159 return; 159 160 } -
trunk/src/game/BattleGroundHandler.cpp
r9 r28 57 57 { 58 58 // temp, must be gossip message... 59 SendNotification( "You don't meet Battleground level requirements");59 SendNotification(LANG_YOUR_BG_LEVEL_REQ_ERROR); 60 60 return; 61 61 } -
trunk/src/game/CharacterHandler.cpp
r6 r28 37 37 #include "SocialMgr.h" 38 38 #include "Util.h" 39 #include "Language.h" 39 40 40 41 class LoginQueryHolder : public SqlQueryHolder … … 719 720 { 720 721 pCurrChar->resetSpells(); 721 SendNotification( "Spells has been reset.");722 SendNotification(LANG_RESET_SPELLS); 722 723 } 723 724 … … 725 726 { 726 727 pCurrChar->resetTalents(true); 727 SendNotification( "Talents has been reset.");728 SendNotification(LANG_RESET_TALENTS); 728 729 } 729 730 … … 733 734 734 735 if(pCurrChar->isGameMaster()) 735 SendNotification( "GM mode is ON");736 SendNotification(LANG_GM_ON); 736 737 737 738 std::string IP_str = GetRemoteAddress(); -
trunk/src/game/Chat.cpp
r18 r28 354 354 static ChatCommand gmCommandTable[] = 355 355 { 356 { "chat", SEC_MODERATOR, &ChatHandler::HandleGMChatCommand, "", NULL }, 356 357 { "list", SEC_PLAYER, &ChatHandler::HandleGMListCommand, "", NULL }, 357 358 { "visible", SEC_MODERATOR, &ChatHandler::HandleVisibleCommand, "", NULL }, … … 508 509 } 509 510 510 bool ChatHandler::hasStringAbbr(const char* s1, const char* s2)511 { 512 for(;;)513 {514 if( !*s2 )515 return true;516 else if( !*s1)511 bool ChatHandler::hasStringAbbr(const char* name, const char* part) 512 { 513 // non "" command 514 if( *name ) 515 { 516 // "" part from non-"" command 517 if( !*part ) 517 518 return false; 518 else if( tolower( *s1 ) != tolower( *s2 ) ) 519 return false; 520 ++s1; ++s2; 521 } 519 520 for(;;) 521 { 522 if( !*part ) 523 return true; 524 else if( !*name ) 525 return false; 526 else if( tolower( *name ) != tolower( *part ) ) 527 return false; 528 ++name; ++part; 529 } 530 } 531 // allow with any for "" 532 533 return true; 522 534 } 523 535 … … 595 607 while (*text == ' ') ++text; 596 608 597 if(!cmd.length())598 return false;599 600 609 for(uint32 i = 0; table[i].Name != NULL; i++) 601 610 { 602 // allow pass "" command name in table 603 if(strlen(table[i].Name) && !hasStringAbbr(table[i].Name, cmd.c_str())) 611 if( !hasStringAbbr(table[i].Name, cmd.c_str()) ) 604 612 continue; 605 613 … … 689 697 continue; 690 698 691 if(strlen(table[i].Name) && !hasStringAbbr(table[i].Name, subcmd)) 692 continue; 699 if( !hasStringAbbr(table[i].Name, subcmd) ) 693 700 694 701 (list += "\n ") += table[i].Name; … … 718 725 continue; 719 726 720 if( strlen(table[i].Name) && !hasStringAbbr(table[i].Name, cmd))727 if( !hasStringAbbr(table[i].Name, cmd) ) 721 728 continue; 722 729 -
trunk/src/game/Chat.h
r18 r28 70 70 71 71 protected: 72 bool hasStringAbbr(const char* s1, const char* s2);72 bool hasStringAbbr(const char* name, const char* part); 73 73 void SendGlobalSysMessage(const char *str); 74 74 … … 95 95 bool HandleNotifyCommand(const char* args); 96 96 bool HandleGMmodeCommand(const char* args); 97 bool HandleGMChatCommand(const char* args); 97 98 bool HandleVisibleCommand(const char* args); 98 99 bool HandleGPSCommand(const char* args); -
trunk/src/game/ChatHandler.cpp
r2 r28 59 59 if(!langDesc) 60 60 { 61 SendNotification( "Unknown language");61 SendNotification(LANG_UNKNOWN_LANGUAGE); 62 62 return; 63 63 } … … 77 77 if(!foundAura) 78 78 { 79 SendNotification( "You don't know that language");79 SendNotification(LANG_NOT_LEARNED_LANGUAGE); 80 80 return; 81 81 } -
trunk/src/game/ConfusedMovementGenerator.cpp
r2 r28 102 102 return true; 103 103 104 if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED))104 if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) 105 105 return true; 106 106 -
trunk/src/game/Creature.cpp
r18 r28 74 74 } 75 75 return false; 76 } 77 78 size_t VendorItemData::FindItemSlot(uint32 item_id) const 79 { 80 for(size_t i = 0; i < m_items.size(); ++i ) 81 if(m_items[i]->item==item_id) 82 return i; 83 return m_items.size(); 76 84 } 77 85 … … 1911 1919 void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float* dist ) const 1912 1920 { 1913 if(CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow())) 1914 { 1915 x = data->posX; 1916 y = data->posY; 1917 z = data->posZ; 1918 if(ori) 1919 *ori = data->orientation; 1920 if(dist) 1921 *dist = data->spawndist; 1922 } 1923 else 1924 { 1925 x = GetPositionX(); 1926 y = GetPositionY(); 1927 z = GetPositionZ(); 1928 if(ori) 1929 *ori = GetOrientation(); 1930 if(dist) 1931 *dist = 0; 1932 } 1921 if (m_DBTableGuid) 1922 { 1923 if (CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow())) 1924 { 1925 x = data->posX; 1926 y = data->posY; 1927 z = data->posZ; 1928 if(ori) 1929 *ori = data->orientation; 1930 if(dist) 1931 *dist = data->spawndist; 1932 1933 return; 1934 } 1935 } 1936 1937 x = GetPositionX(); 1938 y = GetPositionY(); 1939 z = GetPositionZ(); 1940 if(ori) 1941 *ori = GetOrientation(); 1942 if(dist) 1943 *dist = 0; 1933 1944 } 1934 1945 -
trunk/src/game/Creature.h
r18 r28 309 309 bool RemoveItem( uint32 item_id ); 310 310 VendorItem const* FindItem(uint32 item_id) const; 311 size_t FindItemSlot(uint32 item_id) const; 311 312 312 313 void Clear() -
trunk/src/game/FleeingMovementGenerator.cpp
r2 r28 33 33 return; 34 34 35 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED) )35 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED) ) 36 36 return; 37 37 … … 339 339 if( !&owner || !owner.isAlive() ) 340 340 return false; 341 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED) )341 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED) ) 342 342 return true; 343 343 -
trunk/src/game/GridNotifiers.h
r13 r28 853 853 { 854 854 if(u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && 855 (u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUN DED) || u->hasUnitState(UNIT_STAT_STUNDED) || u->hasUnitState(UNIT_STAT_CONFUSED)))855 (u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUNNED) || u->hasUnitState(UNIT_STAT_CONFUSED))) 856 856 { 857 857 return true; -
trunk/src/game/Group.cpp
r9 r28 624 624 case 1: //player choose Need 625 625 { 626 SendLootRoll(0, playerGUID, 1, 1, *roll);626 SendLootRoll(0, playerGUID, 0, 0, *roll); 627 627 ++roll->totalNeed; 628 628 itr->second = NEED; … … 631 631 case 2: //player choose Greed 632 632 { 633 SendLootRoll(0, playerGUID, 2, 2, *roll);633 SendLootRoll(0, playerGUID, 128, 2, *roll); 634 634 ++roll->totalGreed; 635 635 itr->second = GREED; -
trunk/src/game/HomeMovementGenerator.cpp
r2 r28 44 44 return; 45 45 46 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED) )46 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ) 47 47 return; 48 48 -
trunk/src/game/Language.h
r18 r28 76 76 LANG_LEVEL_MINREQUIRED_AND_ITEM = 50, 77 77 LANG_NPC_TAINER_HELLO = 51, 78 // Room for more level 0 78 LANG_COMMAND_INVALID_ITEM_COUNT = 52, 79 LANG_COMMAND_MAIL_ITEMS_LIMIT = 53, 80 // Room for more level 0 54-99 not used 79 81 80 82 // level 1 chat … … 160 162 LANG_MAIL_SENT = 169, 161 163 LANG_SOUND_NOT_EXIST = 170, 162 // Room for more level 1 164 // Room for more level 1 171-199 not used 163 165 164 166 // level 2 chat … … 305 307 LANG_NO_PLAYERS_FOUND = 330, 306 308 LANG_EXTENDED_COST_NOT_EXIST = 331, 307 308 // Room for more level 2 309 LANG_GM_ON = 332, 310 LANG_GM_OFF = 333, 311 LANG_GM_CHAT_ON = 334, 312 LANG_GM_CHAT_OFF = 335, 313 // Room for more level 2 336-399 not used 309 314 310 315 // level 3 chat … … 611 616 LANG_BG_GROUP_TOO_LARGE = 711, 612 617 LANG_ARENA_GROUP_TOO_LARGE = 712, 613 LANG_ARENA_YOUR_TEAM_ONLY = 713, 614 LANG_ARENA_NOT_ENOUGH_PLAYERS = 714, 615 LANG_ARENA_GOLD_WINS = 715, 616 LANG_ARENA_GREEN_WINS = 716, 617 LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 717, 618 LANG_BG_GROUP_OFFLINE_MEMBER = 718, 619 LANG_BG_GROUP_MIXED_FACTION = 719, 620 LANG_BG_GROUP_MIXED_LEVELS = 720, 621 LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 721, 622 LANG_BG_GROUP_MEMBER_DESERTER = 722, 623 LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 723, 624 625 LANG_CANNOT_TELE_TO_BG = 724, 626 LANG_CANNOT_SUMMON_TO_BG = 725, 627 LANG_CANNOT_GO_TO_BG_GM = 726, 628 LANG_CANNOT_GO_TO_BG_FROM_BG = 727, 629 630 LANG_ARENA_TESTING = 728 631 618 LANG_YOUR_ARENA_LEVEL_REQ_ERROR = 713, 619 LANG_HIS_ARENA_LEVEL_REQ_ERROR = 714, 620 LANG_YOUR_BG_LEVEL_REQ_ERROR = 715, 621 LANG_YOUR_ARENA_TEAM_FULL = 716, 622 // Room for BG/ARENA 717-799 not used 623 624 LANG_ARENA_YOUR_TEAM_ONLY = 730, 625 LANG_ARENA_NOT_ENOUGH_PLAYERS = 731, 626 LANG_ARENA_GOLD_WINS = 732, 627 LANG_ARENA_GREEN_WINS = 733, 628 LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 734, 629 LANG_BG_GROUP_OFFLINE_MEMBER = 735, 630 LANG_BG_GROUP_MIXED_FACTION = 736, 631 LANG_BG_GROUP_MIXED_LEVELS = 737, 632 LANG_BG_GROUP_MEMBER_ALREADY_IN_QUEUE = 738, 633 LANG_BG_GROUP_MEMBER_DESERTER = 739, 634 LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS = 740, 635 636 LANG_CANNOT_TELE_TO_BG = 741, 637 LANG_CANNOT_SUMMON_TO_BG = 742, 638 LANG_CANNOT_GO_TO_BG_GM = 743, 639 LANG_CANNOT_GO_TO_BG_FROM_BG = 744, 640 641 LANG_ARENA_TESTING = 745, 642 643 // in game strings 644 LANG_PET_INVALID_NAME = 800, 645 LANG_NOT_ENOUGH_GOLD = 801, 646 LANG_NOT_FREE_TRADE_SLOTS = 802, 647 LANG_NOT_PARTNER_FREE_TRADE_SLOTS = 803, 648 LANG_YOU_NOT_HAVE_PERMISSION = 804, 649 LANG_UNKNOWN_LANGUAGE = 805, 650 LANG_NOT_LEARNED_LANGUAGE = 806, 651 LANG_NEED_CHARACTER_NAME = 807, 652 LANG_PLAYER_NOT_EXIST_OR_OFFLINE = 808, 653 LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND = 809, 654 // Room for in-game strings 810-999 not used 655 656 // FREE IDS 1000-9999 657 658 // Use for not-in-svn patches 10000-10999 659 // Use for custom patches 11000-11999 660 661 // NOT RESERVED IDS 12000- 632 662 }; 633 663 #endif 634 635 /* NOT USED VALUES636 // alliance ranks637 #define LANG_ALI_PRIVATE "Private "638 #define LANG_ALI_CORPORAL "Corporal "639 #define LANG_ALI_SERGEANT "Sergeant "640 #define LANG_ALI_MASTER_SERGEANT "Master Sergeant "641 #define LANG_ALI_SERGEANT_MAJOR "Sergeant Major "642 #define LANG_ALI_KNIGHT "Knight "643 #define LANG_ALI_KNIGHT_LIEUTENANT "Knight-Lieutenant "644 #define LANG_ALI_KNIGHT_CAPTAIN "Knight-Captain "645 #define LANG_ALI_KNIGHT_CHAMPION "Knight-Champion "646 #define LANG_ALI_LIEUTENANT_COMMANDER "Lieutenant Commander "647 #define LANG_ALI_COMMANDER "Commander "648 #define LANG_ALI_MARSHAL "Marshal "649 #define LANG_ALI_FIELD_MARSHAL "Field Marshal "650 #define LANG_ALI_GRAND_MARSHAL "Grand Marshal "651 #define LANG_ALI_GAME_MASTER "Game Master "652 653 // horde ranks654 #define LANG_HRD_SCOUT "Scout "655 #define LANG_HRD_GRUNT "Grunt "656 #define LANG_HRD_SERGEANT "Sergeant "657 #define LANG_HRD_SENIOR_SERGEANT "Senior Sergeant "658 #define LANG_HRD_FIRST_SERGEANT "First Sergeant "659 #define LANG_HRD_STONE_GUARD "Stone Guard "660 #define LANG_HRD_BLOOD_GUARD "Blood Guard "661 #define LANG_HRD_LEGIONNARE "Legionnaire "662 #define LANG_HRD_CENTURION "Centurion "663 #define LANG_HRD_CHAMPION "Champion "664 #define LANG_HRD_LIEUTENANT_GENERAL "Lieutenant General "665 #define LANG_HRD_GENERAL "General "666 #define LANG_HRD_WARLORD "Warlord "667 #define LANG_HRD_HIGH_WARLORD "High Warlord "668 #define LANG_HRD_GAME_MASTER "Game Master "669 670 #define LANG_NO_RANK "No rank "671 #define LANG_RANK "%s (Rank %u)"672 #define LANG_HONOR_TODAY "Today: [Honorable kills: |c0000ff00%u|r] [Dishonorable kills: |c00ff0000%u|r]"673 #define LANG_HONOR_YESTERDAY "Yesterday: [Kills: |c0000ff00%u|r] [Honor: %u]"674 #define LANG_HONOR_THIS_WEEK "This week: [Kills: |c0000ff00%u|r] [Honor: %u]"675 #define LANG_HONOR_LAST_WEEK "Last week: [Kills: |c0000ff00%u|r] [Honor: %u] [Standing: %u]"676 #define LANG_HONOR_LIFE "Lifetime: [Honorable kills: |c0000ff00%u|r] [Dishonorable kills: |c00ff0000%u|r] [Highest rank %u: %s]"677 678 // level 2679 #define LANG_ADD_OBJ "AddObject at Chat.cpp" //log680 #define LANG_DEMORPHED "Demorphed %s" //log681 682 // level 3683 #define LANG_SPAWNING_SPIRIT_HEAL "Spawning spirit healers\n"684 #define LANG_NO_SPIRIT_HEAL_DB "No spirit healers in database, exiting."685 686 #define LANG_ADD_OBJ_LV3 "AddObject at Level3.cpp line 1176"687 688 */ -
trunk/src/game/Level1.cpp
r9 r28 148 148 if(!*args) 149 149 { 150 SendSysMessage(LANG_USE_BOL); 151 SetSentErrorMessage(true); 152 return false; 150 if(m_session->GetPlayer()->isGameMaster()) 151 m_session->SendNotification(LANG_GM_ON); 152 else 153 m_session->SendNotification(LANG_GM_OFF); 154 return true; 153 155 } 154 156 … … 158 160 { 159 161 m_session->GetPlayer()->SetGameMaster(true); 160 m_session->SendNotification( "GM mode is ON");162 m_session->SendNotification(LANG_GM_ON); 161 163 #ifdef _DEBUG_VMAPS 162 164 VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); … … 169 171 { 170 172 m_session->GetPlayer()->SetGameMaster(false); 171 m_session->SendNotification( "GM mode is OFF");173 m_session->SendNotification(LANG_GM_OFF); 172 174 #ifdef _DEBUG_VMAPS 173 175 VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); … … 182 184 } 183 185 186 // Enables or disables hiding of the staff badge 187 bool ChatHandler::HandleGMChatCommand(const char* args) 188 { 189 if(!*args) 190 { 191 if(m_session->GetPlayer()->isGMChat()) 192 m_session->SendNotification(LANG_GM_CHAT_ON); 193 else 194 m_session->SendNotification(LANG_GM_CHAT_OFF); 195 return true; 196 } 197 198 std::string argstr = (char*)args; 199 200 if (argstr == "on") 201 { 202 m_session->GetPlayer()->SetGMChat(true); 203 m_session->SendNotification(LANG_GM_CHAT_ON); 204 return true; 205 } 206 207 if (argstr == "off") 208 { 209 m_session->GetPlayer()->SetGMChat(false); 210 m_session->SendNotification(LANG_GM_CHAT_OFF); 211 return true; 212 } 213 214 SendSysMessage(LANG_USE_BOL); 215 SetSentErrorMessage(true); 216 return false; 217 } 218 219 184 220 //Enable\Dissable Invisible mode 185 221 bool ChatHandler::HandleVisibleCommand(const char* args) … … 196 232 { 197 233 m_session->GetPlayer()->SetGMVisible(true); 198 m_session->SendNotification( GetMangosString(LANG_INVISIBLE_VISIBLE));234 m_session->SendNotification(LANG_INVISIBLE_VISIBLE); 199 235 return true; 200 236 } … … 202 238 if (argstr == "off") 203 239 { 204 m_session->SendNotification( GetMangosString(LANG_INVISIBLE_INVISIBLE));240 m_session->SendNotification(LANG_INVISIBLE_INVISIBLE); 205 241 m_session->GetPlayer()->SetGMVisible(false); 206 242 return true; … … 1824 1860 return false; 1825 1861 1862 // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12] 1863 1826 1864 char* pName = strtok((char*)args, " "); 1827 char* msgSubject = strtok(NULL, " "); 1828 char* msgText = strtok(NULL, ""); 1865 if(!pName) 1866 return false; 1867 1868 char* tail1 = strtok(NULL, ""); 1869 if(!tail1) 1870 return false; 1871 1872 char* msgSubject; 1873 if(*tail1=='"') 1874 msgSubject = strtok(tail1+1, "\""); 1875 else 1876 { 1877 char* space = strtok(tail1, "\""); 1878 if(!space) 1879 return false; 1880 msgSubject = strtok(NULL, "\""); 1881 } 1882 1883 if (!msgSubject) 1884 return false; 1885 1886 char* tail2 = strtok(NULL, ""); 1887 if(!tail2) 1888 return false; 1889 1890 char* msgText; 1891 if(*tail2=='"') 1892 msgText = strtok(tail2+1, "\""); 1893 else 1894 { 1895 char* space = strtok(tail2, "\""); 1896 if(!space) 1897 return false; 1898 msgText = strtok(NULL, "\""); 1899 } 1829 1900 1830 1901 if (!msgText) … … 1832 1903 1833 1904 // pName, msgSubject, msgText isn't NUL after prev. check 1834 1835 1905 std::string name = pName; 1836 1906 std::string subject = msgSubject; 1837 1907 std::string text = msgText; 1838 1908 1909 // extract items 1910 typedef std::pair<uint32,uint32> ItemPair; 1911 typedef std::list< ItemPair > ItemPairs; 1912 ItemPairs items; 1913 1914 // get all tail string 1915 char* tail = strtok(NULL, ""); 1916 1917 // get from tail next item str 1918 while(char* itemStr = strtok(tail, " ")) 1919 { 1920 // and get new tail 1921 tail = strtok(NULL, ""); 1922 1923 // parse item str 1924 char* itemIdStr = strtok(itemStr, ":"); 1925 char* itemCountStr = strtok(NULL, " "); 1926 1927 uint32 item_id = atoi(itemIdStr); 1928 if(!item_id) 1929 return false; 1930 1931 ItemPrototype const* item_proto = objmgr.GetItemPrototype(item_id); 1932 if(!item_proto) 1933 { 1934 PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id); 1935 SetSentErrorMessage(true); 1936 return false; 1937 } 1938 1939 uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1; 1940 if(item_count < 1 || item_proto->MaxCount && item_count > item_proto->MaxCount) 1941 { 1942 PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id); 1943 SetSentErrorMessage(true); 1944 return false; 1945 } 1946 1947 while(item_count > item_proto->Stackable) 1948 { 1949 items.push_back(ItemPair(item_id,item_proto->Stackable)); 1950 item_count -= item_proto->Stackable; 1951 } 1952 1953 items.push_back(ItemPair(item_id,item_count)); 1954 1955 if(items.size() > MAX_MAIL_ITEMS) 1956 { 1957 PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS); 1958 SetSentErrorMessage(true); 1959 return false; 1960 } 1961 } 1962 1839 1963 if(!normalizePlayerName(name)) 1840 1964 { … … 1845 1969 1846 1970 uint64 receiver_guid = objmgr.GetPlayerGUIDByName(name); 1847 1848 1971 if(!receiver_guid) 1849 return false; 1972 { 1973 SendSysMessage(LANG_PLAYER_NOT_FOUND); 1974 SetSentErrorMessage(true); 1975 return false; 1976 } 1850 1977 1851 1978 uint32 mailId = objmgr.GenerateMailID(); … … 1861 1988 Player *receiver = objmgr.GetPlayer(receiver_guid); 1862 1989 1863 WorldSession::SendMailTo(receiver,messagetype, stationery, sender_guidlo, GUID_LOPART(receiver_guid), subject, itemTextId, NULL, 0, 0, MAIL_CHECK_MASK_NONE); 1990 // fill mail 1991 MailItemsInfo mi; // item list preparing 1992 1993 for(ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) 1994 { 1995 if(Item* item = Item::CreateItem(itr->first,itr->second,m_session->GetPlayer())) 1996 { 1997 item->SaveToDB(); // save for prevent lost at next mail load, if send fail then item will deleted 1998 mi.AddItem(item->GetGUIDLow(), item->GetEntry(), item); 1999 } 2000 } 2001 2002 WorldSession::SendMailTo(receiver,messagetype, stationery, sender_guidlo, GUID_LOPART(receiver_guid), subject, itemTextId, &mi, 0, 0, MAIL_CHECK_MASK_NONE); 1864 2003 1865 2004 PSendSysMessage(LANG_MAIL_SENT, name.c_str()); -
trunk/src/game/MiscHandler.cpp
r9 r28 1427 1427 GetPlayer()->TeleportTo(mapid,PositionX,PositionY,PositionZ,Orientation); 1428 1428 else 1429 SendNotification( "You do not have permission to perform that function");1429 SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); 1430 1430 sLog.outDebug("Received worldport command from player %s", GetPlayer()->GetName()); 1431 1431 } … … 1436 1436 1437 1437 sLog.outDebug("Received opcode CMSG_WHOIS"); 1438 std::string charname , acc, email, lastip, msg;1438 std::string charname; 1439 1439 recv_data >> charname; 1440 1440 1441 1441 if (GetSecurity() < SEC_ADMINISTRATOR) 1442 1442 { 1443 SendNotification( "You do not have permission to perform that function");1443 SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); 1444 1444 return; 1445 1445 } … … 1447 1447 if(charname.empty()) 1448 1448 { 1449 SendNotification("Please provide character name"); 1450 return; 1451 } 1452 1453 uint32 accid; 1454 Field *fields; 1449 SendNotification(LANG_NEED_CHARACTER_NAME); 1450 return; 1451 } 1455 1452 1456 1453 Player *plr = objmgr.GetPlayer(charname.c_str()); 1457 1454 1458 if(plr) 1459 accid = plr->GetSession()->GetAccountId(); 1460 else 1461 { 1462 SendNotification("Player %s not found or offline", charname.c_str()); 1463 return; 1464 } 1465 1466 if(!accid) 1467 { 1468 SendNotification("Account for character %s not found", charname.c_str()); 1469 return; 1470 } 1455 if(!plr) 1456 { 1457 SendNotification(LANG_PLAYER_NOT_EXIST_OR_OFFLINE, charname.c_str()); 1458 return; 1459 } 1460 1461 uint32 accid = plr->GetSession()->GetAccountId(); 1471 1462 1472 1463 QueryResult *result = loginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid); 1473 if(result) 1474 { 1475 fields = result->Fetch(); 1476 acc = fields[0].GetCppString(); 1477 if(acc.empty()) 1478 acc = "Unknown"; 1479 email = fields[1].GetCppString(); 1480 if(email.empty()) 1481 email = "Unknown"; 1482 lastip = fields[2].GetCppString(); 1483 if(lastip.empty()) 1484 lastip = "Unknown"; 1485 msg = charname + "'s " + "account is " + acc + ", e-mail: " + email + ", last ip: " + lastip; 1486 1487 WorldPacket data(SMSG_WHOIS, msg.size()+1); 1488 data << msg; 1489 _player->GetSession()->SendPacket(&data); 1490 } 1491 else 1492 SendNotification("Account for character %s not found", charname.c_str()); 1464 if(!result) 1465 { 1466 SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str()); 1467 return; 1468 } 1469 1470 Field *fields = result->Fetch(); 1471 std::string acc = fields[0].GetCppString(); 1472 if(acc.empty()) 1473 acc = "Unknown"; 1474 std::string email = fields[1].GetCppString(); 1475 if(email.empty()) 1476 email = "Unknown"; 1477 std::string lastip = fields[2].GetCppString(); 1478 if(lastip.empty()) 1479 lastip = "Unknown"; 1480 1481 std::string msg = charname + "'s " + "account is " + acc + ", e-mail: " + email + ", last ip: " + lastip; 1482 1483 WorldPacket data(SMSG_WHOIS, msg.size()+1); 1484 data << msg; 1485 _player->GetSession()->SendPacket(&data); 1493 1486 1494 1487 delete result; 1488 1495 1489 sLog.outDebug("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); 1496 1490 } -
trunk/src/game/MotionMaster.cpp
r2 r28 77 77 MotionMaster::UpdateMotion(const uint32 &diff) 78 78 { 79 if( i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED) )79 if( i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED) ) 80 80 return; 81 81 assert( !empty() ); -
trunk/src/game/ObjectMgr.cpp
r18 r28 6680 6680 m_mCacheTrainerSpellMap.clear(); 6681 6681 6682 std::set<uint32> skip_trainers; 6683 6682 6684 QueryResult *result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer"); 6683 6685 … … 6715 6717 if(!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER)) 6716 6718 { 6717 sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry); 6719 if(skip_trainers.count(entry) == 0) 6720 { 6721 sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry); 6722 skip_trainers.insert(entry); 6723 } 6718 6724 continue; 6719 6725 } … … 6765 6771 m_mCacheVendorItemMap.clear(); 6766 6772 6773 std::set<uint32> skip_vendors; 6774 6767 6775 QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor"); 6768 6776 if( !result ) … … 6791 6799 uint32 ExtendedCost = fields[4].GetUInt32(); 6792 6800 6793 if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost ))6801 if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost,NULL,&skip_vendors)) 6794 6802 continue; 6795 6803 … … 6879 6887 } 6880 6888 6881 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl ) const6889 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors ) const 6882 6890 { 6883 6891 CreatureInfo const* cInfo = GetCreatureTemplate(vendor_entry); … … 6893 6901 if(!(cInfo->npcflag & UNIT_NPC_FLAG_VENDOR)) 6894 6902 { 6895 if(pl) 6896 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6897 else 6898 sLog.outErrorDb("Table `npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); 6903 if(!skip_vendors || skip_vendors->count(vendor_entry)==0) 6904 { 6905 if(pl) 6906 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6907 else 6908 sLog.outErrorDb("Table `npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); 6909 6910 if(skip_vendors) 6911 skip_vendors->insert(vendor_entry); 6912 } 6899 6913 return false; 6900 6914 } -
trunk/src/game/ObjectMgr.h
r18 r28 743 743 void AddVendorItem(uint32 entry,uint32 item, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost); 744 744 bool RemoveVendorItem(uint32 entry,uint32 item); 745 bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL ) const;745 bool IsVendorItemValid( uint32 vendor_entry, uint32 item, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL ) const; 746 746 protected: 747 747 uint32 m_auctionid; -
trunk/src/game/PetHandler.cpp
r2 r28 31 31 #include "Util.h" 32 32 #include "Pet.h" 33 #include "Language.h" 33 34 34 35 void WorldSession::HandlePetAction( WorldPacket & recv_data ) … … 396 397 if((!ObjectMgr::IsValidPetName(name)) || (objmgr.IsReservedName(name))) 397 398 { 398 SendNotification( "Invalid name");399 SendNotification(LANG_PET_INVALID_NAME); 399 400 return; 400 401 } … … 416 417 if(!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname,0),declinedname)) 417 418 { 418 SendNotification( "Invalid name");419 SendNotification(LANG_PET_INVALID_NAME); 419 420 return; 420 421 } -
trunk/src/game/PetitionsHandler.cpp
r2 r28 112 112 if(_player->getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)) 113 113 { 114 SendNotification( GetMangosString(LANG_ARENA_ONE_TOOLOW), 70);114 SendNotification(LANG_ARENA_ONE_TOOLOW, 70); 115 115 return; 116 116 } … … 531 531 { 532 532 // player is too low level to join an arena team 533 SendNotification( "You must be level %u to join an arena team!",sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));533 SendNotification(LANG_YOUR_ARENA_LEVEL_REQ_ERROR,sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); 534 534 return; 535 535 } -
trunk/src/game/Player.cpp
r18 r28 266 266 SetAcceptTicket(true); 267 267 268 // players always a nd GM if set in config accept whispers by default269 if(GetSession()->GetSecurity() == SEC_PLAYER || sWorld.getConfig(CONFIG_GM_WISPERING_TO))268 // players always accept 269 if(GetSession()->GetSecurity() == SEC_PLAYER) 270 270 SetAcceptWhispers(true); 271 271 … … 1416 1416 // 0x2 - dnd 1417 1417 // 0x1 - afk 1418 if(isG ameMaster())1418 if(isGMChat()) 1419 1419 return 4; 1420 1420 else if(isDND()) … … 1556 1556 } 1557 1557 1558 SetSemaphoreTeleport(false);1559 1560 1558 if(!GetSession()->PlayerLogout()) 1559 { 1560 // don't reset teleport semaphore while logging out, otherwise m_teleport_dest won't be used in Player::SaveToDB 1561 SetSemaphoreTeleport(false); 1562 1561 1563 UpdateZone(GetZoneId()); 1564 } 1562 1565 1563 1566 // new zone … … 9323 9326 if( pProto ) 9324 9327 { 9328 // May be here should be more stronger checks; STUNNED checked 9329 // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. 9330 if (not_loading && hasUnitState(UNIT_STAT_STUNNED)) 9331 return EQUIP_ERR_YOU_ARE_STUNNED; 9332 9325 9333 if(pItem->IsBindedNotWith(GetGUID())) 9326 9334 return EQUIP_ERR_DONT_OWN_THAT_ITEM; … … 9346 9354 if(isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0) 9347 9355 return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err 9356 9357 if(IsNonMeleeSpellCasted(false)) 9358 return EQUIP_ERR_CANT_DO_RIGHT_NOW; 9348 9359 9349 9360 uint8 eslot = FindEquipSlot( pProto, slot, swap ); … … 13799 13810 switch(sWorld.getConfig(CONFIG_GM_LOGIN_STATE)) 13800 13811 { 13801 case 0: // disable 13802 break; 13803 case 1: // enable 13804 SetGameMaster(true); 13805 break; 13812 default: 13813 case 0: break; // disable 13814 case 1: SetGameMaster(true); break; // enable 13806 13815 case 2: // save state 13807 if(gmstate )13816 if(gmstate & PLAYER_EXTRA_GM_ON) 13808 13817 SetGameMaster(true); 13809 13818 break; 13819 } 13820 13821 switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS)) 13822 { 13810 13823 default: 13824 case 0: break; // disable 13825 case 1: SetAcceptTicket(true); break; // enable 13826 case 2: // save state 13827 if(gmstate & PLAYER_EXTRA_GM_ACCEPT_TICKETS) 13828 SetAcceptTicket(true); 13829 break; 13830 } 13831 13832 switch(sWorld.getConfig(CONFIG_GM_CHAT)) 13833 { 13834 default: 13835 case 0: break; // disable 13836 case 1: SetGMChat(true); break; // enable 13837 case 2: // save state 13838 if(gmstate & PLAYER_EXTRA_GM_CHAT) 13839 SetGMChat(true); 13840 break; 13841 } 13842 13843 switch(sWorld.getConfig(CONFIG_GM_WISPERING_TO)) 13844 { 13845 default: 13846 case 0: break; // disable 13847 case 1: SetAcceptWhispers(true); break; // enable 13848 case 2: // save state 13849 if(gmstate & PLAYER_EXTRA_ACCEPT_WHISPERS) 13850 SetAcceptWhispers(true); 13811 13851 break; 13812 13852 } … … 14878 14918 14879 14919 ss << ", "; 14880 ss << (isGameMaster()? 1 : 0);14920 ss << m_ExtraFlags; 14881 14921 14882 14922 ss << ", "; … … 16388 16428 } 16389 16429 16390 VendorItem const* crItem = vItems->FindItem(item);16391 if( !crItem)16430 size_t vendor_slot = vItems->FindItemSlot(item); 16431 if(vendor_slot >= vItems->GetItemCount()) 16392 16432 { 16393 16433 SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0); 16394 16434 return false; 16395 16435 } 16436 16437 VendorItem const* crItem = vItems->m_items[vendor_slot]; 16396 16438 16397 16439 // check current item amount if it limited … … 16521 16563 WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 16522 16564 data << pCreature->GetGUID(); 16523 data << (uint32) crItem->item;16565 data << (uint32)(vendor_slot+1); // numbered from 1 at client 16524 16566 data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 16525 16567 data << (uint32)count; … … 16560 16602 WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); 16561 16603 data << pCreature->GetGUID(); 16562 data << (uint32) crItem->item;16604 data << (uint32)(vendor_slot+1); // numbered from 1 at client 16563 16605 data << (uint32)(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); 16564 16606 data << (uint32)count; -
trunk/src/game/Player.h
r18 r28 497 497 PLAYER_EXTRA_TAXICHEAT = 0x0008, 498 498 PLAYER_EXTRA_GM_INVISIBLE = 0x0010, 499 PLAYER_EXTRA_GM_CHAT = 0x0020, // Show GM badge in chat messages 499 500 500 501 // other states … … 955 956 bool isGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; } 956 957 void SetGameMaster(bool on); 958 bool isGMChat() const { return GetSession()->GetSecurity() >= SEC_MODERATOR && (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT); } 959 void SetGMChat(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; } 957 960 bool isTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; } 958 961 void SetTaxiCheater(bool on) { if(on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; } -
trunk/src/game/PointMovementGenerator.cpp
r18 r28 42 42 return false; 43 43 44 if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED))44 if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) 45 45 return true; 46 46 -
trunk/src/game/RandomMovementGenerator.cpp
r26 r28 127 127 RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff) 128 128 { 129 if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED))129 if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) 130 130 { 131 131 i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer -
trunk/src/game/SocialMgr.cpp
r2 r28 42 42 bool PlayerSocial::AddToSocialList(uint32 friend_guid, bool ignore) 43 43 { 44 // prevent list (client-side) overflow45 if(m_playerSocialMap.size() >= (255-1))44 // client limit 45 if(m_playerSocialMap.size() >= 50) 46 46 return false; 47 47 … … 181 181 bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || security > SEC_PLAYER; 182 182 183 PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID); 184 if(itr != player->GetSocial()->m_playerSocialMap.end()) 185 friendInfo.Note = itr->second.Note; 186 183 187 // PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters 184 188 // MODERATOR, GAME MASTER, ADMINISTRATOR can see all … … 219 223 WorldPacket data; 220 224 MakeFriendStatusPacket(result, friend_guid, &data); 225 GetFriendInfo(player, friend_guid, fi); 221 226 switch(result) 222 227 { 228 case FRIEND_ADDED_OFFLINE: 229 case FRIEND_ADDED_ONLINE: 230 data << fi.Note; 231 break; 232 } 233 234 switch(result) 235 { 236 case FRIEND_ADDED_ONLINE: 223 237 case FRIEND_ONLINE: 224 GetFriendInfo(player, friend_guid, fi);225 238 data << uint8(fi.Status); 226 239 data << uint32(fi.Area); 227 240 data << uint32(fi.Level); 228 241 data << uint32(fi.Class); 229 break;230 case FRIEND_ADDED_ONLINE:231 GetFriendInfo(player, friend_guid, fi);232 data << name;233 data << uint8(fi.Status);234 data << uint32(fi.Area);235 data << uint32(fi.Level);236 data << uint32(fi.Class);237 break;238 case FRIEND_ADDED_OFFLINE:239 data << name;240 242 break; 241 243 } … … 300 302 social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note); 301 303 302 // prevent list (client-side) overflow303 if(social->m_playerSocialMap.size() >= 255)304 // client limit 305 if(social->m_playerSocialMap.size() >= 50) 304 306 break; 305 307 } -
trunk/src/game/Spell.cpp
r18 r28 987 987 if( !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_NO_INITIAL_AGGRO) ) 988 988 { 989 if(!unit->IsStandState() && !unit->hasUnitState(UNIT_STAT_STUN DED))989 if(!unit->IsStandState() && !unit->hasUnitState(UNIT_STAT_STUNNED)) 990 990 unit->SetStandState(PLAYER_STATE_NONE); 991 991 … … 2408 2408 2409 2409 // check for incapacitating player states 2410 if( m_caster->hasUnitState(UNIT_STAT_STUN DED | UNIT_STAT_CONFUSED))2410 if( m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) 2411 2411 cancel(); 2412 2412 -
trunk/src/game/SpellAuras.cpp
r2 r28 3190 3190 if (apply) 3191 3191 { 3192 m_target->addUnitState(UNIT_STAT_STUN DED);3192 m_target->addUnitState(UNIT_STAT_STUNNED); 3193 3193 m_target->SetUInt64Value(UNIT_FIELD_TARGET, 0); 3194 3194 … … 3214 3214 return; 3215 3215 3216 m_target->clearUnitState(UNIT_STAT_STUN DED);3216 m_target->clearUnitState(UNIT_STAT_STUNNED); 3217 3217 m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); 3218 3218 … … 3443 3443 m_target->RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); 3444 3444 3445 if(!m_target->hasUnitState(UNIT_STAT_STUN DED)) // prevent allow move if have also stun effect3445 if(!m_target->hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect 3446 3446 { 3447 3447 if(m_target->getVictim() && m_target->isAlive()) -
trunk/src/game/SpellEffects.cpp
r18 r28 1466 1466 return; 1467 1467 1468 if( !unitTarget->hasUnitState(UNIT_STAT_STUN DED) && m_caster->GetTypeId()==TYPEID_PLAYER)1468 if( !unitTarget->hasUnitState(UNIT_STAT_STUNNED) && m_caster->GetTypeId()==TYPEID_PLAYER) 1469 1469 { 1470 1470 // decreased damage (/2) for non-stunned target. … … 3402 3402 3403 3403 // target must be OK to do this 3404 if( unitTarget->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUN DED | UNIT_STAT_FLEEING ) )3404 if( unitTarget->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING ) ) 3405 3405 return; 3406 3406 -
trunk/src/game/TargetedMovementGenerator.cpp
r18 r28 48 48 return; 49 49 50 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED) )50 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) ) 51 51 return; 52 52 … … 128 128 return true; 129 129 130 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED) )130 if( owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED) ) 131 131 return true; 132 132 -
trunk/src/game/TradeHandler.cpp
r2 r28 27 27 #include "Item.h" 28 28 #include "SocialMgr.h" 29 #include "Language.h" 29 30 30 31 enum TradeStatus … … 256 257 if( _player->tradeGold > _player->GetMoney() ) 257 258 { 258 SendNotification( "You do not have enough gold");259 SendNotification(LANG_NOT_ENOUGH_GOLD); 259 260 _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); 260 261 _player->acceptTrade = false; … … 265 266 if( _player->pTrader->tradeGold > _player->pTrader->GetMoney() ) 266 267 { 267 _player->pTrader->GetSession( )->SendNotification( "You do not have enough gold");268 _player->pTrader->GetSession( )->SendNotification(LANG_NOT_ENOUGH_GOLD); 268 269 SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); 269 270 _player->pTrader->acceptTrade = false; … … 339 340 if(!myCanCompleteTrade) 340 341 { 341 SendNotification( "You do not have enough free slots");342 GetPlayer( )->pTrader->GetSession( )->SendNotification( "Your partner does not have enough free bag slots");342 SendNotification(LANG_NOT_FREE_TRADE_SLOTS); 343 GetPlayer( )->pTrader->GetSession( )->SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); 343 344 SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); 344 345 _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); … … 347 348 else if (!hisCanCompleteTrade) 348 349 { 349 SendNotification( "Your partner does not have enough free bag slots");350 GetPlayer()->pTrader->GetSession()->SendNotification( "You do not have enough free slots");350 SendNotification(LANG_NOT_PARTNER_FREE_TRADE_SLOTS); 351 GetPlayer()->pTrader->GetSession()->SendNotification(LANG_NOT_FREE_TRADE_SLOTS); 351 352 SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); 352 353 _player->pTrader->GetSession()->SendTradeStatus(TRADE_STATUS_BACK_TO_TRADE); … … 462 463 } 463 464 464 if( GetPlayer()->hasUnitState(UNIT_STAT_STUN DED) )465 if( GetPlayer()->hasUnitState(UNIT_STAT_STUNNED) ) 465 466 { 466 467 SendTradeStatus(TRADE_STATUS_YOU_STUNNED); … … 508 509 } 509 510 510 if( pOther->hasUnitState(UNIT_STAT_STUN DED) )511 if( pOther->hasUnitState(UNIT_STAT_STUNNED) ) 511 512 { 512 513 SendTradeStatus(TRADE_STATUS_TARGET_STUNNED); -
trunk/src/game/Unit.cpp
r9 r28 471 471 RemoveSpellsCausingAura(SPELL_AURA_MOD_INVISIBILITY); 472 472 473 if(pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUN DED))473 if(pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->IsStandState() && !pVictim->hasUnitState(UNIT_STAT_STUNNED)) 474 474 pVictim->SetStandState(PLAYER_STATE_NONE); 475 475 } … … 2150 2150 void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool extra ) 2151 2151 { 2152 if(hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUN DED | UNIT_STAT_FLEEING) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) )2152 if(hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED) ) 2153 2153 return; 2154 2154 … … 2962 2962 float Unit::GetUnitDodgeChance() const 2963 2963 { 2964 if(hasUnitState(UNIT_STAT_STUN DED))2964 if(hasUnitState(UNIT_STAT_STUNNED)) 2965 2965 return 0.0f; 2966 2966 if( GetTypeId() == TYPEID_PLAYER ) … … 2981 2981 float Unit::GetUnitParryChance() const 2982 2982 { 2983 if ( IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUN DED))2983 if ( IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED)) 2984 2984 return 0.0f; 2985 2985 … … 3013 3013 float Unit::GetUnitBlockChance() const 3014 3014 { 3015 if ( IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUN DED))3015 if ( IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED)) 3016 3016 return 0.0f; 3017 3017 … … 7986 7986 if (spellInfo->Mechanic == MECHANIC_FEAR ) 7987 7987 { 7988 if ( hasUnitState(UNIT_STAT_STUN DED) )7988 if ( hasUnitState(UNIT_STAT_STUNNED) ) 7989 7989 return true; 7990 7990 } … … 8663 8663 8664 8664 //If a mob or player is stunned he will not be able to detect stealth 8665 if (u->hasUnitState(UNIT_STAT_STUN DED) && (u != this))8665 if (u->hasUnitState(UNIT_STAT_STUNNED) && (u != this)) 8666 8666 return false; 8667 8667 … … 9137 9137 if(target) 9138 9138 { 9139 if(!hasUnitState(UNIT_STAT_STUN DED))9139 if(!hasUnitState(UNIT_STAT_STUNNED)) 9140 9140 SetInFront(target); 9141 9141 ((Creature*)this)->AI()->AttackStart(target); -
trunk/src/game/Unit.h
r9 r28 347 347 UNIT_STAT_MELEE_ATTACKING = 0x0002, // player is melee attacking someone 348 348 //UNIT_STAT_MELEE_ATTACK_BY = 0x0004, // player is melee attack by someone 349 UNIT_STAT_STUN DED = 0x0008,349 UNIT_STAT_STUNNED = 0x0008, 350 350 UNIT_STAT_ROAMING = 0x0010, 351 351 UNIT_STAT_CHASE = 0x0020, … … 757 757 { 758 758 return !hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT | 759 UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED ) && GetOwnerGUID()==0;759 UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED ) && GetOwnerGUID()==0; 760 760 } 761 761 -
trunk/src/game/WaypointMovementGenerator.cpp
r18 r28 86 86 // Waypoint movement can be switched on/off 87 87 // This is quite handy for escort quests and other stuff 88 if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUN DED | UNIT_STAT_DISTRACTED))88 if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) 89 89 return true; 90 90 -
trunk/src/game/World.cpp
r19 r28 643 643 } 644 644 645 m_configs[CONFIG_GM_WISPERING_TO] = sConfig.GetBoolDefault("GM.WhisperingTo",false); 646 m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList",false); 647 m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList",false); 648 m_configs[CONFIG_GM_LOGIN_STATE] = sConfig.GetIntDefault("GM.LoginState",2); 649 m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false); 645 m_configs[CONFIG_GM_LOGIN_STATE] = sConfig.GetIntDefault("GM.LoginState",2); 646 m_configs[CONFIG_GM_ACCEPT_TICKETS] = sConfig.GetIntDefault("GM.AcceptTickets",2); 647 m_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat",2); 648 m_configs[CONFIG_GM_WISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo",2); 649 650 m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList",false); 651 m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList",false); 652 m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false); 650 653 651 654 m_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode",0); -
trunk/src/game/World.h
r19 r28 107 107 CONFIG_MAX_PRIMARY_TRADE_SKILL, 108 108 CONFIG_MIN_PETITION_SIGNS, 109 CONFIG_GM_LOGIN_STATE, 110 CONFIG_GM_ACCEPT_TICKETS, 111 CONFIG_GM_CHAT, 109 112 CONFIG_GM_WISPERING_TO, 110 113 CONFIG_GM_IN_GM_LIST, 111 114 CONFIG_GM_IN_WHO_LIST, 112 CONFIG_GM_LOGIN_STATE,113 115 CONFIG_GM_LOG_TRADE, 114 116 CONFIG_GROUP_VISIBILITY, -
trunk/src/game/WorldSession.cpp
r6 r28 441 441 } 442 442 443 void WorldSession::SendNotification(int32 string_id,...) 444 { 445 char const* format = GetMangosString(string_id); 446 if(format) 447 { 448 va_list ap; 449 char szStr [1024]; 450 szStr[0] = '\0'; 451 va_start(ap, format); 452 vsnprintf( szStr, 1024, format, ap ); 453 va_end(ap); 454 455 WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr)+1)); 456 data << szStr; 457 SendPacket(&data); 458 } 459 } 460 443 461 const char * WorldSession::GetMangosString( int32 entry ) 444 462 { -
trunk/src/game/WorldSession.h
r6 r28 80 80 void SendPacket(WorldPacket const* packet); 81 81 void SendNotification(const char *format,...) ATTR_PRINTF(2,3); 82 void SendNotification(int32 string_id,...); 82 83 void SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type); 83 84 void SendPartyResult(PartyOperation operation, std::string member, PartyResult res);