[Release]My source...

05/24/2010 00:09 pro4never#136
Quote:
Originally Posted by ElectricZebra View Post
How do we add mobs and guards?

#edit
item.Plus = Math.Min(Data[9], 9); is not in the source, I have searched, all I have found close to that is newItem.Plus = Math.Min((byte)9, plus);
From what little I looked into adding monsters you will need to create a new structure to hold monster info, create a database to hold that info (or use flatfile, up to you), create a new dictionary to hold that information in the source, load it into the source using a database function and then worry about the actual FUNCTION of mobs as well as the spawning (from what I understand you can use the entity spawn packet to spawn the monsters.. there was an enum I spotted in the entity code to switch between player and monster)

You will then need to write all the monster movement, attacking, being attacked and dying/removal system (including any threading you wish to do to make it more efficient) The most likely way to do that would be create a monster handler thread and have it do a monster check function every like 20 ms or something checking for local players/attacking/etc.

Again... use another source as a guide line but keep in mind that most of those sources are very poorly written.

CoEmu is a rather nice example (BASE one, not the messed up edited versions).

Same basic idea with guards but you will wanna link it to a player, deal with exp awarding and all that other good stuff.


Personally I'm working on a new companion/bot system but I may come back to this source after I get that working.
05/24/2010 00:49 BlueFlame11#137
Look just search

Code:
[B]newItem.Plus = Math.Min((byte)9, plus);[/B]
I just changed the 9 to a 12 ;O
Gonna test it now lol

#Edit
Yeah just changing it to a 12 made it work i can make +12 gears now ^^
05/24/2010 08:07 BlueFlame11#138
Quote:
Originally Posted by ElectricZebra View Post
Does anyone got mobs yet?
Well you can always go find a different source and convert there mobs to work with this source
05/24/2010 17:13 MonstersAbroad#139
Quote:
Originally Posted by ElectricZebra View Post
Does anyone got mobs yet?
'Decker' Simply add about 5 enums for it ex: Hunt Players and guards haaa xd and make a new cs IMob.cs you should know what to put it in then make a new .cs called Mob.cs and code them all in I would personally do a seprate .cs for guards but thats just me
05/26/2010 00:50 chickmagnet#140
would some1 b nice and make a guide on how 2 creat npc coz id really like 2 learn how 2 work this source:D:)
05/26/2010 01:39 Arcо#141
Take a look at the released npcs.
05/26/2010 22:18 MonstersAbroad#142
Hello
I have this code
Code:
public void DuelistTest()
        {
            Game.Entity duelist = new Game.Entity(Game.EntityFlag.Bot);
            duelist.MapObjType = Game.MapObjectType.Bot;
            this.BotOwner = Entity;
            BotOwner = Entity;
            duelist.Name = Entity.Name + "[BOT]";
            duelist.X = Entity.X += 1;
            duelist.Y = Entity.Y += 1;
            duelist.Dodge = Entity.Dodge *= 2;
            duelist.Defence = Entity.Defence *= 2;
            duelist.MapID = Entity.MapID;
            duelist.Body = Entity.Body;
            duelist.Hitpoints = Entity.MaxHitpoints;
            duelist.Level = Entity.Level;
            duelist.Stamina = 250;
            duelist.Face = Entity.Face;
            duelist.Facing = Entity.Facing;
            duelist.HairColor = Entity.HairColor;
            duelist.HairStyle = Entity.HairStyle;
            duelist.Strength = 750;
            duelist.Agility = 750;
            duelist.Spirit = 750;
            duelist.Vitality = 750;
            duelist.Spouse = "TheServer";
            duelist.MinAttack = 500;
            duelist.MaxAttack = 3000;
            duelist.BaseMinAttack = 500;
            duelist.BaseMaxAttack = 3000;
            duelist.BaseMagicDefence = 300;
            duelist.BaseMagicAttack = 5000;
            duelist.Class = Entity.Class;
            duelist.ItemBless = Entity.ItemBless;
            duelist.ItemHP = Entity.ItemHP;
            duelist.ItemMP = Entity.ItemMP;
            duelist.PKMode = Game.Enums.PKMode.PK;
            // entity.UID = 400001;
            duelist.UID = (uint)ServerBase.Kernel.Random.Next(400000, 500000);
            ServerBase.Kernel.Bots.Add(duelist.UID, this);
            duelist.SendSpawn(this);
        }
