[FAQ] HellmouthSource

03/10/2011 17:46 RT-Gaming#46
Hey Pro4Never could you be so nice and explain me a bit more what I excactly need to add??

thanks alot !
03/10/2011 19:15 pro4never#47
Here's a little hint...

The mobspawn code never adds the mob to the map or to the members dictionary. That would be where I'd recommend starting.
03/11/2011 06:22 denominator#48
What`s wrong with this o.0? ID IS 62 but it tells me on the created NPC that there is no script?

Code:
#region Plit
                            case 62:
                                {
                                    if (LinkBack == 0)
                                    {
                                        Text("Do you want enter the guild arena?", Client);
                                        Link("Yes.", 9, Client);
                                        Link("Just passing by.", 255, Client);
                                        Finish(Client);
                                    }
                                    else if (LinkBack == 9)
                                        Teleport(Client, 348, 339, 1038);
                                    break;
                                }
                            #endregion
03/11/2011 06:37 pro4never#49
Make sure that the script is placed in the switch statement where the others are and that you have debugged the project since editing (you are opening the whole project not just the .cs file)

Also double check that the error that pops up tells you it's using that npc id.

Also.. isn't this already coded in the external npc files? Does no one have any desire to use external scripts that imo are SOOO much easier?
03/11/2011 07:27 BioHazarxPaul#50
I love the external npc system I just have no need to want to use ur source when id rather help on the real hellmouthco server
03/11/2011 07:28 denominator#51
It was a test and I am used to using 5165, I know how to add NPCs but a few things change for this like it`s just link rather than NPCLink etc. I F6 then F5ed it like I always do, I added the NPC to database so he is actually there. Just not sure as to why ID 62 is not matching with the script?


Code:
                   return;
                                        }
                                        Program.ActionQueue.Enqueue(new Action(null, ActionType.ReturnFlag, Program.CTF.Blue, 5000));
                                        //RESPAWN FLAG
                                    }
                                    else
                                    {
                                        Text("Go to the opposite side of the map and bring me back the blue flag!", Client);
                                        Link("Send Me to Twin City", 9, Client);
                                        Link("Will do!", 255, Client);
                                        Finish(Client);
                                    }
                                }
                                return;
                            #region Plit
                            case 62:
                                {
                                    if (LinkBack == 0)
                                    {
                                        Text("Do you want enter the guild arena?", Client);
                                        Link("Yes.", 9, Client);
                                        Link("Just passing by.", 255, Client);
                                        Finish(Client);
                                    }
                                    else if (LinkBack == 9)
                                        Teleport(Client, 348, 339, 1038);
                                    break;
                                }
                            #endregion
                            case 9:
                                Client.ChangeGarmentDisguise(0);
                                Teleport(Client, 439, 385, 1002);
                                return;
                        }
                        return;
                    case 10010:Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); return;
                    case 10012: Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); break;
                    case 10028: Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); break;
                    case 10011: Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); break;
                    case 10027: Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); break;
                    case 44: Client.Send(Packets.GeneralData(Client.UID, 4, Client.X, Client.Y, 0x7e)); break;
                    case 4101: Client.Send(P
03/11/2011 07:32 pro4never#52
I was bored and couldn't sleep...


So I can confirm that fixing monster (basic spawn) can be done within about... 10 lines of code?

Seriously guys... place some debug and you will easily find it. The only reason I didn't find it in like 2 seconds is because I was break pointing the wrong section which the exception was talking about not realizing which part was null.


NO; I WILL NOT BE POSTING THE ACTUAL FIX. I WILL SIMPLY POINT IN THE RIGHT DIRECTION

This is something you guys NEED to be able to do.

Step 1: Make sure it is loading from database (by default I disabled that)

Step 2: Make sure the monster spawn is setting up everything right.

There are typos causing issues in both the database AND the spawn class. It also is not setting up all monster variables ;)

