Commit Graph

209 Commits

Author SHA1 Message Date
Chaz Brown
b9eb4ddf2e AHBot rewrite, pulled from TC2-3.0.9 repo, in no particular order.
*Any file named README.Something (including the original README) will be copied to the build directory when compiled with VS
*Converted AuctionHouseBot to class structure, implemented Singleton for class
*Moved global variables inside of AuctionHouseBot class,
*Minor code cleanups, reformated headers, fixed switch logic errors
*Parts of this code are from Naicisum's Mangos version.
*Prevent endless looping condition where Item Quality has no percentage
*Fix situation where items in the AH would be less than the maxitems setting
*Move AHBot item filters to initialization so the items that are not allowed only get evaluated once.
*Change the way Bid prices are calculated, along with Maximius' uint64 fix, prices should look a lot better now.
*Includes a fix for grey items from MrSmite

--HG--
branch : trunk
2009-08-06 03:00:45 -04:00
megamage
0fcadd9d25 *Replace "LoginDatabase" with "loginDatabase"
--HG--
branch : trunk
2009-07-31 11:29:28 +08:00
megamage
0a2af88cb4 [8252] Move DB scripting code from global World to Map. Author: Ambal
This one more step to pre-map events proccesing and parallel in future.

    [8256] Restore DB script loading broken after [8252]. Author: VladimirMangos

    Also propetly decrease scheduled DB script actions at map unloading.
    Some code style restore.

--HG--
branch : trunk
2009-07-31 10:48:34 +08:00
QAston
9c52a12e08 Backed out changeset 6ba74f274cb9 - mangos [8249]
--HG--
branch : trunk
2009-07-30 11:44:23 +02:00
megamage
7121d98480 [8249] Implement support spell_proc_item_enchant table for ppm item enchantments triggering at hit.
* Added a new SQL table, spell_proc_item_enchant, for "custom" ppmRates on Item Enchants that do not use auras.
      With table data this must fix ppm for effect from 8033 and ranks enchanting, and item 6947/10918 and ranks enchanting.

    * Implemented SPELLMOD_FREQUENCY_OF_SUCCESS (26).
      That must fix work talent 14113, spell 32645 with ranks, glyph 41094 and item set effect 64917 in frequency part.

    Thanks to MaS0n as author alternative patch that partly used in this patch.
    Thanks to Thenecromancer as author alternative patch that ideas inspire MaS0n's patch writing and then this patch also.

Author: nos4r2zod

*Note: has been implemented before. Only use part of the patch.

--HG--
branch : trunk
2009-07-30 11:33:28 +08:00
megamage
f481e7b14d [8191] Drop code related to use long time empty spell_affect table. Author: XTZGZoReX
After switch to 3.x.x all data get explcitly from ClassMask fields in spell.dbc
    and no need in custom values.

--HG--
branch : trunk
2009-07-23 09:30:05 +08:00
megamage
833e4e41ab [8185] Allow set visible gm level for in gm list and in who list checks. Author: VladimirMangos
* GM.InGMList replaced by GM.InGMList.Level with default value 3 (visible any gm levels)
    * GM.InWhoList replaced by GM.InWhoList.Level with default value 3 (visible any gm levels)

    Update mangosd.conf if used non default value for old GM.InGMList and GM.InWhoList

--HG--
branch : trunk
2009-07-20 11:51:20 +08:00
megamage
208087ff6e [8182] Store and use Map* pointer in WorldObject instead map ids for speedup Author: Ambal
Also some code logic cleanups.
    Changes let make more cleanups in base map access and other places,
    but this chnages not inlcuded in patch.

*This patch may cause crash.

--HG--
branch : trunk
2009-07-16 11:49:00 +08:00
Anubisss
692c927e75 *Show online players numbers in command server info.
--HG--
branch : trunk
2009-07-12 00:16:56 +02:00
megamage
6976043e22 [8126] Improvemets in player/pet/charter name checks. Author: VladimirMangos
* Implement new config options for minimal player/pet/charter name length (2 by default)
    * Better error reporting at problems in names.
    * Add check from max pet/charter name length (same as for player names at client side)

