Jump to content

[Help] Trying to make players lootable.


Guest Zyrtec
 Share

Recommended Posts

Any help is greatly appreciated. I'm pretty new to C++, so I'm just looking for some direction.

* When a player dies(not in BG/Arena/Instance).

+ Move all equipment/gold to corpse.

- Where should I do this at setDeathState(), CreateCorpse() or ...?

- How would I add items to the corpse, possibly like how trading works. Where the items stay on the character, but if someone selects an item to loot off of their corpse, it's unequipped and placed in the killers inventory? If that's possible, that way when they return to get their corpse, any items not looted wont have to be equipped back onto the character...

+ Make corpse lootable, only to opposing faction.

- corpse->SetFlag(CORPSE_FIELD_DYNAMIC_FLAGS, CORPSE_DYNFLAG_LOOTABLE);

- Not sure how to make it so only the opposing faction can loot them.

- And only limiting it to either the individual to who did the killing, group or everyone(I'd prefer FFA).

Link to comment
Share on other sites

i have tried that once, but it made the core very crashy (havent found out why).

keep in mind that you want the loot to be present also if a player releases spirit, which converts the dead player object to a corpse/bones object, means you have to copy remaining unlooted items over.

an easier attempt would be making a system that gives a set of randomly selected items to the player who does the killing blow.

i have some system like this in my repo:

http://github.com/fgenesis/mangos/blob/f54aac529152f760615a3b791ed8f85cec6aef24/src/game/PlayerDropMgr.cpp

http://github.com/fgenesis/mangos/blob/f54aac529152f760615a3b791ed8f85cec6aef24/src/game/PlayerDropMgr.h

also search for "GivePlayerDropReward" and "sPlayerDropStore" in my Player.cpp and copy the modified code. i dont have a patch file for this anymore, so you will have to resolve missing stuff or conflicts yourself.

it uses this additional table instead of traditional loot tables:

CREATE TABLE `player_drop_template` (
 `guid` bigint(16) unsigned NOT NULL DEFAULT '0',
 `racemask` int(11) NOT NULL DEFAULT '-1',
 `classmask` int(11) NOT NULL DEFAULT '-1',
 `gender` tinyint(1) unsigned NOT NULL DEFAULT '0',
 `item` int(11) unsigned NOT NULL DEFAULT '0',
 `chance` float unsigned NOT NULL DEFAULT '100',
 `mincount` int(11) unsigned NOT NULL DEFAULT '1',
 `maxcount` int(11) unsigned NOT NULL DEFAULT '1',
 `kminlvl` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `kmaxlvl` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `vminlvl` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `vmaxlvl` tinyint(3) unsigned NOT NULL DEFAULT '0',
 `lvldiff` tinyint(3) NOT NULL DEFAULT '-70',
 `map` int(10) NOT NULL DEFAULT '-1',
 PRIMARY KEY (`guid`,`racemask`,`classmask`,`gender`,`item`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

if you can extend it to make players really lootable, would be nice to share this with me. good luck, i hope i could help at least a little. btw you can write me a PM anytime.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • 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