EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Feature Requests (https://www.eqemulator.org/forums/forumdisplay.php?f=612)
-   -   #modeltest command (https://www.eqemulator.org/forums/showthread.php?t=20912)

unicorn97211 06-30-2006 09:27 AM

#modeltest command
 
My wife likes to do the zone population. I created a #modeltest command so that she could explore models in each zone. It works like this:

#modeltest [Start Race ID] [End Race ID]

When I enter:

#modeltest 1 10

Spawns 3 rows of 10 mobs using my current loc as the base origin. The first row of 10 is races 1 through 10 male gender, the second row of 10 is races 1 through 10 female gender and the third row of 10 is races 1 through 10 unisex gender.

Code:

1m  1f    1u
 2m  2f    2u
 3m  3f    3u
 4m  4f    4u
 5m  5f    5u
 6m  6f    6u
 7m  7f    7u
 8m  8f    8u
 9m  9f    9u
10m  10f  10u

#modeltest 1 40

Spawns 4 groups of the 3x10 rows listed above for models 1 through 40. Basically we are wrapping at 10. Like so:

Code:

1m  1f    1u    11m  11f  11u      21m  21f    21u      31m  31f    31u
 2m  2f    2u    12m  12f  12u      22m  22f    22u      32m  32f    32u     
 3m  3f    3u    13m  13f  13u      23m  23f    23u      33m  33f    33u   
 4m  4f    4u    14m  14f  14u      24m  24f    24u      34m  34f    34u   
 5m  5f    5u    15m  15f  15u      25m  25f    25u      35m  35f    35u   
 6m  6f    6u    16m  16f  16u      26m  26f    26u      36m  36f    36u   
 7m  7f    7u    17m  17f  17u      27m  27f    27u      37m  37f    37u   
 8m  8f    8u    18m  18f  18u      28m  28f    28u      38m  38f    38u   
 9m  9f    9u    19m  19f  19u      29m  29f    29u      39m  39f    39u   
10m  10f  10u    20m  10f  20u      30m  30f    30u      40m  40f    40u

This is nice when choosing models because you can just spawn a range of races and it's very clearly seen which ones work among all the male humans that don't.

When you see a mob in the grid you like, just target it and #npcstat it to get all the modeling info you need to create your spawns.

I did this once using a range of 1 to 400. LAG! haha but it worked.

If anyone else is interested in this command I'll clean up the code and post it. I'm thinking of adding options to the command to also specify gender and texture/material ranges.

Belfedia 06-30-2006 10:04 PM

I think this command must be include in official version, it was a powerfull tools for search models available in zone. That wonderful :)

soulshot 07-01-2006 06:17 AM

Nice
 
Please do =) that sounds really great as far as a quick way to see visually how the differant mobs would look.

unicorn97211 07-02-2006 10:22 AM

It's still a tad rough but here ya go, I recommend using #repop between uses if you are using large ranges.

Usage:

#modeltest [Start Race] [End Race] [Start Gender] [End Gender] [Start Texture] [End Texture] [Helm Texture]

Examples:

#modeltest 1 3

Shows a model for human, barbarian and erudite for each gender with a texture of 0 and helm texture of 0.

#modeltest 1 3 0 0

Shows only male models for human, barbarian and erudite with a texture of 0 and helm texture of 0.

#modeltest 1 3 0 0 0 10

Shows only male models for human, barbarian and erudite with textures 0 through 10 and helm texture of 0.

#modeltest 1 3 0 0 0 10 2

Shows only male models for human, barbarian and erudite with textures 0 through 10 and helm texture of 2.

#modeltest 1 400

Shows a model for races 1 through 400 for each gender with a texture of 0 and helm texture of 0 and causes a ton of lag!


The Code:
command.h

change:
Code:

void command_mlog(Client *c, const Seperator *sep);
to:
Code:

void command_mlog(Client *c, const Seperator *sep);
// EverHood 6/14/06
void command_modeltest(Client *c, const Seperator *sep);

command.cpp

change:
Code:

                command_add("npcemote","[message] - Make your NPC target emote a message.",150,command_npcemote)
