Merge git://github.com/EQEmu/Server into Development

This commit is contained in:
KayenEQ 2014-10-24 23:28:15 -04:00
commit 4cb6a5635e
14 changed files with 126 additions and 18 deletions

View File

@ -1,5 +1,11 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 10/22/2014 ==
Uleat: Fix for stacking items in a world object..added a new command option: #peekinv world - will show world container contents, if one is in use by target.
== 10/20/2014 ==
demonstar55: Inspect Buffs rank 1 will now show NPC buffs in target window (SoD+)
== 10/19/2014 == == 10/19/2014 ==
Uleat: Updated command #peekinv to display item links properly in RoF clients Uleat: Updated command #peekinv to display item links properly in RoF clients
demonstar55: Group Mentoring in raids demonstar55: Group Mentoring in raids

View File

@ -0,0 +1,4 @@
INSERT INTO altadv_vars SET skill_id="4698", name="Quick Draw", cost="5", max_level="1", hotkey_sid="4294967295", hotkey_sid2="4294967295", title_sid="4698", desc_sid="4698", type="1", spellid="4294967295", prereq_skill="0", prereq_minpoints="0", spell_type="0", spell_refresh="0", class_type="51", cost_inc="0", aa_expansion="12", special_category="4294967295", sof_type="1", sof_cost_inc="0", sof_max_level="2", sof_next_skill="4698", clientver="4", account_time_required="0", sof_current_level="0", sof_next_id="6545", level_inc="0", classes="65534", berserker="1";
INSERT INTO aa_effects SET aaid=4698, slot=1, effectid=362, base1=1, base2=0;
INSERT INTO altadv_vars SET skill_id="6545", name="Quick Draw II", cost="5", max_level="1", hotkey_sid="4294967295", hotkey_sid2="4294967295", title_sid="4698", desc_sid="4698", type="1", spellid="4294967295", prereq_skill="4698", prereq_minpoints="1", spell_type="0", spell_refresh="0", class_type="56", cost_inc="0", aa_expansion="14", special_category="4294967295", sof_type="1", sof_cost_inc="0", sof_max_level="2", sof_next_skill="4698", clientver="5", account_time_required="0", sof_current_level="1", sof_next_id="0", level_inc="0", classes="65534", berserker="1";
INSERT INTO aa_effects SET aaid=6545, slot=1, effectid=362, base1=1, base2=0;

View File