--HG--
branch : trunk
2009-07-10 08:25:33 +08:00
Kudlaty
820f77c265 Fix showing proper EventAI version. Thx for pointing X-Savior
--HG--
branch : trunk
2009-07-09 11:14:43 +02:00
megamage
7c8f37abea [8078] Fixed typos in character data loading after recently added new field.
* Really use race/class/gender fields instead `data` field values.
    * Load extra flags (gm mode onm gm fly mode, gm invisibility and etc) from proper field.

    NOTE: recommedned reset characters.extra_flags field to 0 for all characters.
    It can be corrupted in time login/logout before this fix.

Author: VladimirMangos

--HG--
branch : trunk
2009-06-27 17:50:28 -05:00
megamage
06123fa3af *Add config option Arena.QueueAnnouncer.PlayerOnly
--HG--
branch : trunk
2009-06-19 19:30:32 -05:00
megamage
a49c2982ba *Merge.
*mtmap is disabled by default. To use it, define MULTI_THREAD_MAP in define.h
*mtmap support is not provided for windows users. Because there is no free openmp lib for windows. If you have openmp lib and want to use openmp, you need to manually change the setting.

--HG--
branch : trunk
2009-06-18 19:27:17 -05:00
megamage
7e4fcb1793 *Now new arena team has both team rating and personal rating = 0. According to the change in 3.1
--HG--
branch : trunk
2009-06-17 18:19:08 -05:00
megamage
2d569883e6 *Add config option CheckDB to check if the contents in FULL folder are applied.
--HG--
branch : trunk
2009-06-17 14:09:17 -05:00
Machiavelli
6ad7da569c *Integrate TicketMgr with ObjectMgr and clean up assosciated code. More features concerning ticket system are to be added soon. Please report any issues, thanks.
--HG--
branch : trunk
2009-06-15 23:58:29 +02:00
raczman
19225e8880 Added basic support for multithreaded map updates using openmp standard.
Windows users need to install Platform SDK to use this feature,
linux users have everything they need in gcc.
Number of threads used to update world is set by confiuration file,
and can be changed dynamically without restarting core.
Thanks to megamage and Jeniczek for testing and helping out with this.

--HG--
branch : trunk
2009-06-15 09:07:51 +02:00
megamage
9d670fe6f5 *Switch to support client version 3.1.3
*I strongly recommend you not to use this until you get the 313 db. Now all destructible buildings cause client crash.

Source: Mangos
Thanks to TOM_RUS for most work to make this switch possible ;)

--HG--
branch : trunk
2009-06-11 00:45:59 -05:00
megamage
5daba83c70 *Move relocation notify back to map class so that mtmap can work better.
--HG--
branch : trunk
2009-06-10 16:33:09 -05:00
megamage
4167ca4f84 *Do relocation notify in world class and only not do it every update.
--HG--
branch : trunk
2009-06-09 19:54:46 -05:00
megamage
4e130dcdfd [7980] Implement item use target requirements store and check (new table item_required_target). Author: NoFantasy
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

    * Also implement this table reload
    * Static Spell::SendCastResult function for call not from spell code.
      Can be also used in scripts where need send explicitly spell cast error to client.

--HG--
branch : trunk
2009-06-08 17:25:02 -05:00
megamage
065600bdf6 *Increase default creature/object visible distance. You can change it back if it causes server performance loss (I do not think that will happen)
--HG--
branch : trunk
2009-06-08 12:59:45 -05:00
Machiavelli
06db83ab49 * Fix World::SendGlobalGMMessage, only send packet to connections with appropriate security level
--HG--
branch : trunk
2009-06-08 16:25:07 +02:00
Machiavelli
ab9692f52e * Fix World::SendGMText, only send packet to connections with appropriate security level
--HG--
branch : trunk
2009-06-08 16:20:29 +02:00
megamage
ed7e8569cc *Add config option for wintergrasp (battle time, interval)
--HG--
branch : trunk
2009-06-03 23:23:23 -05:00
megamage
be52748f70 [7931] Allow GAMEOBJECT_TYPE_CAMERA gameobjects with event field set call DB scripts. Author: NoFantasy
Drop also redundent check preveting use SCRIPT_COMMAND_CAST_SPELL script command by gameobject script triggred casting.

--HG--
branch : trunk
2009-06-01 14:56:54 -05:00
megamage
f92e8315cf [7918] Improve portability in work with uint64 string format specifiers and in code literals. Author: VladimirMangos
* Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define.
      I64FMTD renamed to UI64FMTD for more clear name.
    * Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals.
      Please always use UI64LIT(0x00001) instead less portable 0x00001LL

