Jump to content

brew93

Members
  • Posts

    3
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

brew93's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. I did it this way, because I thought if I copy the fishing code,and make changes to use different database, it will work.
  2. I tried to make a fix to looting junks while fishing. It worked! - Only once. After that it stopped working. Now there is no loot when I should fish junk. Could anyone help? Here is the patch: (This is what I used for develop, so it has a lot of unnecessary rows) diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index c410d2e..8c9f3d7 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -418,6 +418,7 @@ ChatCommand * ChatHandler::getCommandTable() { "disenchant_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesDisenchantCommand, "", NULL }, { "event_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventScriptsCommand, "", NULL }, { "fishing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesFishingCommand, "", NULL }, + { "fishing_junk_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesFishingJunkCommand, "", NULL }, { "game_graveyard_zone", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameGraveyardZoneCommand, "", NULL }, { "game_tele", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameTeleCommand, "", NULL }, { "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGOQuestInvRelationsCommand, "", NULL }, diff --git a/src/game/Chat.h b/src/game/Chat.h index 10979cf..92b4063 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -359,6 +359,7 @@ class ChatHandler bool HandleReloadLootTemplatesCreatureCommand(const char* args); bool HandleReloadLootTemplatesDisenchantCommand(const char* args); bool HandleReloadLootTemplatesFishingCommand(const char* args); + bool HandleReloadLootTemplatesFishingJunkCommand(const char* args); bool HandleReloadLootTemplatesGameobjectCommand(const char* args); bool HandleReloadLootTemplatesItemCommand(const char* args); bool HandleReloadLootTemplatesMailCommand(const char* args); diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index c7de9c2..d9bcad4 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -500,6 +500,19 @@ void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner) fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true); } +void GameObject::getFishJunkLoot(Loot *fishloot, Player* loot_owner) +{ + fishloot->clear(); + sLog.outError("This should be junk!"); + uint32 zone, subzone; + GetZoneAndAreaId(zone,subzone); + + // if subzone loot exist use it + if (!fishloot->FillLoot(subzone, LootTemplates_FishingJunk, loot_owner, true, true)) + // else use zone loot (must exist in like case) + fishloot->FillLoot(zone, LootTemplates_FishingJunk, loot_owner,true, true); +} + void GameObject::SaveToDB() { // this should only be used when the gameobject has already been loaded @@ -1167,11 +1180,10 @@ void GameObject::Use(Unit* user) } else { - // fish escaped, can be deleted now - SetLootState(GO_JUST_DEACTIVATED); - - WorldPacket data(SMSG_FISH_ESCAPED, 0); - player->GetSession()->SendPacket(&data); + player->RemoveGameObject(this,false); + SetOwnerGUID(player->GetGUID()); + player->UpdateFishingSkill(); + player->SendLoot(GetGUID(),LOOT_FISHINGJUNK); } break; } diff --git a/src/game/GameObject.h b/src/game/GameObject.h index c6cfc00..d681f36 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -637,6 +637,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject void Refresh(); void Delete(); void getFishLoot(Loot *loot, Player* loot_owner); + void getFishJunkLoot(Loot *loot, Player* loot_owner); GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); } void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); } GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); } diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index adf33d3..a7e2859 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -367,6 +367,14 @@ bool ChatHandler::HandleReloadLootTemplatesFishingCommand(const char*) SendGlobalSysMessage("DB table `fishing_loot_template` reloaded."); return true; } +bool ChatHandler::HandleReloadLootTemplatesFishingJunkCommand(const char*) +{ + sLog.outString( "Re-Loading Loot Tables... (`fishing_junk_template`)" ); + LoadLootTemplates_FishingJunk(); + LootTemplates_FishingJunk.CheckLootRefs(); + SendGlobalSysMessage("DB table `fishing_junk_template` reloaded."); + return true; +} bool ChatHandler::HandleReloadLootTemplatesGameobjectCommand(const char*) { diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index abd73ca..f65358f 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -38,6 +38,7 @@ static eConfigFloatValues const qualityToRate[MAX_ITEM_QUALITY] = { LootStore LootTemplates_Creature( "creature_loot_template", "creature entry", true); LootStore LootTemplates_Disenchant( "disenchant_loot_template", "item disenchant id", true); LootStore LootTemplates_Fishing( "fishing_loot_template", "area id", true); +LootStore LootTemplates_FishingJunk( "fishing_junk_template", "area id", true); LootStore LootTemplates_Gameobject( "gameobject_loot_template", "gameobject entry", true); LootStore LootTemplates_Item( "item_loot_template", "item entry", true); LootStore LootTemplates_Mail( "mail_loot_template", "mail template id", false); @@ -364,6 +365,7 @@ bool LootItem::AllowedForPlayer(Player const * player) const // Inserts the item into the loot (called by LootTemplate processors) void Loot::AddItem(LootStoreItem const & item) { + sLog.outError("I'm here too! This makes me angry!!"); if (item.needs_quest) // Quest drop { if (quest_items.size() < MAX_NR_QUEST_ITEMS) @@ -391,7 +393,7 @@ bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, // Must be provided if(!loot_owner) return false; - + sLog.outError("Loot::FillLoot after 1st return"); LootTemplate const* tab = store.GetLootFor(loot_id); if (!tab) @@ -400,7 +402,7 @@ bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, sLog.outErrorDb("Table '%s' loot id #%u used but it doesn't have records.",store.GetName(),loot_id); return false; } - + sLog.outError("Loot::FillLoot after 2nd return"); items.reserve(MAX_NR_LOOT_ITEMS); quest_items.reserve(MAX_NR_QUEST_ITEMS); @@ -417,7 +419,7 @@ bool Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner, // ... for personal loot else FillNotNormalLootFor(loot_owner); - + sLog.outError("Loot::FillLoot before last return"); return true; } @@ -435,6 +437,7 @@ void Loot::FillNotNormalLootFor(Player* pl) qmapitr = PlayerNonQuestNonFFAConditionalItems.find(plguid); if (qmapitr == PlayerNonQuestNonFFAConditionalItems.end()) + sLog.outError("Before FillNonQuestNonFFAConditionalLoot"); FillNonQuestNonFFAConditionalLoot(pl); } @@ -498,6 +501,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player) QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player) { + sLog.outError(" In Loot::FillNonQuestNonFFAConditionalLoot"); QuestItemList *ql = new QuestItemList(); for(uint8 i = 0; i < items.size(); ++i) @@ -1146,6 +1150,23 @@ void LoadLootTemplates_Fishing() LootTemplates_Fishing.ReportUnusedIds(ids_set); } +void LoadLootTemplates_FishingJunk() +{ + LootIdSet ids_set; + LootTemplates_FishingJunk.LoadAndCollectLootIds(ids_set); + + // remove real entries and check existence loot + for(uint32 i = 1; i < sAreaStore.GetNumRows(); ++i ) + { + if(AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i)) + if (ids_set.find(areaEntry->ID) != ids_set.end()) + ids_set.erase(areaEntry->ID); + } + + // output error for any still listed (not referenced from appropriate table) ids + LootTemplates_FishingJunk.ReportUnusedIds(ids_set); +} + void LoadLootTemplates_Gameobject() { LootIdSet ids_set, ids_setUsed; @@ -1340,7 +1361,8 @@ void LoadLootTemplates_Reference() // check references and remove used LootTemplates_Creature.CheckLootRefs(&ids_set); - LootTemplates_Fishing.CheckLootRefs(&ids_set); + LootTemplates_Fishing.CheckLootRefs(&ids_set); + LootTemplates_FishingJunk.CheckLootRefs(&ids_set); LootTemplates_Gameobject.CheckLootRefs(&ids_set); LootTemplates_Item.CheckLootRefs(&ids_set); LootTemplates_Milling.CheckLootRefs(&ids_set); diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h index 0b7914d..8e52878 100644 --- a/src/game/LootMgr.h +++ b/src/game/LootMgr.h @@ -71,7 +71,8 @@ enum LootType LOOT_MILLING = 8, LOOT_FISHINGHOLE = 20, // unsupported by client, sending LOOT_FISHING instead - LOOT_INSIGNIA = 21 // unsupported by client, sending LOOT_CORPSE instead + LOOT_INSIGNIA = 21, // unsupported by client, sending LOOT_CORPSE instead + LOOT_FISHINGJUNK = 22 }; class Player; @@ -322,6 +323,7 @@ struct LootView extern LootStore LootTemplates_Creature; extern LootStore LootTemplates_Fishing; +extern LootStore LootTemplates_FishingJunk; extern LootStore LootTemplates_Gameobject; extern LootStore LootTemplates_Item; extern LootStore LootTemplates_Mail; @@ -334,6 +336,7 @@ extern LootStore LootTemplates_Spell; void LoadLootTemplates_Creature(); void LoadLootTemplates_Fishing(); +void LoadLootTemplates_FishingJunk(); void LoadLootTemplates_Gameobject(); void LoadLootTemplates_Item(); void LoadLootTemplates_Mail(); @@ -350,6 +353,7 @@ inline void LoadLootTables() { LoadLootTemplates_Creature(); LoadLootTemplates_Fishing(); + LoadLootTemplates_FishingJunk(); LoadLootTemplates_Gameobject(); LoadLootTemplates_Item(); LoadLootTemplates_Mail(); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8e396d3..0fe56cd 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7584,8 +7584,11 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type) // And permit out of range GO with no owner in case fishing hole if (!go || (loot_type != LOOT_FISHINGHOLE && (loot_type != LOOT_FISHING || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this,INTERACTION_DISTANCE))) { - SendLootRelease(guid); - return; + if ( loot_type != LOOT_FISHINGJUNK ) + { + SendLootRelease(guid); + return; + } } loot = &go->loot; @@ -7609,10 +7612,12 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type) loot->FillLoot(lootid, LootTemplates_Gameobject, this, false); } - if (loot_type == LOOT_FISHING) - go->getFishLoot(loot,this); + if (loot_type == LOOT_FISHING) + go->getFishLoot(loot,this); + if (loot_type == LOOT_FISHINGJUNK) + go->getFishJunkLoot(loot,this); - go->SetLootState(GO_ACTIVATED); + go->SetLootState(GO_ACTIVATED); } break; } And there is a new sql table "fishing_junk_template", this is a copy of the "fishing_loot_template".
  3. When I use the Lance Racks in ATG it does nothing. The rack uses this spell. This spell would have to make Alliance Lance for alliance caracters, and Horde Lance for the horde caracters. With this it works. void Spell::EffectScriptEffect(uint32 effIndex) { // TODO: we must implement hunter pet summon at login there (spell 6962) switch(m_spellInfo->Id) { case 63845: // Lance Rack if (Unit* caster = GetCaster()) { switch(caster->getRace()) { // Alliance Lance case RACE_HUMAN: m_caster->CastSpell(m_caster, 63914, true); break; case RACE_DWARF: m_caster->CastSpell(m_caster, 63914, true); break; case RACE_NIGHTELF: m_caster->CastSpell(m_caster, 63914, true); break; case RACE_GNOME: m_caster->CastSpell(m_caster, 63914, true); break; case RACE_DRAENEI: m_caster->CastSpell(m_caster, 63914, true); break; // Horde Lance case RACE_ORC: m_caster->CastSpell(m_caster, 63919, true); break; case RACE_UNDEAD_PLAYER: m_caster->CastSpell(m_caster, 63919, true); break; case RACE_TAUREN: m_caster->CastSpell(m_caster, 63919, true); break; case RACE_TROLL: m_caster->CastSpell(m_caster, 63919, true); break; case RACE_BLOODELF: m_caster->CastSpell(m_caster, 63919, true); break; default: break; } } return; } (SpellEffects.cpp 4995th line)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use