#4 command for combine spawns into spawngroup

Closed
opened 4 years ago by image · 3 comments
image commented 4 years ago

need a command to combine spawns into a spawngroup based on radius

need a command to combine spawns into a spawngroup based on radius
image commented 4 years ago
Collaborator

allow restriction by npc name or race id

allow restriction by npc name or race id
image commented 4 years ago
Collaborator

So upon looking at the latest code there already is such a feature:

COMMAND_SPAWN_COMBINE

    case COMMAND_SPAWN_COMBINE:{
        Spawn* spawn = client->GetPlayer()->GetTarget();
        float radius = 0;
        bool failed = true;
        if(spawn && !spawn->IsPlayer() && sep && sep->arg[0] && sep->arg[0][0]){
            failed = false;
            if(spawn->GetSpawnGroupID() > 0){
                client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Can not combine this spawn as it is in a spawn group.  Remove it from the group and try again.");
            }
            else if(sep->IsNumber(0)){
                radius = atof(sep->arg[0]);
                client->CombineSpawns(radius, spawn);
            }
            else{
                if(strncasecmp(sep->arg[0], "add", 3) == 0){
                    client->AddCombineSpawn(spawn);
                }
                else if(strncasecmp(sep->arg[0], "remove", 6) == 0){
                    client->RemoveCombineSpawn(spawn);
                }
                else if(strncasecmp(sep->arg[0], "save", 4) == 0){
                    const char* name = 0;
                    if(sep->arg[1] && sep->arg[1][0])
                        name = sep->argplus[1];
                    client->SaveCombineSpawns(name);
                }
                else
                    failed = true;
            }
        }
        if(failed){
            client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command combines several spawns into a single spawn group.");
            client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Syntax: /spawn combine [radius/add/remove/save]");
            client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Ex: /spawn combine 1, /spawn combine save (spawn group name)");
        }
        break;
                               }
So upon looking at the latest code there already is such a feature: COMMAND_SPAWN_COMBINE case COMMAND_SPAWN_COMBINE:{ Spawn* spawn = client->GetPlayer()->GetTarget(); float radius = 0; bool failed = true; if(spawn && !spawn->IsPlayer() && sep && sep->arg[0] && sep->arg[0][0]){ failed = false; if(spawn->GetSpawnGroupID() > 0){ client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Can not combine this spawn as it is in a spawn group. Remove it from the group and try again."); } else if(sep->IsNumber(0)){ radius = atof(sep->arg[0]); client->CombineSpawns(radius, spawn); } else{ if(strncasecmp(sep->arg[0], "add", 3) == 0){ client->AddCombineSpawn(spawn); } else if(strncasecmp(sep->arg[0], "remove", 6) == 0){ client->RemoveCombineSpawn(spawn); } else if(strncasecmp(sep->arg[0], "save", 4) == 0){ const char* name = 0; if(sep->arg[1] && sep->arg[1][0]) name = sep->argplus[1]; client->SaveCombineSpawns(name); } else failed = true; } } if(failed){ client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command combines several spawns into a single spawn group."); client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Syntax: /spawn combine [radius/add/remove/save]"); client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Ex: /spawn combine 1, /spawn combine save (spawn group name)"); } break; }
image commented 4 years ago
Collaborator

@devn00b FYI

        client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command combines several spawns into a single spawn group.");
        client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Syntax: /spawn combine [radius/add/remove/save]");
        client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Ex: /spawn combine 1, /spawn combine save (spawn group name)");
@devn00b FYI client->SimpleMessage(CHANNEL_COLOR_YELLOW, "This command combines several spawns into a single spawn group."); client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Syntax: /spawn combine [radius/add/remove/save]"); client->SimpleMessage(CHANNEL_COLOR_YELLOW,"Ex: /spawn combine 1, /spawn combine save (spawn group name)");
image referenced this issue from a commit 2 years ago
image referenced this issue from a commit 2 years ago
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.