From b24cc17a4ba7cd7849d0a3ccc8ae5fc0b1e1de2f Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 26 Dec 2008 16:32:20 -0600 Subject: *Fix a typo. --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 67c56d763bc..57dacea61e3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -41,7 +41,7 @@ WaypointMovementGenerator::Initialize(Creature &u) waypoints = WaypointMgr.GetPath(path_id); if(waypoints && waypoints->size()) { - Traveller traveller(unit); + Traveller traveller(u); node = *(waypoints->at(i_currentNode)); InitTraveller(u,node); i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); -- cgit v1.2.3 From 9bd4507f920a1d6c4790107a34dcd8b983a934c0 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 26 Dec 2008 16:50:35 -0600 Subject: *Fix the bug that proc debuff applied on caster. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 4 ++++ src/game/Unit.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 449867c0022..bf295d03222 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1140,6 +1140,10 @@ void Aura::TriggerSpell() uint64 originalCasterGUID = GetCasterGUID(); SpellEntry const *triggeredSpellInfo = sSpellStore.LookupEntry(trigger_spell_id); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(triggeredSpellInfo->rangeIndex); + if(!GetSpellMaxRange(srange)) + target = caster; //for druid dispel poison + SpellEntry const *auraSpellInfo = GetSpellProto(); uint32 auraId = auraSpellInfo->Id; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 010c5a4d8c4..8e81c11582b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -899,13 +899,13 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I { if(spellmgr.SpellTargetType[spellInfo->EffectImplicitTargetA[i]] == TARGET_TYPE_UNIT_TARGET) { - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + /*SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); if(srange && GetSpellMaxRange(srange) == 0.0f) { Victim = this; break; } - else if(!Victim) + else */if(!Victim) { sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; @@ -7693,8 +7693,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB if(basepoints0) CastCustomSpell(target,trigger_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); - else if(spellmgr.GetSpellCustomAttr(trigger_spell_id) & SPELL_ATTR_CU_AURA_SPELL) - AddAura(trigger_spell_id, target); + //else if(spellmgr.GetSpellCustomAttr(trigger_spell_id) & SPELL_ATTR_CU_AURA_SPELL) + // AddAura(trigger_spell_id, target); else CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); -- cgit v1.2.3 From 4d86f8e6796548f1b76cc19c7f9e5f5c58c7e0fa Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sat, 27 Dec 2008 00:24:48 +0100 Subject: *Improvements to .kick command with new conf setting - by Machiavelli --HG-- branch : trunk --- sql/updates/676_world.sql | 2 ++ src/game/Level2.cpp | 33 ++++++++++++++++++++++++++++++--- src/game/World.cpp | 1 + src/game/World.h | 1 + src/trinitycore/trinitycore.conf.dist | 8 +++++++- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 sql/updates/676_world.sql (limited to 'src') diff --git a/sql/updates/676_world.sql b/sql/updates/676_world.sql new file mode 100644 index 00000000000..2b9135c04bd --- /dev/null +++ b/sql/updates/676_world.sql @@ -0,0 +1,2 @@ +UPDATE `trinity_string` SET `content_default`='Player |cffff0000%s|r kicked by |cffff0000%s|r. Reason: |cffff0000%s|r.' WHERE (`entry`='282'); +UPDATE `command` SET `help`='Syntax: .kick [$charactername] [$reason]\r\n\r\nKick the given character name from the world with or without reason. If no character name is provided then the selected player (except for yourself) will be kicked. If no reason is provided, default is \"No Reason\".' WHERE (`name`='kick'); \ No newline at end of file diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 2b75b9324c1..ac82b8177c6 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1680,6 +1680,8 @@ bool ChatHandler::HandleNpcFactionIdCommand(const char* args) bool ChatHandler::HandleKickPlayerCommand(const char *args) { char* kickName = strtok((char*)args, " "); + char* kickReason = strtok(NULL, "\n"); + if (!kickName) { Player* player = getSelectedPlayer(); @@ -1697,12 +1699,23 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args) SetSentErrorMessage(true); return false; } + + if(player->GetSession()->GetSecurity() > m_session->GetSecurity()) + { + SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on + SetSentErrorMessage(true); + return false; + } player->GetSession()->KickPlayer(); } else { std::string name = kickName; + std::string reason = "No Reason"; + if(kickReason) + reason = kickReason; + if(!normalizePlayerName(name)) { SendSysMessage(LANG_PLAYER_NOT_FOUND); @@ -1716,13 +1729,27 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args) SetSentErrorMessage(true); return false; } - + + if(objmgr.GetPlayer(kickName)->GetSession()->GetSecurity() > m_session->GetSecurity()) + { + SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); //maybe replacement string for this later on + SetSentErrorMessage(true); + return false; + } + if(sWorld.KickPlayer(name)) { - PSendSysMessage(LANG_COMMAND_KICKMESSAGE,name.c_str()); + if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1) + { + sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str()); + } + else + { + PSendSysMessage(LANG_COMMAND_KICKMESSAGE, name.c_str(), m_session->GetPlayer()->GetName(), reason.c_str()); + } } else - PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER,name.c_str()); + PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER, name.c_str()); } return true; diff --git a/src/game/World.cpp b/src/game/World.cpp index 5b36e3d4d9c..7769c9a7942 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -988,6 +988,7 @@ void World::LoadConfigSettings(bool reload) if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1) m_configs[CONFIG_PVP_TOKEN_COUNT] = 1; m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); + m_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false); std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", ""); char * forbiddenMaps = new char[forbiddenmaps.length() + 1]; diff --git a/src/game/World.h b/src/game/World.h index edf5e22850b..4dab7b97b88 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -196,6 +196,7 @@ enum WorldConfigs CONFIG_PVP_TOKEN_ID, CONFIG_PVP_TOKEN_COUNT, CONFIG_NO_RESET_TALENT_COST, + CONFIG_SHOW_KICK_IN_WORLD, CONFIG_VALUE_COUNT }; diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index ba5f2de372f..f4ea9c3a4cd 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1251,6 +1251,12 @@ Ra.Secure = 1 # example: "538,90" # Note that it's HIGHLY DISCOURAGED to forbid starting maps (0, 1, 530)! # +# ShowKickInWorld +# determines wether a message is broadcasted to the entire server when a player gets kicked +# Default: 0 +# 1 = Enable +# 0 = Disable +# ################################################################################################################### PlayerStart.AllReputation = 0 @@ -1264,4 +1270,4 @@ PvPToken.MapAllowType = 4 PvPToken.ItemID = 29434 PvPToken.ItemCount = 1 NoResetTalentsCost = 0 - +ShowKickInWorld = 0 \ No newline at end of file -- cgit v1.2.3