Skip to content

Commit

Permalink
Merge remote branch 'rsap/master'
Browse files Browse the repository at this point in the history
Conflicts:
	addition/anticheat_characters.sql
	src/game/AntiCheat.cpp
	src/game/AntiCheat.h
	src/game/AuctionHouseBot.cpp
	src/game/AuctionHouseHandler.cpp
	src/game/CMakeLists.txt
	src/game/CharacterHandler.cpp
	src/game/GroupHandler.cpp
	src/game/Map.cpp
	src/game/Player.cpp
	src/game/Player.h
	src/game/SpellEffects.cpp
	src/game/TargetedMovementGenerator.cpp
	src/game/World.cpp
	src/game/World.h
	src/game/WorldSession.cpp
	src/game/WorldSession.h
	src/mangosd/mangosd.conf.dist.in
  • Loading branch information
unknown authored and unknown committed Apr 28, 2011
2 parents eb7ac10 + e8da198 commit c8301b1
Show file tree
Hide file tree
Showing 137 changed files with 20,213 additions and 8,601 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Lineendings
*.sln eol=crlf
*.vcproj eol=crlf
*.vcxproj* eol=crlf

# Whitespace rules
# strict (no trailing, no tabs)
*.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol
*.h whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol

# normal (no trailing)
*.sql whitespace=trailing-space,space-before-tab,cr-at-eol
*.txt whitespace=trailing-space,space-before-tab,cr-at-eol

# special files which must ignore whitespace
*.patch whitespace=-trailing-space
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
set(CMAKE_INSTALL_PREFIX ${PREFIX_ABSOLUTE} CACHE PATH "Install path prefix." FORCE)
endif()
if(PREFIX)
string(REGEX REPLACE "^~" "$ENV{HOME}" PREFIX ${PREFIX})
if(!WIN32)
string(REGEX REPLACE "^~" "$ENV{HOME}" PREFIX ${PREFIX})
endif()
get_filename_component(PREFIX_ABSOLUTE ${PREFIX} ABSOLUTE)
set(CMAKE_INSTALL_PREFIX ${PREFIX} CACHE PATH "Install path prefix." FORCE)
else()
Expand Down Expand Up @@ -285,12 +287,12 @@ if(UNIX)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wfatal-errors -Wextra")
elseif(WIN32)
# Disable warnings in Visual Studio 8 and above
# Disable warnings in Visual Studio 8 and above and add /MP
if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267 /MP")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP")
endif()
endif()

Expand Down
54 changes: 49 additions & 5 deletions README.PLAYERBOT
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Commands:
/t BOTNAME equip <ITEM LINK>
/t BOTNAME reset (will reset states, orders and loot list)
/t BOTNAME report (bot reports all items needed to finish quests)
/t BOTNAME point (bot will attack selected target)
/t BOTNAME stats (bot shows available money, free inventory space and estimated item repair costs)
/t BOTNAME survey (bot shows all available gameobjects, within a local perimeter around the bot)
/t BOTNAME find <GAMEOBJECT LINK> (bot will travel to the gameobject location and then wait)
Expand Down Expand Up @@ -151,16 +150,16 @@ I added the following in SharedDefines.h.

enum SpellCategory
{
SPELL_CATEGORY_FOOD = 11,
SPELL_CATEGORY_DRINK = 59
SPELL_CATEGORY_FOOD = 11,
SPELL_CATEGORY_DRINK = 59
};

I also had to add the following to Player.h:

enum PlayerStateType
{
PLAYER_STATE_NONE = 0,
PLAYER_STATE_SIT = 1
PLAYER_STATE_NONE = 0,
PLAYER_STATE_SIT = 1
};


Expand All @@ -183,3 +182,48 @@ Some Problems:
==============

The bots don't always face in the right direction. Sometimes when a bot makes the kill, the corpse is not lootable. The mage bot sometimes get stuck when he begins to cast a spell (but this is corrected the next time he enters combat).

-- BotGuy
What it is:
===========

The new revised'botguy' utilizes NPCs already distributed throughout the world, to allow players to
summon and dismiss bots at will, from their own account.

This is a revised (more stable) version that utilizes the new 'GOSSIP MENU SYSTEM' to modify the menus of existing NPCs
(e.g Trainers etc) to include the bot Recruit/Dismiss menu. (No GameMaster account necessary).

Install (Server administrators only)
=======
Please apply 'mangos_botguy.sql' once to the world database to update the 'gossip_menu_option' table.

-- ToDo
[DONE] ///---Quest---///
[DONE] Bot can accept quest.
[DONE] Bot can join quest.

[DONE] ///---Loot---///
[DONE] Bot can loot.
[DONE] Bot can loot --- maybe only needed q item.

