Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Static AV Loot Table
- struct AVLoot
- {
- uint32 ItemId;
- int8 Faction;
- float Chance;
- uint32 MinCount;
- uint32 MaxCount;
- };
- const static AVLoot g_avLoot[] = {
- // Alliance Loot
- { 17306, 0, 100.0f, 1, 1 }, // Stormpike Soldier's Blood
- { 17326, 0, 80.0, 1, 1 }, // Stormpike Soldier's Meat
- // Horde Loot
- { 17423, 1, 50.0f, 1, 1 }, // Crystal Cluster
- // Global loot
- { 17422, -1, 100.0f, 1, 5 }, // Armor Scrap
- // EOF
- { 0, 0, 0},
- };
- void AlteracValley::HookGenerateLoot(Player *plr, Object *pCorpse)
- {
- const AVLoot *loot_ptr = &g_avLoot[0];
- while(loot_ptr->ItemId != 0)
- {
- if( loot_ptr->Faction == -1 || loot_ptr->Faction == static_cast<int8>( plr->GetTeam() ))
- {
- if( Rand(loot_ptr->Chance * sWorld.getRate(RATE_DROP0)) )
- {
- __LootItem li;
- ItemPrototype *pProto = ItemPrototypeStorage.LookupEntry(loot_ptr->ItemId);
- if( pProto != NULL )
- {
- li.ffa_loot = 0;
- li.item.displayid = pProto->DisplayInfoID;
- li.item.itemproto = pProto;
- if( loot_ptr->MinCount != loot_ptr->MaxCount )
- li.iItemsCount = RandomUInt(loot_ptr->MaxCount - loot_ptr->MinCount) + loot_ptr->MinCount;
- else
- li.iItemsCount = loot_ptr->MinCount;
- li.iRandomProperty = NULL;
- li.iRandomSuffix = NULL;
- li.passed = false;
- li.roll = NULL;
- // push to vector
- TO< Corpse* >(pCorpse)->loot.items.push_back(li);
- }
- }
- }
- ++loot_ptr;
- }
- // add some money
- float gold = ((plr->getLevel() / 2.5f) + 1.0f) * 100.0f; // fix this later
- gold *= sWorld.getRate(RATE_MONEY);
- // set it
- TO< Corpse* >(pCorpse)->loot.gold = float2int32(gold);
- }
Advertisement
Add Comment
Please, Sign In to add comment