aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-03-15 23:03:06 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-03-15 23:03:06 +0100
commite89d586032edcb42e13d7fc5187f17d6db0655b4 (patch)
tree19c7ccea8b70f08559b6b47815d88a1864c70fb9
parentdb0a0e73e41a51fbb0cb1c5b6c600ff9dcb64a7f (diff)
parent3b9ab08029a224fe0f1548eb8187c4186f4ea29b (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
-rw-r--r--doc/TextTables.txt92
-rw-r--r--sql/updates/world/2013_03_15_01_world_smart_scripts.sql12
-rw-r--r--sql/updates/world/2013_03_15_01_world_trinity_strings.sql3
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h4
-rw-r--r--src/server/game/Entities/Player/Player.h1
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp13
-rw-r--r--src/server/game/Handlers/ChatHandler.cpp22
-rw-r--r--src/server/game/Miscellaneous/Language.h3
-rw-r--r--src/server/game/Server/WorldSession.cpp3
-rw-r--r--src/server/scripts/Commands/cs_message.cpp20
10 files changed, 61 insertions, 112 deletions
diff --git a/doc/TextTables.txt b/doc/TextTables.txt
deleted file mode 100644
index fa8aebdb5d3..00000000000
--- a/doc/TextTables.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-=========================================
-Texts Documentation
-=========================================
-
-=========================================================
-WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE.
-FOR MORE UP-TO-DATE INFORMATION, CHECK THE TRINITY WIKI.
-=========================================================
-
-Scriptdev2 Revision 695 introduces a new format for using texts in EventAI and SD2 Scripts.
-This information relates to the *_texts tables located in the ScriptDev Database.
-
-Any script can at any time access and use text from any of the three text tables, as long as the entry does in fact exist.
-Custom scripters are adviced to store their text data in custom_texts.
-
-The different tables has ranges of entries allowed for that table.
-Reserved EventAI in Mangos entry -1 -> -999999
-script_texts: entry -1000000 -> -1999999
-custom_texts: entry -2000000 -> -2999999
-Any entry out of range for that table will display a startup error.
-
-
-=========================================
-Basic Structure of script_texts and custom_texts
-=========================================
-Below is a the list of current fields within the texts tables.
-
-Field_Name Description
------------------------------------------------------------
-entry This value is mearly an NEGATIVE identifier of the current text number. Required for sql queries.
-content_default This is the actual text presented in the default language (English).
-
-content_loc1 This is the actual text presented in the Localization #1 Clients (Korean)
-content_loc2 This is the actual text presented in the Localization #2 Clients (French)
-content_loc3 This is the actual text presented in the Localization #3 Clients (German)
-content_loc4 This is the actual text presented in the Localization #4 Clients (Chinese)
-content_loc5 This is the actual text presented in the Localization #5 Clients (Taiwanese)
-content_loc6 This is the actual text presented in the Localization #6 Clients (Spanish)
-content_loc7 This is the actual text presented in the Localization #7 Clients (Spanish Mexico)
-content_loc8 This is the actual text presented in the Localization #8 Clients (Russian)
-
-sound This value is the Sound ID that corresponds to the actual text used (Defined in SoundEntries.dbc).
-type Variables used to define type of text (Say/Yell/Textemote/Whisper).
-language This value is the Language that the text is native in (Defined in Languages.dbc).
-emote Value from enum Emote (defined in Emotes.dbc). Only source of text will play this emote (not target, if target are defined in DoScriptText)
-comment This is a comment regarding the text entry (For ACID, accepted format is to use Creature ID of NPC using it).
-
-Note: Fields `content_loc1` to `content_loc8` are NULL values by default and are handled by seperate localization projects.
-
-
-=========================================
-Text Types (type)
-=========================================
-Below is the list of current Text types that texts tables can handle. These were previously seperate Actions in ACID.
-
-# Internal Name Description
------------------------------------------------------------
-0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble).
-1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID.
-2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log.
-3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses).
-4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log.
-5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses).
-6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone.
-
-
-=========================================
-Language Types (language)
-=========================================
-Below is the list of current Language types that are allowed.
-This is the Race Language that the text is native to (So it will display properly)
-
-# Internal Name Description
------------------------------------------------------------
-0 UNIVERSAL Text in this language is understood by ALL Races.
-1 ORCISH Text in this language is understood ONLY by Horde Races.
-2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race.
-3 TAURAHE Text in this language is understood ONLY by the Tauren Race.
-6 DWARVISH Text in this language is understood ONLY by the Dwarf Race.
-7 COMMON Text in this language is understood ONLY by Alliance Races.
-8 DEMONIC Text in this language is understood ONLY by the Demon Race (Not Implimented).
-9 TITAN This language was used by Sargeras to speak with other Titians (Not Implemented).
-10 THALASSIAN Text in this language is understood ONLY by the Blood Elf Race.
-11 DRACONIC Text in this language is understood ONLY by the Dragon Race.
-12 KALIMAG Text will display as Kalimag (not readable by players, language of all elementals)
-13 GNOMISH Text in this language is understood ONLY by the Gnome Race.
-14 TROLL Text in this language is understood ONLY by the Troll Race.
-33 GUTTERSPEAK Text in this language is understood ONLY by the Undead Race.
-35 DRAENEI Text in this language is understood ONLY by the Draenai Race.
-36 ZOMBIE (not currently used?)
-37 GNOMISH BINARY Binary language used by Alliance when drinking Binary Brew
-38 GOBLIN BINARY Binary language used by Horce when drinking Binary Brew \ No newline at end of file
diff --git a/sql/updates/world/2013_03_15_01_world_smart_scripts.sql b/sql/updates/world/2013_03_15_01_world_smart_scripts.sql
new file mode 100644
index 00000000000..63561342f3c
--- /dev/null
+++ b/sql/updates/world/2013_03_15_01_world_smart_scripts.sql
@@ -0,0 +1,12 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`=30407 AND `source_type`=0;
+INSERT INTO `smart_scripts`(`entryorguid`,`id`,`link`,`event_type`,`event_flags`,`event_phase_mask`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUES
+(30407,0,1,11,0,0,0,0,0,0,11,56726,0,1,'Captured Crusader - On Respawn - Apply Nerubian Webs (56726)'),
+(30407,1,0,61,0,0,0,0,0,0,22,1,0,1,'Captured Crusader - Linked to id 0 - Set event phase to 1'),
+(30407,2,0, 1,0,1,4000,4000,4000,4000,10,70,22,1,'Captured Crusader - Out of combat - Random emote'),
+(30407,3,4, 8,0,1,56683,0,0,0,11,56687,0,7,'Captured Crusader - Spell hit of Grab Captured Crusader (56683) - Cast Ride Vehicle (56687)'),
+(30407,4,5,61,0,1,0,0,0,0,1,0,0,1,'Captured Crusader - Linked to id 3 - Talk'),
+(30407,5,0,61,0,1,0,0,0,0,22,2,0,1,'Captured Crusader - Linked to id 3 - Set event phase to 2'),
+(30407,6,0, 1,0,2,8000,8000,8000,8000,1,1,0,1,'Captured Crusader - Out of combat - Talk'),
+(30407,7,8,23,1,2,56687,0,0,0,1,2,0,1,'Captured Crusader - Aura Ride Vehicle (56687) removed - Talk'),
+(30407,8,9,61,0,2,0,0,0,0,41,5000,0,1,'Captured Crusader - Linked to id 7 - Despawn'),
+(30407,9,0,61,0,2,0,0,0,0,22,0,0,1,'Captured Crusader - Linked to id 7 - Set event phase to 0');
diff --git a/sql/updates/world/2013_03_15_01_world_trinity_strings.sql b/sql/updates/world/2013_03_15_01_world_trinity_strings.sql
new file mode 100644
index 00000000000..0ae44b1ae53
--- /dev/null
+++ b/sql/updates/world/2013_03_15_01_world_trinity_strings.sql
@@ -0,0 +1,3 @@
+DELETE FROM `trinity_string` where `entry`=363;
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
+(363, 'Player %s cannot whisper you any longer.');
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index d300cf64451..9b5d715b90b 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -105,8 +105,8 @@ enum SMART_EVENT
SMART_EVENT_REWARD_QUEST = 20, // QuestID(0any)
SMART_EVENT_REACHED_HOME = 21, // NONE
SMART_EVENT_RECEIVE_EMOTE = 22, // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
- SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
- SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Stack amount, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Stack amount, Param3/4 RepeatMin, RepeatMax
SMART_EVENT_RESET = 25, // Called after combat, when the creature respawn and spawn.
SMART_EVENT_IC_LOS = 26, // NoHostile, MaxRnage, CooldownMin, CooldownMax
SMART_EVENT_PASSENGER_BOARDED = 27, // CooldownMin, CooldownMax
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index c708179fe04..ab02b316ce5 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2484,6 +2484,7 @@ class Player : public Unit, public GridObject<Player>
void ClearWhisperWhiteList() { WhisperList.clear(); }
void AddWhisperWhiteList(uint64 guid) { WhisperList.push_back(guid); }
bool IsInWhisperWhiteList(uint64 guid);
+ void RemoveFromWhisperWhiteList(uint64 guid) { WhisperList.remove(guid); }
/*! These methods send different packets to the client in apply and unapply case.
These methods are only sent to the current unit.
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 655fb41cc83..54454e46a4a 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16362,7 +16362,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
Player* player = ToPlayer();
- // If player is on mouted duel and exits the mount should immediatly lose the duel
+ // If the player is on mounted duel and exits the mount, he should immediatly lose the duel
if (player && player->duel && player->duel->isMounted)
player->DuelComplete(DUEL_FLED);
@@ -16390,14 +16390,19 @@ void Unit::_ExitVehicle(Position const* exitPosition)
SendMessageToSet(&data, false);
}
+ float height = pos.GetPositionZ();
+
Movement::MoveSplineInit init(this);
- init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false);
+
+ // Creatures without inhabit type air should begin falling after exiting the vehicle
+ if (GetTypeId() == TYPEID_UNIT && !CanFly() && height > GetMap()->GetWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), &height) + 0.1f)
+ init.SetFall();
+
+ init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), height, false);
init.SetFacing(GetOrientation());
init.SetTransportExit();
init.Launch();
- //GetMotionMaster()->MoveFall(); // Enable this once passenger positions are calculater properly (see above)
-
if (player)
player->ResummonPetTemporaryUnSummonedIfAny();
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index 6abde6cac04..ca79c1c350a 100644
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -314,12 +314,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
} break;
case CHAT_MSG_WHISPER:
{
- if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
- {
- SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
- return;
- }
-
if (!normalizePlayerName(to))
{
SendPlayerNotFoundNotice(to);
@@ -327,16 +321,18 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
}
Player* receiver = sObjectAccessor->FindPlayerByName(to);
- if (!receiver || (!HasPermission(RBAC_PERM_CAN_FILTER_WHISPERS) &&
- !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID())))
+ if (!receiver)
{
SendPlayerNotFoundNotice(to);
return;
}
+ if (!sender->isGameMaster() && sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) && !receiver->IsInWhisperWhiteList(sender->GetGUID()))
+ {
+ SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
+ return;
+ }
- // @todo: check only sender permission and add receiver to whiteList if receiver does not have the permission
- if (GetPlayer()->GetTeam() != receiver->GetTeam() && !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT) &&
- !receiver->GetSession()->HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT))
+ if (GetPlayer()->GetTeam() != receiver->GetTeam() && !HasPermission(RBAC_PERM_TWO_SIDE_INTERACTION_CHAT) && !receiver->IsInWhisperWhiteList(sender->GetGUID()))
{
SendWrongFactionNotice();
return;
@@ -349,7 +345,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
}
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
- if (HasPermission(RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))
+ // We also do that if a player is under the required level for whispers.
+ if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
+ (HasPermission(RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())))
sender->AddWhisperWhiteList(receiver->GetGUID());
GetPlayer()->Whisper(msg, lang, receiver->GetGUID());
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 99d36135977..1ac10e156ad 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -384,7 +384,8 @@ enum TrinityStrings
LANG_COMMAND_CHEAT_CD = 360,
LANG_COMMAND_CHEAT_POWER = 361,
LANG_COMMAND_CHEAT_WW = 362,
- // Room for more level 2 363-399 not used
+ LANG_COMMAND_WHISPEROFFPLAYER = 363,
+ // Room for more level 2 364-399 not used
// level 3 chat
LANG_SCRIPTS_RELOADED = 400,
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 642e6e7d29c..074e04547f6 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -516,6 +516,9 @@ void WorldSession::LogoutPlayer(bool save)
///- Remove pet
_player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);
+ ///- Clear whisper whitelist
+ _player->ClearWhisperWhiteList();
+
///- empty buyback items and save the player in the database
// some save parts only correctly work in case player present in map/player_lists (pets, etc)
if (save)
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index e2c53492e9d..66f55b85c1c 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -27,6 +27,7 @@ EndScriptData */
#include "ChannelMgr.h"
#include "Language.h"
#include "Player.h"
+#include "ObjectMgr.h"
class message_commandscript : public CommandScript
{
@@ -186,7 +187,7 @@ public:
return true;
}
- std::string argStr = (char*)args;
+ std::string argStr = strtok((char*)args, " ");
// whisper on
if (argStr == "on")
{
@@ -205,6 +206,23 @@ public:
return true;
}
+ if (argStr == "remove")
+ {
+ std::string name = strtok(NULL, " ");
+ if (normalizePlayerName(name))
+ if (Player* player = sObjectAccessor->FindPlayerByName(name))
+ {
+ handler->GetSession()->GetPlayer()->RemoveFromWhisperWhiteList(player->GetGUID());
+ handler->PSendSysMessage(LANG_COMMAND_WHISPEROFFPLAYER, name);
+ return true;
+ }
+ else
+ {
+ handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND, name);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ }
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;