@ -1907,7 +1907,7 @@ uint16 Mob::GetInstrumentMod(uint16 spell_id) const
void Client::CalcMaxEndurance() void Client::CalcMaxEndurance()
{ {
max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance; max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance + aabonuses.Endurance;
if (max_end < 0) { if (max_end < 0) {
max_end = 0; max_end = 0;

View File

@ -1374,10 +1374,9 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
query = StringFormat("SELECT `status`, `name`, `lsaccount_id`, `gmspeed`, `revoked`, `hideme` FROM `account` WHERE `id` = %u", this->AccountID()); query = StringFormat("SELECT `status`, `name`, `lsaccount_id`, `gmspeed`, `revoked`, `hideme` FROM `account` WHERE `id` = %u", this->AccountID());
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
if (admin){ admin = atoi(row[0]); } admin = atoi(row[0]);
if (account_name){ strcpy(account_name, row[1]); } strncpy(account_name, row[1], 30);
if (lsaccountid && atoi(row[2]) > 0){ lsaccountid = atoi(row[2]); } lsaccountid = atoi(row[2]);
else{ lsaccountid = 0; }
gmspeed = atoi(row[3]); gmspeed = atoi(row[3]);
revoked = atoi(row[4]); revoked = atoi(row[4]);
gmhideme = atoi(row[5]); gmhideme = atoi(row[5]);
@ -12951,7 +12950,23 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
if (nt) if (nt)
{ {
SetTarget(nt); SetTarget(nt);
if ((nt->IsClient() && !nt->CastToClient()->GetPVP()) || bool inspect_buffs = false;
// rank 1 gives you ability to see NPC buffs in target window (SoD+)
if (nt->IsNPC()) {
if (IsRaidGrouped()) {
Raid *raid = GetRaid();
if (raid) {
uint32 gid = raid->GetGroup(this);
if (gid < 12 && raid->GroupCount(gid) > 2)
inspect_buffs = raid->GetLeadershipAA(groupAAInspectBuffs, gid);
}
} else {
Group *group = GetGroup();
if (group && group->GroupCount() > 2)
inspect_buffs = group->GetLeadershipAA(groupAAInspectBuffs);
}
}
if (nt == this || inspect_buffs || (nt->IsClient() && !nt->CastToClient()->GetPVP()) ||
(nt->IsPet() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) || (nt->IsPet() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()) ||
(nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP())) (nt->IsMerc() && nt->GetOwner() && nt->GetOwner()->IsClient() && !nt->GetOwner()->CastToClient()->GetPVP()))
nt->SendBuffsToClient(this); nt->SendBuffsToClient(this);

View File

@ -258,7 +258,7 @@ int command_init(void) {
command_add("heal","- Completely heal your target",10,command_heal) || command_add("heal","- Completely heal your target",10,command_heal) ||
command_add("appearance","[type] [value] - Send an appearance packet for you or your target",150,command_appearance) || command_add("appearance","[type] [value] - Send an appearance packet for you or your target",150,command_appearance) ||
command_add("nukeitem","[itemid] - Remove itemid from your player target's inventory",150,command_nukeitem) || command_add("nukeitem","[itemid] - Remove itemid from your player target's inventory",150,command_nukeitem) ||
command_add("peekinv","[worn/cursor/inv/bank/trade/trib/all] - Print out contents of your player target's inventory",100,command_peekinv) || command_add("peekinv","[worn/inv/cursor/trib/bank/trade/world/all] - Print out contents of your player target's inventory",100,command_peekinv) ||
command_add("findnpctype","[search criteria] - Search database NPC types",100,command_findnpctype) || command_add("findnpctype","[search criteria] - Search database NPC types",100,command_findnpctype) ||
command_add("findzone","[search criteria] - Search database zones",100,command_findzone) || command_add("findzone","[search criteria] - Search database zones",100,command_findzone) ||
command_add("fz",nullptr,100, command_findzone) || command_add("fz",nullptr,100, command_findzone) ||
@ -2965,6 +2965,41 @@ void command_peekinv(Client *c, const Seperator *sep)
} }
} }
if (bAll || (strcasecmp(sep->arg[1], "world") == 0)) {
// Items in world container (if present)
bFound = true;
Object* tsobject = c->GetTradeskillObject();
if (tsobject == nullptr) {
c->Message(1, "No world tradeskill object selected...");
}
else {
c->Message(0, "[WorldObject DBID: %i (entityid: %i)]", tsobject->GetDBID(), tsobject->GetID());
for (int16 i = MAIN_BEGIN; i < EmuConstants::MAP_WORLD_SIZE; ++i) {
const ItemInst* inst = tsobject->GetItem(i);
item = (inst) ? inst->GetItem() : nullptr;
linkbase = StringFormat(linkcore, 0x12, ((item == 0) ? 0 : item->ID), ((item == 0) ? "null" : item->Name), 0x12);
c->Message((item == 0), "WorldSlot: %i, Item: %i (%s), Charges: %i",
(EmuConstants::WORLD_BEGIN + i), ((item == 0) ? 0 : item->ID), linkbase.c_str(), ((item == 0) ? 0 : inst->GetCharges()));
// this should never happen ('WorldBagSlot' as -1 indicates an error state in this implementation)
if (inst && inst->IsType(ItemClassContainer)) {
for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; ++j) {
const ItemInst* instbag = inst->GetItem(j);
item = (instbag) ? instbag->GetItem() : nullptr;
linkbase = StringFormat(linkcore, 0x12, ((item == 0) ? 0 : item->ID), ((item == 0) ? "null" : item->Name), 0x12);
c->Message((item == 0), " WorldBagSlot: %i (Slot #%i, Bag #%i), Item: %i (%s), Charges: %i",
-1, i, j, ((item == 0) ? 0 : item->ID), linkbase.c_str(), ((item == 0) ? 0 : inst->GetCharges()));
}
}
}
}
}
if (!bFound) if (!bFound)
{ {
c->Message(0, "Usage: #peekinv [worn|cursor|inv|bank|trade|trib|all]"); c->Message(0, "Usage: #peekinv [worn|cursor|inv|bank|trade|trib|all]");

View File

@ -1071,6 +1071,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app)
if(!loot_cooldown_timer.Check()) if(!loot_cooldown_timer.Check())
{ {
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
//unlock corpse for others
if (this->BeingLootedBy = client->GetID()) {
BeingLootedBy = 0xFFFFFFFF;
}
return; return;
} }
@ -1079,6 +1083,10 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app)
{ {
client->Message(13, "You may not loot an item while you have an item on your cursor."); client->Message(13, "You may not loot an item while you have an item on your cursor.");
SendEndLootErrorPacket(client); SendEndLootErrorPacket(client);
//unlock corpse for others
if (this->BeingLootedBy = client->GetID()) {
BeingLootedBy = 0xFFFFFFFF;
}
return; return;
} }

View File

@ -1351,7 +1351,7 @@ void EntityList::RefreshClientXTargets(Client *c)
} }
void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *app, void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *app,
bool iSendToSender, Mob *SkipThisMob, bool ackreq, bool HoTT, uint32 ClientVersionBits) bool iSendToSender, Mob *SkipThisMob, bool ackreq, bool HoTT, uint32 ClientVersionBits, bool inspect_buffs)
{ {
auto it = client_list.begin(); auto it = client_list.begin();
while (it != client_list.end()) { while (it != client_list.end()) {
@ -1365,7 +1365,6 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
Mob *TargetsTarget = nullptr; Mob *TargetsTarget = nullptr;
if (Target)
TargetsTarget = Target->GetTarget(); TargetsTarget = Target->GetTarget();
bool Send = false; bool Send = false;
@ -1378,12 +1377,31 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
Send = true; Send = true;
if (c != sender) { if (c != sender) {
if (Target == sender) if (Target == sender) {
if (inspect_buffs) { // if inspect_buffs is true we're sending a mob's buffs to those with the LAA
if (c->IsRaidGrouped()) {
Raid *raid = c->GetRaid();
if (!raid)
continue;
uint32 gid = raid->GetGroup(c);
if (gid > 11 || raid->GroupCount(gid) < 3)
continue;
if (raid->GetLeadershipAA(groupAAInspectBuffs, gid))
Send = true; Send = true;
else if (HoTT) } else {
if (TargetsTarget == sender) Group *group = c->GetGroup();
if (!group || group->GroupCount() < 3)
continue;
if (group->GetLeadershipAA(groupAAInspectBuffs))
Send = true; Send = true;
} }
} else {
Send = true;
}
} else if (HoTT && TargetsTarget == sender) {
Send = true;
}
}
if (Send && (c->GetClientVersionBit() & ClientVersionBits)) if (Send && (c->GetClientVersionBit() & ClientVersionBits))
c->QueuePacket(app, ackreq); c->QueuePacket(app, ackreq);

View File

@ -297,7 +297,7 @@ public:
void QueueClientsGuild(Mob* sender, const EQApplicationPacket* app, bool ignore_sender = false, uint32 guildeqid = 0); void QueueClientsGuild(Mob* sender, const EQApplicationPacket* app, bool ignore_sender = false, uint32 guildeqid = 0);
void QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struct *gbius, uint32 GuildID); void QueueClientsGuildBankItemUpdate(const GuildBankItemUpdate_Struct *gbius, uint32 GuildID);
void QueueClientsByTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, Mob* SkipThisMob = 0, bool ackreq = true, void QueueClientsByTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true, Mob* SkipThisMob = 0, bool ackreq = true,
bool HoTT = true, uint32 ClientVersionBits = 0xFFFFFFFF); bool HoTT = true, uint32 ClientVersionBits = 0xFFFFFFFF, bool inspect_buffs = false);
void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true); void QueueClientsByXTarget(Mob* sender, const EQApplicationPacket* app, bool iSendToSender = true);
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app); void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);

