You can subscribe to this list here.
2010 |
Jan
(28) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: <yet...@us...> - 2010-04-13 22:05:02
|
Revision: 494 http://babbot.svn.sourceforge.net/babbot/?rev=494&view=rev Author: yetihunter Date: 2010-04-13 22:04:55 +0000 (Tue, 13 Apr 2010) Log Message: ----------- Added CalculatePath methods to Caronte for generating paths with specific character dimensions. Not tested yet. Modified Paths: -------------- trunk/Caronte/Graph/PathGraph.cs trunk/Caronte/Program.cs Modified: trunk/Caronte/Graph/PathGraph.cs =================================================================== --- trunk/Caronte/Graph/PathGraph.cs 2010-03-03 09:31:10 UTC (rev 493) +++ trunk/Caronte/Graph/PathGraph.cs 2010-04-13 22:04:55 UTC (rev 494) @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Threading; using WowTriangles; @@ -9,8 +8,8 @@ { public class PathGraph { - public const float toonHeight = 2.0f; - public const float toonSize = 0.5f; + public float toonHeight = 2.0f; + public float toonSize = 0.5f; public const float MinStepLength = 2f; public const float WantedStepLength = 3f; @@ -35,9 +34,7 @@ long LRU = 0; - public PathGraph(string continent, - ChunkedTriangleCollection triangles, - TriangleCollection paint) + public PathGraph(string continent, ChunkedTriangleCollection triangles, TriangleCollection paint) { this.Continent = continent; this.triangleWorld = triangles; @@ -46,14 +43,10 @@ } public void Close() - { - triangleWorld.Close(); - } + { triangleWorld.Close(); } public void Clear() - { - chunks = new SparseMatrix2D<GraphChunk>(8); - } + { chunks = new SparseMatrix2D<GraphChunk>(8); } private void GetChunkCoord(float x, float y, out int ix, out int iy) { @@ -508,10 +501,7 @@ // return null if failed or the last spot in the path found int searchID = 0; - private Spot search(Spot src, Spot dst, - Location realDst, - float minHowClose, bool AllowInvented, - ILocationHeuristics locationHeuristics) + private Spot search(Spot src, Spot dst, Location realDst, float minHowClose, bool AllowInvented, ILocationHeuristics locationHeuristics) { searchID++; int count = 0; @@ -868,5 +858,11 @@ //Console.WriteLine(s); Console.WriteLine(s); } + public Path CreatePath(Location origin, Location destination, float dist, float hight, float radius) + { + this.toonHeight = hight; + this.toonSize = radius; + return CreatePath(origin, destination, dist); + } } } Modified: trunk/Caronte/Program.cs =================================================================== --- trunk/Caronte/Program.cs 2010-03-03 09:31:10 UTC (rev 493) +++ trunk/Caronte/Program.cs 2010-04-13 22:04:55 UTC (rev 494) @@ -17,19 +17,16 @@ along with PPather. If not, see <http://www.gnu.org/licenses/>. */ - - - using System; +using WowTriangles; - namespace Caronte { public class Caronte { private string continent; - private WowTriangles.MPQTriangleSupplier mpq; - private WowTriangles.ChunkedTriangleCollection triangleWorld; + private MPQTriangleSupplier mpq; + private ChunkedTriangleCollection triangleWorld; private Pather.Graph.PathGraph world; @@ -37,14 +34,13 @@ { set { world.Cancel = value; } } - public void Init(string iContinent) { continent = iContinent; - mpq = new WowTriangles.MPQTriangleSupplier(); + mpq = new MPQTriangleSupplier(); mpq.SetContinent(continent); - triangleWorld = new WowTriangles.ChunkedTriangleCollection(512); + triangleWorld = new ChunkedTriangleCollection(512); triangleWorld.SetMaxCached(9); triangleWorld.AddSupplier(mpq); @@ -56,116 +52,118 @@ world = new Pather.Graph.PathGraph(continent, triangleWorld, null); } - - public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, - Pather.Graph.Location iDestination) + public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, Pather.Graph.Location iDestination) { return CalculatePath(iOrigin, iDestination, 5F); } - public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, - Pather.Graph.Location iDestination, float sDist) + public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, Pather.Graph.Location iDestination, float sDist) { - // We try to find a path - Pather.Graph.Path mypath = world.CreatePath(iOrigin, iDestination, sDist); - /* We save the PathGraph. Stores every chunk of the map we used in the PPather\PathInfo\{map} folder */ - world.Save(); - return mypath; } + public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, Pather.Graph.Location iDestination, float charHight, float charRadius) + { + return CalculatePath(iOrigin, iDestination, 5f, charHight, charRadius); + } + public Pather.Graph.Path CalculatePath(Pather.Graph.Location iOrigin, Pather.Graph.Location iDestination, float sDist, float charHight, float charRadius) + { + Pather.Graph.Path mypath = world.CreatePath(iOrigin, iDestination, sDist, charHight, charRadius); + world.Save(); + return mypath; + } } class Program { - static void Main(string[] args) + static void Main() { - /* This init code is almost copy/pasted from PPather. Depending of where - yo are, you can replace Kalimdor with one of: - AhnQiraj - AhnQirajTemple - AlliancePVPBarracks - AuchindounDemon - AuchindounDraenei - AuchindounEthereal - AuchindounShadow - Azeroth - Blackfathom - BlackrockDepths - BlackRockSpire - BlackTemple - BlackwingLair - bladesedgearena - CavernsOfTime - CoilfangDraenei - CoilfangMarsh - CoilfangPumping - CoilfangRaid - Collin - CraigTest - DalaranArena - DeadminesInstance - DeeprunTram - development_nonweighted - DireMaul - EmeraldDream - Expansion01 - GnomeragonInstance - GruulsLair - HellfireDemon - HellfireMilitary - HellfireRaid - HellfireRampart - HillsbradPast - HordePVPBarracks - HyjalPast - Kalimdor - Karazahn - Mauradon - MoltenCore - Monastery - MonasteryInstances - NetherstormBG - OnyxiaLairInstance - OrgrimmarArena - OrgrimmarInstance - PVPLordaeron - PVPZone01 - PVPZone02 - PVPZone03 - PVPZone04 - PVPZone05 - RazorfenDowns - RazorfenKraulInstance - SchoolofNecromancy - ScottTest - Shadowfang - StormwindJail - StormwindPrison - Stratholme - SunkenTemple - Sunwell5Man - Sunwell5ManFix - SunwellPlateau - TanarisInstance - TempestKeepArcane - TempestKeepAtrium - TempestKeepFactory - TempestKeepRaid - test - Uldaman - WailingCaverns - Zul'gurub - ZulAman - */ + //This init code is almost copy/pasted from PPather. Depending of where + //yo are, you can replace Kalimdor with one of: + //AhnQiraj + //AhnQirajTemple + //AlliancePVPBarracks + //AuchindounDemon + //AuchindounDraenei + //AuchindounEthereal + //AuchindounShadow + //Azeroth + //Blackfathom + //BlackrockDepths + //BlackRockSpire + //BlackTemple + //BlackwingLair + //bladesedgearena + //CavernsOfTime + //CoilfangDraenei + //CoilfangMarsh + //CoilfangPumping + //CoilfangRaid + //Collin + //CraigTest + //DalaranArena + //DeadminesInstance + //DeeprunTram + //development_nonweighted + //DireMaul + //EmeraldDream + //Expansion01 + //GnomeragonInstance + //GruulsLair + //HellfireDemon + //HellfireMilitary + //HellfireRaid + //HellfireRampart + //HillsbradPast + //HordePVPBarracks + //HyjalPast + //Kalimdor + //Karazahn + //Mauradon + //MoltenCore + //Monastery + //MonasteryInstances + //NetherstormBG + //OnyxiaLairInstance + //OrgrimmarArena + //OrgrimmarInstance + //PVPLordaeron + //PVPZone01 + //PVPZone02 + //PVPZone03 + //PVPZone04 + //PVPZone05 + //RazorfenDowns + //RazorfenKraulInstance + //SchoolofNecromancy + //ScottTest + //Shadowfang + //StormwindJail + //StormwindPrison + //Stratholme + //SunkenTemple + //Sunwell5Man + //Sunwell5ManFix + //SunwellPlateau + //TanarisInstance + //TempestKeepArcane + //TempestKeepAtrium + //TempestKeepFactory + //TempestKeepRaid + //test + //Uldaman + //WailingCaverns + //Zul'gurub + //ZulAman + - WowTriangles.MPQTriangleSupplier mpq = new WowTriangles.MPQTriangleSupplier(); + var mpq = new MPQTriangleSupplier(); mpq.SetContinent("Expansion01"); - WowTriangles.ChunkedTriangleCollection triangleWorld = new WowTriangles.ChunkedTriangleCollection(512); + var triangleWorld = new ChunkedTriangleCollection(512); triangleWorld.SetMaxCached(9); triangleWorld.AddSupplier(mpq); @@ -174,24 +172,24 @@ /* After the init routines we create a PathGraph object (as before you can replace Kalimdor with whatever you need */ - Pather.Graph.PathGraph world = new Pather.Graph.PathGraph("Expansion01", triangleWorld, null); + var world = new Pather.Graph.PathGraph("Expansion01", triangleWorld, null); // Here we define the starting point (somewhere in the orc noob village) - Pather.Graph.Location origin = new Pather.Graph.Location(240.94f, 2692.39f, 89.74f); + var origin = new Pather.Graph.Location(240.94f, 2692.39f, 89.74f); // Here we define our destination (somewhere in Razor Hill) - Pather.Graph.Location destination = new Pather.Graph.Location(189.63f, 2690.94f, 88.71f); + var destination = new Pather.Graph.Location(189.63f, 2690.94f, 88.71f); // We try to find a path - Pather.Graph.Path mypath = world.CreatePath(origin, destination, 5f); + var mypath = world.CreatePath(origin, destination, 5f); /* We save the PathGraph. Stores every chunk of the map we used in the PPather\PathInfo\{map} folder */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ta...@us...> - 2010-03-03 09:31:16
|
Revision: 493 http://babbot.svn.sourceforge.net/babbot/?rev=493&view=rev Author: tanis Date: 2010-03-03 09:31:10 +0000 (Wed, 03 Mar 2010) Log Message: ----------- - Updated offsets (thx SinnerG) Modified Paths: -------------- trunk/BabBot/BabBot/Data/WoWData.xml Modified: trunk/BabBot/BabBot/Data/WoWData.xml =================================================================== --- trunk/BabBot/BabBot/Data/WoWData.xml 2010-02-04 14:26:27 UTC (rev 492) +++ trunk/BabBot/BabBot/Data/WoWData.xml 2010-03-03 09:31:10 UTC (rev 493) @@ -1278,8 +1278,8 @@ </version> <version name="3.3.2.11403" max_lvl="80"> <globals - game_offset="0x00C93410" - name_store_pointer="0x0" + game_offset="0x00CF8C50" + name_store_pointer="0x00C93448" player_base_offset1="0x34" player_base_offset2="0x24" player_rotation_offset="0x7A8" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: 张墨含 <zm...@gm...> - 2010-02-09 02:28:54
|
Hellow,i'm a Chinese student having played WOW for almost 5 years. Your babbot program fascinate me profoundly,but i found that the source code is disable to be compiled because of the following reasons: the master.csproj can't be debuged or rebuilded. i'm disturbed by the issue seriously,so expect your reply instructing me. think you |
From: <ta...@us...> - 2010-02-04 14:26:33
|
Revision: 492 http://babbot.svn.sourceforge.net/babbot/?rev=492&view=rev Author: tanis Date: 2010-02-04 14:26:27 +0000 (Thu, 04 Feb 2010) Log Message: ----------- - Added some of the offsets for 3.3.2 - Added a couple of thread management functions do the injected DLL Modified Paths: -------------- trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/RouteList.xml trunk/BabBot/BabBot/Data/WoWData.xml trunk/BabBot/BabBot/Manager/InjectionManager.cs trunk/BabBot/BabBot/Manager/ProcessManager.cs trunk/Dante/DanteInterface.cs trunk/Dante/LuaInterface.cs trunk/Dante/MyDirect3D.cs trunk/Dante/Win32.cs Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-02-04 14:26:27 UTC (rev 492) @@ -176,4 +176,5 @@ </game_object> </wow_version> <wow_version name="3.3.0.11159" /> + <wow_version name="3.3.2.11403" /> </game_object_data> \ No newline at end of file Modified: trunk/BabBot/BabBot/Data/RouteList.xml =================================================================== --- trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/BabBot/BabBot/Data/RouteList.xml 2010-02-04 14:26:27 UTC (rev 492) @@ -53,4 +53,5 @@ </route> </wow_version> <wow_version name="3.3.0.11159" /> + <wow_version name="3.3.2.11403" /> </route_list> \ No newline at end of file Modified: trunk/BabBot/BabBot/Data/WoWData.xml =================================================================== --- trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/BabBot/BabBot/Data/WoWData.xml 2010-02-04 14:26:27 UTC (rev 492) @@ -1276,6 +1276,51 @@ lua_tostring = "0x00826B90" /> </version> + <version name="3.3.2.11403" max_lvl="80"> + <globals + game_offset="0x00C93410" + name_store_pointer="0x0" + player_base_offset1="0x34" + player_base_offset2="0x24" + player_rotation_offset="0x7A8" + player_x_offset="0x798" + player_y_offset="0x79C" + player_z_offset="0x7A0" + local_player_corpse_offset="0x00B69858" + camera_offset="0x7E20" + camera_pointer="0x0" + descriptor_offset="0x08" + first_object="0xAC" + guid_offset="0x30" + local_guid_offset="0xC0" + next_object="0x3C" + type_offset="0x14" + first_buff="0xEBC" + next_buff="0x4" + obj_name_base_offset1="0x1A4" + obj_name_base_offset2="0x90" + obj_name_len ="40" + unit_name_base_offset1="0x964" + unit_name_base_offset2="0x5C" + unit_name_len="40" + click_to_move_base="0x00CBA7D8" + click_to_move_unknown="0x0" + click_to_move_turn_scale="0x4" + click_to_move_unknown_2="0x8" + click_to_move_interact_distance="0xc" + click_to_move_action_type="0x1c" + click_to_move_target="0x20" + click_to_move_dest_x="0x8c" + click_to_move_dest_y="0x90" + click_to_move_dest_z="0x94" + + lua_dostring="0x007F25C0" + lua_getstate="0x007F1160" + lua_gettop = "0x00826D80" + lua_register = "0x007F1340" + lua_tostring = "0x00827290" + /> + </version> <!-- Global application configuration parameters that not included into config.xml max_get_target_retries - number of retries (plus first try) bot can have to reach target Modified: trunk/BabBot/BabBot/Manager/InjectionManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/InjectionManager.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/BabBot/BabBot/Manager/InjectionManager.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -269,6 +269,9 @@ SetPatchOffset(Convert.ToUInt32( ProcessManager.Config.CustomParams.LuaCallback, 16)); + // Pass wow's main thread id + SetWowMainThread(); + Output.Instance.Log("Dante injected"); } catch (Exception ExtInfo) @@ -289,6 +292,12 @@ RemoteObject.SetPatchOffset(poffset); } + public void SetWowMainThread() + { + if (RemoteObject != null) + RemoteObject.SetWowMainThread(ProcessManager.GetWowMainThread()); + } + public void Lua_RegisterInputHandler() { if (!registered) Modified: trunk/BabBot/BabBot/Manager/ProcessManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/ProcessManager.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/BabBot/BabBot/Manager/ProcessManager.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -1086,6 +1086,11 @@ SThread.ResumeThread(hThread); } + public static int GetWowMainThread() + { + ProcessThread wowMainThread = SThread.GetMainThread(process.Id); + return wowMainThread.Id; + } /// <summary> /// Get AutoRun mode /// </summary> Modified: trunk/Dante/DanteInterface.cs =================================================================== --- trunk/Dante/DanteInterface.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/Dante/DanteInterface.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -179,5 +179,10 @@ { LuaInterface.RegisterLuaDelegate(lua_config); } + + public void SetWowMainThread(int threadId) + { + LuaInterface.WowMainThreadId = threadId; + } } } Modified: trunk/Dante/LuaInterface.cs =================================================================== --- trunk/Dante/LuaInterface.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/Dante/LuaInterface.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -56,6 +56,7 @@ private static uint state = 0; private static bool LogLuaCalls = true; + internal static int WowMainThreadId = 0; #endregion Modified: trunk/Dante/MyDirect3D.cs =================================================================== --- trunk/Dante/MyDirect3D.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/Dante/MyDirect3D.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -103,12 +103,14 @@ { lock (LuaInterface.dataLock) { + //Kernel32.SuspendThread(LuaInterface.WowMainThreadId); if (EndSceneDebug) LuaInterface.LoggingInterface.LogEndScene(true); try { + switch (LuaInterface.LuaState) { case 255: @@ -192,6 +194,8 @@ LuaInterface.LoggingInterface.LogEndScene(false); //LuaInterface.LoggingInterface.Log(string.Format("Device:{0} RealEndScene:{1}", Device, RealEndScene)); + //Kernel32.ResumeThread(LuaInterface.WowMainThreadId); + return RealEndScene(Device); } } Modified: trunk/Dante/Win32.cs =================================================================== --- trunk/Dante/Win32.cs 2010-01-20 17:14:58 UTC (rev 491) +++ trunk/Dante/Win32.cs 2010-02-04 14:26:27 UTC (rev 492) @@ -18,6 +18,7 @@ */ using System; +using System.ComponentModel; using System.Runtime.InteropServices; using System.Security; @@ -54,14 +55,19 @@ [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId); - /* not used - [DllImport("kernel32.dll")] - public static extern uint SuspendThread(IntPtr hThread); + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern uint ResumeThread(IntPtr hThread); - [DllImport("kernel32.dll")] - public static extern uint ResumeThread(IntPtr hThread); - */ + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern uint SuspendThread(IntPtr hThread); + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, + bool bInheritHandle, + uint dwThreadId + ); + + #endregion #region ProcessAccessFlags enum @@ -101,6 +107,46 @@ } #endregion + + [Flags] + public enum ThreadAccess : int + { + TERMINATE = (0x0001), + SUSPEND_RESUME = (0x0002), + GET_CONTEXT = (0x0008), + SET_CONTEXT = (0x0010), + SET_INFORMATION = (0x0020), + QUERY_INFORMATION = (0x0040), + SET_THREAD_TOKEN = (0x0080), + IMPERSONATE = (0x0100), + DIRECT_IMPERSONATION = (0x0200) + } + public static int ResumeThread(int threadId) + { + if (threadId == 0) return 0; + uint result = 0; + IntPtr ptrOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)threadId); + result = ResumeThread(ptrOpenThread); + if ((int)result == -1) + { + throw new Win32Exception(); + } + return (int)result; + } + + public static int SuspendThread(int threadId) + { + if (threadId == 0) return 0; + uint result = 0; + IntPtr ptrOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)threadId); + result = SuspendThread(ptrOpenThread); + if ((int)result == -1) + { + throw new Win32Exception(); + } + return (int)result; + } + } public unsafe class D3D9 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-20 17:15:04
|
Revision: 491 http://babbot.svn.sourceforge.net/babbot/?rev=491&view=rev Author: attn99 Date: 2010-01-20 17:14:58 +0000 (Wed, 20 Jan 2010) Log Message: ----------- Added TakeTaxi function Modified Paths: -------------- trunk/BabBot/BabBot/Data/WoWData.xml Modified: trunk/BabBot/BabBot/Data/WoWData.xml =================================================================== --- trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-20 00:18:59 UTC (rev 490) +++ trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-20 17:14:58 UTC (rev 491) @@ -1111,8 +1111,56 @@ {0}:Hide() end)()]]></text> </function> + + <!-- TakeTaxi --> + <function name="TakeTaxi"> + <parameters size="2"> + 0 - Name of destination zone + 1 - Name of destination subzone + </parameters> + <return size="2"> + 0 - index of destination or + 0 if destination not found or + -1 if destination found but cannot be taken + (see description) + 1 - description for ex. + if destination exists but not reachable then + it returns DISTANT + + </return> + <text> + <![CDATA[(function() + local descr + local found = 0 + local money = GetMoney() + + local num = NumTaxiNodes() + for i = 1 , num do + node = TaxiNodeName(i) + if (node == "{0}, {1}") then + descr = TaxiNodeGetType(i) + if (descr ~= "REACHABLE") then + found = -1 + break + end + cost = TaxiNodeCost(i) + if (cost > money) then + descr = "NOT_ENOUGH_MONEY" + found = -1; + break; + end + found = i; + TakeTaxiNode(i); + break; + end + end + return found, descr +end)()]]> + </text> + </function> + <!-- Template for new function <!- - name - -> <function name=""> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-20 00:50:47
|
Revision: 490 http://babbot.svn.sourceforge.net/babbot/?rev=490&view=rev Author: attn99 Date: 2010-01-20 00:18:59 +0000 (Wed, 20 Jan 2010) Log Message: ----------- Added Darnassus zone and some NPC Modified Paths: -------------- trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/WoWData.xml Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-17 02:44:53 UTC (rev 489) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-20 00:18:59 UTC (rev 490) @@ -45,6 +45,24 @@ </services> <gossips /> </game_object> + <game_object d3p1:type="NPC" name="Garryeth" zone="Darnassus" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="9942.03" y="2519.24" z="1317.57" type="0" /> + <quests /> + <coordinates /> + <services> + <service name="banker" /> + </services> + <gossips /> + </game_object> + <game_object d3p1:type="NPC" name="Ilyenia Moonfire" zone="Darnassus" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="9908.52" y="2329.23" z="1330.79" type="0" /> + <quests /> + <coordinates /> + <services> + <service d3p1:type="ClassTrainingService" name="class_trainer" class="HUNTER" /> + </services> + <gossips /> + </game_object> <game_object d3p1:type="NPC" name="Innkeeper Keldamyr" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> <base_position x="9802.21" y="982.61" z="1313.9" type="0" /> <quests /> @@ -57,6 +75,16 @@ <gossip name="What can I do at an Inn?" teleport="false" /> </gossips> </game_object> + <game_object d3p1:type="NPC" name="Innkeeper Saelienne" zone="Darnassus" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="10127.9" y="2224.79" z="1328.74" type="0" /> + <quests /> + <coordinates /> + <services> + <service d3p1:type="VendorService" name="vendor" can_repair="false" has_drink="true" has_food="true" /> + <service d3p1:type="ZoneNpcService" name="binder" sub_zone="Craftsmen's Terrace" /> + </services> + <gossips /> + </game_object> <game_object d3p1:type="NPC" name="Janna Brightmoon" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> <base_position x="10438.1" y="787.29" z="1337.29" type="0" /> <quests /> @@ -137,6 +165,15 @@ </services> <gossips /> </game_object> + <game_object d3p1:type="NPC" name="Vesprystus" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="8640.58" y="841.12" z="23.26" type="0" /> + <quests /> + <coordinates /> + <services> + <service d3p1:type="ZoneNpcService" name="taxi" sub_zone="Rut'theran Village" /> + </services> + <gossips /> + </game_object> </wow_version> <wow_version name="3.3.0.11159" /> </game_object_data> \ No newline at end of file Modified: trunk/BabBot/BabBot/Data/WoWData.xml =================================================================== --- trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-17 02:44:53 UTC (rev 489) +++ trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-20 00:18:59 UTC (rev 490) @@ -59,7 +59,8 @@ <continents> <continent id="0" name="All" /> <continent id="1" name="Kalimdor"> - <zone name="Teldrassil" /> + <zone name="Teldrassil" /> + <zone name="Darnassus" /> </continent> <continent id="2" name="Azeroth"> <zone name="Elwynn Forest" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-17 02:45:00
|
Revision: 489 http://babbot.svn.sourceforge.net/babbot/?rev=489&view=rev Author: attn99 Date: 2010-01-17 02:44:53 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Created test branch Removed Paths: ------------- attn_test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-17 02:43:27
|
Revision: 488 http://babbot.svn.sourceforge.net/babbot/?rev=488&view=rev Author: attn99 Date: 2010-01-17 02:43:21 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Created test branch Added Paths: ----------- branches/attn_test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-17 02:39:52
|
Revision: 487 http://babbot.svn.sourceforge.net/babbot/?rev=487&view=rev Author: attn99 Date: 2010-01-17 02:39:46 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Created test branch Added Paths: ----------- attn_test/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-16 18:54:21
|
Revision: 486 http://babbot.svn.sourceforge.net/babbot/?rev=486&view=rev Author: attn99 Date: 2010-01-16 18:54:15 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/WoWData.xml trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs trunk/BabBot/BabBot/Scripts/Common/TravelState.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-16 18:54:15 UTC (rev 486) @@ -5,10 +5,10 @@ <base_position x="10328.9" y="826.05" z="1326.38" type="0" /> <quests> <quest name="The Balance of Nature" id="456" link="|cffffff00|Hquest:456:2|h[The Balance of Nature]|h|r" level="2" bonus_spell="" num="0" dest_name=""> - <text><![CDATA[Greetings, Fediia. I am Conservator Ilthalaine. My purpose in Shadowglen is to ensure that the balance of nature is maintained. - -The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. - + <text><![CDATA[Greetings, Fediia. I am Conservator Ilthalaine. My purpose in Shadowglen is to ensure that the balance of nature is maintained. + +The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. + Unfortunately, the nightsaber and thistle boar populations grew too large. Shadowglen can only produce so much food for the beasts. Journey forth, young priest, and thin the boar and saber populations so that nature's harmony will be preserved.]]></text> <objectives> <obj_list> @@ -57,6 +57,15 @@ <gossip name="What can I do at an Inn?" teleport="false" /> </gossips> </game_object> + <game_object d3p1:type="NPC" name="Janna Brightmoon" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="10438.1" y="787.29" z="1337.29" type="0" /> + <quests /> + <coordinates /> + <services> + <service d3p1:type="VendorService" name="vendor" can_repair="true" has_drink="false" has_food="false" /> + </services> + <gossips /> + </game_object> <game_object d3p1:type="NPC" name="Keina" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> <base_position x="10436.7" y="794.84" z="1322.7" type="0" /> <quests /> @@ -66,6 +75,15 @@ </services> <gossips /> </game_object> + <game_object d3p1:type="NPC" name="Lyrai" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> + <base_position x="10442.9" y="783.99" z="1337.29" type="0" /> + <quests /> + <coordinates /> + <services> + <service d3p1:type="VendorService" name="vendor" can_repair="false" has_drink="true" has_food="true" /> + </services> + <gossips /> + </game_object> <game_object d3p1:type="NPC" name="Melithar Staghelm" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> <base_position x="10389.8" y="763.48" z="1319.95" type="0" /> <quests> Modified: trunk/BabBot/BabBot/Data/WoWData.xml =================================================================== --- trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Data/WoWData.xml 2010-01-16 18:54:15 UTC (rev 486) @@ -1078,8 +1078,6 @@ </text> </function> - StaticPopupDialogs - <!-- FindVisibleStaticDialog --> <function name="FindVisibleStaticDialog"> <parameters size="1"> Modified: trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-16 18:54:15 UTC (rev 486) @@ -247,7 +247,7 @@ ProcessManager.CommandManager.SendKeys(CommandManager.SK_SPACE); // Need wait for jump - t += 1000; + t += 500; } if (t > 0) Modified: trunk/BabBot/BabBot/Scripts/Common/TravelState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-16 18:54:15 UTC (rev 486) @@ -8,11 +8,12 @@ using BabBot.Manager; using BabBot.Wow.Helpers; using Pather.Graph; - +// TODO add support for multiple NPC coordinates namespace BabBot.States.Common { /// <summary> /// Class used to set travel destination for GameObject or Endpoint + /// Currently only supports single NPC coordinates /// Aggro ignored in this state /// </summary> class TravelState : State<WowPlayer> @@ -64,14 +65,34 @@ /// </summary> protected List<Route> FoundRoutes = new List<Route>(); + /// <summary> + /// True when arrived to destination and False if not yet + /// </summary> + public bool AtDest = false; + + /// <summary> + /// Reference on current player + /// </summary> public WowPlayer Player; + /// <summary> + /// Class constructor + /// </summary> + /// <param name="obj">GameObject object</param> + /// <param name="lfs">Logging facility</param> + /// <param name="tooltip_text">Tooltip to show on BotStatus</param> public TravelState(GameObject obj, string lfs, string tooltip_text) { _check = new GameObjCheck(this, obj); Init(obj, lfs, tooltip_text); } + /// <summary> + /// Class constructor + /// </summary> + /// <param name="obj">QuestObjective object</param> + /// <param name="lfs">Logging facility</param> + /// <param name="tooltip_text">Tooltip to show on BotStatus</param> public TravelState(AbstractQuestObjective qobj, string lfs, string tooltip_text) { @@ -79,6 +100,12 @@ Init(qobj, lfs, tooltip_text); } + /// <summary> + /// Init Travel State + /// </summary> + /// <param name="dest">Destination object</param> + /// <param name="lfs">Logging facility</param> + /// <param name="tooltip_text">Tooltip to show on BotStatus</param> void Init(object dest, string lfs, string tooltip_text) { Lfs = lfs; @@ -89,9 +116,9 @@ /// <summary> /// Enter state event handler /// Try locate route or locate destination waypoint and - /// launch NavigationState + /// launch NavigationState /// </summary> - /// <param name="player"></param> + /// <param name="player">Reference on current player</param> protected override void DoEnter(WowPlayer player) { Player = player; @@ -136,7 +163,15 @@ if (eps[1].Waypoint.IsClose(Player.Location)) { // Exact route found - ActivateMoveState(r, player); + try + { + ActivateMoveState(r, player); + } + catch (Exception e) + { + Output.Instance.Log(Lfs, e.Message); + Finish(player); + } return; } @@ -158,24 +193,68 @@ if (min_route != null) { // Found partial route and now look for the route connections + FoundRoutes.Add(min_route); float calc_len = CheckRoute(min_route.PointB, 0); if (calc_len > 0) { + float direct_len = BaseCoord.GetDistanceTo(Player.Location) * 1.2F; // Check if total calc length exceed much direct length - // if ( + if (calc_len <= direct_len) + { + // Join Routes and activate moving state + Waypoints wp_list = new Waypoints(); + foreach (Route r in FoundRoutes) + { + Waypoints wp; + + try + { + wp = GetWaypoints(r); + if (wp == null) + throw new WaypointsNotFoundException(r.WaypointFileName); + + int start_idx = 0; + + if (wp_list.Count > 0) + { + // skip first waypoint when joint wp list + start_idx = 1; + } + + for (int i = start_idx; i < wp.Count; i++) + wp_list.Add(wp[i]); + } + catch (Exception e) + { + Output.Instance.Log(Lfs, e.Message); + Finish(player); + return; + } + } + + // Switch to navigation state + SwitchToNavigation(wp_list); + return; + } } } + + // No routes + // Transfer best coord to Nav state + CallChangeStateEvent(player, new NavigationState(BaseCoord, + Lfs, "Traveling to point " + BaseCoord)); } + } - // set calc flag if it direct path shorter than best route - // calc_route = (dist_a < min_route_len); - - // Check among undef routes - // r = RouteListManager.FindRoute( + private void SwitchToNavigation(Waypoints wps) + { + _last_dest = wps[wps.Count - 1]; + CallChangeStateEvent(Player, new NavigationState(wps, + Lfs, "Traveling to " + _dest.ToString())); } - public float CheckRoute(Endpoint ep, float total_len) + private float CheckRoute(Endpoint ep, float total_len) { // Find all avail routes for dest List<Route> lr = RouteListManager.Waypoints[ep.Waypoint.Length]; @@ -195,8 +274,7 @@ if (eps == null) return 0; - // Only using atm based coord for game obj/quest item - + // At the moment only using based coord for game obj/quest item if (eps[1].Waypoint.IsClose(Player.Location)) { // Exact route found @@ -222,8 +300,12 @@ { // Check if another route connected to given point // This check is recursive - return CheckRoute(min_route.PointB, total_len + min_route_len); - + float len= CheckRoute(min_route.PointB, total_len + min_route_len); + if (len > 0) + { + FoundRoutes.Add(min_route); + return len; + } } return 0; @@ -244,38 +326,43 @@ protected override void DoExecute(WowPlayer player) { - // Check if we arrived - if (_dest.GetType().IsSubclassOf(typeof(GameObject))) + if ((_last_dest != null) && + !_last_dest.IsClose(player.Location)) { - // Check for another NPC location - // if (_vlist != null) - - + // Navigation state failed + Finish(player); + return; } - else + else if (_dest.GetType().IsSubclassOf(typeof(GameObject))) { - if (_last_dest.IsClose(player.Location)) - { - Finish(player); - return; - } + // Check if GameObject actually nearby + // TODO } + else + Finish(player); + } - private void ActivateMoveState(Route r, WowPlayer player) + private Waypoints GetWaypoints(Route r) { - // Load waypoints and launch NavigationState Waypoints wp = RouteListManager.LoadWaypoints(r.WaypointFileName); if (wp != null) { - if (r.Reversible) + if (r.NeedReverse) wp.List.Reverse(); UsedRoutes.Add(r); - CallChangeStateEvent(player, new NavigationState(wp, - Lfs, "Traveling to " + _dest.ToString())); } + return wp; } + + private void ActivateMoveState(Route r, WowPlayer player) + { + // Load waypoints and launch NavigationState + Waypoints wp = GetWaypoints(r); + if (wp != null) + SwitchToNavigation(wp); + } } Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-16 18:54:15 UTC (rev 486) @@ -1267,7 +1267,8 @@ get { WpZones res = (WpZones)MergeList[0]; - if ( res != null && !string.IsNullOrEmpty(res.SameAs)) + if ( res != null && !string.IsNullOrEmpty(res.SameAs) && + res.SameAs.Equals("1")) res = Parent.Objectives.ObjList[Convert. ToInt32(res.SameAs)].Coordinates; return res; @@ -1872,6 +1873,11 @@ } /// <summary> + /// Operational flag that set after GetEndpoints request + /// </summary> + internal bool NeedReverse; + + /// <summary> /// Class contstructor /// </summary> public Route() : base() { } @@ -1934,18 +1940,20 @@ public Endpoint[] GetEndpoints(string name) { - if (PointA.Equals(name)) + NeedReverse = !PointA.Equals(name); + if (NeedReverse) return new Endpoint[] { PointB, PointA }; - else if (PointB.Equals(name)) + else if (PointA.Equals(name)) return new Endpoint[] { PointA, PointB }; else return null; } public Endpoint[] GetEndpoints(Vector3D v) { - if (PointA.Waypoint.Equals(v)) + NeedReverse = PointB.Waypoint.Equals(v); + if (NeedReverse) return new Endpoint[] { PointB, PointA }; - else if (PointB.Waypoint.Equals(v)) + else if (PointA.Waypoint.Equals(v)) return new Endpoint[] { PointA, PointB }; else return null; } Modified: trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs =================================================================== --- trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs 2010-01-16 18:53:50 UTC (rev 485) +++ trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs 2010-01-16 18:54:15 UTC (rev 486) @@ -108,7 +108,7 @@ /// <param name="player"></param> protected override void DoEnter(WowPlayer player) { - CallChangeStateEvent(player, _state); + CallChangeStateEvent(player, _state, false, true); } protected override void DoExecute(WowPlayer player) { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-16 18:53:57
|
Revision: 485 http://babbot.svn.sourceforge.net/babbot/?rev=485&view=rev Author: attn99 Date: 2010-01-16 18:53:50 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Added event on state change and display last state on main form Modified Paths: -------------- trunk/BabBot/BabBot/Wow/WowPlayer.cs Modified: trunk/BabBot/BabBot/Wow/WowPlayer.cs =================================================================== --- trunk/BabBot/BabBot/Wow/WowPlayer.cs 2010-01-16 18:53:05 UTC (rev 484) +++ trunk/BabBot/BabBot/Wow/WowPlayer.cs 2010-01-16 18:53:50 UTC (rev 485) @@ -98,6 +98,7 @@ //create toon's state machine StateMachine = new StateMachine<WowPlayer>(this); + StateMachine.StateChangedEvent += ProcessManager.OnUpdateBotStatus; } public override string Name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-16 18:53:11
|
Revision: 484 http://babbot.svn.sourceforge.net/babbot/?rev=484&view=rev Author: attn99 Date: 2010-01-16 18:53:05 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Ignore player dead state when recording graveyard route Modified Paths: -------------- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs Modified: trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs =================================================================== --- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-16 18:51:37 UTC (rev 483) +++ trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-16 18:53:05 UTC (rev 484) @@ -107,7 +107,9 @@ ctrlRouteDetails.tbZoneA.Text = ProcessManager.Player.ZoneText; // Load RouteRecordingState and start - _route_rec_state = new RouteRecordingState(RecordWp, numRecDistance.Value); + _route_rec_state = new RouteRecordingState(RecordWp, + numRecDistance.Value, ((AbstractListEndpoint)ctrlRouteDetails. + cbTypeA.SelectedItem).EType == EndpointTypes.GRAVEYARD); ProcessManager.Player.StateMachine. InitState = new TestGlobalState(_route_rec_state); Modified: trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-16 18:51:37 UTC (rev 483) +++ trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-16 18:53:05 UTC (rev 484) @@ -36,12 +36,18 @@ private float _min_dist = 1; /// <summary> + /// Is recording done for dead state + /// </summary> + bool _dead_state; + + /// <summary> /// Class constructor /// </summary> /// <param name="WpRecordProc">Callback function on recording event</param> /// <param name="max_dist">Max distance between waypoints before fire recording event</param> - public RouteRecordingState(WaypointRecordingHandler WpRecordProc, decimal max_dist) + public RouteRecordingState(WaypointRecordingHandler WpRecordProc, decimal max_dist, bool dead_state) { + dead_state = _dead_state; _rec_dist = (float) max_dist; OnWaypointRecording = WpRecordProc; } @@ -66,7 +72,8 @@ /// <param name="player"></param> protected override void DoExecute(WowPlayer player) { - if (player.IsDead) + // Ignore dead if in deadstate + if (!_dead_state && player.IsDead) { Finish(player); return; @@ -91,25 +98,5 @@ OnWaypointRecording(_coord.CloneVector()); } } - - /// <summary> - /// Exit event handler - /// </summary> - /// <param name="Entity"></param> - protected override void DoExit(WowPlayer Entity) - { - //on exit we will do nothing - return; - } - - /// <summary> - /// Finish event handler - /// </summary> - /// <param name="Entity"></param> - protected override void DoFinish(WowPlayer Entity) - { - //on finish we will do nothing - return; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-16 18:51:44
|
Revision: 483 http://babbot.svn.sourceforge.net/babbot/?rev=483&view=rev Author: attn99 Date: 2010-01-16 18:51:37 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Added event on state change and display last state on main form Modified Paths: -------------- trunk/BabBot/BabBot/Forms/MainForm.Designer.cs trunk/BabBot/BabBot/Forms/MainForm.cs trunk/BabBot/BabBot/Manager/ProcessManager.cs trunk/BabBot/BabBot/States/State.cs trunk/BabBot/BabBot/States/StateMachine.cs Modified: trunk/BabBot/BabBot/Forms/MainForm.Designer.cs =================================================================== --- trunk/BabBot/BabBot/Forms/MainForm.Designer.cs 2010-01-16 01:53:47 UTC (rev 482) +++ trunk/BabBot/BabBot/Forms/MainForm.Designer.cs 2010-01-16 18:51:37 UTC (rev 483) @@ -102,17 +102,22 @@ this.tabObjectsNear = new System.Windows.Forms.TabPage(); this.tbPlayerNearObjects = new System.Windows.Forms.TextBox(); this.tabRadar = new System.Windows.Forms.TabPage(); + this.gbControls = new System.Windows.Forms.GroupBox(); + this.btnJmpTrnRight = new System.Windows.Forms.Button(); + this.btnJmpTurnLeft = new System.Windows.Forms.Button(); + this.btnUp = new System.Windows.Forms.Button(); + this.btnLeft = new System.Windows.Forms.Button(); + this.btnRight = new System.Windows.Forms.Button(); this.btnE = new System.Windows.Forms.Button(); + this.btnDown = new System.Windows.Forms.Button(); this.btnQ = new System.Windows.Forms.Button(); this.btnSpace = new System.Windows.Forms.Button(); + this.gbPathId = new System.Windows.Forms.GroupBox(); this.cblPathList = new System.Windows.Forms.CheckedListBox(); - this.label38 = new System.Windows.Forms.Label(); + this.gbZoom = new System.Windows.Forms.GroupBox(); this.tbZoom = new System.Windows.Forms.TrackBar(); this.label37 = new System.Windows.Forms.Label(); - this.btnDown = new System.Windows.Forms.Button(); - this.btnRight = new System.Windows.Forms.Button(); - this.btnLeft = new System.Windows.Forms.Button(); - this.btnUp = new System.Windows.Forms.Button(); + this.label38 = new System.Windows.Forms.Label(); this.imgRadar = new System.Windows.Forms.PictureBox(); this.label33 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label(); @@ -232,11 +237,6 @@ this.slBotStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.pbBotProgress = new System.Windows.Forms.ToolStripProgressBar(); this.ttStateMachineInfo = new System.Windows.Forms.ToolTip(this.components); - this.gbZoom = new System.Windows.Forms.GroupBox(); - this.gbPathId = new System.Windows.Forms.GroupBox(); - this.gbControls = new System.Windows.Forms.GroupBox(); - this.btnJmpTurnLeft = new System.Windows.Forms.Button(); - this.btnJmpTrnRight = new System.Windows.Forms.Button(); this.msMain.SuspendLayout(); this.tabControlMain.SuspendLayout(); this.tabPageMain.SuspendLayout(); @@ -254,6 +254,9 @@ this.tabControlPlayer.SuspendLayout(); this.tabObjectsNear.SuspendLayout(); this.tabRadar.SuspendLayout(); + this.gbControls.SuspendLayout(); + this.gbPathId.SuspendLayout(); + this.gbZoom.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbZoom)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.imgRadar)).BeginInit(); this.tabPageEnemies.SuspendLayout(); @@ -267,9 +270,6 @@ this.tabLua.SuspendLayout(); this.tabPageF1.SuspendLayout(); this.statusStrip1.SuspendLayout(); - this.gbZoom.SuspendLayout(); - this.gbPathId.SuspendLayout(); - this.gbControls.SuspendLayout(); this.SuspendLayout(); // // msMain @@ -1026,6 +1026,77 @@ this.tabRadar.Text = "Radar"; this.tabRadar.UseVisualStyleBackColor = true; // + // gbControls + // + this.gbControls.Controls.Add(this.btnJmpTrnRight); + this.gbControls.Controls.Add(this.btnJmpTurnLeft); + this.gbControls.Controls.Add(this.btnUp); + this.gbControls.Controls.Add(this.btnLeft); + this.gbControls.Controls.Add(this.btnRight); + this.gbControls.Controls.Add(this.btnE); + this.gbControls.Controls.Add(this.btnDown); + this.gbControls.Controls.Add(this.btnQ); + this.gbControls.Controls.Add(this.btnSpace); + this.gbControls.Location = new System.Drawing.Point(273, 6); + this.gbControls.Name = "gbControls"; + this.gbControls.Size = new System.Drawing.Size(285, 100); + this.gbControls.TabIndex = 250; + this.gbControls.TabStop = false; + this.gbControls.Text = "Controls"; + // + // btnJmpTrnRight + // + this.btnJmpTrnRight.Location = new System.Drawing.Point(201, 15); + this.btnJmpTrnRight.Name = "btnJmpTrnRight"; + this.btnJmpTrnRight.Size = new System.Drawing.Size(54, 50); + this.btnJmpTrnRight.TabIndex = 249; + this.btnJmpTrnRight.Text = "JMP\r\nTURN\r\nRIGHT"; + this.btnJmpTrnRight.UseVisualStyleBackColor = true; + this.btnJmpTrnRight.Click += new System.EventHandler(this.btnJmpTrnRight_Click); + // + // btnJmpTurnLeft + // + this.btnJmpTurnLeft.Location = new System.Drawing.Point(30, 15); + this.btnJmpTurnLeft.Name = "btnJmpTurnLeft"; + this.btnJmpTurnLeft.Size = new System.Drawing.Size(54, 50); + this.btnJmpTurnLeft.TabIndex = 248; + this.btnJmpTurnLeft.Text = "JMP\r\nTURN\r\nLEFT"; + this.btnJmpTurnLeft.UseVisualStyleBackColor = true; + this.btnJmpTurnLeft.Click += new System.EventHandler(this.btnJmpTurnLeft_Click); + // + // btnUp + // + this.btnUp.Location = new System.Drawing.Point(127, 15); + this.btnUp.Name = "btnUp"; + this.btnUp.Size = new System.Drawing.Size(31, 23); + this.btnUp.TabIndex = 65; + this.btnUp.Text = "UP"; + this.btnUp.UseVisualStyleBackColor = true; + this.btnUp.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUp_MouseDown); + this.btnUp.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUp_MouseUp); + // + // btnLeft + // + this.btnLeft.Location = new System.Drawing.Point(90, 42); + this.btnLeft.Name = "btnLeft"; + this.btnLeft.Size = new System.Drawing.Size(31, 23); + this.btnLeft.TabIndex = 66; + this.btnLeft.Text = "L"; + this.btnLeft.UseVisualStyleBackColor = true; + this.btnLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnLeft_MouseDown); + this.btnLeft.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnLeft_MouseUp); + // + // btnRight + // + this.btnRight.Location = new System.Drawing.Point(164, 42); + this.btnRight.Name = "btnRight"; + this.btnRight.Size = new System.Drawing.Size(31, 23); + this.btnRight.TabIndex = 68; + this.btnRight.Text = "R"; + this.btnRight.UseVisualStyleBackColor = true; + this.btnRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnRight_MouseDown); + this.btnRight.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnRight_MouseUp); + // // btnE // this.btnE.Location = new System.Drawing.Point(164, 15); @@ -1037,6 +1108,17 @@ this.btnE.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnE_MouseDown); this.btnE.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnE_MouseUp); // + // btnDown + // + this.btnDown.Location = new System.Drawing.Point(127, 42); + this.btnDown.Name = "btnDown"; + this.btnDown.Size = new System.Drawing.Size(31, 23); + this.btnDown.TabIndex = 69; + this.btnDown.Text = "DN"; + this.btnDown.UseVisualStyleBackColor = true; + this.btnDown.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnDown_MouseDown); + this.btnDown.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnDown_MouseUp); + // // btnQ // this.btnQ.Location = new System.Drawing.Point(90, 15); @@ -1058,6 +1140,16 @@ this.btnSpace.UseVisualStyleBackColor = true; this.btnSpace.Click += new System.EventHandler(this.btnSpace_Click); // + // gbPathId + // + this.gbPathId.Controls.Add(this.cblPathList); + this.gbPathId.Location = new System.Drawing.Point(423, 112); + this.gbPathId.Name = "gbPathId"; + this.gbPathId.Size = new System.Drawing.Size(135, 88); + this.gbPathId.TabIndex = 249; + this.gbPathId.TabStop = false; + this.gbPathId.Text = "Path Id"; + // // cblPathList // this.cblPathList.CheckOnClick = true; @@ -1070,14 +1162,17 @@ this.cblPathList.Size = new System.Drawing.Size(129, 64); this.cblPathList.TabIndex = 243; // - // label38 + // gbZoom // - this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(111, 67); - this.label38.Name = "label38"; - this.label38.Size = new System.Drawing.Size(24, 13); - this.label38.TabIndex = 242; - this.label38.Text = "10x"; + this.gbZoom.Controls.Add(this.tbZoom); + this.gbZoom.Controls.Add(this.label37); + this.gbZoom.Controls.Add(this.label38); + this.gbZoom.Location = new System.Drawing.Point(273, 112); + this.gbZoom.Name = "gbZoom"; + this.gbZoom.Size = new System.Drawing.Size(144, 88); + this.gbZoom.TabIndex = 248; + this.gbZoom.TabStop = false; + this.gbZoom.Text = "Zoom"; // // tbZoom // @@ -1099,50 +1194,15 @@ this.label37.TabIndex = 240; this.label37.Text = "1x"; // - // btnDown + // label38 // - this.btnDown.Location = new System.Drawing.Point(127, 42); - this.btnDown.Name = "btnDown"; - this.btnDown.Size = new System.Drawing.Size(31, 23); - this.btnDown.TabIndex = 69; - this.btnDown.Text = "DN"; - this.btnDown.UseVisualStyleBackColor = true; - this.btnDown.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnDown_MouseDown); - this.btnDown.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnDown_MouseUp); + this.label38.AutoSize = true; + this.label38.Location = new System.Drawing.Point(111, 67); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(24, 13); + this.label38.TabIndex = 242; + this.label38.Text = "10x"; // - // btnRight - // - this.btnRight.Location = new System.Drawing.Point(164, 42); - this.btnRight.Name = "btnRight"; - this.btnRight.Size = new System.Drawing.Size(31, 23); - this.btnRight.TabIndex = 68; - this.btnRight.Text = "R"; - this.btnRight.UseVisualStyleBackColor = true; - this.btnRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnRight_MouseDown); - this.btnRight.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnRight_MouseUp); - // - // btnLeft - // - this.btnLeft.Location = new System.Drawing.Point(90, 42); - this.btnLeft.Name = "btnLeft"; - this.btnLeft.Size = new System.Drawing.Size(31, 23); - this.btnLeft.TabIndex = 66; - this.btnLeft.Text = "L"; - this.btnLeft.UseVisualStyleBackColor = true; - this.btnLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnLeft_MouseDown); - this.btnLeft.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnLeft_MouseUp); - // - // btnUp - // - this.btnUp.Location = new System.Drawing.Point(127, 15); - this.btnUp.Name = "btnUp"; - this.btnUp.Size = new System.Drawing.Size(31, 23); - this.btnUp.TabIndex = 65; - this.btnUp.Text = "UP"; - this.btnUp.UseVisualStyleBackColor = true; - this.btnUp.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnUp_MouseDown); - this.btnUp.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnUp_MouseUp); - // // imgRadar // this.imgRadar.Location = new System.Drawing.Point(0, 0); @@ -2275,7 +2335,6 @@ this.slBotStatus.Name = "slBotStatus"; this.slBotStatus.Size = new System.Drawing.Size(59, 17); this.slBotStatus.Text = "UNKNOWN"; - this.slBotStatus.ToolTipText = "TEST\r\nTEST\r\n"; // // pbBotProgress // @@ -2290,66 +2349,6 @@ this.ttStateMachineInfo.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; this.ttStateMachineInfo.ToolTipTitle = "StateMachine Info:"; // - // gbZoom - // - this.gbZoom.Controls.Add(this.tbZoom); - this.gbZoom.Controls.Add(this.label37); - this.gbZoom.Controls.Add(this.label38); - this.gbZoom.Location = new System.Drawing.Point(273, 112); - this.gbZoom.Name = "gbZoom"; - this.gbZoom.Size = new System.Drawing.Size(144, 88); - this.gbZoom.TabIndex = 248; - this.gbZoom.TabStop = false; - this.gbZoom.Text = "Zoom"; - // - // gbPathId - // - this.gbPathId.Controls.Add(this.cblPathList); - this.gbPathId.Location = new System.Drawing.Point(423, 112); - this.gbPathId.Name = "gbPathId"; - this.gbPathId.Size = new System.Drawing.Size(135, 88); - this.gbPathId.TabIndex = 249; - this.gbPathId.TabStop = false; - this.gbPathId.Text = "Path Id"; - // - // gbControls - // - this.gbControls.Controls.Add(this.btnJmpTrnRight); - this.gbControls.Controls.Add(this.btnJmpTurnLeft); - this.gbControls.Controls.Add(this.btnUp); - this.gbControls.Controls.Add(this.btnLeft); - this.gbControls.Controls.Add(this.btnRight); - this.gbControls.Controls.Add(this.btnE); - this.gbControls.Controls.Add(this.btnDown); - this.gbControls.Controls.Add(this.btnQ); - this.gbControls.Controls.Add(this.btnSpace); - this.gbControls.Location = new System.Drawing.Point(273, 6); - this.gbControls.Name = "gbControls"; - this.gbControls.Size = new System.Drawing.Size(285, 100); - this.gbControls.TabIndex = 250; - this.gbControls.TabStop = false; - this.gbControls.Text = "Controls"; - // - // btnJmpTurnLeft - // - this.btnJmpTurnLeft.Location = new System.Drawing.Point(30, 15); - this.btnJmpTurnLeft.Name = "btnJmpTurnLeft"; - this.btnJmpTurnLeft.Size = new System.Drawing.Size(54, 50); - this.btnJmpTurnLeft.TabIndex = 248; - this.btnJmpTurnLeft.Text = "JMP\r\nTURN\r\nLEFT"; - this.btnJmpTurnLeft.UseVisualStyleBackColor = true; - this.btnJmpTurnLeft.Click += new System.EventHandler(this.btnJmpTurnLeft_Click); - // - // btnJmpTrnRight - // - this.btnJmpTrnRight.Location = new System.Drawing.Point(201, 15); - this.btnJmpTrnRight.Name = "btnJmpTrnRight"; - this.btnJmpTrnRight.Size = new System.Drawing.Size(54, 50); - this.btnJmpTrnRight.TabIndex = 249; - this.btnJmpTrnRight.Text = "JMP\r\nTURN\r\nRIGHT"; - this.btnJmpTrnRight.UseVisualStyleBackColor = true; - this.btnJmpTrnRight.Click += new System.EventHandler(this.btnJmpTrnRight_Click); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2394,6 +2393,10 @@ this.tabObjectsNear.ResumeLayout(false); this.tabObjectsNear.PerformLayout(); this.tabRadar.ResumeLayout(false); + this.gbControls.ResumeLayout(false); + this.gbPathId.ResumeLayout(false); + this.gbZoom.ResumeLayout(false); + this.gbZoom.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbZoom)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.imgRadar)).EndInit(); this.tabPageEnemies.ResumeLayout(false); @@ -2414,10 +2417,6 @@ this.tabPageF1.ResumeLayout(false); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); - this.gbZoom.ResumeLayout(false); - this.gbZoom.PerformLayout(); - this.gbPathId.ResumeLayout(false); - this.gbControls.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); Modified: trunk/BabBot/BabBot/Forms/MainForm.cs =================================================================== --- trunk/BabBot/BabBot/Forms/MainForm.cs 2010-01-16 01:53:47 UTC (rev 482) +++ trunk/BabBot/BabBot/Forms/MainForm.cs 2010-01-16 18:51:37 UTC (rev 483) @@ -97,6 +97,7 @@ ProcessManager.PlayerWayPoint += PlayerWayPoint; ProcessManager.UpdateAppStatus += UpdateAppStatus; ProcessManager.UpdateGameStatus += UpdateGameStatus; + ProcessManager.UpdateBotStatus += UpdateBotStatus; // Initialize DataSet DataManager.Initialize(); @@ -122,6 +123,7 @@ #endregion + /* Not used [System.Security.Permissions.PermissionSet( System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) @@ -135,7 +137,8 @@ base.WndProc(ref m); } - + */ + private void Initialize() { // Set a default value for waypoint type combo @@ -504,17 +507,20 @@ slGameStatus.Text = status; } - private void UpdateBotStatus(string status) + private void UpdateBotStatus(string status, string tooltip) { // Cross thread calls if (InvokeRequired) { - StatusUpdateDelegate del = UpdateBotStatus; - object[] parameters = { status }; - Invoke(del, parameters); + ProcessManager.UpdateStatusTooltipDelegate del = + UpdateBotStatus; + Invoke(del, new object[] { status, tooltip }); } else - labelBotStatus.Text = status; + { + slBotStatus.Text = status; + slBotStatus.ToolTipText = tooltip; + } } private void ActivateDebugMode() Modified: trunk/BabBot/BabBot/Manager/ProcessManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/ProcessManager.cs 2010-01-16 01:53:47 UTC (rev 482) +++ trunk/BabBot/BabBot/Manager/ProcessManager.cs 2010-01-16 18:51:37 UTC (rev 483) @@ -92,12 +92,19 @@ public delegate void WoWProcessStartedEventHandler(int process); /// <summary> - /// Updates the status bar + /// Updates the status bar element /// </summary> - /// <param name="iStatus">what to write in the statusbar</param> - public delegate void UpdateStatusEventHandler(string iStatus); + /// <param name="iStatus">Information for status bar label</param> + public delegate void UpdateStatusEventHandler(string status); /// <summary> + /// Delegate method to update status bar together with tooltip + /// </summary> + /// <param name="status">Information for status bar label</param> + /// <param name="tooltip">Tooltip for status bar label</param> + public delegate void UpdateStatusTooltipDelegate(string status, string tooltip); + + /// <summary> /// First time run event /// </summary> public delegate void FirstTimeRunHandler(); @@ -174,6 +181,7 @@ public static event UpdateStatusEventHandler UpdateGameStatus; public static event UpdateStatusEventHandler UpdateAppStatus; + public static event UpdateStatusTooltipDelegate UpdateBotStatus; public static event FirstTimeRunHandler FirstTimeRun; public static event ConfigFileChangedHandler ConfigFileChanged; @@ -1257,6 +1265,12 @@ UpdateGameStatus(new_status); } + public static void OnUpdateBotStatus(string new_status, string queue) + { + if (UpdateBotStatus != null) + UpdateBotStatus(new_status, queue); + } + public static void OnBotProgressStart(int max, string tooltip) { if (BotProgressStart != null) Modified: trunk/BabBot/BabBot/States/State.cs =================================================================== --- trunk/BabBot/BabBot/States/State.cs 2010-01-16 01:53:47 UTC (rev 482) +++ trunk/BabBot/BabBot/States/State.cs 2010-01-16 18:51:37 UTC (rev 483) @@ -67,6 +67,15 @@ } } + public virtual string Name + { + get + { + string s = ToString(); + return s.Substring(s.LastIndexOf(".") + 1).ToUpper(); + } + } + /// <summary>Event fires before Enter code runs</summary> public event EventHandler<StateEventArgs<T>> Entering; Modified: trunk/BabBot/BabBot/States/StateMachine.cs =================================================================== --- trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-16 01:53:47 UTC (rev 482) +++ trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-16 18:51:37 UTC (rev 483) @@ -22,6 +22,13 @@ { public sealed class StateMachine<T> { + /// <summary> + /// Delegate method to update bot state + /// </summary> + /// <param name="new_status">New bot status</param> + /// <param name="queue">Current queue</param> + public delegate void StateChangeDelegate(string new_status, string queue); + /// <summary>Create a new state machine for the given entity.</summary> /// <param name="Entity">The entity that this state machine belongs too</param> public StateMachine(T Entity) @@ -44,6 +51,11 @@ public T Entity { get; private set; } /// <summary> + /// State change event + /// </summary> + public event StateChangeDelegate StateChangedEvent; + + /// <summary> /// The overal "goal" state (what this state machine is ultimately trying to accomplish. /// This will also manage what the current state is by changing states as needed /// </summary> @@ -59,8 +71,23 @@ /// <summary>Date/Time when last update was executed</summary> public DateTime LastUpdated { get; private set; } + private bool _running; + /// <summary>Set, Get the state machine running state</summary> - public bool IsRunning { get; set; } + public bool IsRunning + { + get { return _running; } + set + { + _running = value; + if (!_running) + { + GlobalState = null; + CurrentState = null; + OnStateChangedUnknown(); + } + } + } private object obj = new object(); private State<T> _init_state; @@ -101,6 +128,9 @@ //set new global state GlobalState = NewGlobalState; + // Update GUI + OnGlobalStateChanged(GlobalState); + //connect up to the global states change state request GlobalState.ChangeStateRequest += CurrentState_ChangeStateRequest; @@ -112,7 +142,7 @@ public void Update() { //if state machine is not active, then skip - if (!IsRunning) + if (!_running) { // Initialize and start state machine // If global state assigned by external thread @@ -121,7 +151,7 @@ SetGlobalState(InitState); InitState = null; - IsRunning = true; + _running = true; } else return; } @@ -137,9 +167,7 @@ { // Global state doesn't have track // So if it completed stop state machine as well - IsRunning = false; - GlobalState = null; - CurrentState = null; + _running = false; } } @@ -155,9 +183,14 @@ // if current state has track of previous state // than auto-revert, otherwise set it null if (CurrentState.PreviousState != null) + { RevertToPreviousState(); + } else + { CurrentState = null; + OnStateChangedUnknown(); + } } } @@ -178,7 +211,7 @@ /// Change the current state to the new specified state. /// </summary> /// <param name="NewState">New State</param> - /// <param name="TrackPrevious">Track & Return to current state</param> + /// <param name="TrackPrevious">Track and Return to current state</param> /// <param name="ExitPrevious">Exit current state or keep it pending</param> public void ChangeState(State<T> NewState, bool TrackPrevious, bool ExitPrevious) { @@ -208,6 +241,9 @@ //capture new current state CurrentState = NewState; + // Update GUI + OnStateChanged(CurrentState); + //hook up to the new states "State Change Request" event // if it is not already hooked up if (!CurrentState.HasChangeStateEventHookup) @@ -249,5 +285,64 @@ CurrentState.GetType() == State && CurrentState.ExitTime == DateTime.MinValue); } + + /// <summary> + /// Send update event to GUI when global state changed + /// </summary> + /// <param name="state">New state</param> + /// <param name="global">Is State Global</param> + private void OnGlobalStateChanged(State<T> state) + { + OnStateChanged(null, state, true); + } + + /// <summary> + /// Send update event to GUI when global state changed + /// </summary> + /// <param name="state">New state</param> + /// <param name="global">Is State Global</param> + private void OnStateChanged(State<T> state) + { + OnStateChanged("", state, false); + } + + /// <summary> + /// Send update event to GUI when global or local state changed + /// </summary> + /// <param name="state">Update text</param> + /// <param name="global">Is State Global</param> + private void OnStateChanged(string state_str, State<T> state, bool global) + { + if (StateChangedEvent == null) + return; + + string queue = ""; + if (!global) + { + State<T> prev_state = state.PreviousState; + while (prev_state != null) + { + queue += prev_state.Name + Environment.NewLine; + prev_state = prev_state.PreviousState; + } + + // Last always global state + queue += GlobalState.Name; + } + + StateChangedEvent(state_str, queue); + + if (string.IsNullOrEmpty(state_str)) + // Make state from class name + state_str = state.Name; + + StateChangedEvent(state_str, queue); + } + + private void OnStateChangedUnknown() + { + if (StateChangedEvent != null) + StateChangedEvent("UNKNOWN", ""); + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-16 01:53:53
|
Revision: 482 http://babbot.svn.sourceforge.net/babbot/?rev=482&view=rev Author: attn99 Date: 2010-01-16 01:53:47 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs Modified: trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-15 07:08:41 UTC (rev 481) +++ trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-16 01:53:47 UTC (rev 482) @@ -158,6 +158,26 @@ ProcessManager.OnTravelCompleted(); } + /// <summary> + /// Check is bot stuck. For the regular movement it checks that bot pass + /// (1 - _stack_dist) * 100 % (percent) of path. + /// For the small movement (less than 2 yards) this check doesn't work + /// because bot doesn't move to click point directly + /// </summary> + /// <param name="cur_loc">Bot location before it start moving</param> + /// <param name="distance">The distance it should move</param> + /// <returns></returns> + private bool IsStuck(Vector3D cur_loc, float distance) + { + // Check if bot moved + float dd = _player.Location.GetDistanceTo(cur_loc); + float wdist = (distance - dd) / distance; + + // Ignore small steps cause bot not going directly to click position + return ((_retry == 0 && wdist > _stack_dist && distance > 2) || + (_retry > 0 && ((dd < 0.5) || (dd < distance * _stack_dist)))); + } + private float MoveToDest(Path path, Vector3D dest, float step) { float distance = _player.Location.GetDistanceTo(dest); @@ -220,10 +240,10 @@ float z = vnext.Z - cur_loc.Z; _player.ClickToMove(vnext); - if ((_retry == 0) && (z > 3) || (_retry > 0)) + if ((_retry == 0) && (z > 2) || (_retry > 0)) { // Add jump if going too high up or trying unstack - Thread.Sleep(150); + Thread.Sleep(200); ProcessManager.CommandManager.SendKeys(CommandManager.SK_SPACE); // Need wait for jump @@ -234,24 +254,17 @@ // Click a bit earlier for smooth movement Thread.Sleep((int) (0.98 * t)); - // Check if we moved - float dd = _player.Location.GetDistanceTo(cur_loc); - float wdist = (distance - dd) / distance; - - // Ignore small steps cause bot not going directly to click position - if ((_retry == 0 && wdist > _stack_dist && distance > 2) || - (_retry > 0 && ((dd < 0.5) || (dd < distance)))) + // Check for stuck + if (IsStuck(cur_loc, distance)) { // Bot pass less than 80% of step. // Something wrong // Wait a bit we might still moving + float dd = _player.Location.GetDistanceTo(cur_loc); Thread.Sleep((int)(((distance - dd) / 7F) * 1000)); // Check again - dd = _player.Location.GetDistanceTo(cur_loc); - wdist = ((distance - dd) / distance); - if ((_retry == 0 && wdist > _stack_dist && distance > 2) || - (_retry > 0 && ((dd < 0.5) || (dd < step)))) + if (IsStuck(cur_loc, distance)) { // We stuck if (_retry < _max_retry) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-15 07:08:48
|
Revision: 481 http://babbot.svn.sourceforge.net/babbot/?rev=481&view=rev Author: attn99 Date: 2010-01-15 07:08:41 +0000 (Fri, 15 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/RouteList.xml trunk/BabBot/BabBot/Scripts/Common/TravelState.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-15 01:24:22 UTC (rev 480) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-15 07:08:41 UTC (rev 481) @@ -5,15 +5,24 @@ <base_position x="10328.9" y="826.05" z="1326.38" type="0" /> <quests> <quest name="The Balance of Nature" id="456" link="|cffffff00|Hquest:456:2|h[The Balance of Nature]|h|r" level="2" bonus_spell="" num="0" dest_name=""> - <text><![CDATA[Greetings, Fediia. I am Conservator Ilthalaine. My purpose in Shadowglen is to ensure that the balance of nature is maintained. - -The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. - + <text><![CDATA[Greetings, Fediia. I am Conservator Ilthalaine. My purpose in Shadowglen is to ensure that the balance of nature is maintained. + +The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. + Unfortunately, the nightsaber and thistle boar populations grew too large. Shadowglen can only produce so much food for the beasts. Journey forth, young priest, and thin the boar and saber populations so that nature's harmony will be preserved.]]></text> <objectives> <obj_list> - <objective d3p1:type="MonsterQuestObjective" name="Young Nightsaber slain" qty="7" /> - <objective d3p1:type="MonsterQuestObjective" name="Young Thistle Boar slain" qty="4" /> + <objective d3p1:type="MonsterQuestObjective" name="Young Nightsaber slain" qty="7"> + <hot_spots> + <zone name="Teldrassil"> + <waypoint x="10293.55" y="861.35" z="1336.29" type="0" /> + <waypoint x="10282.16" y="742.78" z="1338.97" type="0" /> + </zone> + </hot_spots> + </objective> + <objective d3p1:type="MonsterQuestObjective" name="Young Thistle Boar slain" qty="4"> + <hot_spots same_as="0" /> + </objective> </obj_list> </objectives> <choice_items> Modified: trunk/BabBot/BabBot/Data/RouteList.xml =================================================================== --- trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-15 01:24:22 UTC (rev 480) +++ trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-15 07:08:41 UTC (rev 481) @@ -32,10 +32,10 @@ <length>0</length> </route> <route name="BDCDBBF638B9F74C" reversible="true"> - <point_a d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="1" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_a d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="0" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10293.55" y="861.35" z="1336.29" type="0" /> </point_a> - <point_b d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="1" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_b d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="0" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10282.16" y="742.78" z="1338.97" type="0" /> </point_b> <descr>Same for Boars</descr> Modified: trunk/BabBot/BabBot/Scripts/Common/TravelState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-15 01:24:22 UTC (rev 480) +++ trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-15 07:08:41 UTC (rev 481) @@ -158,7 +158,7 @@ if (min_route != null) { // Found partial route and now look for the route connections - float calc_len = CheckRoute(name, 0); + float calc_len = CheckRoute(min_route.PointB, 0); if (calc_len > 0) { // Check if total calc length exceed much direct length @@ -175,10 +175,10 @@ // r = RouteListManager.FindRoute( } - public float CheckRoute(string name, float total_len) + public float CheckRoute(Endpoint ep, float total_len) { // Find all avail routes for dest - List<Route> lr = RouteListManager.Endpoints[name]; + List<Route> lr = RouteListManager.Waypoints[ep.Waypoint.Length]; // Best route with min total length Route min_route = null; @@ -191,7 +191,7 @@ continue; // It's either A or B - Endpoint[] eps = r.GetEndpoints(name); + Endpoint[] eps = r.GetEndpoints(ep.Waypoint); if (eps == null) return 0; @@ -222,7 +222,7 @@ { // Check if another route connected to given point // This check is recursive - return CheckRoute(name, total_len + min_route_len); + return CheckRoute(min_route.PointB, total_len + min_route_len); } @@ -357,9 +357,24 @@ public override bool DoBeforeRouteCheck() { - /* - if (_qobj.Coordinates == null) - throw new QuestObjCoordNotFound(_qobj.*/ + if ((_qobj.Coordinates == null) || (_qobj.Coordinates.Count == 0)) + throw new QuestObjCoordNotFound(_qobj.Parent.Id, _qobj.Idx); + + // Use current zone as a key + ZoneWp zwp = _qobj.Coordinates[Parent.Player.ZoneText]; + if (zwp != null) + { + Parent.BaseCoord = zwp[0]; + if (Parent.BaseCoord.IsClose(ProcessManager.Player.Location)) + // We already at destination + return false; + + for (int i = 1; i < zwp.Count; i++) + Parent.Vlist.Add(zwp[i]); + } + else + throw new QuestObjCoordNotFound(_qobj.Parent.Id, _qobj.Idx); + return true; } } Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-15 01:24:22 UTC (rev 480) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-15 07:08:41 UTC (rev 481) @@ -1072,6 +1072,9 @@ public class WpZones : CommonTable<ZoneWp> { + [XmlAttribute("same_as")] + public string SameAs; + [XmlElement("zone")] public ZoneWp[] ZoneList { @@ -1256,18 +1259,25 @@ internal string SType; /// <summary> - /// List of hotspots where objectives can be "found" + /// List of hotspots where objective can be found /// </summary> [XmlElement("hot_spots")] public WpZones Coordinates { - get { return (WpZones)MergeList[0]; } + get + { + WpZones res = (WpZones)MergeList[0]; + if ( res != null && !string.IsNullOrEmpty(res.SameAs)) + res = Parent.Objectives.ObjList[Convert. + ToInt32(res.SameAs)].Coordinates; + return res; + } set { MergeList[0] = value; } } - protected Quest Parent; + internal int Idx; - protected int Idx; + internal Quest Parent; internal virtual string FullName { @@ -1930,6 +1940,15 @@ return new Endpoint[] { PointA, PointB }; else return null; } + + public Endpoint[] GetEndpoints(Vector3D v) + { + if (PointA.Waypoint.Equals(v)) + return new Endpoint[] { PointB, PointA }; + else if (PointB.Waypoint.Equals(v)) + return new Endpoint[] { PointA, PointB }; + else return null; + } } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-15 01:24:28
|
Revision: 480 http://babbot.svn.sourceforge.net/babbot/?rev=480&view=rev Author: attn99 Date: 2010-01-15 01:24:22 +0000 (Fri, 15 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs Modified: trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-15 00:52:10 UTC (rev 479) +++ trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-15 01:24:22 UTC (rev 480) @@ -21,6 +21,11 @@ public class NavigationState : State<WowPlayer> { /// <summary> + /// If % bot didn't pass till next position it considered as "stuck" + /// </summary> + private float _stack_dist = 0.2F; + + /// <summary> /// Default distance to calculate each step /// As lower it as more precise bot moves but less smooth /// </summary> @@ -233,16 +238,20 @@ float dd = _player.Location.GetDistanceTo(cur_loc); float wdist = (distance - dd) / distance; - if ((_retry == 0 && wdist >= 0.1) || - (_retry > 0 && ((dd < 0.5) || (dd < step)))) + // Ignore small steps cause bot not going directly to click position + if ((_retry == 0 && wdist > _stack_dist && distance > 2) || + (_retry > 0 && ((dd < 0.5) || (dd < distance)))) { - // Bot pass less than 90% of step. + // Bot pass less than 80% of step. // Something wrong // Wait a bit we might still moving Thread.Sleep((int)(((distance - dd) / 7F) * 1000)); // Check again - if (((distance - _player.Location.GetDistanceTo(cur_loc)) / distance) >= 0.1) + dd = _player.Location.GetDistanceTo(cur_loc); + wdist = ((distance - dd) / distance); + if ((_retry == 0 && wdist > _stack_dist && distance > 2) || + (_retry > 0 && ((dd < 0.5) || (dd < step)))) { // We stuck if (_retry < _max_retry) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-15 00:52:18
|
Revision: 479 http://babbot.svn.sourceforge.net/babbot/?rev=479&view=rev Author: attn99 Date: 2010-01-15 00:52:10 +0000 (Fri, 15 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/RouteList.xml trunk/BabBot/BabBot/Manager/DataManager.cs trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs trunk/BabBot/BabBot/Scripts/Common/TravelState.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs trunk/BabBot/BabBot/Wow/Helpers/QuestHelper.cs Added Paths: ----------- trunk/BabBot/BabBot/Data/Routes/4E95234C5695914A.wp Removed Paths: ------------- trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-15 00:52:10 UTC (rev 479) @@ -12,22 +12,8 @@ Unfortunately, the nightsaber and thistle boar populations grew too large. Shadowglen can only produce so much food for the beasts. Journey forth, young priest, and thin the boar and saber populations so that nature's harmony will be preserved.]]></text> <objectives> <obj_list> - <objective d3p1:type="MonsterQuestObjective" name="Young Nightsaber slain" type="monster" qty="7"> - <hot_spots> - <zone name="Teldrassil"> - <waypoint x="10307.94" y="871.77" z="1333.94" type="0" /> - <waypoint x="10284.48" y="733.76" z="1338.48" type="0" /> - </zone> - </hot_spots> - </objective> - <objective d3p1:type="MonsterQuestObjective" name="Young Thistle Boar slain" type="monster" qty="4"> - <hot_spots> - <zone name="Teldrassil"> - <waypoint x="10293.55" y="861.35" z="1336.29" type="0" /> - <waypoint x="10284.48" y="733.76" z="1338.48" type="0" /> - </zone> - </hot_spots> - </objective> + <objective d3p1:type="MonsterQuestObjective" name="Young Nightsaber slain" qty="7" /> + <objective d3p1:type="MonsterQuestObjective" name="Young Thistle Boar slain" qty="4" /> </obj_list> </objectives> <choice_items> @@ -107,7 +93,11 @@ <objectives_text><![CDATA[Bring the Dolanaar Delivery to Innkeeper Keldamyr.]]></objectives_text> </quest> </quests> - <coordinates /> + <coordinates> + <zone name="Teldrassil"> + <waypoint x="10210.2" y="697.4" z="1360.66" type="0" /> + </zone> + </coordinates> <services /> <gossips /> </game_object> Modified: trunk/BabBot/BabBot/Data/RouteList.xml =================================================================== --- trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-15 00:52:10 UTC (rev 479) @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <route_list version="0"> <wow_version name="3.2.2.10505"> - <route name="433015755FB304C" reversible="true"> - <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Porthannius" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> - <waypoint x="10214.67" y="700.7" z="1360.57" type="0" /> + <route name="4E95234C5695914A" reversible="true"> + <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Innkeeper Keldamyr" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="9802.3" y="980.83" z="1313.9" type="0" /> </point_a> - <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Innkeeper Keldamyr" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> - <waypoint x="9880.52" y="801.66" z="1309.88" type="0" /> + <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Porthannius" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="10210.2" y="697.4" z="1360.66" type="0" /> </point_b> <descr>Path to Dalaran</descr> <length>0</length> Deleted: trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp =================================================================== --- trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp 2010-01-15 00:52:10 UTC (rev 479) @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<waypoints name="433015755FB304C"> - <waypoint x="10214.67" y="700.7" z="1360.57" type="0" /> - <waypoint x="10209.77" y="696.86" z="1360.68" type="0" /> - <waypoint x="10203.84" y="695.86" z="1360.99" type="0" /> - <waypoint x="10191.79" y="695.5" z="1361.08" type="0" /> - <waypoint x="10179.87" y="695.14" z="1361.63" type="0" /> - <waypoint x="10175.73" y="694.94" z="1361.83" type="0" /> - <waypoint x="10165.82" y="692.63" z="1361.66" type="0" /> - <waypoint x="10155.71" y="692.26" z="1361.09" type="0" /> - <waypoint x="10153.76" y="691.97" z="1361.01" type="0" /> - <waypoint x="10144.22" y="688.86" z="1359.98" type="0" /> - <waypoint x="10142.23" y="688.67" z="1359.58" type="0" /> - <waypoint x="10132.25" y="687.78" z="1357.83" type="0" /> - <waypoint x="10130.3" y="687.19" z="1357.41" type="0" /> - <waypoint x="10124.89" y="684.38" z="1355.89" type="0" /> - <waypoint x="10116.72" y="678.62" z="1353" type="0" /> - <waypoint x="10108.63" y="672.79" z="1350.21" type="0" /> - <waypoint x="10101.97" y="665.46" z="1347.07" type="0" /> - <waypoint x="10095.36" y="658.18" z="1343.64" type="0" /> - <waypoint x="10088.67" y="650.81" z="1340.15" type="0" /> - <waypoint x="10082" y="643.46" z="1336.45" type="0" /> - <waypoint x="10079.62" y="640.39" z="1335.1" type="0" /> - <waypoint x="10074.54" y="631.81" z="1331.54" type="0" /> - <waypoint x="10069.45" y="623.21" z="1327.86" type="0" /> - <waypoint x="10064.32" y="614.67" z="1324.01" type="0" /> - <waypoint x="10062.91" y="613.26" z="1323.17" type="0" /> - <waypoint x="10055.83" y="606.23" z="1319.44" type="0" /> - <waypoint x="10048.04" y="598.5" z="1316.88" type="0" /> - <waypoint x="10041.63" y="592.21" z="1315.87" type="0" /> - <waypoint x="10039.87" y="591.61" z="1315.8" type="0" /> - <waypoint x="10034.5" y="590.65" z="1315.7" type="0" /> - <waypoint x="10028.5" y="591.4" z="1315.7" type="0" /> - <waypoint x="10018.5" y="595.62" z="1315.7" type="0" /> - <waypoint x="10008.56" y="599.8" z="1315.71" type="0" /> - <waypoint x="10002.8" y="602.23" z="1315.7" type="0" /> - <waypoint x="10001.15" y="603.54" z="1315.7" type="0" /> - <waypoint x="9999.3" y="605.3" z="1315.73" type="0" /> - <waypoint x="9997.76" y="607.78" z="1315.79" type="0" /> - <waypoint x="9996.46" y="609.55" z="1315.76" type="0" /> - <waypoint x="9989.17" y="617.15" z="1315.17" type="0" /> - <waypoint x="9981.08" y="625.59" z="1314.14" type="0" /> - <waypoint x="9973.02" y="633.99" z="1312.7" type="0" /> - <waypoint x="9965.02" y="642.33" z="1311.94" type="0" /> - <waypoint x="9956.94" y="650.75" z="1310.36" type="0" /> - <waypoint x="9953.98" y="654.32" z="1310.15" type="0" /> - <waypoint x="9950.15" y="660.17" z="1309.93" type="0" /> - <waypoint x="9942.6" y="669.07" z="1309.86" type="0" /> - <waypoint x="9941.44" y="671.21" z="1309.88" type="0" /> - <waypoint x="9936.55" y="681.95" z="1309.93" type="0" /> - <waypoint x="9934.37" y="685.9" z="1309.92" type="0" /> - <waypoint x="9927.94" y="692.69" z="1309.69" type="0" /> - <waypoint x="9925.54" y="696.7" z="1309.72" type="0" /> - <waypoint x="9924.03" y="698.44" z="1309.76" type="0" /> - <waypoint x="9922.54" y="700.22" z="1309.83" type="0" /> - <waypoint x="9916.63" y="710.15" z="1309.96" type="0" /> - <waypoint x="9914.36" y="719.22" z="1309.88" type="0" /> - <waypoint x="9913.08" y="721.21" z="1309.88" type="0" /> - <waypoint x="9906.2" y="730.51" z="1309.94" type="0" /> - <waypoint x="9899.06" y="740.16" z="1309.87" type="0" /> - <waypoint x="9893.05" y="748.28" z="1309.76" type="0" /> - <waypoint x="9892.49" y="749.16" z="1309.78" type="0" /> - <waypoint x="9888.12" y="758.75" z="1309.83" type="0" /> - <waypoint x="9885.63" y="764.24" z="1309.81" type="0" /> - <waypoint x="9885.27" y="766.19" z="1309.83" type="0" /> - <waypoint x="9883.75" y="776.15" z="1309.88" type="0" /> - <waypoint x="9882.25" y="787.11" z="1309.88" type="0" /> - <waypoint x="9881.99" y="793.75" z="1309.88" type="0" /> - <waypoint x="9880.52" y="801.66" z="1309.88" type="0" /> -</waypoints> \ No newline at end of file Added: trunk/BabBot/BabBot/Data/Routes/4E95234C5695914A.wp =================================================================== --- trunk/BabBot/BabBot/Data/Routes/4E95234C5695914A.wp (rev 0) +++ trunk/BabBot/BabBot/Data/Routes/4E95234C5695914A.wp 2010-01-15 00:52:10 UTC (rev 479) @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<waypoints name="4E95234C5695914A"> + <waypoint x="9802.3" y="980.83" z="1313.9" type="0" /> + <waypoint x="9803.43" y="969.1" z="1313.77" type="0" /> + <waypoint x="9804.36" y="962.54" z="1311.47" type="0" /> + <waypoint x="9806.66" y="955.93" z="1308.8" type="0" /> + <waypoint x="9807.93" y="954.6" z="1308.79" type="0" /> + <waypoint x="9809.74" y="954.19" z="1308.79" type="0" /> + <waypoint x="9811.6" y="954.02" z="1308.78" type="0" /> + <waypoint x="9813.45" y="954.2" z="1308.78" type="0" /> + <waypoint x="9819.84" y="954.75" z="1308.78" type="0" /> + <waypoint x="9821.59" y="954.11" z="1308.78" type="0" /> + <waypoint x="9825.61" y="952.26" z="1308.77" type="0" /> + <waypoint x="9826.86" y="950.58" z="1308.88" type="0" /> + <waypoint x="9828.48" y="947.24" z="1309.18" type="0" /> + <waypoint x="9832.17" y="936.66" z="1306.72" type="0" /> + <waypoint x="9834.8" y="929.82" z="1305.98" type="0" /> + <waypoint x="9841.18" y="922.08" z="1305.21" type="0" /> + <waypoint x="9848.24" y="913.52" z="1305.12" type="0" /> + <waypoint x="9851.8" y="909.21" z="1305.55" type="0" /> + <waypoint x="9853.35" y="908.18" z="1305.62" type="0" /> + <waypoint x="9856.8" y="906.86" z="1305.79" type="0" /> + <waypoint x="9860.39" y="906.61" z="1306.04" type="0" /> + <waypoint x="9862.74" y="907.31" z="1306.17" type="0" /> + <waypoint x="9867.96" y="909" z="1306.55" type="0" /> + <waypoint x="9869.59" y="909.9" z="1306.72" type="0" /> + <waypoint x="9879.71" y="915.48" z="1307.4" type="0" /> + <waypoint x="9882.62" y="917.09" z="1307.43" type="0" /> + <waypoint x="9882.37" y="906.12" z="1307.6" type="0" /> + <waypoint x="9882.13" y="896.09" z="1308.07" type="0" /> + <waypoint x="9881.85" y="884.18" z="1307.38" type="0" /> + <waypoint x="9881.57" y="871.93" z="1307.22" type="0" /> + <waypoint x="9881.13" y="867.54" z="1307.22" type="0" /> + <waypoint x="9878.67" y="856.61" z="1307.22" type="0" /> + <waypoint x="9877.84" y="852.02" z="1307.22" type="0" /> + <waypoint x="9877.72" y="843.04" z="1307.22" type="0" /> + <waypoint x="9879.25" y="831.48" z="1307.24" type="0" /> + <waypoint x="9880.84" y="819.56" z="1307.92" type="0" /> + <waypoint x="9882.47" y="807.3" z="1309.56" type="0" /> + <waypoint x="9883.82" y="797.12" z="1309.88" type="0" /> + <waypoint x="9885.42" y="785.09" z="1309.88" type="0" /> + <waypoint x="9887" y="773.17" z="1309.99" type="0" /> + <waypoint x="9888.58" y="761.25" z="1309.85" type="0" /> + <waypoint x="9888.92" y="758.82" z="1309.84" type="0" /> + <waypoint x="9889.79" y="756.66" z="1309.81" type="0" /> + <waypoint x="9891.99" y="752.29" z="1309.8" type="0" /> + <waypoint x="9898.47" y="742.03" z="1309.83" type="0" /> + <waypoint x="9904.19" y="732.97" z="1309.91" type="0" /> + <waypoint x="9909.98" y="723.8" z="1309.88" type="0" /> + <waypoint x="9911.92" y="720.73" z="1309.88" type="0" /> + <waypoint x="9912.69" y="719.17" z="1309.88" type="0" /> + <waypoint x="9917.36" y="709.37" z="1309.96" type="0" /> + <waypoint x="9920.57" y="702.89" z="1309.89" type="0" /> + <waypoint x="9926.99" y="694.28" z="1309.68" type="0" /> + <waypoint x="9933.41" y="685.68" z="1309.91" type="0" /> + <waypoint x="9939.83" y="677.07" z="1309.88" type="0" /> + <waypoint x="9946.33" y="668.37" z="1309.88" type="0" /> + <waypoint x="9952.74" y="659.77" z="1309.97" type="0" /> + <waypoint x="9959.26" y="651.09" z="1310.46" type="0" /> + <waypoint x="9961.19" y="649.58" z="1310.72" type="0" /> + <waypoint x="9969.79" y="642.96" z="1312.23" type="0" /> + <waypoint x="9978.29" y="636.41" z="1313.3" type="0" /> + <waypoint x="9979.43" y="635.08" z="1313.57" type="0" /> + <waypoint x="9985.04" y="628.07" z="1314.51" type="0" /> + <waypoint x="9987.73" y="623.44" z="1314.74" type="0" /> + <waypoint x="9994.49" y="615.1" z="1315.4" type="0" /> + <waypoint x="10001.25" y="606.76" z="1315.78" type="0" /> + <waypoint x="10004.75" y="602.7" z="1315.7" type="0" /> + <waypoint x="10013.33" y="596.26" z="1315.7" type="0" /> + <waypoint x="10018.39" y="594.59" z="1315.7" type="0" /> + <waypoint x="10029.07" y="593.44" z="1315.84" type="0" /> + <waypoint x="10034.4" y="593.26" z="1315.7" type="0" /> + <waypoint x="10039.57" y="594.62" z="1315.83" type="0" /> + <waypoint x="10044.41" y="597.14" z="1316.34" type="0" /> + <waypoint x="10052.76" y="603.89" z="1318.28" type="0" /> + <waypoint x="10055.55" y="606.19" z="1319.37" type="0" /> + <waypoint x="10056.46" y="607.68" z="1319.95" type="0" /> + <waypoint x="10061.59" y="617.12" z="1323.83" type="0" /> + <waypoint x="10066.03" y="624.77" z="1327.34" type="0" /> + <waypoint x="10073.21" y="632.74" z="1331.35" type="0" /> + <waypoint x="10080.4" y="640.72" z="1335.39" type="0" /> + <waypoint x="10087.59" y="648.7" z="1339.27" type="0" /> + <waypoint x="10094.7" y="656.59" z="1343.21" type="0" /> + <waypoint x="10101.89" y="664.57" z="1346.87" type="0" /> + <waypoint x="10109.08" y="672.54" z="1350.28" type="0" /> + <waypoint x="10116.26" y="680.51" z="1353.14" type="0" /> + <waypoint x="10117.68" y="681.55" z="1353.66" type="0" /> + <waypoint x="10122.3" y="684.45" z="1355.23" type="0" /> + <waypoint x="10130.9" y="686.61" z="1357.48" type="0" /> + <waypoint x="10132.76" y="686.72" z="1357.85" type="0" /> + <waypoint x="10143.49" y="687.3" z="1359.83" type="0" /> + <waypoint x="10153.99" y="689.51" z="1361.08" type="0" /> + <waypoint x="10162.8" y="691.29" z="1361.42" type="0" /> + <waypoint x="10173.45" y="692.66" z="1361.77" type="0" /> + <waypoint x="10184.1" y="694.03" z="1361.31" type="0" /> + <waypoint x="10194.87" y="695.42" z="1361.17" type="0" /> + <waypoint x="10205.52" y="696.79" z="1360.81" type="0" /> + <waypoint x="10210.2" y="697.4" z="1360.66" type="0" /> +</waypoints> \ No newline at end of file Modified: trunk/BabBot/BabBot/Manager/DataManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-15 00:52:10 UTC (rev 479) @@ -1434,7 +1434,7 @@ // Lookup endpoint object if (e.HasLinkedObj) { - DefEndpoint de = (DefEndpoint) e; + AbstractDefEndpoint de = (AbstractDefEndpoint)e; switch (e.PType) { case EndpointTypes.GAME_OBJ: @@ -1444,9 +1444,10 @@ case EndpointTypes.QUEST_OBJ: QuestObjEndpoint qoe = (QuestObjEndpoint) e; - Quest q = DataManager. - QuestList[Convert.ToInt32(qoe.Name)]; - if (q.Objectives != null) + Quest q = null; + DataManager.QuestList. + TryGetValue(Convert.ToInt32(qoe.Name), out q); + if (q != null && q.Objectives != null) de.Obj = q.Objectives.ObjList[qoe.ObjId]; break; } Modified: trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-15 00:52:10 UTC (rev 479) @@ -158,7 +158,7 @@ float distance = _player.Location.GetDistanceTo(dest); string tooltip = _tooltip; - while ((distance > step) && (_retry <= _max_retry) && !_terminated) + while ((distance > 5F) && (_retry <= _max_retry) && !_terminated) { if (_retry > 0) { @@ -169,10 +169,6 @@ tooltip = _tooltip + " " + r; } - Output.Instance.Debug("Calculating path from player position " + - _player.Location + " to dest " + dest + " ..."); - - Vector3D[] v_arr = new Vector3D[path.Count]; for (int i = 0; i < path.Count; i++) v_arr[i] = WaypointVector3DHelper.LocationToVector3D(path[i]); @@ -203,15 +199,23 @@ if (_terminated) break; + // Get next coordinate vnext = WaypointVector3DHelper.LocationToVector3D(path.Get(i)); + // Remember cur bot loc + Vector3D cur_loc = _player.Location; + // Calculate travel time distance = vprev.GetDistanceTo(vnext); + if (distance == 0) + continue; int t = (int)((distance / 7F) * 1000); - float z = vnext.Z - _player.Location.Z; + // Calc climb height + float z = vnext.Z - cur_loc.Z; + _player.ClickToMove(vnext); - if ((_retry == 0) && (z > 3)|| (_retry > 0)) + if ((_retry == 0) && (z > 3) || (_retry > 0)) { // Add jump if going too high up or trying unstack Thread.Sleep(150); @@ -226,14 +230,19 @@ Thread.Sleep((int) (0.98 * t)); // Check if we moved - float dd = _player.Location.GetDistanceTo(vnext); - if (dd > _step_dist) + float dd = _player.Location.GetDistanceTo(cur_loc); + float wdist = (distance - dd) / distance; + + if ((_retry == 0 && wdist >= 0.1) || + (_retry > 0 && ((dd < 0.5) || (dd < step)))) { + // Bot pass less than 90% of step. + // Something wrong // Wait a bit we might still moving - Thread.Sleep((int)((dd / 7F) * 1000)); + Thread.Sleep((int)(((distance - dd) / 7F) * 1000)); // Check again - if (dd > _step_dist) + if (((distance - _player.Location.GetDistanceTo(cur_loc)) / distance) >= 0.1) { // We stuck if (_retry < _max_retry) @@ -243,6 +252,8 @@ // Recalculate path to next waypoint but with smaller step float new_step = (float)(step * 0.618); + Output.Instance.Debug("Calculating path from player position " + + _player.Location + " to dest " + vnext + " ..."); Path new_path = ProcessManager.Caronte.CalculatePath( WaypointVector3DHelper.Vector3DToLocation(_player.Location), WaypointVector3DHelper.Vector3DToLocation(vnext), new_step); @@ -286,6 +297,8 @@ else { // Calculate path + Output.Instance.Debug("Calculating path from player position " + + _player.Location + " to dest " + dest + " ..."); path = ProcessManager.Caronte.CalculatePath( WaypointVector3DHelper.Vector3DToLocation(_player.Location), WaypointVector3DHelper.Vector3DToLocation(_dest), _step_dist); Modified: trunk/BabBot/BabBot/Scripts/Common/TravelState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-15 00:52:10 UTC (rev 479) @@ -72,10 +72,11 @@ Init(obj, lfs, tooltip_text); } - public TravelState(Endpoint point, string lfs, string tooltip_text) + public TravelState(AbstractQuestObjective qobj, + string lfs, string tooltip_text) { - _check = new EndpointCheck(this, point); - Init(point, lfs, tooltip_text); + _check = new QuestObjectiveCheck(this, qobj); + Init(qobj, lfs, tooltip_text); } void Init(object dest, string lfs, string tooltip_text) @@ -103,22 +104,67 @@ { if (!_check.DoBeforeRouteCheck()) { - // We already at dest or something wrong + // We already at dest Finish(player); return; } } catch { + // Something wrong with dest Finish(player); return; } - float calc_len = CheckRoute(name, 0); - if (calc_len > 0) + // Check for exact or nearest route to dest name + List<Route> lr = RouteListManager.Endpoints[name]; + if (lr != null) { - // Check if total calc length exceed much direct length - // if ( + // Best route with min total length + Route min_route = null; + float min_route_len = float.MaxValue; + + foreach (Route r in lr) + { + // It's either A or B + Endpoint[] eps = r.GetEndpoints(name); + if (eps == null) + return; + + // Only using atm based coord for game obj/quest item + + if (eps[1].Waypoint.IsClose(Player.Location)) + { + // Exact route found + ActivateMoveState(r, player); + return; + } + + // Exact route not found + // Check Direct Distance to both endpoint + float ddist_b = eps[1].Waypoint.GetDistanceTo(Player.Location); + float ddist_a = eps[0].Waypoint.GetDistanceTo(Player.Location) * 1.2F; + + // Calc lenght and update best route + float cur_len = r.Length + ddist_b; + if (cur_len < min_route_len && + cur_len <= ddist_a) + { + min_route = r; + min_route_len = cur_len; + } + } + + if (min_route != null) + { + // Found partial route and now look for the route connections + float calc_len = CheckRoute(name, 0); + if (calc_len > 0) + { + // Check if total calc length exceed much direct length + // if ( + } + } } @@ -242,7 +288,7 @@ Parent = parent; } - public virtual bool DoBeforeRouteCheck() { return true; } + public abstract bool DoBeforeRouteCheck(); } class GameObjCheck : AbstractCheck @@ -299,14 +345,22 @@ } } - class EndpointCheck : AbstractCheck + class QuestObjectiveCheck : AbstractCheck { - Endpoint _ep; + AbstractQuestObjective _qobj; - internal EndpointCheck(TravelState parent, Endpoint ep) + internal QuestObjectiveCheck(TravelState parent, AbstractQuestObjective qobj) : base(parent) { - _ep = ep; + _qobj = qobj; } + + public override bool DoBeforeRouteCheck() + { + /* + if (_qobj.Coordinates == null) + throw new QuestObjCoordNotFound(_qobj.*/ + return true; + } } } Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-15 00:52:10 UTC (rev 479) @@ -706,7 +706,7 @@ } if (!string.IsNullOrEmpty(objs)) - Objectives = new QuestObjectives(objs); + Objectives = new QuestObjectives(this, objs); } @@ -1206,49 +1206,36 @@ /// </summary> /// <param name="objs">List of objectives in format obj::obj /// where each obj is comma delited list of item, qty, is_finished</param> - public QuestObjectives(string objs) - : base() + public QuestObjectives(Quest q, string objs) + : this() { string[] obj = objs.Split(new string[] { "::" }, StringSplitOptions.None); - foreach (string s in obj) + for(int i = 0; i < obj.Length; i++) { + string s = obj[i]; string[] items = s.Split(','); string text = items[0]; string stype = items[1]; bool is_finished = (!string.IsNullOrEmpty(items[2]) && items[2].Equals("1")); - AbstractQuestObjective qobj = null; + // TODO Add reflection here + string class_name = Output. + GetLogNameByLfs(stype, "") + "QuestObjective"; - // TODO Add reflection here - switch (stype) + try { - case "event": - qobj = new EventQuestObjective(text, is_finished); - break; - - case "item": - qobj = new ItemQuestObjective(text, is_finished); - break; - - case "object": - qobj = new ObjectQuestObjective(text, is_finished); - break; - - case "monster": - qobj = new MonsterQuestObjective(text, is_finished); - break; - - case "reputation": - qobj = new ReputationQuestObjective(text, is_finished); - break; - - default: - throw new QuestSkipException( - "Unknown type of quest objectives '" + stype + "'"); + Type reflect_class = Type.GetType("BabBot.Wow." + class_name); + AbstractQuestObjective qobj = (AbstractQuestObjective) + Activator.CreateInstance(reflect_class, new object[] + {q, i, text, is_finished }); + ObjList.Add(qobj); } - - ObjList.Add(qobj); + catch (Exception e) + { + throw new QuestSkipException("Unknown type of quest objectives '" + + stype + "'. " + e.Message); + } } } } @@ -1266,8 +1253,7 @@ /// <summary> /// Quest objective Type /// </summary> - [XmlAttribute("type")] - public string SType; + internal string SType; /// <summary> /// List of hotspots where objectives can be "found" @@ -1279,6 +1265,10 @@ set { MergeList[0] = value; } } + protected Quest Parent; + + protected int Idx; + internal virtual string FullName { get { return Name; } @@ -1291,15 +1281,27 @@ get { return false; } } - public AbstractQuestObjective(string type) + /// <summary> + /// Parameterless constructor + /// </summary> + public AbstractQuestObjective(string stype) + : base() { - SType = type; + SType = stype; MergeList = new IMergeable[1]; } - public AbstractQuestObjective(string type, string name, bool is_finished) - : this(type) + public AbstractQuestObjective(Quest parent, int idx, string stype) + : this(stype) { + Idx = idx; + Parent = parent; + } + + public AbstractQuestObjective(Quest parent, int idx, + string type, string name, bool is_finished) + : this(parent, idx, type) + { Name = name; Finished = is_finished; } @@ -1331,11 +1333,14 @@ get { return ItemName + ": 0/" + ReqQty; } } - public AbstractQtyQuestObjective(string stype) - : base(stype) { } + public AbstractQtyQuestObjective(string stype) : base(stype) { } - public AbstractQtyQuestObjective(string type, string item_str, bool is_finished) - : base(type) + public AbstractQtyQuestObjective(Quest parent, int idx, string stype) + : base(parent, idx, stype) { } + + public AbstractQtyQuestObjective(Quest parent, int idx, + string type, string item_str, bool is_finished) + : base(parent, idx, type) { Regex r = DataManager.CurWoWVersion.QuestConfig.ObjectiveRx; Match m = r.Match(item_str); @@ -1365,12 +1370,15 @@ /// Class for quest objectives that requires completion of a scripted event /// </summary> public class EventQuestObjective : AbstractQuestObjective - { - public EventQuestObjective() - : base("event") {} + { + public EventQuestObjective() : base("event") { } - public EventQuestObjective(string text, bool is_finished) - : base("event", text, is_finished) { } + public EventQuestObjective(Quest parent, int idx) + : base(parent, idx, "event") { } + + public EventQuestObjective(Quest parent, int idx, + string text, bool is_finished) + : base(parent, idx, "event", text, is_finished) { } } /// <summary> @@ -1378,11 +1386,14 @@ /// </summary> public class ItemQuestObjective : AbstractQtyQuestObjective { - public ItemQuestObjective() - : base("item") {} + public ItemQuestObjective() : base("item") { } - public ItemQuestObjective(string text, bool is_finished) - : base("item", text, is_finished) { } + public ItemQuestObjective(Quest parent, int idx) + : base(parent, idx, "item") { } + + public ItemQuestObjective(Quest parent, int idx, + string text, bool is_finished) + : base(parent, idx, "item", text, is_finished) { } } /// <summary> @@ -1390,11 +1401,14 @@ /// </summary> public class MonsterQuestObjective : AbstractQtyQuestObjective { - public MonsterQuestObjective() - : base("monster") {} + public MonsterQuestObjective() : base("monster") { } - public MonsterQuestObjective(string text, bool is_finished) - : base("monster", text, is_finished) { } + public MonsterQuestObjective(Quest parent, int idx) + : base(parent, idx, "monster") { } + + public MonsterQuestObjective(Quest parent, int idx, + string text, bool is_finished) + : base(parent, idx, "monster", text, is_finished) { } } /// <summary> @@ -1402,11 +1416,14 @@ /// </summary> public class ObjectQuestObjective : AbstractQuestObjective { - public ObjectQuestObjective() - : base("object") {} + public ObjectQuestObjective() : base("object") { } - public ObjectQuestObjective(string text, bool is_finished) - : base("object", text, is_finished) { } + public ObjectQuestObjective(Quest parent, int idx) + : base(parent, idx, "object") { } + + public ObjectQuestObjective(Quest parent, int idx, + string text, bool is_finished) + : base(parent, idx, "object", text, is_finished) { } } /// <summary> @@ -1415,11 +1432,14 @@ /// </summary> public class ReputationQuestObjective : AbstractQuestObjective { - public ReputationQuestObjective() - : base("reputation") {} + public ReputationQuestObjective() : base("reputation") { } - public ReputationQuestObjective(string text, bool is_finished) - : base("reputation", text, is_finished) { } + public ReputationQuestObjective(Quest parent, int idx) + : base(parent, idx, "reputation") { } + + public ReputationQuestObjective(Quest parent, int idx, + string text, bool is_finished) + : base(parent, idx, "reputation", text, is_finished) { } } #endregion @@ -1551,7 +1571,7 @@ } } - public abstract class DefEndpoint : Endpoint + public abstract class AbstractDefEndpoint : Endpoint { private int _coord_idx; @@ -1570,10 +1590,22 @@ /// </summary> internal CommonMergeListItem Obj; + internal WpZones ZoneList + { + get + { + // Quick check on types + if ((Obj == null) || (_coord_idx >= Obj.Count)) + return null; + + return (WpZones)Obj[_coord_idx]; + } + } + /// <summary> /// Parameteless constructor /// </summary> - public DefEndpoint() : base() { } + public AbstractDefEndpoint() : base() { } /// <summary> /// Class constructor @@ -1582,7 +1614,7 @@ /// <param name="zone_text">Zone text where endpoint located</param> /// <param name="waypoint">Waypoint</param> /// <param name="coord_idx">Index of WpZones list in linked object</param> - public DefEndpoint(EndpointTypes type, string zone_text, + public AbstractDefEndpoint(EndpointTypes type, string zone_text, Vector3D waypoint, int coord_idx) : base(type, zone_text, waypoint) { @@ -1599,15 +1631,13 @@ if (_coord_idx >= Obj.Count) return false; - WpZones wpz = null; - IMergeable im = Obj[_coord_idx]; - if (im == null) + WpZones wpz = ZoneList; + if (wpz == null) { + // Create new one if doesn't exists wpz = new WpZones(); Obj[_coord_idx] = wpz; } - else - wpz = (WpZones)im; // Check all object coordinates foreach (ZoneWp zwp in wpz.Values) @@ -1630,7 +1660,7 @@ } } - public class GameObjEndpoint : DefEndpoint + public class GameObjEndpoint : AbstractDefEndpoint { /// <summary> /// Name of Game Object @@ -1685,7 +1715,7 @@ } } - public class QuestObjEndpoint : DefEndpoint + public class QuestObjEndpoint : AbstractDefEndpoint { /// <summary> /// Quest id Modified: trunk/BabBot/BabBot/Wow/Helpers/QuestHelper.cs =================================================================== --- trunk/BabBot/BabBot/Wow/Helpers/QuestHelper.cs 2010-01-14 06:10:12 UTC (rev 478) +++ trunk/BabBot/BabBot/Wow/Helpers/QuestHelper.cs 2010-01-15 00:52:10 UTC (rev 479) @@ -61,6 +61,13 @@ base(msg + ". Skipping the quest") { } } + public class QuestObjCoordNotFound : Exception + { + public QuestObjCoordNotFound(int q_id, int obj_id) + : base("HotSpot coordinates not found for quest objective " + + q_id + "#" + obj_id) { } + } + #endregion public static class QuestHelper This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-14 06:10:19
|
Revision: 478 http://babbot.svn.sourceforge.net/babbot/?rev=478&view=rev Author: attn99 Date: 2010-01-14 06:10:12 +0000 (Thu, 14 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Data/BotDataSet.Designer.cs trunk/BabBot/BabBot/Data/BotDataSet.xsd trunk/BabBot/BabBot/Forms/RoutesForm.cs trunk/BabBot/BabBot/Forms/Shared/RouteDetails.Designer.cs trunk/BabBot/BabBot/Forms/Shared/RouteDetails.cs trunk/BabBot/BabBot/Manager/DataManager.cs Modified: trunk/BabBot/BabBot/Data/BotDataSet.Designer.cs =================================================================== --- trunk/BabBot/BabBot/Data/BotDataSet.Designer.cs 2010-01-14 05:31:47 UTC (rev 477) +++ trunk/BabBot/BabBot/Data/BotDataSet.Designer.cs 2010-01-14 06:10:12 UTC (rev 478) @@ -57,14 +57,14 @@ private global::System.Data.DataRelation relationFK_QuestList_QuestItems; + private global::System.Data.DataRelation relationFK_ZoneList_GameObjects; + private global::System.Data.DataRelation relationFK_GameObjectTypes_GameObjects; - private global::System.Data.DataRelation relationFK_ZoneList_GameObjects; + private global::System.Data.DataRelation relationFK_ServiceTypes_NpcServices; private global::System.Data.DataRelation relationFK_GameObjects_NpcServices; - private global::System.Data.DataRelation relationFK_ServiceTypes_NpcServices; - private global::System.Data.DataRelation relationFK_CoordinatesZone_Coordinates; private global::System.Data.DataRelation relationFK_GameObjects_CoordinatesZone; @@ -484,10 +484,10 @@ this.relationFK_ZoneList_ZoneServices = this.Relations["FK_ZoneList_ZoneServices"]; this.relationFK_GameObjects_QuestList = this.Relations["FK_GameObjects_QuestList"]; this.relationFK_QuestList_QuestItems = this.Relations["FK_QuestList_QuestItems"]; + this.relationFK_ZoneList_GameObjects = this.Relations["FK_ZoneList_GameObjects"]; this.relationFK_GameObjectTypes_GameObjects = this.Relations["FK_GameObjectTypes_GameObjects"]; - this.relationFK_ZoneList_GameObjects = this.Relations["FK_ZoneList_GameObjects"]; + this.relationFK_ServiceTypes_NpcServices = this.Relations["FK_ServiceTypes_NpcServices"]; this.relationFK_GameObjects_NpcServices = this.Relations["FK_GameObjects_NpcServices"]; - this.relationFK_ServiceTypes_NpcServices = this.Relations["FK_ServiceTypes_NpcServices"]; this.relationFK_CoordinatesZone_Coordinates = this.Relations["FK_CoordinatesZone_Coordinates"]; this.relationFK_GameObjects_CoordinatesZone = this.Relations["FK_GameObjects_CoordinatesZone"]; } @@ -533,16 +533,16 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneServices_ServiceTypes", new global::System.Data.DataColumn[] { - this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { - this.tableZoneServices.SERVICE_IDColumn}); + fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneList_ZoneServices", new global::System.Data.DataColumn[] { + this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { + this.tableZoneServices.ZONE_NAMEColumn}); this.tableZoneServices.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneList_ZoneServices", new global::System.Data.DataColumn[] { - this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { - this.tableZoneServices.ZONE_NAMEColumn}); + fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneServices_ServiceTypes", new global::System.Data.DataColumn[] { + this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { + this.tableZoneServices.SERVICE_IDColumn}); this.tableZoneServices.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; @@ -554,6 +554,13 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.Cascade; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.None; + fkc = new global::System.Data.ForeignKeyConstraint("FK_QuestItemType_QuestItems", new global::System.Data.DataColumn[] { + this.tableQuestItemType.IDColumn}, new global::System.Data.DataColumn[] { + this.tableQuestItems.ITEM_TYPE_IDColumn}); + this.tableQuestItems.Constraints.Add(fkc); + fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; + fkc.DeleteRule = global::System.Data.Rule.None; + fkc.UpdateRule = global::System.Data.Rule.None; fkc = new global::System.Data.ForeignKeyConstraint("FK_QuestList_QuestItems", new global::System.Data.DataColumn[] { this.tableQuestList.IDColumn}, new global::System.Data.DataColumn[] { this.tableQuestItems.QIDColumn}); @@ -561,10 +568,10 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_QuestItemType_QuestItems", new global::System.Data.DataColumn[] { - this.tableQuestItemType.IDColumn}, new global::System.Data.DataColumn[] { - this.tableQuestItems.ITEM_TYPE_IDColumn}); - this.tableQuestItems.Constraints.Add(fkc); + fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneList_GameObjects", new global::System.Data.DataColumn[] { + this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { + this.tableGameObjects.ZONE_NAMEColumn}); + this.tableGameObjects.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; @@ -575,12 +582,12 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_ZoneList_GameObjects", new global::System.Data.DataColumn[] { - this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { - this.tableGameObjects.ZONE_NAMEColumn}); - this.tableGameObjects.Constraints.Add(fkc); + fkc = new global::System.Data.ForeignKeyConstraint("FK_ServiceTypes_NpcServices", new global::System.Data.DataColumn[] { + this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { + this.tableNpcServices.SERVICE_IDColumn}); + this.tableNpcServices.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; - fkc.DeleteRule = global::System.Data.Rule.None; + fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.None; fkc = new global::System.Data.ForeignKeyConstraint("FK_GameObjects_NpcServices", new global::System.Data.DataColumn[] { this.tableGameObjects.IDColumn}, new global::System.Data.DataColumn[] { @@ -589,13 +596,13 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_ServiceTypes_NpcServices", new global::System.Data.DataColumn[] { - this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { - this.tableNpcServices.SERVICE_IDColumn}); - this.tableNpcServices.Constraints.Add(fkc); - fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; + fkc = new global::System.Data.ForeignKeyConstraint("FK_CoordinatesZone_Coordinates", new global::System.Data.DataColumn[] { + this.tableCoordinatesZone.IDColumn}, new global::System.Data.DataColumn[] { + this.tableCoordinates.ZONE_IDColumn}); + this.tableCoordinates.Constraints.Add(fkc); + fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.Cascade; fkc.DeleteRule = global::System.Data.Rule.Cascade; - fkc.UpdateRule = global::System.Data.Rule.None; + fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_CoordTypes_Coordinates", new global::System.Data.DataColumn[] { this.tableCoordTypes.IDColumn}, new global::System.Data.DataColumn[] { this.tableCoordinates.COORD_TYPE_IDColumn}); @@ -603,10 +610,10 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_CoordinatesZone_Coordinates", new global::System.Data.DataColumn[] { - this.tableCoordinatesZone.IDColumn}, new global::System.Data.DataColumn[] { - this.tableCoordinates.ZONE_IDColumn}); - this.tableCoordinates.Constraints.Add(fkc); + fkc = new global::System.Data.ForeignKeyConstraint("FK_GameObjects_CoordinatesZone", new global::System.Data.DataColumn[] { + this.tableGameObjects.IDColumn}, new global::System.Data.DataColumn[] { + this.tableCoordinatesZone.GIDColumn}); + this.tableCoordinatesZone.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.Cascade; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; @@ -617,13 +624,6 @@ fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.None; - fkc = new global::System.Data.ForeignKeyConstraint("FK_GameObjects_CoordinatesZone", new global::System.Data.DataColumn[] { - this.tableGameObjects.IDColumn}, new global::System.Data.DataColumn[] { - this.tableCoordinatesZone.GIDColumn}); - this.tableCoordinatesZone.Constraints.Add(fkc); - fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.Cascade; - fkc.DeleteRule = global::System.Data.Rule.Cascade; - fkc.UpdateRule = global::System.Data.Rule.Cascade; this.relationFK_ZoneList_ZoneServices = new global::System.Data.DataRelation("FK_ZoneList_ZoneServices", new global::System.Data.DataColumn[] { this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { this.tableZoneServices.ZONE_NAMEColumn}, false); @@ -636,22 +636,22 @@ this.tableQuestList.IDColumn}, new global::System.Data.DataColumn[] { this.tableQuestItems.QIDColumn}, false); this.Relations.Add(this.relationFK_QuestList_QuestItems); + this.relationFK_ZoneList_GameObjects = new global::System.Data.DataRelation("FK_ZoneList_GameObjects", new global::System.Data.DataColumn[] { + this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { + this.tableGameObjects.ZONE_NAMEColumn}, false); + this.Relations.Add(this.relationFK_ZoneList_GameObjects); this.relationFK_GameObjectTypes_GameObjects = new global::System.Data.DataRelation("FK_GameObjectTypes_GameObjects", new global::System.Data.DataColumn[] { this.tableGameObjectTypes.IDColumn}, new global::System.Data.DataColumn[] { this.tableGameObjects.TYPE_IDColumn}, false); this.Relations.Add(this.relationFK_GameObjectTypes_GameObjects); - this.relationFK_ZoneList_GameObjects = new global::System.Data.DataRelation("FK_ZoneList_GameObjects", new global::System.Data.DataColumn[] { - this.tableZoneList.NAMEColumn}, new global::System.Data.DataColumn[] { - this.tableGameObjects.ZONE_NAMEColumn}, false); - this.Relations.Add(this.relationFK_ZoneList_GameObjects); + this.relationFK_ServiceTypes_NpcServices = new global::System.Data.DataRelation("FK_ServiceTypes_NpcServices", new global::System.Data.DataColumn[] { + this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { + this.tableNpcServices.SERVICE_IDColumn}, false); + this.Relations.Add(this.relationFK_ServiceTypes_NpcServices); this.relationFK_GameObjects_NpcServices = new global::System.Data.DataRelation("FK_GameObjects_NpcServices", new global::System.Data.DataColumn[] { this.tableGameObjects.IDColumn}, new global::System.Data.DataColumn[] { this.tableNpcServices.GIDColumn}, false); this.Relations.Add(this.relationFK_GameObjects_NpcServices); - this.relationFK_ServiceTypes_NpcServices = new global::System.Data.DataRelation("FK_ServiceTypes_NpcServices", new global::System.Data.DataColumn[] { - this.tableServiceTypes.IDColumn}, new global::System.Data.DataColumn[] { - this.tableNpcServices.SERVICE_IDColumn}, false); - this.Relations.Add(this.relationFK_ServiceTypes_NpcServices); this.relationFK_CoordinatesZone_Coordinates = new global::System.Data.DataRelation("FK_CoordinatesZone_Coordinates", new global::System.Data.DataColumn[] { this.tableCoordinatesZone.IDColumn}, new global::System.Data.DataColumn[] { this.tableCoordinates.ZONE_IDColumn}, false); @@ -1850,6 +1850,8 @@ private global::System.Data.DataColumn columnITEMS_CNT; + private global::System.Data.DataColumn columnOBJ_CNT; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public QuestListDataTable() : this(false) { @@ -1966,6 +1968,13 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataColumn OBJ_CNTColumn { + get { + return this.columnOBJ_CNT; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Browsable(false)] public int Count { get { @@ -1994,7 +2003,7 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public QuestListRow AddQuestListRow(int ID, GameObjectsRow parentGameObjectsRowByFK_GameObjects_QuestList, string TITLE, string GREETING_TEXT, string OBJECTIVES_TEXT, string START_FROM, string DELIVER_TO, int LEVEL, string LINK, string BONUS_SPELL, int ITEMS_CNT) { + public QuestListRow AddQuestListRow(int ID, GameObjectsRow parentGameObjectsRowByFK_GameObjects_QuestList, string TITLE, string GREETING_TEXT, string OBJECTIVES_TEXT, string START_FROM, string DELIVER_TO, int LEVEL, string LINK, string BONUS_SPELL, int ITEMS_CNT, int OBJ_CNT) { QuestListRow rowQuestListRow = ((QuestListRow)(this.NewRow())); object[] columnValuesArray = new object[] { ID, @@ -2007,7 +2016,8 @@ LEVEL, LINK, BONUS_SPELL, - ITEMS_CNT}; + ITEMS_CNT, + OBJ_CNT}; if ((parentGameObjectsRowByFK_GameObjects_QuestList != null)) { columnValuesArray[1] = parentGameObjectsRowByFK_GameObjects_QuestList[0]; } @@ -2017,7 +2027,7 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public QuestListRow AddQuestListRow(int ID, GameObjectsRow parentGameObjectsRowByFK_GameObjects_QuestList, string TITLE, string GREETING_TEXT, string OBJECTIVES_TEXT, string START_FROM, string DELIVER_TO, int LEVEL, string LINK, string BONUS_SPELL) { + public QuestListRow AddQuestListRow(int ID, GameObjectsRow parentGameObjectsRowByFK_GameObjects_QuestList, string TITLE, string GREETING_TEXT, string OBJECTIVES_TEXT, string START_FROM, string DELIVER_TO, int LEVEL, string LINK, string BONUS_SPELL, int OBJ_CNT) { QuestListRow rowQuestListRow = ((QuestListRow)(this.NewRow())); object[] columnValuesArray = new object[] { ID, @@ -2030,7 +2040,8 @@ LEVEL, LINK, BONUS_SPELL, - null}; + null, + OBJ_CNT}; if ((parentGameObjectsRowByFK_GameObjects_QuestList != null)) { columnValuesArray[1] = parentGameObjectsRowByFK_GameObjects_QuestList[0]; } @@ -2070,6 +2081,7 @@ this.columnLINK = base.Columns["LINK"]; this.columnBONUS_SPELL = base.Columns["BONUS_SPELL"]; this.columnITEMS_CNT = base.Columns["ITEMS_CNT"]; + this.columnOBJ_CNT = base.Columns["OBJ_CNT"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -2096,6 +2108,8 @@ base.Columns.Add(this.columnBONUS_SPELL); this.columnITEMS_CNT = new global::System.Data.DataColumn("ITEMS_CNT", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnITEMS_CNT); + this.columnOBJ_CNT = new global::System.Data.DataColumn("OBJ_CNT", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnOBJ_CNT); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { this.columnID}, true)); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint2", new global::System.Data.DataColumn[] { @@ -4919,6 +4933,21 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public int OBJ_CNT { + get { + try { + return ((int)(this[this.tableQuestList.OBJ_CNTColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'OBJ_CNT\' in table \'QuestList\' is DBNull.", e); + } + } + set { + this[this.tableQuestList.OBJ_CNTColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public GameObjectsRow GameObjectsRow { get { return ((GameObjectsRow)(this.GetParentRow(this.Table.ParentRelations["FK_GameObjects_QuestList"]))); @@ -5029,6 +5058,16 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public bool IsOBJ_CNTNull() { + return this.IsNull(this.tableQuestList.OBJ_CNTColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void SetOBJ_CNTNull() { + this[this.tableQuestList.OBJ_CNTColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public QuestItemsRow[] GetQuestItemsRows() { if ((this.Table.ChildRelations["FK_QuestList_QuestItems"] == null)) { return new QuestItemsRow[0]; @@ -5304,22 +5343,22 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public GameObjectTypesRow GameObjectTypesRow { + public ZoneListRow ZoneListRow { get { - return ((GameObjectTypesRow)(this.GetParentRow(this.Table.ParentRelations["FK_GameObjectTypes_GameObjects"]))); + return ((ZoneListRow)(this.GetParentRow(this.Table.ParentRelations["FK_ZoneList_GameObjects"]))); } set { - this.SetParentRow(value, this.Table.ParentRelations["FK_GameObjectTypes_GameObjects"]); + this.SetParentRow(value, this.Table.ParentRelations["FK_ZoneList_GameObjects"]); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public ZoneListRow ZoneListRow { + public GameObjectTypesRow GameObjectTypesRow { get { - return ((ZoneListRow)(this.GetParentRow(this.Table.ParentRelations["FK_ZoneList_GameObjects"]))); + return ((GameObjectTypesRow)(this.GetParentRow(this.Table.ParentRelations["FK_GameObjectTypes_GameObjects"]))); } set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ZoneList_GameObjects"]); + this.SetParentRow(value, this.Table.ParentRelations["FK_GameObjectTypes_GameObjects"]); } } @@ -5529,22 +5568,22 @@ } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public GameObjectsRow GameObjectsRow { + public ServiceTypesRow ServiceTypesRow { get { - return ((GameObjectsRow)(this.GetParentRow(this.Table.ParentRelations["FK_GameObjects_NpcServices"]))); + return ((ServiceTypesRow)(this.GetParentRow(this.Table.ParentRelations["FK_ServiceTypes_NpcServices"]))); } set { - this.SetParentRow(value, this.Table.ParentRelations["FK_GameObjects_NpcServices"]); + this.SetParentRow(value, this.Table.ParentRelations["FK_ServiceTypes_NpcServices"]); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public ServiceTypesRow ServiceTypesRow { + public GameObjectsRow GameObjectsRow { get { - return ((ServiceTypesRow)(this.GetParentRow(this.Table.ParentRelations["FK_ServiceTypes_NpcServices"]))); + return ((GameObjectsRow)(this.GetParentRow(this.Table.ParentRelations["FK_GameObjects_NpcServices"]))); } set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ServiceTypes_NpcServices"]); + this.SetParentRow(value, this.Table.ParentRelations["FK_GameObjects_NpcServices"]); } } Modified: trunk/BabBot/BabBot/Data/BotDataSet.xsd =================================================================== --- trunk/BabBot/BabBot/Data/BotDataSet.xsd 2010-01-14 05:31:47 UTC (rev 477) +++ trunk/BabBot/BabBot/Data/BotDataSet.xsd 2010-01-14 06:10:12 UTC (rev 478) @@ -15,80 +15,81 @@ <xs:element name="ContinentList" msprop:Generator_UserTableName="ContinentList" msprop:Generator_RowDeletedName="ContinentListRowDeleted" msprop:Generator_RowChangedName="ContinentListRowChanged" msprop:Generator_RowClassName="ContinentListRow" msprop:Generator_RowChangingName="ContinentListRowChanging" msprop:Generator_RowEvArgName="ContinentListRowChangeEvent" msprop:Generator_RowEvHandlerName="ContinentListRowChangeEventHandler" msprop:Generator_TableClassName="ContinentListDataTable" msprop:Generator_TableVarName="tableContinentList" msprop:Generator_RowDeletingName="ContinentListRowDeleting" msprop:Generator_TablePropName="ContinentList"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="ZoneList" msprop:Generator_UserTableName="ZoneList" msprop:Generator_RowDeletedName="ZoneListRowDeleted" msprop:Generator_RowChangedName="ZoneListRowChanged" msprop:Generator_RowClassName="ZoneListRow" msprop:Generator_RowChangingName="ZoneListRowChanging" msprop:Generator_RowEvArgName="ZoneListRowChangeEvent" msprop:Generator_RowEvHandlerName="ZoneListRowChangeEventHandler" msprop:Generator_TableClassName="ZoneListDataTable" msprop:Generator_TableVarName="tableZoneList" msprop:Generator_RowDeletingName="ZoneListRowDeleting" msprop:Generator_TablePropName="ZoneList"> <xs:complexType> <xs:sequence> - <xs:element name="NAME" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" /> - <xs:element name="CID" msdata:Caption="ID" msprop:Generator_UserColumnName="CID" msprop:Generator_ColumnPropNameInRow="CID" msprop:Generator_ColumnVarNameInTable="columnCID" msprop:Generator_ColumnPropNameInTable="CIDColumn" type="xs:int" /> + <xs:element name="NAME" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" /> + <xs:element name="CID" msdata:Caption="ID" msprop:Generator_UserColumnName="CID" msprop:Generator_ColumnVarNameInTable="columnCID" msprop:Generator_ColumnPropNameInRow="CID" msprop:Generator_ColumnPropNameInTable="CIDColumn" type="xs:int" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="ZoneServices" msprop:Generator_UserTableName="ZoneServices" msprop:Generator_RowDeletedName="ZoneServicesRowDeleted" msprop:Generator_RowChangedName="ZoneServicesRowChanged" msprop:Generator_RowClassName="ZoneServicesRow" msprop:Generator_RowChangingName="ZoneServicesRowChanging" msprop:Generator_RowEvArgName="ZoneServicesRowChangeEvent" msprop:Generator_RowEvHandlerName="ZoneServicesRowChangeEventHandler" msprop:Generator_TableClassName="ZoneServicesDataTable" msprop:Generator_TableVarName="tableZoneServices" msprop:Generator_RowDeletingName="ZoneServicesRowDeleting" msprop:Generator_TablePropName="ZoneServices"> <xs:complexType> <xs:sequence> - <xs:element name="ZONE_NAME" msprop:Generator_UserColumnName="ZONE_NAME" msprop:Generator_ColumnPropNameInRow="ZONE_NAME" msprop:Generator_ColumnVarNameInTable="columnZONE_NAME" msprop:Generator_ColumnPropNameInTable="ZONE_NAMEColumn" type="xs:string" minOccurs="0" /> - <xs:element name="SERVICE_ID" msprop:Generator_UserColumnName="SERVICE_ID" msprop:Generator_ColumnPropNameInRow="SERVICE_ID" msprop:Generator_ColumnVarNameInTable="columnSERVICE_ID" msprop:Generator_ColumnPropNameInTable="SERVICE_IDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="NPC_NAME" msprop:Generator_UserColumnName="NPC_NAME" msprop:Generator_ColumnPropNameInRow="NPC_NAME" msprop:Generator_ColumnVarNameInTable="columnNPC_NAME" msprop:Generator_ColumnPropNameInTable="NPC_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ZONE_NAME" msprop:Generator_UserColumnName="ZONE_NAME" msprop:Generator_ColumnVarNameInTable="columnZONE_NAME" msprop:Generator_ColumnPropNameInRow="ZONE_NAME" msprop:Generator_ColumnPropNameInTable="ZONE_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="SERVICE_ID" msprop:Generator_UserColumnName="SERVICE_ID" msprop:Generator_ColumnVarNameInTable="columnSERVICE_ID" msprop:Generator_ColumnPropNameInRow="SERVICE_ID" msprop:Generator_ColumnPropNameInTable="SERVICE_IDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="NPC_NAME" msprop:Generator_UserColumnName="NPC_NAME" msprop:Generator_ColumnVarNameInTable="columnNPC_NAME" msprop:Generator_ColumnPropNameInRow="NPC_NAME" msprop:Generator_ColumnPropNameInTable="NPC_NAMEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="ServiceTypes" msprop:Generator_UserTableName="ServiceTypes" msprop:Generator_RowDeletedName="ServiceTypesRowDeleted" msprop:Generator_RowChangedName="ServiceTypesRowChanged" msprop:Generator_RowClassName="ServiceTypesRow" msprop:Generator_RowChangingName="ServiceTypesRowChanging" msprop:Generator_RowEvArgName="ServiceTypesRowChangeEvent" msprop:Generator_RowEvHandlerName="ServiceTypesRowChangeEventHandler" msprop:Generator_TableClassName="ServiceTypesDataTable" msprop:Generator_TableVarName="tableServiceTypes" msprop:Generator_RowDeletingName="ServiceTypesRowDeleting" msprop:Generator_TablePropName="ServiceTypes"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="QuestList" msprop:Generator_UserTableName="QuestList" msprop:Generator_RowDeletedName="QuestListRowDeleted" msprop:Generator_RowChangedName="QuestListRowChanged" msprop:Generator_RowClassName="QuestListRow" msprop:Generator_RowChangingName="QuestListRowChanging" msprop:Generator_RowEvArgName="QuestListRowChangeEvent" msprop:Generator_RowEvHandlerName="QuestListRowChangeEventHandler" msprop:Generator_TableClassName="QuestListDataTable" msprop:Generator_TableVarName="tableQuestList" msprop:Generator_RowDeletingName="QuestListRowDeleting" msprop:Generator_TablePropName="QuestList"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnPropNameInTable="GIDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="TITLE" msprop:Generator_UserColumnName="TITLE" msprop:Generator_ColumnPropNameInRow="TITLE" msprop:Generator_ColumnVarNameInTable="columnTITLE" msprop:Generator_ColumnPropNameInTable="TITLEColumn" type="xs:string" minOccurs="0" /> - <xs:element name="GREETING_TEXT" msprop:Generator_UserColumnName="GREETING_TEXT" msprop:Generator_ColumnPropNameInRow="GREETING_TEXT" msprop:Generator_ColumnVarNameInTable="columnGREETING_TEXT" msprop:Generator_ColumnPropNameInTable="GREETING_TEXTColumn" type="xs:string" minOccurs="0" /> - <xs:element name="OBJECTIVES_TEXT" msprop:Generator_UserColumnName="OBJECTIVES_TEXT" msprop:Generator_ColumnPropNameInRow="OBJECTIVES_TEXT" msprop:Generator_ColumnVarNameInTable="columnOBJECTIVES_TEXT" msprop:Generator_ColumnPropNameInTable="OBJECTIVES_TEXTColumn" type="xs:string" minOccurs="0" /> - <xs:element name="START_FROM" msprop:Generator_UserColumnName="START_FROM" msprop:Generator_ColumnPropNameInRow="START_FROM" msprop:Generator_ColumnVarNameInTable="columnSTART_FROM" msprop:Generator_ColumnPropNameInTable="START_FROMColumn" type="xs:string" minOccurs="0" /> - <xs:element name="DELIVER_TO" msprop:Generator_UserColumnName="DELIVER_TO" msprop:Generator_ColumnPropNameInRow="DELIVER_TO" msprop:Generator_ColumnVarNameInTable="columnDELIVER_TO" msprop:Generator_ColumnPropNameInTable="DELIVER_TOColumn" type="xs:string" minOccurs="0" /> - <xs:element name="LEVEL" msprop:Generator_UserColumnName="LEVEL" msprop:Generator_ColumnPropNameInRow="LEVEL" msprop:Generator_ColumnVarNameInTable="columnLEVEL" msprop:Generator_ColumnPropNameInTable="LEVELColumn" type="xs:int" minOccurs="0" /> - <xs:element name="LINK" msprop:Generator_UserColumnName="LINK" msprop:Generator_ColumnPropNameInRow="LINK" msprop:Generator_ColumnVarNameInTable="columnLINK" msprop:Generator_ColumnPropNameInTable="LINKColumn" type="xs:string" minOccurs="0" /> - <xs:element name="BONUS_SPELL" msprop:Generator_UserColumnName="BONUS_SPELL" msprop:Generator_ColumnPropNameInRow="BONUS_SPELL" msprop:Generator_ColumnVarNameInTable="columnBONUS_SPELL" msprop:Generator_ColumnPropNameInTable="BONUS_SPELLColumn" type="xs:string" minOccurs="0" /> - <xs:element name="ITEMS_CNT" msdata:ReadOnly="true" msdata:Expression="Count(Child.NAME)" msprop:Generator_UserColumnName="ITEMS_CNT" msprop:Generator_ColumnVarNameInTable="columnITEMS_CNT" msprop:Generator_ColumnPropNameInRow="ITEMS_CNT" msprop:Generator_ColumnPropNameInTable="ITEMS_CNTColumn" type="xs:int" minOccurs="0" /> + <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInTable="GIDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="TITLE" msprop:Generator_UserColumnName="TITLE" msprop:Generator_ColumnVarNameInTable="columnTITLE" msprop:Generator_ColumnPropNameInRow="TITLE" msprop:Generator_ColumnPropNameInTable="TITLEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="GREETING_TEXT" msprop:Generator_UserColumnName="GREETING_TEXT" msprop:Generator_ColumnVarNameInTable="columnGREETING_TEXT" msprop:Generator_ColumnPropNameInRow="GREETING_TEXT" msprop:Generator_ColumnPropNameInTable="GREETING_TEXTColumn" type="xs:string" minOccurs="0" /> + <xs:element name="OBJECTIVES_TEXT" msprop:Generator_UserColumnName="OBJECTIVES_TEXT" msprop:Generator_ColumnVarNameInTable="columnOBJECTIVES_TEXT" msprop:Generator_ColumnPropNameInRow="OBJECTIVES_TEXT" msprop:Generator_ColumnPropNameInTable="OBJECTIVES_TEXTColumn" type="xs:string" minOccurs="0" /> + <xs:element name="START_FROM" msprop:Generator_UserColumnName="START_FROM" msprop:Generator_ColumnVarNameInTable="columnSTART_FROM" msprop:Generator_ColumnPropNameInRow="START_FROM" msprop:Generator_ColumnPropNameInTable="START_FROMColumn" type="xs:string" minOccurs="0" /> + <xs:element name="DELIVER_TO" msprop:Generator_UserColumnName="DELIVER_TO" msprop:Generator_ColumnVarNameInTable="columnDELIVER_TO" msprop:Generator_ColumnPropNameInRow="DELIVER_TO" msprop:Generator_ColumnPropNameInTable="DELIVER_TOColumn" type="xs:string" minOccurs="0" /> + <xs:element name="LEVEL" msprop:Generator_UserColumnName="LEVEL" msprop:Generator_ColumnVarNameInTable="columnLEVEL" msprop:Generator_ColumnPropNameInRow="LEVEL" msprop:Generator_ColumnPropNameInTable="LEVELColumn" type="xs:int" minOccurs="0" /> + <xs:element name="LINK" msprop:Generator_UserColumnName="LINK" msprop:Generator_ColumnVarNameInTable="columnLINK" msprop:Generator_ColumnPropNameInRow="LINK" msprop:Generator_ColumnPropNameInTable="LINKColumn" type="xs:string" minOccurs="0" /> + <xs:element name="BONUS_SPELL" msprop:Generator_UserColumnName="BONUS_SPELL" msprop:Generator_ColumnVarNameInTable="columnBONUS_SPELL" msprop:Generator_ColumnPropNameInRow="BONUS_SPELL" msprop:Generator_ColumnPropNameInTable="BONUS_SPELLColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ITEMS_CNT" msdata:ReadOnly="true" msdata:Expression="Count(Child.NAME)" msprop:Generator_UserColumnName="ITEMS_CNT" msprop:Generator_ColumnPropNameInRow="ITEMS_CNT" msprop:Generator_ColumnVarNameInTable="columnITEMS_CNT" msprop:Generator_ColumnPropNameInTable="ITEMS_CNTColumn" type="xs:int" minOccurs="0" /> + <xs:element name="OBJ_CNT" msprop:Generator_UserColumnName="OBJ_CNT" msprop:Generator_ColumnPropNameInRow="OBJ_CNT" msprop:Generator_ColumnVarNameInTable="columnOBJ_CNT" msprop:Generator_ColumnPropNameInTable="OBJ_CNTColumn" type="xs:int" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="QuestItems" msprop:Generator_UserTableName="QuestItems" msprop:Generator_RowDeletedName="QuestItemsRowDeleted" msprop:Generator_RowChangedName="QuestItemsRowChanged" msprop:Generator_RowClassName="QuestItemsRow" msprop:Generator_RowChangingName="QuestItemsRowChanging" msprop:Generator_RowEvArgName="QuestItemsRowChangeEvent" msprop:Generator_RowEvHandlerName="QuestItemsRowChangeEventHandler" msprop:Generator_TableClassName="QuestItemsDataTable" msprop:Generator_TableVarName="tableQuestItems" msprop:Generator_RowDeletingName="QuestItemsRowDeleting" msprop:Generator_TablePropName="QuestItems"> <xs:complexType> <xs:sequence> - <xs:element name="QID" msprop:Generator_UserColumnName="QID" msprop:Generator_ColumnPropNameInRow="QID" msprop:Generator_ColumnVarNameInTable="columnQID" msprop:Generator_ColumnPropNameInTable="QIDColumn" type="xs:int" /> - <xs:element name="IDX" msprop:Generator_UserColumnName="IDX" msprop:Generator_ColumnVarNameInTable="columnIDX" msprop:Generator_ColumnPropNameInRow="IDX" msprop:Generator_ColumnPropNameInTable="IDXColumn" type="xs:int" /> - <xs:element name="ITEM_TYPE_ID" msprop:Generator_UserColumnName="ITEM_TYPE_ID" msprop:Generator_ColumnPropNameInRow="ITEM_TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnITEM_TYPE_ID" msprop:Generator_ColumnPropNameInTable="ITEM_TYPE_IDColumn" type="xs:int" /> - <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> - <xs:element name="QTY" msprop:Generator_UserColumnName="QTY" msprop:Generator_ColumnPropNameInRow="QTY" msprop:Generator_ColumnVarNameInTable="columnQTY" msprop:Generator_ColumnPropNameInTable="QTYColumn" type="xs:int" minOccurs="0" /> - <xs:element name="FULL_NAME" msprop:Generator_UserColumnName="FULL_NAME" msprop:Generator_ColumnPropNameInRow="FULL_NAME" msprop:Generator_ColumnVarNameInTable="columnFULL_NAME" msprop:Generator_ColumnPropNameInTable="FULL_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="QID" msprop:Generator_UserColumnName="QID" msprop:Generator_ColumnVarNameInTable="columnQID" msprop:Generator_ColumnPropNameInRow="QID" msprop:Generator_ColumnPropNameInTable="QIDColumn" type="xs:int" /> + <xs:element name="IDX" msprop:Generator_UserColumnName="IDX" msprop:Generator_ColumnPropNameInRow="IDX" msprop:Generator_ColumnVarNameInTable="columnIDX" msprop:Generator_ColumnPropNameInTable="IDXColumn" type="xs:int" /> + <xs:element name="ITEM_TYPE_ID" msprop:Generator_UserColumnName="ITEM_TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnITEM_TYPE_ID" msprop:Generator_ColumnPropNameInRow="ITEM_TYPE_ID" msprop:Generator_ColumnPropNameInTable="ITEM_TYPE_IDColumn" type="xs:int" /> + <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="QTY" msprop:Generator_UserColumnName="QTY" msprop:Generator_ColumnVarNameInTable="columnQTY" msprop:Generator_ColumnPropNameInRow="QTY" msprop:Generator_ColumnPropNameInTable="QTYColumn" type="xs:int" minOccurs="0" /> + <xs:element name="FULL_NAME" msprop:Generator_UserColumnName="FULL_NAME" msprop:Generator_ColumnVarNameInTable="columnFULL_NAME" msprop:Generator_ColumnPropNameInRow="FULL_NAME" msprop:Generator_ColumnPropNameInTable="FULL_NAMEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="QuestItemType" msprop:Generator_UserTableName="QuestItemType" msprop:Generator_RowDeletedName="QuestItemTypeRowDeleted" msprop:Generator_RowChangedName="QuestItemTypeRowChanged" msprop:Generator_RowClassName="QuestItemTypeRow" msprop:Generator_RowChangingName="QuestItemTypeRowChanging" msprop:Generator_RowEvArgName="QuestItemTypeRowChangeEvent" msprop:Generator_RowEvHandlerName="QuestItemTypeRowChangeEventHandler" msprop:Generator_TableClassName="QuestItemTypeDataTable" msprop:Generator_TableVarName="tableQuestItemType" msprop:Generator_RowDeletingName="QuestItemTypeRowDeleting" msprop:Generator_TablePropName="QuestItemType"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="TYPE" msprop:Generator_UserColumnName="TYPE" msprop:Generator_ColumnVarNameInTable="columnTYPE" msprop:Generator_ColumnPropNameInRow="TYPE" msprop:Generator_ColumnPropNameInTable="TYPEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="TYPE" msprop:Generator_UserColumnName="TYPE" msprop:Generator_ColumnPropNameInRow="TYPE" msprop:Generator_ColumnVarNameInTable="columnTYPE" msprop:Generator_ColumnPropNameInTable="TYPEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="GameObjects" msprop:Generator_UserTableName="GameObjects" msprop:Generator_RowDeletedName="GameObjectsRowDeleted" msprop:Generator_RowChangedName="GameObjectsRowChanged" msprop:Generator_RowClassName="GameObjectsRow" msprop:Generator_RowChangingName="GameObjectsRowChanging" msprop:Generator_RowEvArgName="GameObjectsRowChangeEvent" msprop:Generator_RowEvHandlerName="GameObjectsRowChangeEventHandler" msprop:Generator_TableClassName="GameObjectsDataTable" msprop:Generator_TableVarName="tableGameObjects" msprop:Generator_RowDeletingName="GameObjectsRowDeleting" msprop:Generator_TablePropName="GameObjects"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="TYPE_ID" msprop:Generator_UserColumnName="TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnTYPE_ID" msprop:Generator_ColumnPropNameInRow="TYPE_ID" msprop:Generator_ColumnPropNameInTable="TYPE_IDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> - <xs:element name="ZONE_NAME" msprop:Generator_UserColumnName="ZONE_NAME" msprop:Generator_ColumnVarNameInTable="columnZONE_NAME" msprop:Generator_ColumnPropNameInRow="ZONE_NAME" msprop:Generator_ColumnPropNameInTable="ZONE_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ID" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="TYPE_ID" msprop:Generator_UserColumnName="TYPE_ID" msprop:Generator_ColumnPropNameInRow="TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnTYPE_ID" msprop:Generator_ColumnPropNameInTable="TYPE_IDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="NAME" msprop:Generator_UserColumnName="NAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ZONE_NAME" msprop:Generator_UserColumnName="ZONE_NAME" msprop:Generator_ColumnPropNameInRow="ZONE_NAME" msprop:Generator_ColumnVarNameInTable="columnZONE_NAME" msprop:Generator_ColumnPropNameInTable="ZONE_NAMEColumn" type="xs:string" minOccurs="0" /> <xs:element name="FACTION" msprop:Generator_UserColumnName="FACTION" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnFACTION" msprop:Generator_ColumnPropNameInTable="FACTIONColumn" msprop:Generator_ColumnPropNameInRow="FACTION" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> @@ -96,48 +97,48 @@ <xs:element name="GameObjectTypes" msprop:Generator_UserTableName="GameObjectTypes" msprop:Generator_RowDeletedName="GameObjectTypesRowDeleted" msprop:Generator_RowChangedName="GameObjectTypesRowChanged" msprop:Generator_RowClassName="GameObjectTypesRow" msprop:Generator_RowChangingName="GameObjectTypesRowChanging" msprop:Generator_RowEvArgName="GameObjectTypesRowChangeEvent" msprop:Generator_RowEvHandlerName="GameObjectTypesRowChangeEventHandler" msprop:Generator_TableClassName="GameObjectTypesDataTable" msprop:Generator_TableVarName="tableGameObjectTypes" msprop:Generator_RowDeletingName="GameObjectTypesRowDeleting" msprop:Generator_TablePropName="GameObjectTypes"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="TYPE" msprop:Generator_UserColumnName="TYPE" msprop:Generator_ColumnVarNameInTable="columnTYPE" msprop:Generator_ColumnPropNameInRow="TYPE" msprop:Generator_ColumnPropNameInTable="TYPEColumn" type="xs:string" /> + <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="TYPE" msprop:Generator_UserColumnName="TYPE" msprop:Generator_ColumnPropNameInRow="TYPE" msprop:Generator_ColumnVarNameInTable="columnTYPE" msprop:Generator_ColumnPropNameInTable="TYPEColumn" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="NpcServices" msprop:Generator_UserTableName="NpcServices" msprop:Generator_RowDeletedName="NpcServicesRowDeleted" msprop:Generator_RowChangedName="NpcServicesRowChanged" msprop:Generator_RowClassName="NpcServicesRow" msprop:Generator_RowChangingName="NpcServicesRowChanging" msprop:Generator_RowEvArgName="NpcServicesRowChangeEvent" msprop:Generator_RowEvHandlerName="NpcServicesRowChangeEventHandler" msprop:Generator_TableClassName="NpcServicesDataTable" msprop:Generator_TableVarName="tableNpcServices" msprop:Generator_RowDeletingName="NpcServicesRowDeleting" msprop:Generator_TablePropName="NpcServices"> <xs:complexType> <xs:sequence> - <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnPropNameInTable="GIDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="SERVICE_ID" msprop:Generator_UserColumnName="SERVICE_ID" msprop:Generator_ColumnVarNameInTable="columnSERVICE_ID" msprop:Generator_ColumnPropNameInRow="SERVICE_ID" msprop:Generator_ColumnPropNameInTable="SERVICE_IDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="SERVICE_NAME" msprop:Generator_UserColumnName="SERVICE_NAME" msprop:Generator_ColumnPropNameInRow="SERVICE_NAME" msprop:Generator_ColumnVarNameInTable="columnSERVICE_NAME" msprop:Generator_ColumnPropNameInTable="SERVICE_NAMEColumn" type="xs:string" minOccurs="0" /> - <xs:element name="DESCR" msprop:Generator_UserColumnName="DESCR" msprop:Generator_ColumnVarNameInTable="columnDESCR" msprop:Generator_ColumnPropNameInRow="DESCR" msprop:Generator_ColumnPropNameInTable="DESCRColumn" type="xs:string" minOccurs="0" /> - <xs:element name="FULL_NAME" msdata:ReadOnly="true" msdata:Expression="SERVICE_NAME + ':' + DESCR" msprop:Generator_UserColumnName="FULL_NAME" msprop:Generator_ColumnVarNameInTable="columnFULL_NAME" msprop:Generator_ColumnPropNameInRow="FULL_NAME" msprop:Generator_ColumnPropNameInTable="FULL_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInTable="GIDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="SERVICE_ID" msprop:Generator_UserColumnName="SERVICE_ID" msprop:Generator_ColumnPropNameInRow="SERVICE_ID" msprop:Generator_ColumnVarNameInTable="columnSERVICE_ID" msprop:Generator_ColumnPropNameInTable="SERVICE_IDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="SERVICE_NAME" msprop:Generator_UserColumnName="SERVICE_NAME" msprop:Generator_ColumnVarNameInTable="columnSERVICE_NAME" msprop:Generator_ColumnPropNameInRow="SERVICE_NAME" msprop:Generator_ColumnPropNameInTable="SERVICE_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="DESCR" msprop:Generator_UserColumnName="DESCR" msprop:Generator_ColumnPropNameInRow="DESCR" msprop:Generator_ColumnVarNameInTable="columnDESCR" msprop:Generator_ColumnPropNameInTable="DESCRColumn" type="xs:string" minOccurs="0" /> + <xs:element name="FULL_NAME" msdata:ReadOnly="true" msdata:Expression="SERVICE_NAME + ':' + DESCR" msprop:Generator_UserColumnName="FULL_NAME" msprop:Generator_ColumnPropNameInRow="FULL_NAME" msprop:Generator_ColumnVarNameInTable="columnFULL_NAME" msprop:Generator_ColumnPropNameInTable="FULL_NAMEColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Coordinates" msprop:Generator_UserTableName="Coordinates" msprop:Generator_RowDeletedName="CoordinatesRowDeleted" msprop:Generator_RowChangedName="CoordinatesRowChanged" msprop:Generator_RowClassName="CoordinatesRow" msprop:Generator_RowChangingName="CoordinatesRowChanging" msprop:Generator_RowEvArgName="CoordinatesRowChangeEvent" msprop:Generator_RowEvHandlerName="CoordinatesRowChangeEventHandler" msprop:Generator_TableClassName="CoordinatesDataTable" msprop:Generator_TableVarName="tableCoordinates" msprop:Generator_RowDeletingName="CoordinatesRowDeleting" msprop:Generator_TablePropName="Coordinates"> <xs:complexType> <xs:sequence> - <xs:element name="ZONE_ID" msprop:Generator_UserColumnName="ZONE_ID" msprop:Generator_ColumnPropNameInRow="ZONE_ID" msprop:Generator_ColumnVarNameInTable="columnZONE_ID" msprop:Generator_ColumnPropNameInTable="ZONE_IDColumn" type="xs:int" /> - <xs:element name="X" msprop:Generator_UserColumnName="X" msprop:Generator_ColumnVarNameInTable="columnX" msprop:Generator_ColumnPropNameInRow="X" msprop:Generator_ColumnPropNameInTable="XColumn" type="xs:double" minOccurs="0" /> - <xs:element name="Y" msprop:Generator_UserColumnName="Y" msprop:Generator_ColumnVarNameInTable="columnY" msprop:Generator_ColumnPropNameInRow="Y" msprop:Generator_ColumnPropNameInTable="YColumn" type="xs:double" minOccurs="0" /> - <xs:element name="Z" msprop:Generator_UserColumnName="Z" msprop:Generator_ColumnVarNameInTable="columnZ" msprop:Generator_ColumnPropNameInRow="Z" msprop:Generator_ColumnPropNameInTable="ZColumn" type="xs:double" minOccurs="0" /> - <xs:element name="COORD_TYPE_ID" msprop:Generator_UserColumnName="COORD_TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnCOORD_TYPE_ID" msprop:Generator_ColumnPropNameInRow="COORD_TYPE_ID" msprop:Generator_ColumnPropNameInTable="COORD_TYPE_IDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="COORD" msdata:ReadOnly="true" msdata:Expression="COORD_TYPE_ID + ': ' +CONVERT( X * 100, 'System.Int32')/100 + ' | ' + CONVERT( Y * 100, 'System.Int32')/100 +' | ' + CONVERT( Z * 100, 'System.Int32')/100" msprop:Generator_UserColumnName="COORD" msprop:Generator_ColumnVarNameInTable="columnCOORD" msprop:Generator_ColumnPropNameInRow="COORD" msprop:Generator_ColumnPropNameInTable="COORDColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ZONE_ID" msprop:Generator_UserColumnName="ZONE_ID" msprop:Generator_ColumnVarNameInTable="columnZONE_ID" msprop:Generator_ColumnPropNameInRow="ZONE_ID" msprop:Generator_ColumnPropNameInTable="ZONE_IDColumn" type="xs:int" /> + <xs:element name="X" msprop:Generator_UserColumnName="X" msprop:Generator_ColumnPropNameInRow="X" msprop:Generator_ColumnVarNameInTable="columnX" msprop:Generator_ColumnPropNameInTable="XColumn" type="xs:double" minOccurs="0" /> + <xs:element name="Y" msprop:Generator_UserColumnName="Y" msprop:Generator_ColumnPropNameInRow="Y" msprop:Generator_ColumnVarNameInTable="columnY" msprop:Generator_ColumnPropNameInTable="YColumn" type="xs:double" minOccurs="0" /> + <xs:element name="Z" msprop:Generator_UserColumnName="Z" msprop:Generator_ColumnPropNameInRow="Z" msprop:Generator_ColumnVarNameInTable="columnZ" msprop:Generator_ColumnPropNameInTable="ZColumn" type="xs:double" minOccurs="0" /> + <xs:element name="COORD_TYPE_ID" msprop:Generator_UserColumnName="COORD_TYPE_ID" msprop:Generator_ColumnPropNameInRow="COORD_TYPE_ID" msprop:Generator_ColumnVarNameInTable="columnCOORD_TYPE_ID" msprop:Generator_ColumnPropNameInTable="COORD_TYPE_IDColumn" type="xs:int" minOccurs="0" /> + <xs:element name="COORD" msdata:ReadOnly="true" msdata:Expression="COORD_TYPE_ID + ': ' +CONVERT( X * 100, 'System.Int32')/100 + ' | ' + CONVERT( Y * 100, 'System.Int32')/100 +' | ' + CONVERT( Z * 100, 'System.Int32')/100" msprop:Generator_UserColumnName="COORD" msprop:Generator_ColumnPropNameInRow="COORD" msprop:Generator_ColumnVarNameInTable="columnCOORD" msprop:Generator_ColumnPropNameInTable="COORDColumn" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="CoordinatesZone" msprop:Generator_UserTableName="CoordinatesZone" msprop:Generator_RowDeletedName="CoordinatesZoneRowDeleted" msprop:Generator_RowChangedName="CoordinatesZoneRowChanged" msprop:Generator_RowClassName="CoordinatesZoneRow" msprop:Generator_RowChangingName="CoordinatesZoneRowChanging" msprop:Generator_RowEvArgName="CoordinatesZoneRowChangeEvent" msprop:Generator_RowEvHandlerName="CoordinatesZoneRowChangeEventHandler" msprop:Generator_TableClassName="CoordinatesZoneDataTable" msprop:Generator_TableVarName="tableCoordinatesZone" msprop:Generator_RowDeletingName="CoordinatesZoneRowDeleting" msprop:Generator_TablePropName="CoordinatesZone"> <xs:complexType> <xs:sequence> - <xs:element name="ID" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> - <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnPropNameInTable="GIDColumn" type="xs:int" minOccurs="0" /> - <xs:element name="ZONE_NAME" msprop:Generator_UserColumnName="ZONE_NAME" msprop:Generator_ColumnVarNameInTable="columnZONE_NAME" msprop:Generator_ColumnPropNameInRow="ZONE_NAME" msprop:Generator_ColumnPropNameInTable="ZONE_NAMEColumn" type="xs:string" minOccurs="0" /> + <xs:element name="ID" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInTable="IDColumn" type="xs:int" /> + <xs:element name="GID" msprop:Generator_UserColumnName="GID" msprop:Generator_ColumnPropNameInRow="GID" msprop:Generator_ColumnVarNameInTable="columnGID" msprop:Generator_ColumnPropNameInTable="GIDColumn" typ... [truncated message content] |
From: <at...@us...> - 2010-01-14 05:31:53
|
Revision: 477 http://babbot.svn.sourceforge.net/babbot/?rev=477&view=rev Author: attn99 Date: 2010-01-14 05:31:47 +0000 (Thu, 14 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Common/Serializer.cs trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/RouteList.xml trunk/BabBot/BabBot/Forms/Shared/RouteDetails.Designer.cs trunk/BabBot/BabBot/Forms/Shared/RouteDetails.cs trunk/BabBot/BabBot/Forms/Shared/RouteDetails.resx trunk/BabBot/BabBot/Manager/DataManager.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs trunk/BabBot/BabBot/Wow/WoWData.cs Modified: trunk/BabBot/BabBot/Common/Serializer.cs =================================================================== --- trunk/BabBot/BabBot/Common/Serializer.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Common/Serializer.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -213,6 +213,31 @@ { protected IMergeable[] MergeList; + internal int Count + { + get + { + return (MergeList == null) ? -1 : MergeList.Length; + } + } + + internal IMergeable this[int idx] + { + get + { + if ((MergeList == null) || + (idx < 0) || (idx >= MergeList.Length)) + return null; + else + return MergeList[idx]; + } + set + { + MergeList[idx] = value; + } + } + + [XmlIgnore] public override bool Changed { @@ -691,11 +716,6 @@ return true; } - public T FindItemByName(string name) - { - return _stable[name]; - } - public void Add(T item) { _changed = true; Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-14 05:31:47 UTC (rev 477) @@ -10,10 +10,24 @@ The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. Unfortunately, the nightsaber and thistle boar populations grew too large. Shadowglen can only produce so much food for the beasts. Journey forth, young priest, and thin the boar and saber populations so that nature's harmony will be preserved.]]></text> - <objectives name="456"> + <objectives> <obj_list> - <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Nightsaber slain" qty="7" /> - <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Thistle Boar slain" qty="4" /> + <objective d3p1:type="MonsterQuestObjective" name="Young Nightsaber slain" type="monster" qty="7"> + <hot_spots> + <zone name="Teldrassil"> + <waypoint x="10307.94" y="871.77" z="1333.94" type="0" /> + <waypoint x="10284.48" y="733.76" z="1338.48" type="0" /> + </zone> + </hot_spots> + </objective> + <objective d3p1:type="MonsterQuestObjective" name="Young Thistle Boar slain" type="monster" qty="4"> + <hot_spots> + <zone name="Teldrassil"> + <waypoint x="10293.55" y="861.35" z="1336.29" type="0" /> + <waypoint x="10284.48" y="733.76" z="1338.48" type="0" /> + </zone> + </hot_spots> + </objective> </obj_list> </objectives> <choice_items> @@ -66,7 +80,7 @@ The mysterious woodland protector, Tarindrella, has returned to Shadowglen. The dryad's presence has not been felt in the forests of Kalimdor in years. Something is surely amiss if she has journeyed back to this land. Seek out Tarindrella and see what business she tends to in our grove. One of the Sentinels reported seeing her to the southwest of Aldrassil.]]></text> - <objectives name="458"> + <objectives> <obj_list /> </objectives> <objectives_text><![CDATA[Seek out the dryad known as Tarindrella.]]></objectives_text> @@ -83,7 +97,7 @@ <text><![CDATA[Greetings, young priest. Can you offer me aid? I have a package of herbs that I must deliver to the town of Dolanaar. But I still have business with the druids of Shadowglen and cannot yet leave. Can you deliver this package for me? It must be sent to Innkeeper Keldamyr, at the Dolanaar inn. It lies along the road, to the south.]]></text> - <objectives name="2159"> + <objectives> <obj_list /> </objectives> <choice_items> Modified: trunk/BabBot/BabBot/Data/RouteList.xml =================================================================== --- trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-14 05:31:47 UTC (rev 477) @@ -25,24 +25,24 @@ <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Conservator Ilthalaine" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10328.29" y="826.6" z="1326.38" type="0" /> </point_a> - <point_b d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_b d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="0" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10307.94" y="871.77" z="1333.94" type="0" /> </point_b> <descr /> <length>0</length> </route> <route name="BDCDBBF638B9F74C" reversible="true"> - <point_a d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_a d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="1" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10293.55" y="861.35" z="1336.29" type="0" /> </point_a> - <point_b d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_b d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="1" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10282.16" y="742.78" z="1338.97" type="0" /> </point_b> <descr>Same for Boars</descr> <length>0</length> </route> <route name="E22C72F11FC2E41" reversible="true"> - <point_a d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <point_a d4p1:type="QuestObjEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" obj_idx="0" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10284.48" y="733.76" z="1338.48" type="0" /> </point_a> <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Conservator Ilthalaine" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> Modified: trunk/BabBot/BabBot/Forms/Shared/RouteDetails.Designer.cs =================================================================== --- trunk/BabBot/BabBot/Forms/Shared/RouteDetails.Designer.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Forms/Shared/RouteDetails.Designer.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -206,14 +206,12 @@ // // cbObjA0 // - this.cbObjA0.DisplayMember = "ID"; this.cbObjA0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbObjA0.FormattingEnabled = true; this.cbObjA0.Location = new System.Drawing.Point(50, 3); this.cbObjA0.Name = "cbObjA0"; this.cbObjA0.Size = new System.Drawing.Size(142, 21); this.cbObjA0.TabIndex = 4; - this.cbObjA0.ValueMember = "ID"; this.cbObjA0.DataSourceChanged += new System.EventHandler(this.cbObjA0_DataSourceChanged); this.cbObjA0.SelectedIndexChanged += new System.EventHandler(this.OnRegisterChanges); // @@ -248,14 +246,13 @@ // // cbObjA1 // - this.cbObjA1.DisplayMember = "ID"; this.cbObjA1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbObjA1.FormattingEnabled = true; this.cbObjA1.Location = new System.Drawing.Point(50, 2); this.cbObjA1.Name = "cbObjA1"; this.cbObjA1.Size = new System.Drawing.Size(142, 21); this.cbObjA1.TabIndex = 20; - this.cbObjA1.ValueMember = "ID"; + this.cbObjA1.ValueMember = "IDX"; this.cbObjA1.SelectedIndexChanged += new System.EventHandler(this.OnRegisterChanges); // // pOptB @@ -332,14 +329,12 @@ // // cbObjB0 // - this.cbObjB0.DisplayMember = "ID"; this.cbObjB0.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbObjB0.FormattingEnabled = true; this.cbObjB0.Location = new System.Drawing.Point(50, 3); this.cbObjB0.Name = "cbObjB0"; this.cbObjB0.Size = new System.Drawing.Size(142, 21); this.cbObjB0.TabIndex = 4; - this.cbObjB0.ValueMember = "ID"; this.cbObjB0.SelectedIndexChanged += new System.EventHandler(this.OnRegisterChanges); // // lblObjB0 @@ -373,14 +368,13 @@ // // cbObjB1 // - this.cbObjB1.DisplayMember = "ID"; this.cbObjB1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbObjB1.FormattingEnabled = true; this.cbObjB1.Location = new System.Drawing.Point(50, 2); this.cbObjB1.Name = "cbObjB1"; this.cbObjB1.Size = new System.Drawing.Size(142, 21); this.cbObjB1.TabIndex = 20; - this.cbObjB1.ValueMember = "ID"; + this.cbObjB1.ValueMember = "IDX"; this.cbObjB1.SelectedIndexChanged += new System.EventHandler(this.OnRegisterChanges); // // pRouteDescr Modified: trunk/BabBot/BabBot/Forms/Shared/RouteDetails.cs =================================================================== --- trunk/BabBot/BabBot/Forms/Shared/RouteDetails.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Forms/Shared/RouteDetails.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -305,8 +305,8 @@ public AbstractDefListEndpoint(string bs_name) : base() { } - public AbstractDefListEndpoint(RouteDetails owner, - Panel target, char a_b, EndpointTypes etype, string[] bs_list, string[] members) + public AbstractDefListEndpoint(RouteDetails owner, Panel target, + char a_b, EndpointTypes etype, string[] bs_list, string[] members) : base(owner, target, a_b, etype) { _bs_cnt = bs_list.Length; @@ -358,6 +358,7 @@ { cb.DataSource = bs[idx]; cb.DisplayMember = member; + // For now it's static ((Label)cb.Tag).Text = DisplayMembers[idx][0] + DisplayMembers[idx].Substring(1).ToLower(); } @@ -428,9 +429,11 @@ public override Endpoint GetEndpoint(string ZoneText, Vector3D waypoint) { - BotDataSet.QuestListRow row = (BotDataSet.QuestListRow)((DataRowView) + BotDataSet.QuestListRow q_row = (BotDataSet.QuestListRow)((DataRowView) ((BindingSource)cb_list[0].DataSource).Current).Row; - return new QuestItemEndpoint(EType, row.ID, cb_list[1].Text, ZoneText, waypoint); + BotDataSet.QuestItemsRow obj_row = (BotDataSet.QuestItemsRow)((DataRowView) + ((BindingSource)cb_list[1].DataSource).Current).Row; + return new QuestObjEndpoint(EType, q_row.ID, obj_row.IDX, ZoneText, waypoint); } public override void OnSelection(Endpoint ep) @@ -438,17 +441,20 @@ base.OnSelection(ep); if (ep != null) { - QuestItemEndpoint qi = (QuestItemEndpoint)ep; + QuestObjEndpoint qi = (QuestObjEndpoint)ep; Quest q = DataManager.FindQuestById(qi.QuestId); + + string s = null; + if (q.Objectives.ObjList != null) + s = q.Objectives.ObjList[qi.ObjId].Name; + if (q != null) { cb_list[0].Text = q.Title; - cb_list[1].Text = qi.ItemName; + cb_list[1].Text = s; } } } - - } public class HotSpotListEndpoint : DefListEndpoint Modified: trunk/BabBot/BabBot/Forms/Shared/RouteDetails.resx =================================================================== --- trunk/BabBot/BabBot/Forms/Shared/RouteDetails.resx 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Forms/Shared/RouteDetails.resx 2010-01-14 05:31:47 UTC (rev 477) @@ -123,9 +123,6 @@ <metadata name="botDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>16, 7</value> </metadata> - <metadata name="botDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>16, 7</value> - </metadata> <metadata name="bsGameObjectsB.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>257, 10</value> </metadata> Modified: trunk/BabBot/BabBot/Manager/DataManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -311,6 +311,8 @@ #endregion + #region Game Data + public class DataManager { /// <summary> @@ -552,7 +554,7 @@ internal static WoWVersion FindWoWVersionByName(string version) { - return wdata.FindVersion(version); + return wdata[version]; } public static void SetWowVersion(string version) @@ -952,7 +954,7 @@ { // If null it produces exception check = DataManager.CurWoWVersion. - GameObjData.FindGameObjByName(obj.Name); + GameObjData[obj.Name]; } catch { } @@ -1108,7 +1110,9 @@ } } - + + #endregion + #region Routes public class WaypointsNotFoundException : Exception @@ -1228,8 +1232,8 @@ /// <param name="route">Route object</param> /// <param name="is_new">Is route new</param> /// <param name="export">Is export required</param> - private static bool SaveRoute(Route route, - Waypoints waypoints, bool is_new, bool export, string lfs) + private static bool SaveRoute(Route route, Waypoints waypoints, + bool is_new, bool export, string lfs) { if (is_new) DataManager.CurWoWVersion.Routes.Add(route); @@ -1242,9 +1246,10 @@ ExportRoute(route, waypoints); // Check if Quest/Gameobjects needs to be updated - if (route.PointA.UpdateDependedObj()) - // Index GameObject data as well - DataManager.SaveGameObjData(lfs); + if (route.PointA.UpdateDependedObj() || + route.PointB.UpdateDependedObj()) + // Index GameObject data as well + DataManager.SaveGameObjData(lfs); return true; } @@ -1424,6 +1429,27 @@ { Endpoint e = r[c]; + // Lookup endpoint object + if (e.HasLinkedObj) + { + DefEndpoint de = (DefEndpoint) e; + switch (e.PType) + { + case EndpointTypes.GAME_OBJ: + de.Obj = DataManager. + CurWoWVersion.GameObjData[de.Name]; + break; + + case EndpointTypes.QUEST_OBJ: + QuestObjEndpoint qoe = (QuestObjEndpoint) e; + Quest q = DataManager. + QuestList[Convert.ToInt32(qoe.Name)]; + if (q.Objectives != null) + de.Obj = q.Objectives.ObjList[qoe.ObjId]; + break; + } + } + if (c.Equals('a') || c.Equals('b') && r.Reversible) { Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -46,10 +46,11 @@ set { Items = value; } } + /* public GameObject FindGameObjByName(string name) { return FindItemByName(name); - } + }*/ public Quest FindMaxQuestByTitle(string title) { @@ -664,7 +665,7 @@ Link = link; Level = level; BonusSpell = bonus_spell; - Objectives = new QuestObjectives(id.ToString()); + Objectives = new QuestObjectives(); XmlDocument doc = new XmlDocument(); TextObjectives = doc.CreateCDataSection(objectives); @@ -705,7 +706,7 @@ } if (!string.IsNullOrEmpty(objs)) - Objectives = new QuestObjectives(id.ToString(), objs); + Objectives = new QuestObjectives(objs); } @@ -1184,7 +1185,7 @@ public QuestObjectivesList() : base() { } } - public class QuestObjectives : CommonMergeListItem + public class QuestObjectives { /// <summary> /// List with quest objectives @@ -1193,36 +1194,10 @@ public QuestObjectivesList ObjList; /// <summary> - /// List of hotspots where objectives can be "found" - /// </summary> - [XmlElement("hot_spots")] - public WpZones Coordinates - { - get { return (WpZones)MergeList[0]; } - set { MergeList[0] = value; } - } - - /// <summary> /// Paremetless class constructor /// </summary> public QuestObjectives() : base() - { - Init(); - } - - /// <summary> - /// Class constructor - /// </summary> - /// <param name="name">Quest Id</param> - public QuestObjectives(string id) - : base(id) { - Init(); - } - - private void Init() - { - MergeList = new IMergeable[1]; ObjList = new QuestObjectivesList(); } @@ -1231,8 +1206,8 @@ /// </summary> /// <param name="objs">List of objectives in format obj::obj /// where each obj is comma delited list of item, qty, is_finished</param> - public QuestObjectives(string id, string objs) - : this (id) + public QuestObjectives(string objs) + : base() { string[] obj = objs.Split(new string[] { "::" }, StringSplitOptions.None); foreach (string s in obj) @@ -1286,17 +1261,24 @@ [XmlInclude(typeof(MonsterQuestObjective))] [XmlInclude(typeof(ObjectQuestObjective))] [XmlInclude(typeof(ReputationQuestObjective))] - public abstract class AbstractQuestObjective + public abstract class AbstractQuestObjective : CommonMergeListItem { + /// <summary> + /// Quest objective Type + /// </summary> [XmlAttribute("type")] public string SType; - [XmlAttribute("name")] - public string Name; + /// <summary> + /// List of hotspots where objectives can be "found" + /// </summary> + [XmlElement("hot_spots")] + public WpZones Coordinates + { + get { return (WpZones)MergeList[0]; } + set { MergeList[0] = value; } + } - [XmlElement("wp_list")] - public WpZones Waypoints; - internal virtual string FullName { get { return Name; } @@ -1312,6 +1294,7 @@ public AbstractQuestObjective(string type) { SType = type; + MergeList = new IMergeable[1]; } public AbstractQuestObjective(string type, string name, bool is_finished) @@ -1473,7 +1456,7 @@ /// Route Endpoint class /// </summary> [XmlInclude(typeof(GameObjEndpoint))] - [XmlInclude(typeof(QuestItemEndpoint))] + [XmlInclude(typeof(QuestObjEndpoint))] public class Endpoint { /// <summary> @@ -1503,11 +1486,25 @@ /// </summary> internal EndpointTypes PType; + /// <summary> + /// Is endpoint has linked object + /// </summary> + internal virtual bool HasLinkedObj + { + get { return false; } + } + + /// <summary> + /// Endpoint description. Generated from Endpoint type + /// </summary> internal virtual string Descr { get { return Enum.GetName(typeof(EndpointTypes), PType).ToLower(); } } + /// <summary> + /// Parameteless constructor + /// </summary> public Endpoint() { } /// <summary> @@ -1522,6 +1519,10 @@ Waypoint = waypoint; } + /// <summary> + /// Update linked object + /// </summary> + /// <returns>True if linked object was changed and false if not</returns> public virtual bool UpdateDependedObj() { // By default no dependecies @@ -1550,18 +1551,65 @@ } } - public class DefEndpoint : Endpoint + public abstract class DefEndpoint : Endpoint { - + private int _coord_idx; + + /// <summary> + /// Name of the object this endpoint linked with + /// </summary> + abstract public string Name { get; } + + internal override bool HasLinkedObj + { + get { return true; } + } + + /// <summary> + /// Linked object + /// </summary> + internal CommonMergeListItem Obj; + + /// <summary> + /// Parameteless constructor + /// </summary> public DefEndpoint() : base() { } - public DefEndpoint(EndpointTypes type, string zone_text, Vector3D waypoint) - : base(type, zone_text, waypoint) { } + /// <summary> + /// Class constructor + /// </summary> + /// <param name="type">Endpoint type</param> + /// <param name="zone_text">Zone text where endpoint located</param> + /// <param name="waypoint">Waypoint</param> + /// <param name="coord_idx">Index of WpZones list in linked object</param> + public DefEndpoint(EndpointTypes type, string zone_text, + Vector3D waypoint, int coord_idx) + : base(type, zone_text, waypoint) + { + _coord_idx = coord_idx; + } + /// <summary> + /// Check WpZones list in linked object. + /// </summary> + /// <returns>True if Waypoint wasn't found and Waypoint was added</returns> + protected bool CheckWpZones() + { + // Quick check on types + if (_coord_idx >= Obj.Count) + return false; - protected bool CheckWpZones(WpZones wpz) - { - // It's not the base coord. Check the rest + WpZones wpz = null; + IMergeable im = Obj[_coord_idx]; + if (im == null) + { + wpz = new WpZones(); + Obj[_coord_idx] = wpz; + } + else + wpz = (WpZones)im; + + // Check all object coordinates foreach (ZoneWp zwp in wpz.Values) if (zwp.Name.Equals(ZoneText)) foreach (Vector3D v in zwp.List) @@ -1573,13 +1621,29 @@ return true; } + public override bool UpdateDependedObj() + { + if (Obj == null) + return false; + else + return CheckWpZones(); + } } public class GameObjEndpoint : DefEndpoint { + /// <summary> + /// Name of Game Object + /// </summary> [XmlAttribute("game_obj_name")] public string GameObjName; + [XmlIgnore] + public override string Name + { + get { return GameObjName; } + } + internal override string Descr { get { return GameObjName.ToString().ToLower().Replace(' ', '_'); } @@ -1588,13 +1652,11 @@ public GameObjEndpoint() : base() { } public GameObjEndpoint(EndpointTypes type, string name, string zone_text, Vector3D waypoint) - : base(EndpointTypes.GAME_OBJ, zone_text, waypoint) + : base(EndpointTypes.GAME_OBJ, zone_text, waypoint, 1) { GameObjName = name; } - internal GameObject Obj; - public override bool UpdateDependedObj() { // Update related game object @@ -1602,18 +1664,11 @@ return false; // Compare based coord coordinates - if (Obj.BasePosition.IsClose(Waypoint)) + if (((GameObject)Obj).BasePosition.IsClose(Waypoint)) return false; - if (Obj.ObjType == DataManager.GameObjectTypes.NPC) - { - NPC npc = (NPC)Obj; - - // It's not the base coord. Check the rest - return CheckWpZones(npc.Coordinates); - } - - return base.UpdateDependedObj(); + // It's not the base coord. Check the rest + return CheckWpZones(); } public override bool Equals(object obj) @@ -1630,53 +1685,52 @@ } } - public class QuestItemEndpoint : Endpoint + public class QuestObjEndpoint : DefEndpoint { + /// <summary> + /// Quest id + /// </summary> [XmlAttribute("quest_id")] public int QuestId; - [XmlAttribute("item_name")] - public string ItemName; + /// <summary> + /// Objective name + /// </summary> + [XmlAttribute("obj_idx")] + public int ObjId; + [XmlIgnore] + public override string Name + { + get { return QuestId.ToString(); } + } + internal override string Descr { get { - return QuestId + "#" + ItemName.ToString().ToLower().Replace(' ', '_'); ; + return QuestId + "#" + ObjId; ; } } - public QuestItemEndpoint() : base() { } + public QuestObjEndpoint() : base() { } - public QuestItemEndpoint(EndpointTypes type, - int quest_id, string item_name, string zone_text, Vector3D waypoint) - : base(EndpointTypes.QUEST_OBJ, zone_text, waypoint) + public QuestObjEndpoint(EndpointTypes type, + int quest_id, int obj_id, string zone_text, Vector3D waypoint) + : base(EndpointTypes.QUEST_OBJ, zone_text, waypoint, 0) { QuestId = quest_id; - ItemName = item_name; + ObjId = obj_id; } - internal QuestObjectives Obj; - - public override bool UpdateDependedObj() - { - // Update related game object - if ((Obj == null) || (Obj.Coordinates == null)) - return false; - - // TODO - - return base.UpdateDependedObj(); - } - public override bool Equals(object obj) { if (!base.Equals(obj)) return false; - QuestItemEndpoint qie = (QuestItemEndpoint)obj; + QuestObjEndpoint qie = (QuestObjEndpoint)obj; return (QuestId == qie.QuestId) && - ItemName.Equals(qie.ItemName); + ObjId.Equals(qie.ObjId); } public override int GetHashCode() Modified: trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs =================================================================== --- trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Wow/Helpers/NpcHelper.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -247,7 +247,7 @@ public static GameObject FindGameObjByName(string name) { - GameObject obj = DataManager.CurWoWVersion.GameObjData.FindGameObjByName(name); + GameObject obj = DataManager.CurWoWVersion.GameObjData[name]; if (obj == null) throw new GameObjectNotFountException(name); @@ -581,7 +581,7 @@ Output.Instance.Log(lfs, "NPC '" + npc.Name + "' successfully added to " + DataManager.GameObjDataFileName); - return DataManager.CurWoWVersion.GameObjData.FindGameObjByName(npc.Name); + return DataManager.CurWoWVersion.GameObjData[npc.Name]; } return null; Modified: trunk/BabBot/BabBot/Wow/WoWData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/WoWData.cs 2010-01-13 23:00:49 UTC (rev 476) +++ trunk/BabBot/BabBot/Wow/WoWData.cs 2010-01-14 05:31:47 UTC (rev 477) @@ -43,10 +43,12 @@ [XmlElement("app_config")] public AppConfig AppConfig; + /* public WoWVersion FindVersion(string version) { return (WoWVersion) FindItemByName(version); } + * */ } public class WoWVersion : CommonMergeListItem This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-13 23:00:57
|
Revision: 476 http://babbot.svn.sourceforge.net/babbot/?rev=476&view=rev Author: attn99 Date: 2010-01-13 23:00:49 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs trunk/BabBot/BabBot/Forms/RoutesForm.cs trunk/BabBot/BabBot/Manager/DataManager.cs trunk/BabBot/BabBot/Scripts/Common/TravelState.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs Modified: trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs =================================================================== --- trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-13 01:16:40 UTC (rev 475) +++ trunk/BabBot/BabBot/Forms/RouteRecorderForm.cs 2010-01-13 23:00:49 UTC (rev 476) @@ -47,9 +47,10 @@ RecStates _rec_state = RecStates.IDLE; RouteRecordingState _route_rec_state; private Route _route; + private string _lfs = "route_recorder"; public RouteRecorderForm() - : base ("route_mgr") + : base ("route_record") { InitializeComponent(); ctrlRouteDetails.RegisterChanges += new EventHandler(RegisterChanges); @@ -352,7 +353,7 @@ Waypoints waypoints = GetWaypointsList(_route.FileName); // Save route - if (RouteListManager.SaveRoute(_route, waypoints)) + if (RouteListManager.SaveRoute(_route, waypoints, _lfs)) { string s = "Route successfully saved"; Modified: trunk/BabBot/BabBot/Forms/RoutesForm.cs =================================================================== --- trunk/BabBot/BabBot/Forms/RoutesForm.cs 2010-01-13 01:16:40 UTC (rev 475) +++ trunk/BabBot/BabBot/Forms/RoutesForm.cs 2010-01-13 23:00:49 UTC (rev 476) @@ -144,7 +144,7 @@ { Route route = GetRoute(); // Save route - if (RouteListManager.SaveRoute(route)) + if (RouteListManager.SaveRoute(route, _lfs)) { IsChanged = false; @@ -209,7 +209,7 @@ ". Check format and try again"; try { - Route r = RouteListManager.ImportRoute(fname); + Route r = RouteListManager.ImportRoute(fname, _lfs); if (r == null) { ShowErrorMessage(err); Modified: trunk/BabBot/BabBot/Manager/DataManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-13 01:16:40 UTC (rev 475) +++ trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-13 23:00:49 UTC (rev 476) @@ -1179,9 +1179,9 @@ /// <param name="route">Route object</param> /// <param name="waypoints">Waypoint object</param> /// <returns></returns> - public static bool SaveRoute(Route route, Waypoints waypoints) + public static bool SaveRoute(Route route, Waypoints waypoints, string lfs) { - return SaveRoute(route, waypoints, true); + return SaveRoute(route, waypoints, true, lfs); } /// <summary> @@ -1191,7 +1191,8 @@ /// <param name="waypoints">Waypoint object</param> /// <param name="export">Is export required</param> /// <returns></returns> - private static bool SaveRoute(Route route, Waypoints waypoints, bool export) + private static bool SaveRoute(Route route, + Waypoints waypoints, bool export, string lfs) { bool is_new = route.WaypointFileName == null; // Make sure file name for new route waypoints is unique @@ -1209,16 +1210,16 @@ waypoints.Name + ".wp", typeof(Waypoints), waypoints)) return false; - return SaveRoute(route, waypoints, is_new, export); + return SaveRoute(route, waypoints, is_new, export, lfs); } /// <summary> /// Save existing route /// </summary> /// <param name="route">Route object</param> - public static bool SaveRoute(Route route) + public static bool SaveRoute(Route route, string lfs) { - return SaveRoute(route, null, false, false); + return SaveRoute(route, null, false, false, lfs); } /// <summary> @@ -1228,17 +1229,22 @@ /// <param name="is_new">Is route new</param> /// <param name="export">Is export required</param> private static bool SaveRoute(Route route, - Waypoints waypoints, bool is_new, bool export) + Waypoints waypoints, bool is_new, bool export, string lfs) { if (is_new) DataManager.CurWoWVersion.Routes.Add(route); else DataManager.CurWoWVersion.Routes[route.WaypointFileName] = route; - SaveRouteList("routes"); + SaveRouteList(lfs); if (export) ExportRoute(route, waypoints); + + // Check if Quest/Gameobjects needs to be updated + if (route.PointA.UpdateDependedObj()) + // Index GameObject data as well + DataManager.SaveGameObjData(lfs); return true; } @@ -1352,7 +1358,7 @@ /// </summary> /// <param name="fname">File Name</param> /// <returns></returns> - public static Route ImportRoute(string fname) + public static Route ImportRoute(string fname, string lfs) { if (!File.Exists(fname)) { @@ -1386,7 +1392,7 @@ r.WpList = null; r.Version = null; - if (!SaveRoute(r, wp, false)) + if (!SaveRoute(r, wp, false, lfs)) return null; return r; Modified: trunk/BabBot/BabBot/Scripts/Common/TravelState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-13 01:16:40 UTC (rev 475) +++ trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-13 23:00:49 UTC (rev 476) @@ -57,8 +57,13 @@ /// <summary> /// List of used routes /// </summary> - protected List<Route> UsedRoute = new List<Route>(); + protected List<Route> UsedRoutes = new List<Route>(); + /// <summary> + /// List of found routes + /// </summary> + protected List<Route> FoundRoutes = new List<Route>(); + public WowPlayer Player; public TravelState(GameObject obj, string lfs, string tooltip_text) @@ -109,31 +114,56 @@ return; } + float calc_len = CheckRoute(name, 0); + if (calc_len > 0) + { + // Check if total calc length exceed much direct length + // if ( + } + + + // set calc flag if it direct path shorter than best route + // calc_route = (dist_a < min_route_len); + + // Check among undef routes + // r = RouteListManager.FindRoute( + } + + public float CheckRoute(string name, float total_len) + { // Find all avail routes for dest List<Route> lr = RouteListManager.Endpoints[name]; - // Best route + // Best route with min total length + Route min_route = null; float min_route_len = float.MaxValue; - Route min_route = null; foreach (Route r in lr) { + // Quick check we not cycling + if (FoundRoutes.IndexOf(r) >= 0) + continue; + // It's either A or B Endpoint[] eps = r.GetEndpoints(name); if (eps == null) - return; + return 0; // Only using atm based coord for game obj/quest item - if (CheckEndpoint(eps[1], r, player, cur_loc)) - return; + if (eps[1].Waypoint.IsClose(Player.Location)) + { + // Exact route found + FoundRoutes.Add(r); + return total_len + r.Length; + } // Exact route not found // Check Direct Distance to both endpoint - float ddist_b = eps[1].Waypoint.GetDistanceTo(cur_loc); - float ddist_a = eps[0].Waypoint.GetDistanceTo(cur_loc); + float ddist_b = eps[1].Waypoint.GetDistanceTo(Player.Location); + float ddist_a = eps[0].Waypoint.GetDistanceTo(Player.Location); - // Calc min lenght for best route + // Calc lenght and update best route float cur_len = r.Length + ddist_b; if (cur_len < min_route_len) { @@ -146,21 +176,13 @@ { // Check if another route connected to given point // This check is recursive + return CheckRoute(name, total_len + min_route_len); } - else - { - // Go with navigation state - } - - // set calc flag if it direct path shorter than best route - // calc_route = (dist_a < min_route_len); - - // Check among undef routes - // r = RouteListManager.FindRoute( + return 0; } - + private bool CheckEndpoint(Endpoint ep, Route r, WowPlayer player, Vector3D cur_loc) { @@ -203,7 +225,7 @@ if (r.Reversible) wp.List.Reverse(); - UsedRoute.Add(r); + UsedRoutes.Add(r); CallChangeStateEvent(player, new NavigationState(wp, Lfs, "Traveling to " + _dest.ToString())); } Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-13 01:16:40 UTC (rev 475) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-13 23:00:49 UTC (rev 476) @@ -1084,6 +1084,15 @@ { return FindItemByName(name); } + + public void AddCoordinate(string zone_name, Vector3D v) + { + ZoneWp zwp = this[zone_name]; + if (zwp == null) + Add(new ZoneWp(zone_name, v)); + else + zwp.Add(v); + } } public class ZoneWp : CommonNameList<Vector3D> @@ -1513,6 +1522,12 @@ Waypoint = waypoint; } + public virtual bool UpdateDependedObj() + { + // By default no dependecies + return false; + } + public override bool Equals(object obj) { if (obj == null) @@ -1533,14 +1548,43 @@ { return Descr; } + } + public class DefEndpoint : Endpoint + { + + public DefEndpoint() : base() { } + + public DefEndpoint(EndpointTypes type, string zone_text, Vector3D waypoint) + : base(type, zone_text, waypoint) { } + + + protected bool CheckWpZones(WpZones wpz) + { + // It's not the base coord. Check the rest + foreach (ZoneWp zwp in wpz.Values) + if (zwp.Name.Equals(ZoneText)) + foreach (Vector3D v in zwp.List) + if (v.IsClose(Waypoint)) + return false; + + // Looks we got another waypoint + wpz.AddCoordinate(ZoneText, Waypoint); + return true; + } + } - public class GameObjEndpoint : Endpoint + public class GameObjEndpoint : DefEndpoint { [XmlAttribute("game_obj_name")] public string GameObjName; + internal override string Descr + { + get { return GameObjName.ToString().ToLower().Replace(' ', '_'); } + } + public GameObjEndpoint() : base() { } public GameObjEndpoint(EndpointTypes type, string name, string zone_text, Vector3D waypoint) @@ -1549,9 +1593,27 @@ GameObjName = name; } - internal override string Descr + internal GameObject Obj; + + public override bool UpdateDependedObj() { - get { return GameObjName.ToString().ToLower().Replace(' ', '_'); } + // Update related game object + if (Obj == null) + return false; + + // Compare based coord coordinates + if (Obj.BasePosition.IsClose(Waypoint)) + return false; + + if (Obj.ObjType == DataManager.GameObjectTypes.NPC) + { + NPC npc = (NPC)Obj; + + // It's not the base coord. Check the rest + return CheckWpZones(npc.Coordinates); + } + + return base.UpdateDependedObj(); } public override bool Equals(object obj) @@ -1594,6 +1656,19 @@ ItemName = item_name; } + internal QuestObjectives Obj; + + public override bool UpdateDependedObj() + { + // Update related game object + if ((Obj == null) || (Obj.Coordinates == null)) + return false; + + // TODO + + return base.UpdateDependedObj(); + } + public override bool Equals(object obj) { if (!base.Equals(obj)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2010-01-13 01:16:47
|
Revision: 475 http://babbot.svn.sourceforge.net/babbot/?rev=475&view=rev Author: attn99 Date: 2010-01-13 01:16:40 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Development on TravelState Modified Paths: -------------- trunk/BabBot/BabBot/Common/Serializer.cs trunk/BabBot/BabBot/Data/GameObjectData.xml trunk/BabBot/BabBot/Data/RouteList.xml trunk/BabBot/BabBot/Manager/DataManager.cs trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs trunk/BabBot/BabBot/Scripts/Common/QuestExecState.cs trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs trunk/BabBot/BabBot/Scripts/Common/TravelState.cs trunk/BabBot/BabBot/Wow/GameObjectData.cs Added Paths: ----------- trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp trunk/BabBot/BabBot/Data/Routes/9D753283EA107840.wp Removed Paths: ------------- trunk/BabBot/BabBot/Data/Routes/27487C946FD4794C.wp Modified: trunk/BabBot/BabBot/Common/Serializer.cs =================================================================== --- trunk/BabBot/BabBot/Common/Serializer.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Common/Serializer.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -207,6 +207,7 @@ /// <summary> /// Class with collection item that includes a mergeable list, for ex WoWVersion + /// Used by: QuestObjectives, GameObject /// </summary> public abstract class CommonMergeListItem : CommonMergeItem { Modified: trunk/BabBot/BabBot/Data/GameObjectData.xml =================================================================== --- trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Data/GameObjectData.xml 2010-01-13 01:16:40 UTC (rev 475) @@ -10,9 +10,11 @@ The spring rains were particularly heavy this year, causing some of the forest's beasts to flourish while others suffered. Unfortunately, the nightsaber and thistle boar populations grew too large. Shadowglen can only produce so much food for the beasts. Journey forth, young priest, and thin the boar and saber populations so that nature's harmony will be preserved.]]></text> - <objectives> - <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Nightsaber slain" qty="7" /> - <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Thistle Boar slain" qty="4" /> + <objectives name="456"> + <obj_list> + <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Nightsaber slain" qty="7" /> + <objective d3p1:type="MonsterQuestObjective" type="monster" name="Young Thistle Boar slain" qty="4" /> + </obj_list> </objectives> <choice_items> <item name="Archery Training Gloves" qty="1" /> @@ -58,12 +60,15 @@ <game_object d3p1:type="NPC" name="Melithar Staghelm" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> <base_position x="10389.8" y="763.48" z="1319.95" type="0" /> <quests> - <quest name="The Woodland Protector" id="458" link="|cffffff00|Hquest:458:1|h[The Woodland Protector]|h|r" level="1" bonus_spell="" num="0" dest_name="Tarindrella"> + <quest name="The Woodland Protector" id="458" link="|cffffff00|Hquest:458:1|h[The Woodland Protector]|h|r" level="1" bonus_spell="" num="0" dest_name=""> <text><![CDATA[Thank goodness you are here, priest. Strange news has traveled to me through the whisperings of the forest spirits. The mysterious woodland protector, Tarindrella, has returned to Shadowglen. The dryad's presence has not been felt in the forests of Kalimdor in years. Something is surely amiss if she has journeyed back to this land. Seek out Tarindrella and see what business she tends to in our grove. One of the Sentinels reported seeing her to the southwest of Aldrassil.]]></text> + <objectives name="458"> + <obj_list /> + </objectives> <objectives_text><![CDATA[Seek out the dryad known as Tarindrella.]]></objectives_text> </quest> </quests> @@ -72,12 +77,15 @@ <gossips /> </game_object> <game_object d3p1:type="NPC" name="Porthannius" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> - <base_position x="10214.3" y="700.55" z="1360.6" type="0" /> + <base_position x="10214.3" y="700.55" z="1360.61" type="0" /> <quests> <quest name="Dolanaar Delivery" id="2159" link="|cffff8040|Hquest:2159:5|h[Dolanaar Delivery]|h|r" level="5" bonus_spell="" num="0" dest_name=""> <text><![CDATA[Greetings, young priest. Can you offer me aid? I have a package of herbs that I must deliver to the town of Dolanaar. But I still have business with the druids of Shadowglen and cannot yet leave. Can you deliver this package for me? It must be sent to Innkeeper Keldamyr, at the Dolanaar inn. It lies along the road, to the south.]]></text> + <objectives name="2159"> + <obj_list /> + </objectives> <choice_items> <item name="Darnassian Bleu" qty="5" /> <item name="Refreshing Spring Water" qty="5" /> @@ -98,13 +106,6 @@ </services> <gossips /> </game_object> - <game_object d3p1:type="NPC" name="Tarindrella" zone="Teldrassil" faction="Alliance" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance"> - <base_position x="10296.9" y="870.23" z="1335.89" type="0" /> - <quests /> - <coordinates /> - <services /> - <gossips /> - </game_object> </wow_version> <wow_version name="3.3.0.11159" /> </game_object_data> \ No newline at end of file Modified: trunk/BabBot/BabBot/Data/RouteList.xml =================================================================== --- trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Data/RouteList.xml 2010-01-13 01:16:40 UTC (rev 475) @@ -1,15 +1,26 @@ <?xml version="1.0" encoding="utf-8"?> <route_list version="0"> <wow_version name="3.2.2.10505"> - <route name="27487C946FD4794C" reversible="true"> - <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Innkeeper Keldamyr" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> - <waypoint x="9802.23" y="980.46" z="1313.9" type="0" /> + <route name="433015755FB304C" reversible="true"> + <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Porthannius" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="10214.67" y="700.7" z="1360.57" type="0" /> </point_a> - <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Porthannius" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> - <waypoint x="10213.63" y="699.01" z="1360.44" type="0" /> + <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Innkeeper Keldamyr" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="9880.52" y="801.66" z="1309.88" type="0" /> </point_b> <descr>Path to Dalaran</descr> + <length>0</length> </route> + <route name="9D753283EA107840" reversible="true"> + <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Conservator Ilthalaine" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="10330.11" y="823.67" z="1326.41" type="0" /> + </point_a> + <point_b d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Porthannius" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> + <waypoint x="10225.92" y="700.62" z="1356.97" type="0" /> + </point_b> + <descr /> + <length>0</length> + </route> <route name="B223A2FEF93A964A" reversible="true"> <point_a d4p1:type="GameObjEndpoint" zone="Teldrassil" type="game_obj" game_obj_name="Conservator Ilthalaine" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> <waypoint x="10328.29" y="826.6" z="1326.38" type="0" /> @@ -18,6 +29,7 @@ <waypoint x="10307.94" y="871.77" z="1333.94" type="0" /> </point_b> <descr /> + <length>0</length> </route> <route name="BDCDBBF638B9F74C" reversible="true"> <point_a d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> @@ -27,6 +39,7 @@ <waypoint x="10282.16" y="742.78" z="1338.97" type="0" /> </point_b> <descr>Same for Boars</descr> + <length>0</length> </route> <route name="E22C72F11FC2E41" reversible="true"> <point_a d4p1:type="QuestItemEndpoint" zone="Teldrassil" type="quest_obj" quest_id="456" item_name="Young Nightsaber slain" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance"> @@ -36,6 +49,7 @@ <waypoint x="10382.55" y="757.25" z="1319.91" type="0" /> </point_b> <descr>Turn in quest</descr> + <length>0</length> </route> </wow_version> <wow_version name="3.3.0.11159" /> Deleted: trunk/BabBot/BabBot/Data/Routes/27487C946FD4794C.wp =================================================================== --- trunk/BabBot/BabBot/Data/Routes/27487C946FD4794C.wp 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Data/Routes/27487C946FD4794C.wp 2010-01-13 01:16:40 UTC (rev 475) @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<waypoints name="27487C946FD4794C"> - <waypoint x="9802.23" y="980.46" z="1313.9" type="0" /> - <waypoint x="9802.57" y="969.63" z="1313.89" type="0" /> - <waypoint x="9802.67" y="967.06" z="1313.13" type="0" /> - <waypoint x="9804.58" y="964.39" z="1312.23" type="0" /> - <waypoint x="9806.61" y="957.75" z="1308.79" type="0" /> - <waypoint x="9807.45" y="956.49" z="1308.79" type="0" /> - <waypoint x="9808.8" y="955.78" z="1308.79" type="0" /> - <waypoint x="9813.09" y="954.16" z="1308.79" type="0" /> - <waypoint x="9823.01" y="952.87" z="1308.78" type="0" /> - <waypoint x="9824.45" y="952.41" z="1308.77" type="0" /> - <waypoint x="9825.53" y="951.34" z="1308.77" type="0" /> - <waypoint x="9826.95" y="949.46" z="1309.04" type="0" /> - <waypoint x="9828.19" y="946.67" z="1309.2" type="0" /> - <waypoint x="9830.15" y="939.27" z="1306.77" type="0" /> - <waypoint x="9835.84" y="931.06" z="1306.03" type="0" /> - <waypoint x="9841.88" y="922.5" z="1305.3" type="0" /> - <waypoint x="9848.05" y="913.75" z="1305.09" type="0" /> - <waypoint x="9849.83" y="911.23" z="1305.34" type="0" /> - <waypoint x="9851.01" y="910.31" z="1305.48" type="0" /> - <waypoint x="9859.47" y="907.06" z="1305.97" type="0" /> - <waypoint x="9860.98" y="907.02" z="1306.07" type="0" /> - <waypoint x="9871.3" y="909.42" z="1306.85" type="0" /> - <waypoint x="9881.61" y="911.82" z="1307.38" type="0" /> - <waypoint x="9883.91" y="912.35" z="1307.42" type="0" /> - <waypoint x="9882.31" y="901.88" z="1307.9" type="0" /> - <waypoint x="9880.77" y="891.45" z="1308.35" type="0" /> - <waypoint x="9881.65" y="880.97" z="1307.09" type="0" /> - <waypoint x="9882.34" y="872.76" z="1307.22" type="0" /> - <waypoint x="9882.12" y="871.36" z="1307.22" type="0" /> - <waypoint x="9879.72" y="861.29" z="1307.22" type="0" /> - <waypoint x="9877.79" y="852.8" z="1307.22" type="0" /> - <waypoint x="9877.83" y="842.56" z="1307.22" type="0" /> - <waypoint x="9877.86" y="839.62" z="1307.22" type="0" /> - <waypoint x="9880.67" y="829.78" z="1307.37" type="0" /> - <waypoint x="9881.7" y="826.16" z="1307.33" type="0" /> - <waypoint x="9882.17" y="815.91" z="1308.58" type="0" /> - <waypoint x="9882.62" y="805.7" z="1309.69" type="0" /> - <waypoint x="9883.08" y="795.46" z="1309.88" type="0" /> - <waypoint x="9883.53" y="785.23" z="1309.88" type="0" /> - <waypoint x="9883.98" y="775" z="1309.88" type="0" /> - <waypoint x="9884.24" y="769.83" z="1309.88" type="0" /> - <waypoint x="9884.83" y="768.56" z="1309.87" type="0" /> - <waypoint x="9889.78" y="761.25" z="1309.96" type="0" /> - <waypoint x="9891.22" y="757.9" z="1309.87" type="0" /> - <waypoint x="9896.66" y="749.23" z="1309.69" type="0" /> - <waypoint x="9902.12" y="740.56" z="1309.87" type="0" /> - <waypoint x="9907.9" y="731.4" z="1309.88" type="0" /> - <waypoint x="9913.36" y="722.74" z="1309.88" type="0" /> - <waypoint x="9914.02" y="721.49" z="1309.88" type="0" /> - <waypoint x="9917.28" y="711.79" z="1309.89" type="0" /> - <waypoint x="9920.54" y="702.08" z="1309.89" type="0" /> - <waypoint x="9921.29" y="700.11" z="1309.87" type="0" /> - <waypoint x="9926.69" y="691.55" z="1309.7" type="0" /> - <waypoint x="9932.15" y="682.89" z="1309.87" type="0" /> - <waypoint x="9934.87" y="678.62" z="1309.9" type="0" /> - <waypoint x="9941.84" y="671.28" z="1309.88" type="0" /> - <waypoint x="9944.84" y="668.11" z="1309.88" type="0" /> - <waypoint x="9949.64" y="659.07" z="1309.94" type="0" /> - <waypoint x="9950.52" y="657.99" z="1309.98" type="0" /> - <waypoint x="9958.65" y="651.77" z="1310.38" type="0" /> - <waypoint x="9966.69" y="645.62" z="1311.78" type="0" /> - <waypoint x="9974.74" y="639.47" z="1312.65" type="0" /> - <waypoint x="9979.31" y="635.96" z="1313.46" type="0" /> - <waypoint x="9985.45" y="627.77" z="1314.47" type="0" /> - <waypoint x="9991.5" y="619.64" z="1314.98" type="0" /> - <waypoint x="9997.55" y="611.53" z="1315.85" type="0" /> - <waypoint x="10003.6" y="603.41" z="1315.7" type="0" /> - <waypoint x="10006.63" y="599.36" z="1315.7" type="0" /> - <waypoint x="10007.74" y="598.5" z="1315.7" type="0" /> - <waypoint x="10011.42" y="596.16" z="1315.7" type="0" /> - <waypoint x="10018.97" y="593.52" z="1315.7" type="0" /> - <waypoint x="10029.03" y="592.48" z="1315.76" type="0" /> - <waypoint x="10031.97" y="592.22" z="1315.7" type="0" /> - <waypoint x="10033.33" y="592.53" z="1315.7" type="0" /> - <waypoint x="10043" y="595.55" z="1316.1" type="0" /> - <waypoint x="10051.48" y="601.05" z="1317.6" type="0" /> - <waypoint x="10055.72" y="603.82" z="1318.9" type="0" /> - <waypoint x="10056.74" y="604.94" z="1319.37" type="0" /> - <waypoint x="10058.83" y="607.78" z="1320.58" type="0" /> - <waypoint x="10062.8" y="617.09" z="1324.18" type="0" /> - <waypoint x="10063.36" y="618.39" z="1324.76" type="0" /> - <waypoint x="10068.91" y="625.99" z="1328.37" type="0" /> - <waypoint x="10074.51" y="633.55" z="1331.94" type="0" /> - <waypoint x="10080.47" y="641.59" z="1335.6" type="0" /> - <waypoint x="10086.08" y="649.16" z="1338.97" type="0" /> - <waypoint x="10092.03" y="657.19" z="1342.51" type="0" /> - <waypoint x="10097.98" y="665.23" z="1345.83" type="0" /> - <waypoint x="10102.78" y="671.64" z="1348.54" type="0" /> - <waypoint x="10111.14" y="677.12" z="1351.46" type="0" /> - <waypoint x="10119.63" y="682.62" z="1354.3" type="0" /> - <waypoint x="10122.71" y="684.58" z="1355.36" type="0" /> - <waypoint x="10132.65" y="686.46" z="1357.82" type="0" /> - <waypoint x="10142.61" y="688.27" z="1359.62" type="0" /> - <waypoint x="10152.69" y="690.09" z="1361.07" type="0" /> - <waypoint x="10162.64" y="691.89" z="1361.42" type="0" /> - <waypoint x="10172.6" y="693.7" z="1361.84" type="0" /> - <waypoint x="10174" y="693.73" z="1361.8" type="0" /> - <waypoint x="10178.47" y="693.58" z="1361.61" type="0" /> - <waypoint x="10188.48" y="695.06" z="1361.05" type="0" /> - <waypoint x="10192.81" y="695.65" z="1361.1" type="0" /> - <waypoint x="10203.03" y="695.46" z="1361.08" type="0" /> - <waypoint x="10205.86" y="695.41" z="1360.94" type="0" /> - <waypoint x="10207.31" y="695.83" z="1360.83" type="0" /> - <waypoint x="10209.64" y="697.59" z="1360.73" type="0" /> - <waypoint x="10213.63" y="699.01" z="1360.44" type="0" /> -</waypoints> \ No newline at end of file Added: trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp =================================================================== --- trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp (rev 0) +++ trunk/BabBot/BabBot/Data/Routes/433015755FB304C.wp 2010-01-13 01:16:40 UTC (rev 475) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="utf-8"?> +<waypoints name="433015755FB304C"> + <waypoint x="10214.67" y="700.7" z="1360.57" type="0" /> + <waypoint x="10209.77" y="696.86" z="1360.68" type="0" /> + <waypoint x="10203.84" y="695.86" z="1360.99" type="0" /> + <waypoint x="10191.79" y="695.5" z="1361.08" type="0" /> + <waypoint x="10179.87" y="695.14" z="1361.63" type="0" /> + <waypoint x="10175.73" y="694.94" z="1361.83" type="0" /> + <waypoint x="10165.82" y="692.63" z="1361.66" type="0" /> + <waypoint x="10155.71" y="692.26" z="1361.09" type="0" /> + <waypoint x="10153.76" y="691.97" z="1361.01" type="0" /> + <waypoint x="10144.22" y="688.86" z="1359.98" type="0" /> + <waypoint x="10142.23" y="688.67" z="1359.58" type="0" /> + <waypoint x="10132.25" y="687.78" z="1357.83" type="0" /> + <waypoint x="10130.3" y="687.19" z="1357.41" type="0" /> + <waypoint x="10124.89" y="684.38" z="1355.89" type="0" /> + <waypoint x="10116.72" y="678.62" z="1353" type="0" /> + <waypoint x="10108.63" y="672.79" z="1350.21" type="0" /> + <waypoint x="10101.97" y="665.46" z="1347.07" type="0" /> + <waypoint x="10095.36" y="658.18" z="1343.64" type="0" /> + <waypoint x="10088.67" y="650.81" z="1340.15" type="0" /> + <waypoint x="10082" y="643.46" z="1336.45" type="0" /> + <waypoint x="10079.62" y="640.39" z="1335.1" type="0" /> + <waypoint x="10074.54" y="631.81" z="1331.54" type="0" /> + <waypoint x="10069.45" y="623.21" z="1327.86" type="0" /> + <waypoint x="10064.32" y="614.67" z="1324.01" type="0" /> + <waypoint x="10062.91" y="613.26" z="1323.17" type="0" /> + <waypoint x="10055.83" y="606.23" z="1319.44" type="0" /> + <waypoint x="10048.04" y="598.5" z="1316.88" type="0" /> + <waypoint x="10041.63" y="592.21" z="1315.87" type="0" /> + <waypoint x="10039.87" y="591.61" z="1315.8" type="0" /> + <waypoint x="10034.5" y="590.65" z="1315.7" type="0" /> + <waypoint x="10028.5" y="591.4" z="1315.7" type="0" /> + <waypoint x="10018.5" y="595.62" z="1315.7" type="0" /> + <waypoint x="10008.56" y="599.8" z="1315.71" type="0" /> + <waypoint x="10002.8" y="602.23" z="1315.7" type="0" /> + <waypoint x="10001.15" y="603.54" z="1315.7" type="0" /> + <waypoint x="9999.3" y="605.3" z="1315.73" type="0" /> + <waypoint x="9997.76" y="607.78" z="1315.79" type="0" /> + <waypoint x="9996.46" y="609.55" z="1315.76" type="0" /> + <waypoint x="9989.17" y="617.15" z="1315.17" type="0" /> + <waypoint x="9981.08" y="625.59" z="1314.14" type="0" /> + <waypoint x="9973.02" y="633.99" z="1312.7" type="0" /> + <waypoint x="9965.02" y="642.33" z="1311.94" type="0" /> + <waypoint x="9956.94" y="650.75" z="1310.36" type="0" /> + <waypoint x="9953.98" y="654.32" z="1310.15" type="0" /> + <waypoint x="9950.15" y="660.17" z="1309.93" type="0" /> + <waypoint x="9942.6" y="669.07" z="1309.86" type="0" /> + <waypoint x="9941.44" y="671.21" z="1309.88" type="0" /> + <waypoint x="9936.55" y="681.95" z="1309.93" type="0" /> + <waypoint x="9934.37" y="685.9" z="1309.92" type="0" /> + <waypoint x="9927.94" y="692.69" z="1309.69" type="0" /> + <waypoint x="9925.54" y="696.7" z="1309.72" type="0" /> + <waypoint x="9924.03" y="698.44" z="1309.76" type="0" /> + <waypoint x="9922.54" y="700.22" z="1309.83" type="0" /> + <waypoint x="9916.63" y="710.15" z="1309.96" type="0" /> + <waypoint x="9914.36" y="719.22" z="1309.88" type="0" /> + <waypoint x="9913.08" y="721.21" z="1309.88" type="0" /> + <waypoint x="9906.2" y="730.51" z="1309.94" type="0" /> + <waypoint x="9899.06" y="740.16" z="1309.87" type="0" /> + <waypoint x="9893.05" y="748.28" z="1309.76" type="0" /> + <waypoint x="9892.49" y="749.16" z="1309.78" type="0" /> + <waypoint x="9888.12" y="758.75" z="1309.83" type="0" /> + <waypoint x="9885.63" y="764.24" z="1309.81" type="0" /> + <waypoint x="9885.27" y="766.19" z="1309.83" type="0" /> + <waypoint x="9883.75" y="776.15" z="1309.88" type="0" /> + <waypoint x="9882.25" y="787.11" z="1309.88" type="0" /> + <waypoint x="9881.99" y="793.75" z="1309.88" type="0" /> + <waypoint x="9880.52" y="801.66" z="1309.88" type="0" /> +</waypoints> \ No newline at end of file Added: trunk/BabBot/BabBot/Data/Routes/9D753283EA107840.wp =================================================================== --- trunk/BabBot/BabBot/Data/Routes/9D753283EA107840.wp (rev 0) +++ trunk/BabBot/BabBot/Data/Routes/9D753283EA107840.wp 2010-01-13 01:16:40 UTC (rev 475) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<waypoints name="9D753283EA107840"> + <waypoint x="10330.11" y="823.67" z="1326.41" type="0" /> + <waypoint x="10325.31" y="819.79" z="1326.57" type="0" /> + <waypoint x="10324.37" y="818.32" z="1327.34" type="0" /> + <waypoint x="10319.8" y="810.47" z="1327.35" type="0" /> + <waypoint x="10312.34" y="802.37" z="1329.09" type="0" /> + <waypoint x="10311.33" y="800.83" z="1329.46" type="0" /> + <waypoint x="10305.47" y="791.79" z="1331.92" type="0" /> + <waypoint x="10299.55" y="782.65" z="1333.39" type="0" /> + <waypoint x="10293.56" y="773.4" z="1335.36" type="0" /> + <waypoint x="10287.7" y="764.36" z="1337.08" type="0" /> + <waypoint x="10281.77" y="755.2" z="1338.16" type="0" /> + <waypoint x="10275.86" y="746.09" z="1340.12" type="0" /> + <waypoint x="10269.64" y="736.48" z="1342.24" type="0" /> + <waypoint x="10263.62" y="727.33" z="1344.41" type="0" /> + <waypoint x="10256.16" y="719.39" z="1346.15" type="0" /> + <waypoint x="10248.72" y="711.46" z="1348.2" type="0" /> + <waypoint x="10241.32" y="703.59" z="1351.57" type="0" /> + <waypoint x="10238.66" y="700.75" z="1352.54" type="0" /> + <waypoint x="10236.71" y="700.69" z="1353.18" type="0" /> + <waypoint x="10225.92" y="700.62" z="1356.97" type="0" /> +</waypoints> \ No newline at end of file Modified: trunk/BabBot/BabBot/Manager/DataManager.cs =================================================================== --- trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Manager/DataManager.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -690,12 +690,12 @@ } } - if (q.ObjList != null) + if (q.Objectives.ObjList != null) { // Add quest objectives - for (int i = 0; i < q.ObjList.Count; i++) + for (int i = 0; i < q.Objectives.ObjList.Count; i++) { - AbstractQuestObjective qobj = q.ObjList[i]; + AbstractQuestObjective qobj = q.Objectives.ObjList[i]; int qty = 0; if (qobj.HasQty) Modified: trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Scripts/Common/NavigationState.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -211,7 +211,7 @@ float z = vnext.Z - _player.Location.Z; _player.ClickToMove(vnext); - if ((_retry == 0) && (z > 2)|| (_retry > 0)) + if ((_retry == 0) && (z > 3)|| (_retry > 0)) { // Add jump if going too high up or trying unstack Thread.Sleep(150); Modified: trunk/BabBot/BabBot/Scripts/Common/QuestExecState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/QuestExecState.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Scripts/Common/QuestExecState.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -61,7 +61,7 @@ switch (_q.State) { case QuestStates.ACCEPTED: - if ((_q.ObjList == null) || + if ((_q.Objectives.ObjList == null) || _q.Completed) { } // Go to each objective Modified: trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Scripts/Common/RouteRecordingState.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -66,6 +66,12 @@ /// <param name="player"></param> protected override void DoExecute(WowPlayer player) { + if (player.IsDead) + { + Finish(player); + return; + } + Vector3D cur_loc = player.Location; if (player.Orientation != _angle) Modified: trunk/BabBot/BabBot/Scripts/Common/TravelState.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Scripts/Common/TravelState.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -33,6 +33,12 @@ private object _dest; /// <summary> + /// Base coordinates for destination target + /// If dest has multiple coordinates see VList + /// </summary> + public Vector3D BaseCoord; + + /// <summary> /// List of coordinates if more than 1 (for NPC) /// </summary> public List<Vector3D> Vlist = null; @@ -48,6 +54,11 @@ /// </summary> AbstractCheck _check; + /// <summary> + /// List of used routes + /// </summary> + protected List<Route> UsedRoute = new List<Route>(); + public WowPlayer Player; public TravelState(GameObject obj, string lfs, string tooltip_text) @@ -112,6 +123,8 @@ if (eps == null) return; + // Only using atm based coord for game obj/quest item + if (CheckEndpoint(eps[1], r, player, cur_loc)) return; @@ -121,13 +134,25 @@ float ddist_a = eps[0].Waypoint.GetDistanceTo(cur_loc); // Calc min lenght for best route - min_route_len = Math.Min(r.Length + ddist_b, min_route_len); + float cur_len = r.Length + ddist_b; + if (cur_len < min_route_len) + { + min_route = r; + min_route_len = cur_len; + } } - if (min_route == null) + if (min_route != null) { + // Check if another route connected to given point + // This check is recursive + + } + else + { // Go with navigation state } + // set calc flag if it direct path shorter than best route // calc_route = (dist_a < min_route_len); @@ -178,6 +203,7 @@ if (r.Reversible) wp.List.Reverse(); + UsedRoute.Add(r); CallChangeStateEvent(player, new NavigationState(wp, Lfs, "Traveling to " + _dest.ToString())); } @@ -229,8 +255,8 @@ return false; // Check if obj has coordinates - Vector3D v = NpcHelper.GetGameObjCoord(_obj, Parent.Lfs); - if (v == null) + Parent.BaseCoord = NpcHelper.GetGameObjCoord(_obj, Parent.Lfs); + if (Parent.BaseCoord == null) throw new GameObjectCoordNotFound(_obj.Name); // Check for other coordinates Modified: trunk/BabBot/BabBot/Wow/GameObjectData.cs =================================================================== --- trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-12 17:34:50 UTC (rev 474) +++ trunk/BabBot/BabBot/Wow/GameObjectData.cs 2010-01-13 01:16:40 UTC (rev 475) @@ -623,7 +623,7 @@ /// List of objectives /// </summary> [XmlElement("objectives")] - public QuestObjectives ObjList; + public QuestObjectives Objectives; /// <summary> /// Index in toon quest log if quest already accepted @@ -664,6 +664,7 @@ Link = link; Level = level; BonusSpell = bonus_spell; + Objectives = new QuestObjectives(id.ToString()); XmlDocument doc = new XmlDocument(); TextObjectives = doc.CreateCDataSection(objectives); @@ -704,7 +705,7 @@ } if (!string.IsNullOrEmpty(objs)) - ObjList = new QuestObjectives(objs); + Objectives = new QuestObjectives(id.ToString(), objs); } @@ -1159,9 +1160,11 @@ #region Quest Objectives - public class QuestObjectives : CommonList<AbstractQuestObjective> + public class QuestObjectivesList : CommonList<AbstractQuestObjective> { - + /// <summary> + /// List with quest objectives + /// </summary> [XmlElement("objective")] public AbstractQuestObjective[] ObjList { @@ -1169,18 +1172,58 @@ set { Items = value; } } + public QuestObjectivesList() : base() { } + } + + public class QuestObjectives : CommonMergeListItem + { /// <summary> + /// List with quest objectives + /// </summary> + [XmlElement("obj_list")] + public QuestObjectivesList ObjList; + + /// <summary> + /// List of hotspots where objectives can be "found" + /// </summary> + [XmlElement("hot_spots")] + public WpZones Coordinates + { + get { return (WpZones)MergeList[0]; } + set { MergeList[0] = value; } + } + + /// <summary> /// Paremetless class constructor /// </summary> - public QuestObjectives() - : base() { } + public QuestObjectives() : base() + { + Init(); + } /// <summary> /// Class constructor /// </summary> + /// <param name="name">Quest Id</param> + public QuestObjectives(string id) + : base(id) + { + Init(); + } + + private void Init() + { + MergeList = new IMergeable[1]; + ObjList = new QuestObjectivesList(); + } + + /// <summary> + /// Class constructor + /// </summary> /// <param name="objs">List of objectives in format obj::obj /// where each obj is comma delited list of item, qty, is_finished</param> - public QuestObjectives(string objs) + public QuestObjectives(string id, string objs) + : this (id) { string[] obj = objs.Split(new string[] { "::" }, StringSplitOptions.None); foreach (string s in obj) @@ -1221,7 +1264,7 @@ "Unknown type of quest objectives '" + stype + "'"); } - Add(qobj); + ObjList.Add(qobj); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ta...@us...> - 2010-01-12 17:34:57
|
Revision: 474 http://babbot.svn.sourceforge.net/babbot/?rev=474&view=rev Author: tanis Date: 2010-01-12 17:34:50 +0000 (Tue, 12 Jan 2010) Log Message: ----------- - Reverted changes to scripting. It just will never work to have the scripts in a separate AppDomain as it breaks up any kind of communication with the main classes of the bot. Modified Paths: -------------- trunk/BabBot/BabBot/Scripting/Host.cs trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs trunk/BabBot/BabBot/States/State.cs trunk/BabBot/BabBot/States/StateEventArgs.cs trunk/BabBot/BabBot/States/StateMachine.cs trunk/BabBot/BabBot/Wow/WowObject.cs Property Changed: ---------------- trunk/BabBot/BabBot/Bot/Enemy.cs trunk/BabBot/BabBot/Bot/NavigationState.cs trunk/BabBot/BabBot/Bot/Spell.cs trunk/BabBot/BabBot/Wow/PlayerState.cs Property changes on: trunk/BabBot/BabBot/Bot/Enemy.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/BabBot/BabBot/Bot/NavigationState.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Property changes on: trunk/BabBot/BabBot/Bot/Spell.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Modified: trunk/BabBot/BabBot/Scripting/Host.cs =================================================================== --- trunk/BabBot/BabBot/Scripting/Host.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/Scripting/Host.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -28,37 +28,17 @@ { public class Host { - private States.State<Wow.WowPlayer> Script; - private AppDomain Domain; + private States.State<Wow.WowPlayer> script; public void Start(string iScript) { - //Script = Load("Scripts/PatTestScript.cs"); - Script = Load(iScript); - ProcessManager.Player.StateMachine.SetGlobalState(Script); + //script = Load("Scripts/PatTestScript.cs"); + script = Load(iScript); + ProcessManager.Player.StateMachine.SetGlobalState(script); } private States.State<Wow.WowPlayer> Load(string iScript) { - if (Domain != null) - { - ProcessManager.Player.StateMachine.SetGlobalState(null); - ProcessManager.Player.StateMachine.IsRunning = false; - Unload(); - } - - var ads = new AppDomainSetup - { - ApplicationBase = Path.GetDirectoryName(iScript), - PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory, - ApplicationName = Path.GetFileName(Assembly.GetExecutingAssembly().Location), - ShadowCopyFiles = "true", - ShadowCopyDirectories = Path.GetDirectoryName(iScript) - }; - - Domain = AppDomain.CreateDomain("Scripts", null, ads); - //AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); - //variable to hold output State<WowPlayer> state = null; @@ -68,10 +48,6 @@ // do not cache the scripts CSScript.CacheEnabled = false; - CSScript.Compile(Path.GetFullPath(iScript), Path.GetFullPath(iScript).Replace(".cs", ".dll"), true, null); - var asmHelper = new AsmHelper(Path.GetFullPath(iScript).Replace(".cs", ".dll"), null, true); - state = (State<WowPlayer>)asmHelper.CreateObject("BabBot.Scripts.Core"); - /* Assembly asm = CSScript.Load(Path.GetFullPath(iScript), null, true); //get all types in assembly @@ -89,18 +65,8 @@ break; } } - */ + return state; } - - private void Unload() - { - if ((Script != null) && (Domain != null)) - { - AppDomain.Unload(Domain); - Domain = null; - Script = null; - } - } } } \ No newline at end of file Modified: trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs =================================================================== --- trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -16,11 +16,8 @@ Copyright 2009 BabBot Team */ -using System; - namespace BabBot.States { - [Serializable] public class ChangeStateEventArgs<T> : StateEventArgs<T> { public ChangeStateEventArgs(T Entity, State<T> NewState, bool TrackPrevious, bool ExitPrevious) : base(Entity) Modified: trunk/BabBot/BabBot/States/State.cs =================================================================== --- trunk/BabBot/BabBot/States/State.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/States/State.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -33,7 +33,7 @@ /// Represents a generic state in the fininte state machine /// </summary> /// <typeparam name="T">T is the type of object that this state will interact with</typeparam> - public abstract class State<T> : MarshalByRefObject + public abstract class State<T> { public DateTime EnterTime { get; protected set; } public DateTime LastExecuteTime { get; protected set; } Modified: trunk/BabBot/BabBot/States/StateEventArgs.cs =================================================================== --- trunk/BabBot/BabBot/States/StateEventArgs.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/States/StateEventArgs.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -20,7 +20,6 @@ namespace BabBot.States { - [Serializable] public class StateEventArgs<T> : EventArgs { public StateEventArgs(T Entity) Modified: trunk/BabBot/BabBot/States/StateMachine.cs =================================================================== --- trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -20,7 +20,7 @@ namespace BabBot.States { - public sealed class StateMachine<T> : MarshalByRefObject + public sealed class StateMachine<T> { /// <summary>Create a new state machine for the given entity.</summary> /// <param name="Entity">The entity that this state machine belongs too</param> @@ -98,18 +98,14 @@ GlobalState.ChangeStateRequest -= CurrentState_ChangeStateRequest; } - // we start the new global state only if it's not null. othewise we probably just stopped the FSM - if (NewGlobalState != null) - { - //set new global state - GlobalState = NewGlobalState; + //set new global state + GlobalState = NewGlobalState; - //connect up to the global states change state request - GlobalState.ChangeStateRequest += CurrentState_ChangeStateRequest; + //connect up to the global states change state request + GlobalState.ChangeStateRequest += CurrentState_ChangeStateRequest; - //enter new global state - GlobalState.Enter(Entity); - } + //enter new global state + GlobalState.Enter(Entity); } /// <summary>Update states in state machine</summary> Property changes on: trunk/BabBot/BabBot/Wow/PlayerState.cs ___________________________________________________________________ Deleted: svn:mergeinfo - Modified: trunk/BabBot/BabBot/Wow/WowObject.cs =================================================================== --- trunk/BabBot/BabBot/Wow/WowObject.cs 2010-01-12 17:26:02 UTC (rev 473) +++ trunk/BabBot/BabBot/Wow/WowObject.cs 2010-01-12 17:34:50 UTC (rev 474) @@ -21,7 +21,7 @@ using BabBot.Common; namespace BabBot.Wow { - public class WowObject : MarshalByRefObject + public class WowObject { public uint ObjectPointer { get; protected set; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ta...@us...> - 2010-01-12 17:26:12
|
Revision: 473 http://babbot.svn.sourceforge.net/babbot/?rev=473&view=rev Author: tanis Date: 2010-01-12 17:26:02 +0000 (Tue, 12 Jan 2010) Log Message: ----------- - Messing up stuff :) Modified Paths: -------------- trunk/BabBot/BabBot/Scripts/Paladin/Core.cs Modified: trunk/BabBot/BabBot/Scripts/Paladin/Core.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 17:01:21 UTC (rev 472) +++ trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 17:26:02 UTC (rev 473) @@ -23,8 +23,7 @@ using BabBot.Scripts.Common; using BabBot.Wow; -// NOTE: The namespace of the main script should always be "BabBot.Scripts" and che class name "Core" -namespace BabBot.Scripts +namespace BabBot.Scripts.Paladin { public class Core : GlobalBaseBotState { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ta...@us...> - 2010-01-12 17:01:29
|
Revision: 472 http://babbot.svn.sourceforge.net/babbot/?rev=472&view=rev Author: tanis Date: 2010-01-12 17:01:21 +0000 (Tue, 12 Jan 2010) Log Message: ----------- - Added a note to the sample Core script Modified Paths: -------------- trunk/BabBot/BabBot/Scripts/Paladin/Core.cs Modified: trunk/BabBot/BabBot/Scripts/Paladin/Core.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 16:50:36 UTC (rev 471) +++ trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 17:01:21 UTC (rev 472) @@ -23,6 +23,7 @@ using BabBot.Scripts.Common; using BabBot.Wow; +// NOTE: The namespace of the main script should always be "BabBot.Scripts" and che class name "Core" namespace BabBot.Scripts { public class Core : GlobalBaseBotState This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ta...@us...> - 2010-01-12 16:50:46
|
Revision: 471 http://babbot.svn.sourceforge.net/babbot/?rev=471&view=rev Author: tanis Date: 2010-01-12 16:50:36 +0000 (Tue, 12 Jan 2010) Log Message: ----------- - Scripts can now be loaded and unloaded as many times as we want. There still is a bug that might cause the .NET remoting server to just drop the instance of the script. I do not know exactly why it happens Modified Paths: -------------- trunk/BabBot/BabBot/Scripting/Host.cs trunk/BabBot/BabBot/Scripts/Paladin/Core.cs trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs trunk/BabBot/BabBot/States/State.cs trunk/BabBot/BabBot/States/StateEventArgs.cs trunk/BabBot/BabBot/States/StateMachine.cs trunk/BabBot/BabBot/Wow/WowObject.cs Modified: trunk/BabBot/BabBot/Scripting/Host.cs =================================================================== --- trunk/BabBot/BabBot/Scripting/Host.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/Scripting/Host.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -28,17 +28,37 @@ { public class Host { - private States.State<Wow.WowPlayer> script; + private States.State<Wow.WowPlayer> Script; + private AppDomain Domain; public void Start(string iScript) { - //script = Load("Scripts/PatTestScript.cs"); - script = Load(iScript); - ProcessManager.Player.StateMachine.SetGlobalState(script); + //Script = Load("Scripts/PatTestScript.cs"); + Script = Load(iScript); + ProcessManager.Player.StateMachine.SetGlobalState(Script); } private States.State<Wow.WowPlayer> Load(string iScript) { + if (Domain != null) + { + ProcessManager.Player.StateMachine.SetGlobalState(null); + ProcessManager.Player.StateMachine.IsRunning = false; + Unload(); + } + + var ads = new AppDomainSetup + { + ApplicationBase = Path.GetDirectoryName(iScript), + PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory, + ApplicationName = Path.GetFileName(Assembly.GetExecutingAssembly().Location), + ShadowCopyFiles = "true", + ShadowCopyDirectories = Path.GetDirectoryName(iScript) + }; + + Domain = AppDomain.CreateDomain("Scripts", null, ads); + //AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + //variable to hold output State<WowPlayer> state = null; @@ -48,6 +68,10 @@ // do not cache the scripts CSScript.CacheEnabled = false; + CSScript.Compile(Path.GetFullPath(iScript), Path.GetFullPath(iScript).Replace(".cs", ".dll"), true, null); + var asmHelper = new AsmHelper(Path.GetFullPath(iScript).Replace(".cs", ".dll"), null, true); + state = (State<WowPlayer>)asmHelper.CreateObject("BabBot.Scripts.Core"); + /* Assembly asm = CSScript.Load(Path.GetFullPath(iScript), null, true); //get all types in assembly @@ -65,8 +89,18 @@ break; } } - + */ return state; } + + private void Unload() + { + if ((Script != null) && (Domain != null)) + { + AppDomain.Unload(Domain); + Domain = null; + Script = null; + } + } } } \ No newline at end of file Modified: trunk/BabBot/BabBot/Scripts/Paladin/Core.cs =================================================================== --- trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/Scripts/Paladin/Core.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -23,7 +23,7 @@ using BabBot.Scripts.Common; using BabBot.Wow; -namespace BabBot.Scripts.Paladin +namespace BabBot.Scripts { public class Core : GlobalBaseBotState { Modified: trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs =================================================================== --- trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/States/ChangeStateEventArgs.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -16,8 +16,11 @@ Copyright 2009 BabBot Team */ +using System; + namespace BabBot.States { + [Serializable] public class ChangeStateEventArgs<T> : StateEventArgs<T> { public ChangeStateEventArgs(T Entity, State<T> NewState, bool TrackPrevious, bool ExitPrevious) : base(Entity) Modified: trunk/BabBot/BabBot/States/State.cs =================================================================== --- trunk/BabBot/BabBot/States/State.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/States/State.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -33,7 +33,7 @@ /// Represents a generic state in the fininte state machine /// </summary> /// <typeparam name="T">T is the type of object that this state will interact with</typeparam> - public abstract class State<T> + public abstract class State<T> : MarshalByRefObject { public DateTime EnterTime { get; protected set; } public DateTime LastExecuteTime { get; protected set; } Modified: trunk/BabBot/BabBot/States/StateEventArgs.cs =================================================================== --- trunk/BabBot/BabBot/States/StateEventArgs.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/States/StateEventArgs.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -20,6 +20,7 @@ namespace BabBot.States { + [Serializable] public class StateEventArgs<T> : EventArgs { public StateEventArgs(T Entity) Modified: trunk/BabBot/BabBot/States/StateMachine.cs =================================================================== --- trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/States/StateMachine.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -20,7 +20,7 @@ namespace BabBot.States { - public sealed class StateMachine<T> + public sealed class StateMachine<T> : MarshalByRefObject { /// <summary>Create a new state machine for the given entity.</summary> /// <param name="Entity">The entity that this state machine belongs too</param> @@ -98,14 +98,18 @@ GlobalState.ChangeStateRequest -= CurrentState_ChangeStateRequest; } - //set new global state - GlobalState = NewGlobalState; + // we start the new global state only if it's not null. othewise we probably just stopped the FSM + if (NewGlobalState != null) + { + //set new global state + GlobalState = NewGlobalState; - //connect up to the global states change state request - GlobalState.ChangeStateRequest += CurrentState_ChangeStateRequest; + //connect up to the global states change state request + GlobalState.ChangeStateRequest += CurrentState_ChangeStateRequest; - //enter new global state - GlobalState.Enter(Entity); + //enter new global state + GlobalState.Enter(Entity); + } } /// <summary>Update states in state machine</summary> Modified: trunk/BabBot/BabBot/Wow/WowObject.cs =================================================================== --- trunk/BabBot/BabBot/Wow/WowObject.cs 2010-01-12 13:53:03 UTC (rev 470) +++ trunk/BabBot/BabBot/Wow/WowObject.cs 2010-01-12 16:50:36 UTC (rev 471) @@ -21,7 +21,7 @@ using BabBot.Common; namespace BabBot.Wow { - public class WowObject + public class WowObject : MarshalByRefObject { public uint ObjectPointer { get; protected set; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |