MMOEmpire Custom Items

Posts 1–15 of 73 · Page 1 of 5
MMOEmpire Custom Items
For this tutorial you will need:
-Visual C# 2010 Express
-MMOEmpire server v2, uploaded and edited by Drowlys.
-A brain



Let's begin.

0. Make sure the server is completely OFF.

1. Open up the solution in Visual C# by selecting the project file in the private server folder.

2. Navigate to db/data/additions.xml. Also open up dat20.xml.

3. Copy an object (item) from dat20.xml into additions.xml. Edit the stats, etc. This part should be pretty straight forward. You can also look at some other items and add in special abilities, etc.

4. Google "(decimal) to hex", replacing (decimal) with a number ID you think will be unique (start with about 5500 and go up). When you get the hex ID, search for it in both addtions.xml and dat20.xml. If there are no results, it is unique and you can use it. Put the hex code where it says "type=" at the top of the object.

5. Make sure you remember what the name of your item is so you can spawn it. The name is where it says "ID=" at the top of the object.

Here's an example of an object:
Code:
  <Object type="0x15B5" id="Sword of Owlupus">
    <Class>Equipment</Class>
    <Item/>
    <Texture>
      <File>lofiObj5</File>
      <Index>0x3b</Index>
    </Texture>
    <SlotType>1</SlotType>
    <Tier>18</Tier>
    <Description>A sword crafted from the bones of Owlupus.</Description>
    <RateOfFire>2</RateOfFire>
    <Sound>weapon/mithril_sword</Sound>
    <Projectile>
      <ObjectId>Blue Bolt</ObjectId>
      <Speed>150</Speed>
      <MinDamage>500</MinDamage>
      <MaxDamage>750</MaxDamage>
      <LifetimeMS>600</LifetimeMS>
    </Projectile>
    <BagType>4</BagType>
    <FameBonus>20</FameBonus>
    <OldSound>bladeSwing</OldSound>
  </Object>
The item will have the following stats:

Code:
Type: Sword
Tier: 18
Name: Sword of Owlupus
ID: 5557
Damage: 500-750
Description: A sword crafted from the bones of Owlupus.
Rate of Fire: 200%
Fame Bonus: 20%
Lifetime of projectiles: 600 ms
Speed of projectiles: 150
Dropped in a white bag
Skysplitter sword texture
Blue bolt projectile texture
6. Save all.

7. Right click on db and rebuild.

8. Right click on wServer and rebuild.

9. Start up the server and join it. Spawn your item and have fun!

Optional: Add your item to a monster's drop tables!

1. Navigate to wServer/logic/db

2. Choose a monster to add your drop to (ex. "BehaviorDb.CubeGod" for Cube God). Lesser monsters are classified by region (ex. "BehaviorDb.Highlands" for monsters in the highlands), and miscellaneous in misc, etc.