View File

@ -1480,6 +1480,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
} }
world_inst->SetCharges(world_charges); world_inst->SetCharges(world_charges);
m_tradeskill_object->PutItem(world_idx, world_inst);
m_tradeskill_object->Save(); m_tradeskill_object->Save();
if (src_charges == 0) { if (src_charges == 0) {

View File

@ -1044,7 +1044,7 @@ int32 Merc::CalcManaRegenCap()
void Merc::CalcMaxEndurance() void Merc::CalcMaxEndurance()
{ {
max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance; max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance + aabonuses.Endurance;
if (max_end < 0) { if (max_end < 0) {
max_end = 0; max_end = 0;

View File

@ -318,6 +318,14 @@ void Object::Delete(bool reset_state)
} }
} }
const ItemInst* Object::GetItem(uint8 index) {
if (index < EmuConstants::MAP_WORLD_SIZE) {
return m_inst->GetItem(index);
}
return nullptr;
}
// Add item to object (only logical for world tradeskill containers // Add item to object (only logical for world tradeskill containers
void Object::PutItem(uint8 index, const ItemInst* inst) void Object::PutItem(uint8 index, const ItemInst* inst)
{ {

View File

@ -121,6 +121,7 @@ public:
void StartDecay() {decay_timer.Start();} void StartDecay() {decay_timer.Start();}
// Container functions // Container functions
const ItemInst* GetItem(uint8 index);
void PutItem(uint8 index, const ItemInst* inst); void PutItem(uint8 index, const ItemInst* inst);
void DeleteItem(uint8 index); // Item inside container void DeleteItem(uint8 index); // Item inside container
ItemInst* PopItem(uint8 index); // Pop item out of container ItemInst* PopItem(uint8 index); // Pop item out of container

View File

@ -4168,6 +4168,12 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
safe_delete(outapp); safe_delete(outapp);
} }
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
safe_delete(outapp);
}
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater) if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UnderfootAndLater)
{ {
EQApplicationPacket *outapp = MakeBuffsPacket(false); EQApplicationPacket *outapp = MakeBuffsPacket(false);

View File

@ -3132,6 +3132,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
safe_delete(outapp); safe_delete(outapp);
} }
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
safe_delete(outapp);
}
// recalculate bonuses since we stripped/added buffs // recalculate bonuses since we stripped/added buffs
CalcBonuses(); CalcBonuses();