|
You last visited: Today at 13:43
Advertisement
[Release] Spawn mob via NPC
Discussion on [Release] Spawn mob via NPC within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
11/03/2011, 11:06
|
#1
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
[Release] Spawn mob via NPC
Hi guys, i've searched and searched for a way to spawn a mob from a NPC and couldent find anything on any of the forums, i finaly figured it out after much trial and error, and now im going to release it to make it easier for other people learning to code, this was designed for 5165, NewestCoServer, mabey there are better ways to code it but i dont give a shit this is my way so if you dont like it you can (....) yeh lol
This was made for the 2nd reborn quest, but mine is custom made.
Step: 1 Go to NPCDialog and add this.
Code:
#region EARTHSEAL
case 3005:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Would you like to summon the HillSpirit"));
GC.AddSend(Packets.NPCLink("Yes Please.", 1));
GC.AddSend(Packets.NPCLink("No i dont have the items.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(722723, 1) && GC.MyChar.InventoryContains(722724, 1) && GC.MyChar.InventoryContains(722725, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722723));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722724));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722725));
{
[COLOR="Red"] string[] FMobs = File.ReadAllLines(@"D:\OldCODB\SpecialMap\MapMobInfo1.txt");
Hashtable Mobs = new Hashtable(FMobs.Length);
for (int i = 0; i < FMobs.Length; i++)
{
if (FMobs[i][0] != '*')
{
Game.Mob M = new NewestCOServer.Game.Mob(FMobs[i]);
Mobs.Add(M.MobID, M);
}
}
string[] FSpawns = File.ReadAllLines(@"D:\OldCODB\SpecialMap\MapSpawn1.txt");
foreach (string Spawn in FSpawns)
{
if (Spawn[0] == '*') return;
string[] SpawnInfo = Spawn.Split(' ');
int MobID = int.Parse(SpawnInfo[0]);
int Count = int.Parse(SpawnInfo[1]);
ushort Map = ushort.Parse(SpawnInfo[2]);
ushort XFrom = ushort.Parse(SpawnInfo[3]);
ushort YFrom = ushort.Parse(SpawnInfo[4]);
ushort XTo = ushort.Parse(SpawnInfo[5]);
ushort YTo = ushort.Parse(SpawnInfo[6]);
if (!Game.World.H_Mobs.Contains(Map))
Game.World.H_Mobs.Add(Map, new Hashtable());
Hashtable MapMobs = (Hashtable)Game.World.H_Mobs[Map];
DMap D = (DMap)DMaps.H_DMaps[Map];
for (int i = 0; i < Count; i++)
{
Game.Mob _Mob = new NewestCOServer.Game.Mob((Game.Mob)Mobs[MobID]);
_Mob.Loc = new NewestCOServer.Game.Location();
_Mob.Loc.Map = Map;
_Mob.Loc.X = (ushort)Program.Rnd.Next(Math.Min(XFrom, XTo), Math.Max(XFrom, XTo));
_Mob.Loc.Y = (ushort)Program.Rnd.Next(Math.Min(YFrom, YTo), Math.Max(YFrom, YTo));
_Mob.StartLoc = _Mob.Loc;
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
MapMobs.Add(_Mob.EntityID, _Mob);[/COLOR] }
}
}
}
else
{
GC.AddSend(Packets.NPCSay("Sorry you dont have Moss, DreamGrass and SoulAroma"));
GC.AddSend(Packets.NPCLink("I will get them.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
Step: 2 Go to OldCODB and make a folder called SpecialMap
Step: 3 Create 2 new txt documents 1 called MapMobInfo1 and another called MapSpawn1
Step: 4 Open MapMobInfo1 and add this:
Code:
220 HillSpirit 1 153 50 10000 500 85 0 250 750 10 100 2 True 6 10000 50000 1500 90000 True
Step: 5 Open MapSpawn1 and add this:
Code:
220 1 1700 442 886 435 886
And for the NPC go to OldCODB/NPCs.txt and add this:
Code:
3005 2210 2 0 1700 444 878
F5 Debug
, You need Moss, DreamGrass, and SoulAroma to summon the hill spirit.
Press thanks if i helped.
|
|
|
11/03/2011, 12:11
|
#2
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
I would suggest you strip down the code a bit, but good job.
|
|
|
11/03/2011, 13:27
|
#3
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
|
Umm... unless I'm completely misreading this you're PERMANENTLY adding the spawn to your server respawns database (flatfile but point remains)
You're reading all the spawns in from @"D:\OldCODB\SpecialMap\MapMobInfo1.txt" and adding the new entry..
Why bother adding to db at all?
Just generate monsters to be added and add them to the active monsters collection (spawns them, they have ai but they have no sort of respawn at all!)
|
|
|
11/03/2011, 14:31
|
#4
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
Cuz were not all geeks like you lol
i did inbox you, for help and u did agreed but never got back to me.
Newest co threading is **** so cpu gets high u need atleast 1 maintain a day, cheak the timer on the respawn.
and to be fair pro4never, there aint anything like this released anywere i searched for hours, so atleast im giving people something to work with.
|
|
|
11/03/2011, 14:43
|
#5
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
|
Quote:
Originally Posted by sonofskeletor
Cuz were not all geeks like you lol
i did inbox you, for help and u did agreed but never got back to me.
Newest co threading is **** so cpu gets high u need atleast 1 maintain a day, cheak the timer on the respawn.
and to be fair pro4never, there aint anything like this released anywere i searched for hours, so atleast im giving people something to work with.
|
I could be wrong but I seem to remember monster spawn methods being released like 100 times... I know I released some AGES ago for coemu and I've seen at least a few threads on the subject for 5165 lotf.
Not saying this is useless I'm just providing advice.
I never answer pm's unless they contain something worth answering tbh. If it's a general question that could be answered by other form members then it belongs in the form, not my inbox so it just gets deleted.
<edit>
I did a quick search and I KNOW there's others.
You should be able to just generate the monster info and then add to MapMobs apparently. That might help you refine your code some.
|
|
|
11/03/2011, 14:49
|
#6
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
Arco has just upgraded my source to 5180 and added all the arena and **** come and test pro4never ill show you my cool command to its so sexy!
Code:
if (Cmd[0] == "/crash")
{
Game.Character C = World.CharacterFromName2(Cmd[1]);
if (C != null)
{
for (byte b = 0; b < 255; b++)
C.MyClient.LocalMessage(2105, "http://www.Red tube.com/79734");
Game.World.SendMsgToAll(" ", C.Name + " Has been crashed by " + GC.MyChar.Name + "[GM] hahahahaha ************!.", 2011, 0);
}
}
Rofl sorry i had to giggle.
oh and on topic, i had a look at how the demonboxes for 5165 work and i had a play around with it and it was bullshit, so i just did it my own way, i aint seen NO mob spawns from NPC released tho.
Code:
Mob Demon = new Mob("100 Demon 6 731 250 50000 2500 70 10000 0 0 100 70 21 8036 0 False 18 100000 500000 500 3 False");
Demon.EntityID = 450;
Hashtable MapMobs = (Hashtable)Game.World.H_Mobs[Loc.Map];
DMap D = (DMap)DMaps.H_DMaps[Loc.Map];
Game.Mob _Mob = new NewestCOServer.Game.Mob(Demon);
_Mob.Loc = new NewestCOServer.Game.Location();
_Mob.Loc.Map = Loc.Map;
_Mob.Loc.X = Loc.X;
_Mob.Loc.Y = Loc.Y;
Couldent get this **** to work, i tryed and tryed.
|
|
|
11/03/2011, 17:40
|
#7
|
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
|
The crash command made me lol, because you can just start shutdown.exe from the client.
|
|
|
11/05/2011, 02:11
|
#8
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
How tell me how to load it from the explorer o.O
If fun knowing if that person dont disconnect, there trying to fight the internet pages rofl
|
|
|
11/08/2011, 00:22
|
#9
|
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
|
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Would you like to summon the HillSpirit"));
GC.AddSend(Packets.NPCLink("Yes Please.", 1));
GC.AddSend(Packets.NPCLink("No i dont have the items.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(722723, 1) && GC.MyChar.InventoryContains(722724, 1) && GC.MyChar.InventoryContains(722725, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722723));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722724));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722725));
Mob Demon = new Mob("100 Demon 6 731 250 50000 2500 70 10000 0 0 100 70 21 8036 0 False 18 100000 500000 500 3 False");
Demon.EntityID = 450;
Hashtable MapMobs = (Hashtable)Game.World.H_Mobs[Loc.Map];
DMap D = (DMap)DMaps.H_DMaps[Loc.Map];
Game.Mob _Mob = new NewestCOServer.Game.Mob(Demon);
_Mob.Loc = new NewestCOServer.Game.Location();
_Mob.Loc.Map = 1002;
_Mob.Loc.X = 350;
_Mob.Loc.Y = 350;
_Mob.StartLoc = _Mob.Loc;
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
while (Game.World.H_Chars.Contains(_Mob.EntityID) || MapMobs.Contains(_Mob.EntityID))
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
MapMobs.Add(_Mob.EntityID, _Mob);
}
}
maybe can work(i doubt it, i never get something working without test  xD), but maybe you can do this works
(looking at the link that p4n provided)
1002 change to map of the npc (TC in this case)
the pair of 350 change it to the npc cords. +15 or something to spawn the mob near
|
|
|
11/08/2011, 14:35
|
#10
|
elite*gold: 0
Join Date: Oct 2011
Posts: 33
Received Thanks: 21
|
my eyes hurt
|
|
|
11/10/2011, 19:01
|
#11
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
Quote:
Originally Posted by U2_Caparzo
Code:
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Would you like to summon the HillSpirit"));
GC.AddSend(Packets.NPCLink("Yes Please.", 1));
GC.AddSend(Packets.NPCLink("No i dont have the items.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(722723, 1) && GC.MyChar.InventoryContains(722724, 1) && GC.MyChar.InventoryContains(722725, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722723));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722724));
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722725));
Mob Demon = new Mob("100 Demon 6 731 250 50000 2500 70 10000 0 0 100 70 21 8036 0 False 18 100000 500000 500 3 False");
Demon.EntityID = 450;
Hashtable MapMobs = (Hashtable)Game.World.H_Mobs[Loc.Map];
DMap D = (DMap)DMaps.H_DMaps[Loc.Map];
Game.Mob _Mob = new NewestCOServer.Game.Mob(Demon);
_Mob.Loc = new NewestCOServer.Game.Location();
_Mob.Loc.Map = 1002;
_Mob.Loc.X = 350;
_Mob.Loc.Y = 350;
_Mob.StartLoc = _Mob.Loc;
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
while (Game.World.H_Chars.Contains(_Mob.EntityID) || MapMobs.Contains(_Mob.EntityID))
_Mob.EntityID = (uint)Program.Rnd.Next(400000, 500000);
MapMobs.Add(_Mob.EntityID, _Mob);
}
}
maybe can work(i doubt it, i never get something working without test  xD), but maybe you can do this works
(looking at the link that p4n provided)
1002 change to map of the npc (TC in this case)
the pair of 350 change it to the npc cords. +15 or something to spawn the mob near
|
Simple case of opening the SpecialMap folder, chaning the NPC co,ords and map, and change the mob name and mesh in mobinfo. The demon box code dont work its shit i tryed it in all types of format layouts and everytime it was a fail, i worked a whole day on that code it works fine. Plus the 2 meshes are different, i dont even think you need both.
|
|
|
11/11/2011, 11:02
|
#12
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Quote:
Originally Posted by sonofskeletor
Cuz were not all geeks like you lol
i did inbox you, for help and u did agreed but never got back to me.
Newest co threading is **** so cpu gets high u need atleast 1 maintain a day, cheak the timer on the respawn.
and to be fair pro4never, there aint anything like this released anywere i searched for hours, so atleast im giving people something to work with.
|
Geek? It's called having the correct knowledge. dumbass.
|
|
|
11/28/2011, 18:36
|
#13
|
elite*gold: 0
Join Date: Jul 2007
Posts: 200
Received Thanks: 31
|
Quote:
Originally Posted by _DreadNought_
Geek? It's called having the correct knowledge. dumbass.
|
SMD
|
|
|
 |
Similar Threads
|
[RELEASE] Fastest Mass Spawn
11/26/2011 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 475 Replies
If you have tried to use the Laiden mass spawn hack at the end of Treasure of Crespo, you should see that it only spawns about 1 Ego per second. After messing around with the vac script in CE, I had no luck making anything faster, but I knew it could be done. So, I went to winhex and looked around for anything that might help. I got it working, but only with winhex. Here's how:
First off, the things you will need are found here (give the releasers thanks, because without them, this...
|
[Release]Sensenmann spawn
07/23/2011 - Metin2 PServer Guides & Strategies - 11 Replies
Vorwort:
Hallo Com, da mein Server nun endgültig den Geist aufgab, dank einigen Hackern werde ich jetzt mal eine neue Karriere starten in der Metin2 Sektion.
Die Quest die euch anbiete ist vermutlich mal was neues, zumindestens habe ich in der SuFu nichts gefunden.
Die Quest:
Bei der Quest handelt es sich darum einen Sensenmann zu spawnen. Man benötigt 20.000.000 Erfahrungspunkte, eine Verwandlungskugel und einen Horn des Dunklen Fürsten. Verwandlungskugel und das Horn werden nicht...
|
[RELEASE]Mob-Spawn-Item
10/06/2010 - Metin2 PServer Guides & Strategies - 17 Replies
Hey Com,
ich wollte hier mal eine Quest releasen, die ich schon sehr lange benutze!
Es ist eine Quest für ein Item, das ein beliebiges Monster spawnen kann!
Es ist praktisch für eure Team Mitglieder ohne GM Rechte(nur ein Beispiel)
Es funktioniert folgendermaßen:
Rechtsklick -> Fenster öffnet sich mit "Bestätigen" und "Abbrechen" -> "Bestätigen" -> Neues Fenster mit Input-Feld -> Monster ID eintragen -> OK -> Monster wird gespawnt...
|
[Release] Monster spawn void
03/17/2010 - CO2 PServer Guides & Releases - 22 Replies
Ok so be warned, this is messy as I haven't cleaned up most of it. Also note: as far as I'm aware, all mesh sizeadds are controlled by the client so I wasn't able to add that into this (the whole reason I started messing around with this was to easily change mob names/custom quest mobs without having to edit client)
Anyways, I have no use for it and I have no reason to clean up the code at all so I'm gonna go ahead and post what I have done.
Current version works perfectly to spawn mobs....
|
All times are GMT +1. The time now is 13:46.
|
|