i need to know how to make the Warsong glutch battleground give the winning/ losing team my custom token i went in the WarsongGlutch.cpp and i dont know what to edit can someone help me -.-
i need to know how to make the Warsong glutch battleground give the winning/ losing team my custom token i went in the WarsongGlutch.cpp and i dont know what to edit can someone help me -.-
The marks in WSG are added by using this spell
Create Warsong Mark of Honor (WInner) - Spell - World of Warcraft
So to fix this for new items, you must edit the script, not just change the ID in the script.
One way would to remake the DBC, edit the item recived by this spell. I think...
Else, the part where this can be found look like this in ArcEmu
I'm sure you can edit the code instead of CastSpell((*itr), loser_spell, true); to give the item... but to bad I'm suck at c++ atm =PCode:/* add the marks of honor to all players */ SpellEntry * winner_spell = dbcSpell.LookupEntry(24950); SpellEntry * loser_spell = dbcSpell.LookupEntry(24951); for(uint32 i = 0; i < 2; ++i) { for(set<Player*>::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) { (*itr)->Root(); if(i == m_winningteam) (*itr)->CastSpell((*itr), winner_spell, true); else (*itr)->CastSpell((*itr), loser_spell, true); } }
Last edited by Power of Illuminati; 06-24-2008 at 02:55 PM.
how can i edit the Dbc?
Hmm, wasn't able to find anything in the DBC now when I looked.. damn =P Only way would be to edit the script, so it gives the item instead of casting a spell... trying to find the command right now
(*itr)->GetItemInterface()->AddItemToFreeSlot(Item);
Of course, that will not deal with cases where the player already has a stack of tokens and you want to add to it.
Found where to edit the item given by the spell now.
You open your DBC file spell.dbc by using a DBC editor.. search on the forums, there is some somewhere.
This is laggy, real laggy =P
Then you scroll down to the IDs 24950 and 24951. These are the spell IDs...
Now go to the right till you comes to field 108. On these lines you see a number, 20558. This is the ItemID (atleast what it looks like as this is the WSG mark itemID )
Change that to your customitem... and atleast give it a test
what i wrote for EOTSItemPrototype *winneritem = ItemPrototypeStorage.LookupEntry(29024);
ItemPrototype *loseritem = ItemPrototypeStorage.LookupEntry(29024);
//SpellEntry * winner_spell = dbcSpell.LookupEntry(24953);
//SpellEntry * loser_spell = dbcSpell.LookupEntry(24952);
for(uint32 i = 0; i < 2; ++i)
{
for(set<Player*>::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
{
(*itr)->Root();
if(i == m_winningteam)
{
SlotResult slotresult;
slotresult = (*itr)->GetItemInterface()->FindFreeInventorySlot(winneritem);
if(!slotresult.Result)
{
(*itr)->GetItemInterface()->BuildInventoryChangeError(NULL, NULL, INV_ERR_INVENTORY_FULL);
}
else
{
Item *itm = objmgr.CreateItem(29024, (*itr));
itm->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 3);
(*itr)->GetItemInterface()->SafeAddItem(itm,slotresult.ContainerSlot, slotresult.Slot);
(*itr)->SaveToDB(false);
}
}
else
{
SlotResult slotresult;
slotresult = (*itr)->GetItemInterface()->FindFreeInventorySlot(loseritem);
if(!slotresult.Result)
{
(*itr)->GetItemInterface()->BuildInventoryChangeError(NULL, NULL, INV_ERR_INVENTORY_FULL);
}
else
{
Item *itm = objmgr.CreateItem(29024, (*itr));
itm->SetUInt32Value(ITEM_FIELD_STACK_COUNT, 1);
(*itr)->GetItemInterface()->SafeAddItem(itm,slotresult.ContainerSlot, slotresult.Slot);
(*itr)->SaveToDB(false);
}
}
}
}