All pastes #554703 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-10 07:20 UTC
rendered paste body
void Tier6Gossip::GossipSelectOption(Creature* pCreature, Player* Plr, uint32 Id, uint32 IntId)
{
    sLog.outDebug("Gossip_Tier6.cpp : Select option %u by %s", IntId, Plr->GetName());
    switch(IntId)
    {
                case 1:
                        //ItemPrototype * proto = objmgr.GetItemPrototype(1327);
                        //Item * pItem = objmgr.CreateItem(1327, Plr);
                        //if(!Plr->GetItemInterface()->AddItemToFreeSlot(pItem))
uint32 setid = ("thesetid"); //do this
uint32 ItemId; //because scripts are ghay
WorldSession * m_session;  //another fucking hack fix, not sure if this will work

	ItemSetEntry *entry = sItemSetStore.LookupEntry(setid);
	std::list<ItemPrototype*>* l = objmgr.GetListForItemSet(setid);
	if(!entry || !l)
	{
		break;
	}
	const char* setname = sItemSetStore.LookupString(entry->name);
	uint32 start = getMSTime();
	for(std::list<ItemPrototype*>::iterator itr = l->begin(); itr != l->end(); ++itr)
	{
		Item *itm = objmgr.CreateItem((*itr)->ItemId, m_session->GetPlayer());
		if(!itm) continue;
		if(!chr->GetItemInterface()->AddItemToFreeSlot(itm))
		{
			m_session->SendNotification("No free slots left!"); //if it doesnt work, delete it.
			delete itm;
			return true;
		} 
	}
       break;  
}  
        
}