Register for your free account! | Forgot your password?

You last visited: Today at 17:27

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



summon monster

Discussion on summon monster within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2009
Posts: 113
Received Thanks: 0
summon monster

Hello all i would like to make this command spawn monster to me


case "summon":
{
var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
varr.MoveNext();
int COunt = ServerBase.Kernel.GamePool.Count;
for (uint x = 0;
x < COunt;
x++)
{
if (x >= COunt) break;

Client.GameState pClient = (varr.Current as Client.GameState);

if (pClient.Entity.Name.ToLower().Contains(Data[1]))
{
pClient.Entity.Teleport(client.Entity.MapID, client.Entity.X, client.Entity.Y);
}

varr.MoveNext();
}
break;
yosif is offline  
Old 01/24/2013, 20:05   #2
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
for what i've understand so far is that you want a command to summon monster ?
Code:
                            #region summon
                            case "summon":
                                {
                                    //bookmark3
                                RESPAWN:
                                    Database.MonsterInformation monster = Database.MonsterInformation.MonsterInfos[Convert.ToUInt32(Data[1])];
                                    Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                                    entity.MapObjType = Game.MapObjectType.Monster;
                                    entity.MonsterInfo = monster;
                                    entity.MonsterInfo.Owner = entity;
                                    entity.Name = monster.Name;
                                    entity.MinAttack = monster.MinAttack;
                                    entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                                    entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                                    entity.Body = monster.Mesh;
                                    entity.Level = monster.Level;
                                    entity.Defence = 100;
                                    entity.X = client.Entity.X;
                                    entity.Y = client.Entity.Y;
                                    entity.UID = (uint)ServerBase.Kernel.Random.Next(500000, 500050);
                                    entity.MapID = client.Entity.MapID;
                                    entity.SendUpdates = true;
                                    client.Map.RemoveEntity(entity);
                                    client.Map.AddEntity(entity);
                                    if (!client.Map.Entities.ContainsKey((uint)(entity.UID)))
                                    {
                                        Conquer_Online_Server.Console.WriteLine("couldn't summon monster , retrying");
                                        goto RESPAWN;
                                    }
                                    break;
                                }
                                #endregion
i'm using another way but that should work just fine
go for it is offline  
Thanks
1 User
Old 01/24/2013, 20:14   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
There's probably a much better way to modularize your code (such as creating an overload for the Monster/Entity constructor to let you generate a monster based on ID/Map/X/Y).

Also worth noting that goto statements should be avoided and are considered poor programming practice. You'd be better off doing something like..


while(client.Map.Entities.ContainsKey((uint)(entit y.UID)))
entity.UID = (uint)ServerBase.Kernel.Random.Next(400000, 500000);

Still... much MUCH better ways to write this all.
pro4never is offline  
Thanks
1 User
Old 01/24/2013, 20:22   #4
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by pro4never View Post
There's probably a much better way to modularize your code (such as creating an overload for the Monster/Entity constructor to let you generate a monster based on ID/Map/X/Y).

Also worth noting that goto statements should be avoided and are considered poor programming practice. You'd be better off doing something like..


while(client.Map.Entities.ContainsKey((uint)(entit y.UID)))
entity.UID = (uint)ServerBase.Kernel.Random.Next(400000, 500000);

Still... much MUCH better ways to write this all.
i've done this ages ago with 2 overrides
one of them with client instance and one without
Code:
                            #region summonat
                            case "summonat":
                                {
                                //bookmark3
                                RESPAWN:
                                    Database.MonsterInformation monster = Database.MonsterInformation.MonsterInfos[Convert.ToUInt32(Data[1])];
                                    Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                                    entity.MapObjType = Game.MapObjectType.Monster;
                                    entity.MonsterInfo = monster;
                                    entity.MonsterInfo.Owner = entity;
                                    entity.Name = monster.Name;
                                    entity.MinAttack = monster.MinAttack;
                                    entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                                    entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                                    entity.Body = monster.Mesh;
                                    entity.Level = monster.Level;
                                    entity.Defence = 100;
                                    entity.X = Convert.ToUInt16(Data[3]);
                                    entity.Y = Convert.ToUInt16(Data[4]);
                                    entity.UID = (uint)ServerBase.Kernel.Random.Next(500000, 500050);
                                    entity.MapID = Convert.ToUInt16(Data[2]);
                                    entity.SendUpdates = true;
                                    client.Map.RemoveEntity(entity);
                                    client.Map.AddEntity(entity);
                                    if (!client.Map.Entities.ContainsKey((uint)(entity.UID)))
                                    {
                                        Conquer_Online_Server.Console.WriteLine("couldn't summon monster , retrying");
                                        goto RESPAWN;
                                    }
                                    break;
                                }
                            #endregion
but im no longer using that but thanks for the notifying about goto now im using method with instance of monster information parameter and summoning it which is way better , btw this method sometimes fail to summon monsters which to why i no longer use it
thanks pro ^^
go for it is offline  
Old 01/25/2013, 05:44   #5
 
elite*gold: 0
Join Date: Sep 2009
Posts: 103
Received Thanks: 0
so when i use this i shuold write : "sumon birdman ? or "summon (monster id ) ?
mmno is offline  
Old 01/25/2013, 06:40   #6
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
you should use summon ID
go for it is offline  
Old 01/25/2013, 06:46   #7
 
elite*gold: 0
Join Date: Jan 2013
Posts: 5
Received Thanks: 0
indredible!
serrato is offline  
Old 01/26/2013, 06:11   #8
 
elite*gold: 0
Join Date: Jul 2009
Posts: 113
Received Thanks: 0
not work any one of them thanks i hope some one fix it
yosif is offline  
Reply


Similar Threads Similar Threads
Monster Hunter tri zocker gesucht lvl 40+ high rank monster
10/13/2011 - Consoles - 5 Replies
Ich suche wie der titel schon sagt einen oder eine monster hunter zocker oder zockerin ^^ ich muss dringend ein paar high rank monster machen in tundra wie gigginox und andere Ich bitte nur um ein paar matches wo ich steine abbauen kann und anschliessend das monster töten kann
Nansru\Devil spirit and Monster Summon
10/07/2011 - SRO Private Server - 0 Replies
i how to spawn devil spirit with gm command? know F3 bllabla 0 and enter spawn okk i pick up and freeze wtf?..why?....and i drop monster summon scroll and pick up ok...but no monster :-\
Monster.ini file - Boss Monster time and location
12/16/2008 - Zero - 2 Replies
does any1 have the monster.ini file that tell you wen the boss monster appears and where it appears cause i think they mightve patched over the other 1. if any1 can find a way to get it to work again id be grateful. if u think u can help i can send u the other monster.ini file that used to work. Or if this isnt possible does any1 have spawn times for the bosses in neptune/green planet? Either of those would be helpful Thanks in advance
No CP summon/ranged and longbow summon hack
07/15/2008 - General Gaming Discussion - 11 Replies
- no cp and nak (2 in 1): combine No CP summon and longbow summon hack - no ranged: like b4



All times are GMT +1. The time now is 17:27.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.