--HG--
branch : trunk
2009-05-31 16:15:12 -05:00
megamage
1a857d382a *Start game event system before init bg and opvp in case that bg and opvp needs to start some game events.
--HG--
branch : trunk
2009-05-30 14:48:13 -05:00
megamage
00f50798d3 *Merge.
--HG--
branch : trunk
2009-05-25 12:51:14 -05:00
QAston
1c505261bc *Remove auras with duration lower than 30 sec on arena start.
*Do not remove rougue poisons and dk runes on arena start.
*Apply healing bonus for healing stream totem.
*Do not duplicate damage bonus in code with the one in db for Seal of Vengenance/Corruption

--HG--
branch : trunk
2009-05-24 22:54:13 +02:00
megamage
09b386a786 [7886] Drop use table petcreateinfo_spell
This is first commit in chain for remove oudated and not used pet functionality.

    * Use instead dropped table CreatureSpellData.dbc if creature_template.PetSpellDataId set (mostly hunter pets)
    * Use creature_template.spellN if not set creature_template.PetSpellDataId (mostly different summon creatures)
    * Fixed bug with not removing from action bar spell icon for not ranked unlearned spells.

    Note: summoned controllable creatures without PetSpellDataId must have expected spells in spellN feilds for creature_template.

[7887] Drop pet spell teaching code, including field in character_pet.

Author: VladimirMangos

--HG--
branch : trunk
2009-05-24 12:16:12 -05:00
raczman
b0a48f60c9 Added new config option: vmap.petLOS
Enabling it makes pets do LOS check before attacking its target.

--HG--
branch : trunk
2009-05-21 23:17:52 +02:00
megamage
67c84b1f3d Mobs fleeing and getting assistance feature implementaion. Author: Neo2003
--HG--
branch : trunk
2009-05-21 10:48:00 -05:00
megamage
3569f949d7 [7839] Rafactoring player targeting code in chat command and related cleanups/improvments.
* New extractOptFirstArg function for easy get 2 args in case option playe name as first arg.
    * New extractPlayerTarget function for get player pointer/guid/name for online/offline player base at provided name
      or if not provided by current seelction with error cases processing.
    * Property apply mute/unmute in case use different character name from loggined currently for account.
    * .reset commands can be used from console now
    * .repairitems comamnd can be used from console now but only to online player.

Author: VladimirMangos

--HG--
branch : trunk
2009-05-17 10:57:55 -05:00
QAston
47d5fc51c5 *Item enchancment/proc patch - original code by Thenecromancer
-void Player::CastItemCombatSpell(Item *item,Unit* Target, WeaponAttackType attType)
-{
-    if(!item || item->IsBroken())
-        return;
-
-    ItemPrototype const *proto = item->GetProto();
-    if(!proto)
-        return;
+void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo, ItemPrototype const * proto)
+{
+    Unit * Target = damageInfo->target;
+    WeaponAttackType attType = damageInfo->attackType;

     if (!Target || Target == this )
         return;

-    for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
-    {
-        _Spell const& spellData = proto->Spells[i];
-
-        // no spell
-        if(!spellData.SpellId )
-            continue;
-
-        // wrong triggering type
-        if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
-            continue;
-
-        SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
-        if(!spellInfo)
-        {
-            sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId);
-            continue;
-        }
-
-        // not allow proc extra attack spell at extra attack
-        if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
-            return;
-
-        float chance = spellInfo->procChance;
-
-        if(spellData.SpellPPMRate)
-        {
-            uint32 WeaponSpeed = GetAttackTime(attType);
-            chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
-        }
-        else if(chance > 100.0f)
-        {
-            chance = GetWeaponProcChance();
-        }
-
-        if (roll_chance_f(chance))
-            CastSpell(Target, spellInfo->Id, true, item);
+    // Can do effect if any damage done to target
+    if (damageInfo->damage)
+    {
+        for (int i = 0; i < 5; i++)
+        {
+            _Spell const& spellData = proto->Spells[i];
+
+            // no spell
+            if(!spellData.SpellId )
+                continue;
+
+            // wrong triggering type
+            if(spellData.SpellTrigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
+                continue;
+
+            SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
+            if(!spellInfo)
+            {
+                sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId);
+                continue;
+            }
+
+            // not allow proc extra attack spell at extra attack
+            if( m_extraAttacks && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
+                return;
+
+            float chance = spellInfo->procChance;
+
+            if(spellData.SpellPPMRate)
+            {
+                uint32 WeaponSpeed = GetAttackTime(attType);
+                chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
+            }
+            else if(chance > 100.0f)
+            {
+                chance = GetWeaponProcChance();
+            }
+
+            if (roll_chance_f(chance))
+                CastSpell(Target, spellInfo->Id, true, item);
+        }
     }

     // item combat enchantments
@@ -6993,6 +6993,21 @@
             if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
                 continue;

+            SpellEnchantProcEntry const* entry =  spellmgr.GetSpellEnchantProcEvent(enchant_id);
+
+            if (entry && entry->procEx)
+            {
+                // Check hit/crit/dodge/parry requirement
+                if((entry->procEx & damageInfo->procEx) == 0)
+                    continue;
+            }
+            else
+            {
+                // Can do effect if any damage done to target
+                if (!(damageInfo->damage))
+                    continue;
+            }
+
             SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]);
             if (!spellInfo)
             {
@@ -7001,6 +7016,18 @@
             }

             float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