//---Instance teleport Problems---///
[DONE] Needs some fix.

///---Combat and Movement Orders---///
[DONE] Movement orders (stay, follow)
[DONE] Combat orders (protect, assist)
Combat order TANK
Combat order HEAL

///---Temporary item enchantments---///
[DONE] Rogue : Poison
Warrior : Sharpening Stone, Rune of Warding, Rune of Shielding.

//---After fear bot's lose target---///
Needs some fix.

///---Move behind target---///
Rogue : some abilitys require Rogue to be stealthed and behind target.

///---Implement locale independet way of getting spellIDs---///
[DONE] Hardcode lowest rank spellID, use function to get highest rank
229 changes: 229 additions & 0 deletions README.PlayerBot
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
What it is:
===========

Playerbot lets you add another character from your account as a bot that you can control and which will hopefully help you. Only characters from your account can be used, so you can have a maximum of 9 bots at one time.

This was taken from the Trinity site, and modified slightly by me to get some of the kinks out. I reworked the priest class and also added a mage class and a warrior class, which are still in crude form. Any class can be used as a bot - just don't expect much in the way of spells or abilities until someone writes the code for them.

Bots will only use abilities that they have - for example, a priest will only use the renew spell if it has been trained. Also, bot's equipment will lose durability like any other character. So every so often you'll need to log in and repair and train your bot.

For Mangos 7800+

Commands:
=========