3. Find the part where it sets the loot drops. For the Cube God it looks like this:
Code:
loot: new LootBehavior(LootDef.Empty,
Tuple.Create(100, new LootDef(0, 5, 0, 8,
       Tuple.Create(0.05, (ILoot)new ItemLoot("Dirk of Cronus")), //5% de chance de loot Cronus
       Tuple.Create(0.05, (ILoot)new ItemLoot("Amulet of Resurrection")), //5% de chance de loot Ammy

       Tuple.Create(0.05, (ILoot)new TierLoot(11, ItemType.Weapon)),
       Tuple.Create(0.05, (ILoot)new TierLoot(12, ItemType.Armor)),
       Tuple.Create(0.05, (ILoot)new TierLoot(5, ItemType.Ring)),

       Tuple.Create(1.0, (ILoot)new StatPotionsLoot(1, 2))
4. Copy one of the Tuple.Create lines, preferably one that has the name of the item in quotes, but it is not necessary.

5. If it says "TierLoot" before parenthesis, change it to "ItemLoot". Then add the name of your item into the parenthesis, with quotes. For example:
Code:
Tuple.Create(0.05, (ILoot)new ItemLoot("Sword of Owlupus")),
6. Edit the decimal number for the drop chance. It is a percentage. In my example, there is a 5% chance of a Cube God to drop a "Sword of Owlupus". For first test use 1.00 so it is a 100% chance your item will drop.

6 1/2. Remember to add the comma at the end of line, unless it is the last loot drop line! Notice how the stat potion loot line does not have the comma.

7. Save.

8. Rebuild wServer like before.

9. Run server and test it by killing the monster.

Have fun!
Whenever I try this, when I go to open the wserver.exe, it instantly crashes, and ruins my wserver, so i gotta replace the entire wserver folder from the original download for it to work.
What am I doing wrong? I'm recompiling wserver and db whilst in Visual studio.
Quote Originally Posted by muriwo View Post
Whenever I try this, when I go to open the wserver.exe, it instantly crashes, and ruins my wserver, so i gotta replace the entire wserver folder from the original download for it to work.
What am I doing wrong? I'm recompiling wserver and db whilst in Visual studio.
Make sure your syntax is correct and you are putting everything in correctly. Also I'm using Visual C#, not visual studio. Another cause might be that you are recompiling not rebuilding. My guess is that there is a syntax error somewhere in your object or additions.xml that is causing it. The end of mine looks like this:
Code:
  <Object type="0x15B5" id="Sword of Owlupus">
    <Class>Equipment</Class>
    <Item/>
    <Texture>
      <File>lofiObj5</File>
      <Index>0x3b</Index>
    </Texture>
    <SlotType>1</SlotType>
    <Tier>18</Tier>
    <Description>A sword crafted from the bones of Owlupus.</Description>
    <RateOfFire>2</RateOfFire>
    <Sound>weapon/mithril_sword</Sound>
    <Projectile>
      <ObjectId>Blue Bolt</ObjectId>
      <Speed>100</Speed>
      <MinDamage>500</MinDamage>
      <MaxDamage>750</MaxDamage>
      <LifetimeMS>350</LifetimeMS>
    </Projectile>
    <BagType>4</BagType>
    <FameBonus>20</FameBonus>
    <OldSound>bladeSwing</OldSound>
  </Object>
</Addition>
Quote Originally Posted by Owlupus View Post
Make sure your syntax is correct and you are putting everything in correctly. Also I'm using Visual C#, not visual studio. Another cause might be that you are recompiling not rebuilding. My guess is that there is a syntax error somewhere in your object or additions.xml that is causing it. The end of mine looks like this:
Code:
  <Object type="0x15B5" id="Sword of Owlupus">
    <Class>Equipment</Class>
    <Item/>
    <Texture>
      <File>lofiObj5</File>
      <Index>0x3b</Index>
    </Texture>
    <SlotType>1</SlotType>
    <Tier>18</Tier>
    <Description>A sword crafted from the bones of Owlupus.</Description>
    <RateOfFire>2</RateOfFire>
    <Sound>weapon/mithril_sword</Sound>
    <Projectile>
      <ObjectId>Blue Bolt</ObjectId>
      <Speed>100</Speed>
      <MinDamage>500</MinDamage>
      <MaxDamage>750</MaxDamage>
      <LifetimeMS>350</LifetimeMS>
    </Projectile>
    <BagType>4</BagType>
    <FameBonus>20</FameBonus>
    <OldSound>bladeSwing</OldSound>
  </Object>
</Addition>
I'm using Visual C# also and I am rebuilding, just been use to talking about rabcdasm so I accidently put recompiling. :S
This is how mine looks:
<Object type="0x539" id="Dirk of Death">
<Class>Equipment</Class>
<Item/>
<Texture>
<File>lofiObj2</File>
<Index>0x54</Index>
</Texture>
<SlotType>2</SlotType>
<Description>This dagger was found forged, melted, and created all by Satan himself.</Description>
<RateOfFire>1</RateOfFire>
<Sound>weapon/fire_dagger</Sound>
<Projectile>
<ObjectId>Rainbow Magic</ObjectId>
<Speed>200</Speed>
<MinDamage>250</MinDamage>
<MaxDamage>500</MaxDamage>
<LifetimeMS>420</LifetimeMS>
</Projectile>
<ActivateOnEquip stat="27" amount="5">IncrementStat</ActivateOnEquip>
<BagType>4</BagType>
<FameBonus>6</FameBonus>
<OldSound>daggerSwing</OldSound>
</Object>
Quote Originally Posted by muriwo View Post
I'm using Visual C# also and I am rebuilding, just been use to talking about rabcdasm so I accidently put recompiling. :S
This is how mine looks:
Do you have </Addition> below that?
You may have added in this code below what marks the end of the xml.
Other than that, it looks like it should work. You might have edited something before in the source and whenever you recompile wServer it adds the modifications back, but I really don't know.
P.S. Use code instead of quote next time
Crashes for me too..

EDIT: I made a ring, maybe rings are supposed to be there, I searched for ring but didn't find anything.
Nice I'm working on a Item Creator actually, U will can select the type of item, Max damage, Number of Projectiles, Etc... And u will got a generate xml to insert in addition.xml
By 'Copy Objects' do you mean Copy everything in the d20 and insert it into the addition file?
Quote Originally Posted by muriwo View Post
By 'Copy Objects' do you mean Copy everything in the d20 and insert it into the addition file?
No, Objects are where it says <Object> in the beginnning and </Object> at the end. You need to add them AFTER the last </Object> but BEFORE the </Additions> at the end.

EDIT: I added your code into my addtions.xml, it works fine.


Quote Originally Posted by tedde123 View Post
Crashes for me too..

EDIT: I made a ring, maybe rings are supposed to be there, I searched for ring but didn't find anything.
Ring works fine for me.
Thanks for the tutorial, I never thought of rebuilding db too.
Awesome! I'm going to test this as soon as I can!
What that size thing does?
Quote Originally Posted by CrazyJani View Post
What that size thing does?
I don't think it does anything. I was trying to get maximum HP.
Quote Originally Posted by MillSup View Post
THANKS FOR THIS!

Holy shit
thats awesome
Posts 1–15 of 73 · Page 1 of 5
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us