mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
Merge remote-tracking branch 'remotes/origin/master' into logging_changes
Conflicts: world/client.cpp world/worlddb.cpp zone/aggro.cpp zone/bot.cpp zone/client.cpp zone/client_packet.cpp zone/client_process.cpp zone/doors.cpp zone/entity.cpp zone/inventory.cpp zone/mob_ai.cpp zone/perl_client.cpp zone/spells.cpp zone/waypoints.cpp zone/zone.cpp zone/zonedb.cpp zone/zoning.cpp
This commit is contained in:
+35
-37
@@ -1785,14 +1785,7 @@ void command_itemtest(Client *c, const Seperator *sep)
|
||||
void command_gassign(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC())
|
||||
{
|
||||
database.AssignGrid(
|
||||
c,
|
||||
(c->GetTarget()->CastToNPC()->org_x),
|
||||
(c->GetTarget()->CastToNPC()->org_y),
|
||||
atoi(sep->arg[1])
|
||||
);
|
||||
}
|
||||
database.AssignGrid(c, c->GetTarget()->CastToNPC()->m_SpawnPoint, atoi(sep->arg[1]));
|
||||
else
|
||||
c->Message(0,"Usage: #gassign [num] - must have an npc target!");
|
||||
}
|
||||
@@ -1965,7 +1958,7 @@ void command_dbspawn2(Client *c, const Seperator *sep)
|
||||
if(sep->IsNumber(5))
|
||||
cond_min = atoi(sep->arg[5]);
|
||||
}
|
||||
database.CreateSpawn2(c, atoi(sep->arg[1]), zone->GetShortName(), c->GetHeading(), c->GetX(), c->GetY(), c->GetZ(), atoi(sep->arg[2]), atoi(sep->arg[3]), cond, cond_min);
|
||||
database.CreateSpawn2(c, atoi(sep->arg[1]), zone->GetShortName(), c->GetPosition(), atoi(sep->arg[2]), atoi(sep->arg[3]), cond, cond_min);
|
||||
}
|
||||
else {
|
||||
c->Message(0, "Usage: #dbspawn2 spawngroup respawn variance [condition_id] [condition_min]");
|
||||
@@ -2044,10 +2037,12 @@ void command_wp(Client *c, const Seperator *sep)
|
||||
if (wp == 0) //default to highest if it's left blank, or we enter 0
|
||||
wp = database.GetHighestWaypoint(zone->GetZoneID(), atoi(sep->arg[2])) + 1;
|
||||
if (strcasecmp("-h",sep->arg[5]) == 0) {
|
||||
database.AddWP(c, atoi(sep->arg[2]),wp, c->GetX(), c->GetY(), c->GetZ(), atoi(sep->arg[3]),zone->GetZoneID(), c->GetHeading());
|
||||
database.AddWP(c, atoi(sep->arg[2]),wp, c->GetPosition(), atoi(sep->arg[3]),zone->GetZoneID());
|
||||
}
|
||||
else {
|
||||
database.AddWP(c, atoi(sep->arg[2]),wp, c->GetX(), c->GetY(), c->GetZ(), atoi(sep->arg[3]),zone->GetZoneID(), -1);
|
||||
auto position = c->GetPosition();
|
||||
position.m_Heading = -1;
|
||||
database.AddWP(c, atoi(sep->arg[2]),wp, position, atoi(sep->arg[3]),zone->GetZoneID());
|
||||
}
|
||||
}
|
||||
else if (strcasecmp("delete",sep->arg[1]) == 0)
|
||||
@@ -2415,7 +2410,7 @@ void command_spawn(Client *c, const Seperator *sep)
|
||||
Log.LogDebug(Logs::General,"#spawn Spawning:");
|
||||
#endif
|
||||
|
||||
NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c);
|
||||
NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetPosition(), c);
|
||||
if (!npc) {
|
||||
c->Message(0, "Format: #spawn name race level material hp gender class priweapon secweapon merchantid bodytype - spawns a npc those parameters.");
|
||||
c->Message(0, "Name Format: NPCFirstname_NPCLastname - All numbers in a name are stripped and \"_\" characters become a space.");
|
||||
@@ -2474,7 +2469,7 @@ void command_npctypespawn(Client *c, const Seperator *sep)
|
||||
const NPCType* tmp = 0;
|
||||
if ((tmp = database.GetNPCType(atoi(sep->arg[1])))) {
|
||||
//tmp->fixedZ = 1;
|
||||
NPC* npc = new NPC(tmp, 0, c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), FlyMode3);
|
||||
NPC* npc = new NPC(tmp, 0, c->GetPosition(), FlyMode3);
|
||||
if (npc && sep->IsNumber(2))
|
||||
npc->SetNPCFactionID(atoi(sep->arg[2]));
|
||||
|
||||
@@ -2537,7 +2532,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
peekTrade = 0x20,
|
||||
peekWorld = 0x40
|
||||
} ;
|
||||
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsClient()) {
|
||||
c->Message(0, "You must have a PC target selected for this command");
|
||||
return;
|
||||
@@ -2583,7 +2578,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
|
||||
}
|
||||
|
||||
if ((scopeWhere & peekWorn) && (targetClient->GetClientVersion() >= EQClientSoF)) {
|
||||
if ((scopeWhere & peekWorn) && (targetClient->GetClientVersion() >= ClientVersion::SoF)) {
|
||||
inst_main = targetClient->GetInv().GetItem(MainPowerSource);
|
||||
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
|
||||
linker.SetItemInst(inst_main);
|
||||
@@ -4859,7 +4854,7 @@ void command_manaburn(Client *c, const Seperator *sep)
|
||||
c->Message(0, "#Manaburn needs a target.");
|
||||
else {
|
||||
int cur_level=c->GetAA(MANA_BURN);//ManaBurn ID
|
||||
if (c->DistNoRootNoZ(*target) > 200)
|
||||
if (ComparativeDistance(c->GetPosition(), target->GetPosition()) > 200)
|
||||
c->Message(0,"You are too far away from your target.");
|
||||
else {
|
||||
if(cur_level == 1) {
|
||||
@@ -5366,8 +5361,7 @@ void command_wpadd(Client *c, const Seperator *sep)
|
||||
{
|
||||
int type1=0,
|
||||
type2=0,
|
||||
pause=0,
|
||||
heading=-1; // Defaults for a new grid
|
||||
pause=0; // Defaults for a new grid
|
||||
|
||||
Mob *t=c->GetTarget();
|
||||
if (t && t->IsNPC())
|
||||
@@ -5390,9 +5384,11 @@ void command_wpadd(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (strcmp("-h",sep->arg[2]) == 0)
|
||||
heading = c->GetHeading();
|
||||
uint32 tmp_grid = database.AddWPForSpawn(c, s2info->GetID(), c->GetX(),c->GetY(),c->GetZ(), pause, type1, type2, zone->GetZoneID(), heading);
|
||||
auto position = c->GetPosition();
|
||||
if (strcmp("-h",sep->arg[2]) != 0)
|
||||
position.m_Heading = -1;
|
||||
|
||||
uint32 tmp_grid = database.AddWPForSpawn(c, s2info->GetID(), position, pause, type1, type2, zone->GetZoneID());
|
||||
if (tmp_grid)
|
||||
t->CastToNPC()->SetGrid(tmp_grid);
|
||||
|
||||
@@ -5509,9 +5505,8 @@ void command_givemoney(Client *c, const Seperator *sep)
|
||||
|
||||
void command_itemsearch(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
if (sep->arg[1][0] == 0)
|
||||
c->Message(0, "Usage: #itemsearch [search string]");
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *search_criteria=sep->argplus[1];
|
||||
@@ -5566,6 +5561,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
|
||||
c->Message(0, "50 items shown...too many results.");
|
||||
else
|
||||
c->Message(0, "%i items found", count);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7217,7 +7213,7 @@ void command_pf(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *who = c->GetTarget();
|
||||
c->Message(0, "POS: (%.2f, %.2f, %.2f)", who->GetX(), who->GetY(), who->GetZ());
|
||||
c->Message(0, "WP: (%.2f, %.2f, %.2f) (%d/%d)", who->GetCWPX(), who->GetCWPY(), who->GetCWPZ(), who->GetCWP(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1);
|
||||
c->Message(0, "WP: %s (%d/%d)", to_string(who->GetCurrentWayPoint()).c_str(), who->IsNPC()?who->CastToNPC()->GetMaxWp():-1);
|
||||
c->Message(0, "TAR: (%.2f, %.2f, %.2f)", who->GetTarX(), who->GetTarY(), who->GetTarZ());
|
||||
c->Message(0, "TARV: (%.2f, %.2f, %.2f)", who->GetTarVX(), who->GetTarVY(), who->GetTarVZ());
|
||||
c->Message(0, "|TV|=%.2f index=%d", who->GetTarVector(), who->GetTarNDX());
|
||||
@@ -7259,16 +7255,18 @@ void command_bestz(Client *c, const Seperator *sep) {
|
||||
|
||||
if(c->GetTarget()) {
|
||||
z=c->GetTarget()->GetZ();
|
||||
RegionType = zone->watermap->ReturnRegionType(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z));
|
||||
auto position = xyz_location(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
|
||||
RegionType = zone->watermap->ReturnRegionType(position);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(position));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(position));
|
||||
|
||||
}
|
||||
else {
|
||||
z=c->GetZ();
|
||||
RegionType = zone->watermap->ReturnRegionType(c->GetX(), c->GetY(), z);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(c->GetX(), c->GetY(), z));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(c->GetX(), c->GetY(), z));
|
||||
auto position = xyz_location(c->GetX(), c->GetY(), z);
|
||||
RegionType = zone->watermap->ReturnRegionType(position);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(position));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(position));
|
||||
|
||||
}
|
||||
|
||||
@@ -7923,7 +7921,7 @@ void command_setgraveyard(Client *c, const Seperator *sep)
|
||||
zoneid = database.GetZoneID(sep->arg[1]);
|
||||
|
||||
if(zoneid > 0) {
|
||||
graveyard_id = database.CreateGraveyardRecord(zoneid, t->GetX(), t->GetY(), t->GetZ(), t->GetHeading());
|
||||
graveyard_id = database.CreateGraveyardRecord(zoneid, t->GetPosition());
|
||||
|
||||
if(graveyard_id > 0) {
|
||||
c->Message(0, "Successfuly added a new record for this graveyard!");
|
||||
@@ -7986,7 +7984,7 @@ void command_summonburriedplayercorpse(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading());
|
||||
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetPosition());
|
||||
|
||||
if(!PlayerCorpse)
|
||||
c->Message(0, "Your target doesn't have any burried corpses.");
|
||||
@@ -9908,7 +9906,7 @@ void command_distance(Client *c, const Seperator *sep) {
|
||||
if(c && c->GetTarget()) {
|
||||
Mob* target = c->GetTarget();
|
||||
|
||||
c->Message(0, "Your target, %s, is %1.1f units from you.", c->GetTarget()->GetName(), c->Dist(*target));
|
||||
c->Message(0, "Your target, %s, is %1.1f units from you.", c->GetTarget()->GetName(), Distance(c->GetPosition(), target->GetPosition()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10030,7 +10028,7 @@ void command_disarmtrap(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillDisarmTraps))
|
||||
{
|
||||
if(c->DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
@@ -10055,7 +10053,7 @@ void command_sensetrap(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillSenseTraps))
|
||||
{
|
||||
if(c->DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
@@ -10080,7 +10078,7 @@ void command_picklock(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillPickLock))
|
||||
{
|
||||
if(c->DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
@@ -10679,4 +10677,4 @@ void command_logs(Client *c, const Seperator *sep){
|
||||
c->Message(0, "--- #logs list_settings - Shows current log settings and categories");
|
||||
c->Message(0, "--- #logs set [console|file|gmsay] <category_id> <debug_level (1-3)> - Sets log settings during the lifetime of the zone");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user