1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not A Bug XMLSpawner2 Issue

Discussion in 'Archived Bug Reports' started by cmileto, Dec 10, 2013.

  1. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    I cannot seem to use the LOOTPACK attachment in any spawners, when i try i get :

    Unable to add LOOTPACK

    Looking into it more I feel that if one is to implement tass23's changes from here http://www.servuo.com/threads/loot-and-lootpack-cs-for-sa.219/ that will fix the lootpack attachment for xmlspawner2.

    See this area of basexmlspawner.cs is where the lootpack is handled.
    Code (C#):
    1.  case itemKeyword.LOOTPACK:
    2.                                 {
    3.                                     // syntax is LOOTPACK,type
    4.                                     if (itemkeywordargs.Length == 2)
    5.                                     {
    6.                                         LootPack lootpack = null;
    7.                                         string loottype = itemkeywordargs[1];
    8.  
    9.  
    10.  
    11.  
    12.                                         if (loottype.ToLower() == "poor")
    13.                                         {
    14.                                             lootpack = LootPack.Poor;
    15.                                         }
    16.                                         else if (loottype.ToLower() == "meager")
    17.                                         {
    18.                                             lootpack = LootPack.Meager;
    19.                                         }
    20.                                         else if (loottype.ToLower() == "average")
    21.                                         {
    22.                                             lootpack = LootPack.Average;
    23.                                         }
    24.                                         else if (loottype.ToLower() == "rich")
    25.                                         {
    26.                                             lootpack = LootPack.Rich;
    27.                                         }
    28.                                         else if (loottype.ToLower() == "filthyrich")
    29.                                         {
    30.                                             lootpack = LootPack.FilthyRich;
    31.                                         }
    32.                                         else if (loottype.ToLower() == "ultrarich")
    33.                                         {
    34.                                             lootpack = LootPack.UltraRich;
    35.                                         }
    36.                                         else if (loottype.ToLower() == "superboss")
    37.                                         {
    38.                                             lootpack = LootPack.SuperBoss;
    39.                                         }
    40.                                         else
    41.                                         {
    42.                                             status_str = "Invalid LOOTPACK type: " + loottype;
    43.                                             return false;
    44.                                         }
    45.  
    46.  
    47.  
    48.  
    49.                                         int m_KillersLuck = 0;
    50.                                         if (trigmob != null)
    51.                                         {
    52.                                             m_KillersLuck = LootPack.GetLuckChanceForKiller(trigmob);
    53.                                         }
    54.  
    55.  
    56.  
    57.  
    58.                                         bool converterror = false;
    59.                                         try
    60.                                         {
    61.                                             // generate the nospawn component of the lootpack
    62.                                             lootpack.Generate(m, pack, false, m_KillersLuck);
    63.  
    64.  
    65.  
    66.  
    67.                                             // generate the spawn component (basically gold) requires a mobile and wont work in containers
    68.                                             // because Generate does a test for TryDropItem for stackables which requires a valid mob argument,
    69.                                             // any stackable generated in a container will fail
    70.                                             // so just test for a valid mobile and only do the atspawn generate for them.
    71.                                             if (m != null)
    72.                                                 lootpack.Generate(m, pack, true, m_KillersLuck);
    73.                                         }
    74.                                         catch
    75.                                         {
    76.                                             status_str = "Unable to add LOOTPACK";
    77.                                             converterror = true;
    78.                                         }
    79.  
    80.  
    81.  
    82.  
    83.                                         if (converterror)
    84.                                             return false;
    85.                                     }
    86.                                     else
    87.                                     {
    88.                                         status_str = "LOOTPACK takes 1 arg : " + itemtypestr;
    89.                                         return false;
    90.                                     }
    91.                                     break;
    92.                                 }
    93.                         }
    94.                     }
    And also see in lootpack.cs the lack of lootpack definitions for the currentexpansion being used which is what is confusing xmlspawner I beleive.

    Code (C#):
    1.  #region Generic accessors
    2. public static LootPack Poor { get { return Core.SE ? SePoor : Core.AOS ? AosPoor : OldPoor; } }
    3. public static LootPack Meager { get { return Core.SE ? SeMeager : Core.AOS ? AosMeager : OldMeager; } }
    4. public static LootPack Average { get { return Core.SE ? SeAverage : Core.AOS ? AosAverage : OldAverage; } }
    5. public static LootPack Rich { get { return Core.SE ? SeRich : Core.AOS ? AosRich : OldRich; } }
    6. public static LootPack FilthyRich { get { return Core.SE ? SeFilthyRich : Core.AOS ? AosFilthyRich : OldFilthyRich; } }
    7. public static LootPack UltraRich { get { return Core.SE ? SeUltraRich : Core.AOS ? AosUltraRich : OldUltraRich; } }
    8. public static LootPack SuperBoss { get { return Core.SE ? SeSuperBoss : Core.AOS ? AosSuperBoss : OldSuperBoss; } }
    9. #endregion

    Has anyone else already done this or delt with this issue? Im about to implement tass's lootpack changes and i will report back.

    p.s. would an easy peasy solution to just restore the lootpack attachment be to remove the Old lootpack references from the above spots?
     
  2. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    Nevermind I cannot seem to find the place to do the very first edit listed. :( Now I do not know what to do in order to fix this. Anyone else have an idea or can test this to see if its just an issue on us?

    [add xmlspawner woodenchest/ADD/Lootpack,superboss/ see if it works for you. ty
     
  3. jase giffin
    Offline

    jase giffin Active Member

    Joined:
    Sep 14, 2013
    Messages:
    253
    Likes Received:
    73
    The comma? In place of / or is it supposed to be drfined like that
     
  4. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,634
    Likes Received:
    397
    Have you checked out the XML Spawner Tutorial?
    In this he has lootpack as LOOTPACK- now I'm not sure if this was just put as this to stand out or if it should be used as the way shown. Just a thought :)
     
  5. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    Ty for the input but I am indeed using the caps when entering it on the spwner in game. I actually tried it both ways but both provide the same error msg(in game), as does trying to use any lootpack in the spawner
     
  6. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    I just setup a totally stock un modified servuo publish 54 and using LOOTPACK in any xlmspawner for it doesnt work, gives the same in game msg that Unable to add LOOTPACK.
    This breaks most custom quest functionality with xmlspawner. While i am unsure how to fix I am still examining and trying to find solution.
     
  7. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    You might let fwiffo on runuo know about it, he is still actively developing the system.
     
  8. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    I posted in his xmlspawner thread there. tyvm Ravenwolfe. If I hear anything Ill post it here as well.
     
  9. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    He recently made an update which is not in servuo yet. I updated my server and the only problem i noticed is that it did not have termur in it. I fix that already and when im done travelling, i can post it. Not sure if it fixes your issue however.
     
  10. cmileto
    Online

    cmileto Member

    Joined:
    Nov 18, 2013
    Messages:
    177
    Likes Received:
    9
    I just found our error and fixed it. Was related to a script we added that my oldest son had modifed, was not SERVUO or XMLSPAWNER bug, This topic can be deleted please, my apologies.
     
Similar Threads: XMLSpawner2 Issue
Forum Title Date
Script Support xmlspawner2 install error Nov 19, 2016
Script Support xmlspawner2 question Mar 4, 2015
General Discussion Pre-AOS & XMLSpawner2 Feb 6, 2015
Support XMLSPAWNER2 install error Jan 2, 2015
Bug Reports New Covetous - Some other issues. Dec 4, 2017
Script Support OnDragLift issue Nov 23, 2017
Bug Reports One issue so far with spawn conversion Nov 21, 2017