+
+            if (entry && entry->PPMChance)
+            {
+                uint32 WeaponSpeed = GetAttackTime(attType);
+                chance = GetPPMProcChance(WeaponSpeed, entry->PPMChance, spellInfo);
+            }
+            else if (entry && entry->customChance)
+                chance = entry->customChance;
+
+            // Apply spell mods
+            ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance);
+
             if (roll_chance_f(chance))
             {
                 if(IsPositiveSpell(pEnchant->spellid[s]))
@@ -7012,6 +7039,7 @@
     }
 }

+
 void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex)
 {
     ItemPrototype const* proto = item->GetProto();

--HG--
branch : trunk
2009-05-15 16:37:22 +02:00
Genars & Aokromes
80a6d723f5 New server options to block adding GMs to friends by players and to block inviting GMs to parties
--HG--
branch : trunk
2009-05-14 23:07:17 +02:00
Genars & Aokromes
854e791c2f New server options to block adding GMs to friends by players and to block inviting GMs to parties
--HG--
branch : trunk
2009-05-14 23:07:17 +02:00
Aokromes
a882c4538a New configuration option: GM.Visible
regulates visibility of GM at login.

--HG--
branch : trunk
2009-05-12 08:22:06 +02:00
QAston
fcf0fdc1c1 *Item enchancment/proc patch - original code by Thenecromancer
--HG--
branch : trunk
2009-05-10 18:06:22 +02:00
megamage
e69d2cbed9 [7776] Completed implementation of CMSG_SPELLCLICK Author: arrai
For vehicles, you have to add the correct SPELL_AURA_CONTROL_VEHICLE spells to
    npc_spellclick_spells, otherwise you won't be able to use them

--HG--
branch : trunk
2009-05-05 16:56:15 -05:00
Disassembler
92cfbad2b2 Backport from TC2 (resp. Mangos) conf options Death.Bones.* for disable bones
creating from corpse in world zones or in arena/bg.

--HG--
branch : trunk
2009-05-04 16:54:35 +02:00
megamage
de11b9e901 [7730] Some optimizantion and code style. Author: zhenya
--HG--
branch : trunk
2009-04-29 00:26:07 -05:00
megamage
5ac67c27f7 [7715] Provided way for scripts set alternative gameobject state for client show. Author: VladimirMangos
Also use enum for gsmeobject states.

--HG--
branch : trunk
2009-04-27 18:36:10 -05:00
megamage
373914f1f9 *Fix a typo in reading config file.
--HG--
branch : trunk
2009-04-25 12:53:23 -05:00
megamage
19f8ba8cc1 [7707] Remove duplicate line in check. Author: NoFantasy
--HG--
branch : trunk
2009-04-24 11:45:59 -05:00
megamage
e7e03d167e *Merge.
--HG--
branch : trunk
2009-04-22 17:52:01 -05:00
megamage
2ecf455090 *Move move and remove obj from world update to map update.
--HG--
branch : trunk
2009-04-21 11:18:46 -05:00
megamage
905833f84e *Merge.
--HG--
branch : trunk
2009-04-15 17:06:38 -05:00
raczman
a712170758 Creature respawn linking, idea by Rat, wrote by Iskander, blessed by raczman.
--HG--
branch : trunk
2009-04-14 14:33:48 +02:00