Step 3: Make sure I am actually adding the mob to the map/spawn members once I generate it (*gasp* how has no one seemed to even notice that I removed that? ^^)


Anndd that's all the help i'm providing.

yes, monsters can be attacked and die. They do not attack back, move, respawn, despawn or drop anything. Those systems are NOT coded and should be done your self.


[Only registered and activated users can see links. Click Here To Register...]


<edit>

Sorry for the double post. wireless network sucks.

@ question about npc.

it's not working cause you wrote it as one of the linkbacks for the capture the flag wars...

Notice there are still more }/return; statements after where you are adding the code.

But yes... try looking through the external npcs... there was already a guild conductor in there which you could use as an example (or any of the other conductors)

I suggest /debug so server prints out like everything possible to you including what npc you are talking to.
03/11/2011 07:42 denominator#53
Ok thanks I was putting it into the wrong area lol. It`s for a TG guy but I just wanted to test that I could add an NPC and also add script to it :D
03/11/2011 07:56 noblewarrior#54
hey, i'm coding npcs using the python way (npcs.npc files) but i can't figure out how to make an npc make somone learn a skill.
e.g trojangod(promo) i want him to teach players herc. how would i go about writing this in the .npc files or has a code to learn skills not been added?
anyway, thanks in advance ;)
03/11/2011 07:57 BioHazarxPaul#55
and.... it just went from how do i make monsters spawn to how do i make them drop items and move... should just give up now pro its not going to end people always want everything handed to them on here.

***With a select few I guess ill add that do try***
03/11/2011 08:02 denominator#56
When you say external do you mean using phpmyadmin/navicat? I don`t use navicat as it`s not actually needed with xampp lol. Also I attempted to use the GuildWars.cs from the other project but seemed to fail at it lol. I`m sure I will eventually crack it though :D

Ok I decided to continue having a play around with this and had a look at what you have said about mob spawning, needless to say I get an error sooooooo I decided to Google the error and I assume I need something like this code?

Code:
if (null == formCollection)
            {
                return;
            }
            object obj = formCollection["UserId"];
            if (null == obj)
            {
                return;
            }
I have had a look at this and tried several things but I`m not to sure on what it should be because Game.World obviously does not exist in this source lol.

Code:
Game.World.SendMsgToAll("SYSTEM", "http://somewebsite.com", 2105, 0);
I also tried

Code:
Link("http://somewebsite.com", 2105, Client);
03/11/2011 12:41 dimepp95#57
Pro4Never can you help us with coding monsters?
03/11/2011 15:37 komy9#58
mane i can execute sql file ... what should i do?:|
03/11/2011 15:48 pro4never#59
@sql: install sql with innodb enabled and try again.

@denom: a null reference exception means one or more variable is never assigned. Place a breakpoint and find out which one.

@ mobs: no, do it yourself. I've provided everything
03/11/2011 16:36 mohamedkhaled#60
@pro4never i would suggest to not release mobs classes or codes for any reason.
and 1 more question! i know well at C# but i didn't read the whole source yet .. but i tried to make npc that upgrades weapon level/quality but when i use something like this it don't upgrade the level.. didn't check the method also! xD
PHP Code:
Client.UpgradeEquipLevel(8); 
but when i use
PHP Code:
Client.UpgradeEquipQuality(8); 
the quality upgrades!

here
PHP Code:
HeadBand //level
weapon 1 //level / quality
weapon 2 //level / quality
Armor //level
Necklace //quality
Ring //quality
Boot //quality 
Some of them accept level upgrade and some of them don't the same for the quality upgrade.



Quote:
Originally Posted by BioHazarxPaul View Post
and.... it just went from how do i make monsters spawn to how do i make them drop items and move... should just give up now pro its not going to end people always want everything handed to them on here.

***With a select few I guess ill add that do try***
i don't know why did he released the source either.. if they want something i suggest to let them think and do it themselves i expected annoying will be the 1st thing he will get ..