Jump to content

player loot


Guest marx

Recommended Posts

oke i think someone else looking for it ..mangos got awsome av patch ...and player loot works in av that ya kill player and get items what have been added to creature loot template entry 1 ..so i know its possible to add that everywere ,like on all maps but can anyone help me out here

need to edit something in it ithink or mabye anyone can give some info

 if(go->getLootState() == GO_READY)
        {
           if((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S))
               if( BattleGround *bg = GetBattleGround())
                   if(bg->GetTypeID() == BATTLEGROUND_AV)
                       if(!(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(go->GetEntry(),GetTeam())))
                       {
                           SendLootRelease(guid);
                           return;
                       }

           if(uint32 lootid = go->GetLootId())
            {
                loot->clear();
                loot->FillLoot(lootid, LootTemplates_Gameobject, this);
               go->SetLootState(GO_ACTIVATED);
            }

            if(loot_type == LOOT_FISHING)
                go->getFishLoot(loot);
            go->SetLootState(GO_ACTIVATED);
        }
    }
@@ -7150,6 +7184,8 @@
            bones->lootForBody = true;
            uint32 pLevel = bones->loot.gold;
            bones->loot.clear();
           if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV)
               loot->FillLoot(1, LootTemplates_Creature, this);
            // It may need a better formula
            // Now it works like this: lvl10: ~6copper, lvl70: ~9silver
            bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) );

Link to comment
Share on other sites

oke i think someone else looking for it ..mangos got awsome av patch ...and player loot works in av that ya kill player and get items what have been added to creature loot template entry 1 ..so i know its possible to add that everywere ,like on all maps but can anyone help me out here

need to edit something in it ithink or mabye anyone can give some info

Im asking him.

so this code lets you loot off a player if they are dead in av?

and you are wanting to let any player loot from any player if they die any where on any map? Not just av?

I Do not really know.

But maybe you can add that code you have to the map.cpp

maybe.

Like i did i didnt want any player to be able to use gm commands in any instance so i added a custom that would deactivate any command i didnt want the players to us while the run a instance. like speed and i didnt want any player to be able to summon them out of the instance or appear to them . and i want to add a welcome message to the player explaing whats going on with there commands and why they do not work.

if (player->activate_commands == true && player->Instance_Enter == false)

{

player->activate_commands =false;

player->Instance_Enter = true;

player->activate_Fly = false;

player->broadcast_command= false;

player->GodModeCheat = false;

player->activate_Gm = false;

player->SetSpeed(MOVE_WALK, 1,true);

player->SetSpeed(MOVE_WALKBACK,1,true);

player->SetSpeed(MOVE_RUN, 1,true);

player->SetSpeed(MOVE_SWIM, 1,true);

player->SetSpeed(MOVE_FLY, 1,true);

player->jap_commands = true;//they can not

player->jtp_commands = true;//they can not

player->BroadcastMessage("|cffFFFFFF Wecome To Mancent Gm FunServer.");

player->BroadcastMessage("|cffFFFFFF You Have Entered An Instance All Your Commands Are Now Deactivated.");

player->BroadcastMessage("|cffFFFFFF Once You Leave This Instance All Your Commands Will Reactivate.");

}

Link to comment
Share on other sites

this was the wrong-code part where you are searching ^^ this just looks, if a player can loot a specific gameobject, when the mine-owner changed (and yes, this is a hack ^^)

(maybe player-loot is also a hack)

cause i already extracted the code somewhere, here you have a nice patch:

and you just need to remove the line with "if(GetBattleGround()->GetTypeID() ==BATTLEGROUND_AV) " out of it, then it'll work everywhere..

Index: Player.cpp
===================================================================
--- Player.cpp    (revision 6446)
+++ Player.cpp    (working copy)
@@ -7068,6 +7068,8 @@
            bones->lootForBody = true;
            uint32 pLevel = bones->loot.gold;
            bones->loot.clear();
+            if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV) //make other conditions if you want
+                loot->FillLoot(1, LootTemplates_Creature, this); //1 is the id in creature_template
            // It may need a better formula
            // Now it works like this: lvl10: ~6copper, lvl70: ~9silver
            bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) );
Index: LootHandler.cpp
===================================================================
--- LootHandler.cpp    (revision 6446)
+++ LootHandler.cpp    (working copy)
@@ -29,6 +29,7 @@
#include "Group.h"
#include "World.h"
#include "Util.h"
+#include "ObjectAccessor.h"

void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
{
@@ -68,6 +69,16 @@

        loot = &pItem->loot;
    }
+    else if (IS_CORPSE_GUID(lguid))
+    {
+        Corpse *bones = ObjectAccessor::GetCorpse(*player, lguid);
+        if (!bones)
+        {
+            player->SendLootRelease(lguid);
+            return;
+        }
+        loot = &bones->loot;
+    }
    else
    {
        Creature* pCreature =

Link to comment
Share on other sites

i got new core added that patch and still nothing ...did i do something wrong or it yust isint working ..tred some other ways to nothing so far..

if anyone can help me out here..all suggestions welcomed

and i would like to have that players get loot allways if player gets killed not on spesific level

Link to comment
Share on other sites

i uploaded a working version:

http://mangos-files.eu/patches/?file=playerloot.patch

but you only can loot others, when he/she released their spirit - also it's not possible to loot players from own faction

edit: now it should also be possible to loot players who hasn't released their spirit:

http://github.com/balrok/mangos/commit/0d82232c5379bbb31602e0e1d0fdcf3eda677572

Link to comment
Share on other sites

  • 1 month later...
its working good so ty again but is there any way to add something like this

player can only loot if he have get fonor from the target

and loot same player only once

Sure, just edit the code, use additional checks, ... if you don't know how, try learning it, others won't always do the work for you.

Link to comment
Share on other sites

  • 1 year later...
×
×
  • 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