What should I be adding to that to make it ahve my equiment ?
05/26/2010 22:24 Arcо#143
I know in 5165, its GC.MyChar.Equips.RightHand.ID = WeaponID;
Just change the 'RightHand' to whatever equip placement.
Idk about impulse's source though.
05/26/2010 22:40 -impulse-#144
You should copy the spawn buffer of your entity (Entity.SpawnPacket) to your bot and then only change the name and UID(it will close the client if you do not change the UID).

duelist.SpawnPacket = new byte[Entity.SpawnPacket.Length];
Entity.SpawnPacket.CopyTo(duelist.SpawnPacket, 0);


Also, I've seen

duelist.Dodge = Entity.Dodge *= 2;
duelist.Defence = Entity.Defence *= 2;

Code:
Entity.Dodge = 5;
Entity.Defence = 10;

duelist.Dodge = Entity.Dodge *= 2;
duelist.Defence = Entity.Defence *= 2;
Beat me if Entity.Dodge won't be 10 and Entity.Defence won't be 20
05/26/2010 22:43 MonstersAbroad#145
Quote:
Originally Posted by -impulse- View Post
You should copy the spawn buffer of your entity (Entity.SpawnPacket) to your bot and then only change the name and UID(it will close the client if you do not change the UID).

duelist.SpawnPacket = new byte[Entity.SpawnPacket.Length];
Entity.SpawnPacket.CopyTo(duelist.SpawnPacket, 0);


Also, I've seen

duelist.Dodge = Entity.Dodge *= 2;
duelist.Defence = Entity.Defence *= 2;

Code:
Entity.Dodge = 5;
Entity.Defence = 10;

duelist.Dodge = Entity.Dodge *= 2;
duelist.Defence = Entity.Defence *= 2;
Beat me if Entity.Dodge won't be 10 and Entity.Defence won't be 20
Thanks but whats wrong with dodge and defence being 10 and 20 ?
05/27/2010 08:04 -impulse-#146
Next time you do that the Entity.Dodge will 20 and Entity.Defence will 40

*You modify Entity.Dodge and Entity.Defence that's the problem.
05/27/2010 08:35 pro4never#147
@bot equipment. Simple way is to loop through the client eq and add it to bot eq.

So something like (coemu'ish example)

Foreach(keyvaluepair<int, iteminfo> item in client.equipment)
bot.equipment.add(item.id, item)

Not a perfect example but do that before spawning and it should work properly to clone your items onto the bot (redo item uid though or it may cause a problem)
05/27/2010 09:46 -impulse-#148
Quote:
Originally Posted by pro4never View Post
@bot equipment. Simple way is to loop through the client eq and add it to bot eq.

So something like (coemu'ish example)

Foreach(keyvaluepair<int, iteminfo> item in client.equipment)
bot.equipment.add(item.id, item)

Not a perfect example but do that before spawning and it should work properly to clone your items onto the bot (redo item uid though or it may cause a problem)
The gear that gets spawned on the entity is part of the entity spawn packet, as I said, just copy the entity.spawnpacket into bot.spawnpacket and you have all stats there(except attack, def, etc), but mainly you have like a copy of your entity. Change it's uid and send and a minion looking just like you should appear without headaches.
05/27/2010 18:15 -impulse-#149
public void DuelistTest()
{
Game.Entity duelist = new Game.Entity(Game.EntityFlag.Bot);
duelist.MapObjType = Game.MapObjectType.Bot;
this.BotOwner = Entity.Owner;
duelist.UID = (uint)ServerBase.Kernel.Random.Next(4000000, 5000000);
lock(ServerBase.Kernel.Bots)
ServerBase.Kernel.Bots.Add(duelist.UID, this);
duelist.Name = Entity.Name + "[BOT]";
duelist.Body = Entity.Body;
for(int counter = 12; counter < 130; counter++)
duelist.SpawnPacket[counter] = Entity.SpawnPacket[counter];
duelist.X = Entity.X += 1;
duelist.Y = Entity.Y += 1;
duelist.SendSpawn(this);
}
05/27/2010 18:26 MonstersAbroad#150
Again it spawns but no equips :(