/s .bot add BOTNAME (add character to world)
/s .bot remove BOTNAME
/s .bot co|combatorder BOTNAME COMBATORDER [TARGET]
/invite BOTNAME (bot will auto accept invite)
/t BOTNAME attack (bot will attack selected target, similar to the way a pet can attack)
/t BOTNAME follow (orders bot to follow player; will also revive bot if dead or teleport bot if far away)
/t BOTNAME stay
/t BOTNAME assist (you'll need to be attacking something and the bot only does melee atm)
/t BOTNAME spells (replies with all spells known to bot)
/t BOTNAME cast <SPELLID | (part of) SPELLNAME | SPELLLINK>
/t BOTNAME use <ITEM LINK>
/t BOTNAME equip <ITEM LINK>
/t BOTNAME reset (will reset states, orders and loot list)
/t BOTNAME report (bot reports all items needed to finish quests)
/t BOTNAME stats (bot shows available money, free inventory space and estimated item repair costs)
/t BOTNAME survey (bot shows all available gameobjects, within a local perimeter around the bot)
/t BOTNAME find <GAMEOBJECT LINK> (bot will travel to the gameobject location and then wait)
/t BOTNAME get <GAMEOBJECT LINK> (bot will fetch the selected gameobject and then return to the player)
/t BOTNAME quests (List bot's current quests)
/t BOTNAME drop <QUESTLINK> (Drop a quest)
/t BOTNAME orders (Shows bot's combat orders)
/t BOTNAME pet spells (Shows spells known to bot's pet. Autocast spells will be shown in green)
/t BOTNAME pet cast <SPELLID | (part of) SPELLNAME | SPELLLINK>
/t BOTNAME pet toggle <SPELLID | (part of) SPELLNAME | SPELLLINK> (Toggle autocast for a given spell)
/t BOTNAME pet state (Shows current react mode of bot's pet)
/t BOTNAME pet react <(a)ggressive | (d)efensive | (p)assive> (Set bot's pet reaction mode)

Shortcuts:
c = cast
e = equip
u = use

Gameobject interaction with bots:
=================================

The bot(s) can now interact with gameobjects. This is particularly useful, in order to complete 'gather' type
quests (e.g Milly's harvest in Northshire). The bot(s) can also now, harvest 'ore deposits' and 'herbs'

Three new commands have been introduced 'survey, 'find' & 'get', to facilitate this new feature.

The 'survey' command provides the means for bot(s) to detect gameobjects in the world. It can be used to detect
available gameobjects local to a single bot, or more effectively (wider area) those for a party of bots.

Suggestion: setup the 'survey' command as an assigned macro button, on the client (e.g /p survey). You can
then quickly refresh the gameobject list.

Gameobject list <GAMEOBJECT LINK> (Currently bots can only interact with ore, herb and needed quest items)
---------------

[Copper Vein][Silverleaf][Earthroot][Milly's Harvest][Battered Chest][Food Crate]

Then, use the 'find' or 'get' commands to interect with the gameobject.

Using the gameobject list information, it is possible to locate and/or fetch each of the gameobjects. To select
a <GAMEOBJECT LINK>, hold down the shift key and click on the relevant link with your mouse.

Repair with bots:
=================

The bot(s) can now be repaired, as the player repairs. You can decide whether you wish the bot(s) to pay for
their own repair or if available, use the guild bank. Choose the appropriate repair 'Anvil' at your local
NPC. Only group bot(s) members can be repaired. If you wish to exclude certain bot(s) from repair, then
temporarily uninvite bot(s) from the group.

Limitations: Bot(s) cannot repair individual items.
If the player does not require repair, you cannot repair bot(s).

The new 'stats' command provides useful information to help in the repair decision.

First: Money available to bot(s)
Second: Free inventory slots for bot(s)
Third: Estimated (excludes NPC reputation discount) item damage cost for bot(s).

Combat Orders explained:
========================

There are primary and secondary commands which can be combined. In this way it is
possible to define a bot to assist the main tank and also protect the healer, making
combat management much easier.
The commands assist and protect require a target parameter or a friendly player
selected by bots master.
Available Combat Orders:
tank pri try to bind all targets involved in combat by gaining highest threat
assist pri do damage on selected targets attacker without getting highest threat
heal pri concentrate on healing - no offensive spells, try to keep threat low
protect sec if target of protect get's directly attacked gain higher threat on attacker
reset - clear out assist and protect targets and set combat order to nothing
Examples:
.bot co TheTank tank
.bot co MyHealer heal
.bot co TheBrutal assist TheTank
.bot co TheBrutal protect MyHealer

Trading with bots:
==================

To trade items/money with your bot simply initiate a trade and the bot will tell you how much money and items are available. To request an item simple whisper the bot and shift click the link of the item you would like. You can link multiple items on the same line. You can also request money in the following manner when the trade window is open:
/w BOTNAME 10g <-- request that the bot give you 10 gold
/w BOTNAME 6g500s25c <-- request 6 gold, 500 silver, and 25 cooper

A bot is also able to show an item in its 'Will not be traded' slot. The item can be either
in its bags or be equipped and even be soulbound. By this you can cast spells/enchantments
on soulbound items ('nt' stands for 'not trading').
/w BOTNAME nt [Powerful Soulbound Item]

More Information:
=================

If specifying a spell substring, the spell chosen will be in priority of exact name match, highest spell rank, and spell using no reagents. Case does not matter. Here's some examples:
/t BOTNAME c greater heal
/t BOTNAME cast pain
/w BOTNAME c poly
/w BOTNAME cast fort
/t BOTNAME cast <SPELLID>
- OR -
/w BOTNAME c <SPELLID>

Also all commands can be broadcast to the party. For example:
/p follow
/p spells

To use or equip items for your bot say:
/w BOTNAME use <ITEMLINK1> <ITEMLINK2>
/w BOTNAME equip <ITEMLINK1> <ITEMLINK2>
- OR -
/w BOTNAME u <ITEMLINK1> <ITEMLINK2>
/w BOTNAME e <ITEMLINK1> <ITEMLINK2>

If you inspect your bot, your bot will tell you what items you have in your inventory that you can equip. To create a link in the chat window, hold the shift key and press the left mouse button when clicking the link.


Changes from Trinity to Mangos:
===============================

I added the following in SharedDefines.h.

enum SpellCategory
{
SPELL_CATEGORY_FOOD = 11,
SPELL_CATEGORY_DRINK = 59
};

I also had to add the following to Player.h:

enum PlayerStateType
{
PLAYER_STATE_NONE = 0,
PLAYER_STATE_SIT = 1
};


Configuration variables:
========================
Also see src/mangosd/mangosd.conf.dist for configuration variables!

PlayerbotAI.DebugWhisper
Enable debug output by whispering master
Default: 0 - off
1 - on

PlayerbotAI.FollowDistanceMin
PlayerbotAI.FollowDistanceMax
Min. and max. follow distance for bots
Default: 0.5 / 1.0


Some Problems:
==============

The bots don't always face in the right direction. Sometimes when a bot makes the kill, the corpse is not lootable. The mage bot sometimes get stuck when he begins to cast a spell (but this is corrected the next time he enters combat).

-- BotGuy
What it is:
===========

The new revised'botguy' utilizes NPCs already distributed throughout the world, to allow players to
summon and dismiss bots at will, from their own account.

This is a revised (more stable) version that utilizes the new 'GOSSIP MENU SYSTEM' to modify the menus of existing NPCs
(e.g Trainers etc) to include the bot Recruit/Dismiss menu. (No GameMaster account necessary).

Install (Server administrators only)
=======
Please apply 'mangos_botguy.sql' once to the world database to update the 'gossip_menu_option' table.

-- ToDo
[DONE] ///---Quest---///
[DONE] Bot can accept quest.
[DONE] Bot can join quest.

[DONE] ///---Loot---///
[DONE] Bot can loot.
[DONE] Bot can loot --- maybe only needed q item.

//---Instance teleport Problems---///
[DONE] Needs some fix.

///---Combat and Movement Orders---///
[DONE] Movement orders (stay, follow)
[DONE] Combat orders (protect, assist)
Combat order TANK
Combat order HEAL

///---Temporary item enchantments---///
[DONE] Rogue : Poison
Warrior : Sharpening Stone, Rune of Warding, Rune of Shielding.

//---After fear bot's lose target---///
Needs some fix.

///---Move behind target---///
Rogue : some abilitys require Rogue to be stealthed and behind target.

///---Implement locale independet way of getting spellIDs---///
[DONE] Hardcode lowest rank spellID, use function to get highest rank
5 changes: 5 additions & 0 deletions addition/707_mangos_spell_hacks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ DELETE FROM spell_proc_event WHERE entry IN (57529, 57531);
INSERT INTO spell_proc_event (entry, SchoolMask, SpellFamilyName, SpellFamilyMaskA0, SpellFamilyMaskA1, SpellFamilyMaskA2, SpellFamilyMaskB0, SpellFamilyMaskB1, SpellFamilyMaskB2, SpellFamilyMaskC0, SpellFamilyMaskC1, SpellFamilyMaskC2, procFlags, procEx, ppmRate, CustomChance, Cooldown) VALUES
(57529, 0x00, 3, 0x61400035 | 0x200000 | 0x20000 | 0x0000040 | 0x000080 | 0x00000002 | 0x00000200 | 0x00001000 | 0x00800000 , 0,0 , 0x00001000 | 0x00008000 | 0x00000002 | 0x00001000 | 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0);
-- dbc | arc. mis.| frost no| ice lance | blizzard | fire blast | cone of co | arc. expl. | dragon's br., , dbc | arc. barr | fire Blast | frotfireb. | blast wave

-- from FallenangelX
DELETE FROM `spell_proc_event` WHERE `entry` IN (51682);
INSERT INTO `spell_proc_event` VALUES
(51682, 0x00, 8, 0x10014000, 0x10014000, 0x10014000, 0x00080000, 0x00080000, 0x00080000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
8 changes: 6 additions & 2 deletions addition/732_mangos_vehicle_accessory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ INSERT INTO `vehicle_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`de
(33114,33142,1,1,'Overload Control Device'),
(33114,33143,2,1,'Leviathan Defense Turret'),
(36678,38309,0,1,'Professor Putricide - trigger'),
(36678,38308,1,1,'Professor Putricide - trigger'),
(33214,33218,1,1,'Mechanolift 304-A'),
(35637,34705,0,0,'Marshal Jacob Alerius\' Mount'),
(35633,34702,0,0,'Ambrose Boltspark\'s Mount'),
Expand All @@ -50,7 +51,6 @@ INSERT INTO `vehicle_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`de
(29625,29694,0,0,'Hyldsmeet Proto-Drake'),
(30330,30332,0,0,'Jotunheim Proto-Drake'),
(32189,32190,0,0,'Skybreaker Recon Fighter'),
(36678,38308,1,1,'Professor Putricide - trigger'),
(32640,32642,1,0,'Traveler Mammoth (H) - Vendor'),
(32640,32641,2,0,'Traveler Mammoth (H) - Vendor & Repairer'),
(32633,32638,1,0,'Traveler Mammoth (A) - Vendor'),
Expand All @@ -59,4 +59,8 @@ INSERT INTO `vehicle_accessory`(`entry`,`accessory_entry`,`seat_id`,`minion`,`de
(29555,29556,0,0,'Goblin Sapper'),
(28018,28006,0,1,'Thiassi the Light Bringer'),
(28054,28053,0,0,'Lucky Wilhelm - Apple'),
(28614,28616,0,1,'Scarlet Gryphon Rider');
(28614,28616,0,1,'Scarlet Gryphon Rider'),
(36476,36477,0,0,'Krick and Ick'),
(36661,36658,0,0,'Scourgelord Tyrannus and Rimefang');

UPDATE `creature_template_addon` SET `auras` = '' WHERE `entry` IN (32638,32642);
1 change: 0 additions & 1 deletion addition/732_mangos_vehicle_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ ALTER TABLE creature_template
ADD COLUMN `spell6` mediumint(8) unsigned NOT NULL default '0' AFTER `spell5`,
ADD COLUMN `spell7` mediumint(8) unsigned NOT NULL default '0' AFTER `spell6`,
ADD COLUMN `spell8` mediumint(8) unsigned NOT NULL default '0' AFTER `spell7`,
ADD COLUMN `VehicleId` mediumint(8) unsigned NOT NULL default '0' AFTER `PetSpellDataId`,
ADD COLUMN `PowerType` tinyint(3) unsigned NOT NULL default '0' AFTER `MaxHealth`;

Loading

0 comments on commit c8301b1

Please sign in to comment.