to:
Code:

                command_add("npcemote","[message] - Make your NPC target emote a message.",150,command_npcemote) ||
                // EverHood 6/14/06
                command_add("modeltest","- Spawn an NPC for every race in a grid. *Use in open areas!",250,command_modeltest)

Add this to the end:
Code:

// EverHood 6/14/06
// Wifes world buidling request
void command_modeltest(Client *c, const Seperator *sep)
{
        if(sep->arg[1][0] == '\0') {
                c->Message(0, "Syntax: #modeltest [Start Race] [End Race] [Start Gender] [End Gender] [Start Texture] [End Texture] [Helm Texture]");
                return;
        }

        int x = 1,y = 1,StartGender = 0,EndGender=2,StartTexture=0,EndTexture=0,HelmTexture=0;
        int start_race = atoi(sep->arg[1]);
        int maxraces = atoi(sep->arg[2]);
        if(!sep->arg[3][0] == '\0')
                StartGender=atoi(sep->arg[3]);
        if(!sep->arg[4][0] == '\0')
                EndGender=atoi(sep->arg[4]);
        if(!sep->arg[5][0] == '\0')
                StartTexture=atoi(sep->arg[5]);
        if(!sep->arg[6][0] == '\0')
                EndTexture=atoi(sep->arg[6]);
        if(!sep->arg[7][0] == '\0')
                HelmTexture=atoi(sep->arg[7]);
        if(maxraces<start_race)
                maxraces=start_race;
        c->Message(0,"Spawning %i Races %i Genders and %i Textures.",maxraces-start_race,(EndGender-StartGender)+1,(EndTexture-StartTexture)+1);
        for(int race = start_race;race<=maxraces; race++){
                for(int gender = StartGender;gender<=EndGender; gender++){
                        for(int texture = StartTexture;texture<=EndTexture; texture++){
                                //Time to create the NPC!!
                                NPCType* npc_type = new NPCType;
                                memset(npc_type, 0, sizeof(NPCType));
                                strcpy(npc_type->name,"Test");
                                npc_type->cur_hp = 100;
                                npc_type->max_hp = 100;
                                npc_type->race = race;
                                npc_type->gender = gender;
                                npc_type->class_ = 1;
                                npc_type->deity= 1;
                                npc_type->level = 1;
                                npc_type->npc_id = 0;
                                npc_type->loottable_id = 0;
                                npc_type->texture = texture;
                                npc_type->light = 0;
                                npc_type->walkspeed = 0.67;
                                npc_type->runspeed = 1.25;
                                npc_type->merchanttype = 0;       
                                npc_type->bodytype = 0;
                                npc_type->equipment[7] = 0;
                                npc_type->equipment[8] = 0;
                                npc_type->helmtexture = HelmTexture;
                                npc_type->STR = 150;
                                npc_type->STA = 150;
                                npc_type->DEX = 150;
                                npc_type->AGI = 150;
                                npc_type->INT = 150;
                                npc_type->WIS = 150;
                                npc_type->CHA = 150;
                               
                                NPC* npc = new NPC(npc_type, 0,c->GetX()+(x*10)-(gender*2), c->GetY()+(y*60)-(gender*9)-(texture*3), c->GetZ(), 180);
                                npc->GiveNPCTypeData(npc_type);
                                //safe_delete(npc_type);
                       
                                entity_list.AddNPC(npc);
                        }
                }
                if(x==10){
                        x=1;
                        y++;
                }else{
                        x++;
                }
        }
}

Let me know if anyone wants a unified diff of this and I'll work one up.

Enjoy :)

fathernitwit 07-04-2006 04:18 AM

hmm... this is a nice tool, but I would really like to see things like this written in perl. The only problem is that there is no way to make a raw NPC like this, however I think there should be. Would you consider writting up a new quest method: quest::spawnraw() which takes each of the npc_type fields (plus location) as arguments and does what your inner loop does? Such a command would prove quite useful for regular quests, and would allow this to be written as a perl command.


All times are GMT -4. The time now is 05:44 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.