Jump to content

chmuun

Members
  • Posts

    41
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by chmuun

  1. Umm guys i meant that like account bans are kept in "realmd"(DB) and "account_banned"(Table) and sorry about my first post ... i know its kinda confusing Thanks guys, MaNGOS should have a character ban system maybe.
  2. Hi, I've searched a lot but i didn't find if the characters are banned where is it stored in DB that tells it that it is banned, please help. Thanks!
  3. Does any one knows any new stable revision?
  4. Hey all The current version I'm using 9239 is unstable... Crarshes after about every 2 hours Can any one please tell me a revision above 9239 and is a lil more stable Thanks
  5. I am having problems with my script on compile I want to know how to convery UNIT to PLAYER or how to make a new instance of PLAYER by Guid or how to get WorldSession of UNIT PLEASE HELP ME! this = Player* pVictim = Unit* Thanks in advance
  6. Can some one tell me how to give items to players in C++, I've tried looking in the class files, couldnt find anything
  7. Damn!, I really need that hook and i have no idea how to make one... Its so hard
  8. if u have the custom hook please please please can u give it to me... Or can u talk to me on msn [email protected]
  9. Stab can u tell me where to put the custom hooks?
  10. These 2 files are a class file for a PvP script of mine, it saves/loads/stores the PvP Stats(onpvpkill) made on arcemu, can some 1 please convert this to work with MaNGOS, i've tried really hard but idk about the vector and objmgr.getplayer or things like that PvPManager.cpp: #include "StdAfx.h" #include "PvPManager.h" PvPMgr::PvPMgr() { Index = 0; CurrentKills = 0; TotalKills = 0; GroupKills = 0; TotalDeaths = 0; LastGuid = 0; LastGuidCount = 0; Spree = 0; LastSpree = 0; CurrentDeaths = 0; IsInTurny = false; } void PvPMgr::SaveData() { CharacterDatabase.Query("REPLACE INTO `pvpmanager` VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", Index, CurrentKills, TotalKills, GroupKills, Spree, TotalDeaths, CurrentDeaths, LastGuid, LastGuidCount); } void PvPMgr::LoadData() { QueryResult * result = CharacterDatabase.Query("SELECT * FROM `pvpmanager` WHERE `index` = '%u'", Index); if(!result) { return; } Field * rows = result->Fetch(); CurrentKills = rows[1].GetUInt32(); TotalKills = rows[2].GetUInt32(); GroupKills = rows[3].GetUInt32(); Spree = rows[4].GetUInt32(); LastSpree = rows[4].GetUInt32(); TotalDeaths = rows[5].GetUInt32(); CurrentDeaths = rows[6].GetUInt32(); LastGuid = rows[7].GetUInt32(); LastGuidCount = rows[8].GetUInt32(); } void PvPMgr::AddItem(const uint32 &ItemID, const uint32 &Amt, const bool &Stack) { Item * ItemToAdd; SlotResult Slot; Player * Plr = objmgr.GetPlayer(Index); if(Plr == NULL) return; if(Stack) { ItemToAdd = Plr->GetItemInterface()->FindItemLessMax(ItemID, Amt, false); if(ItemToAdd != NULL) { ItemToAdd->ModUnsigned32Value(ITEM_FIELD_STACK_COUNT, Amt); ItemToAdd->m_isDirty = true; Plr->BroadcastMessage("%s%s x%u Awarded", MSG_COLOR_GOLD, ItemToAdd->GetProto()->Name1, Amt); return; } } for(uint32 i = 1;i <= Amt;i++) { ItemToAdd = objmgr.CreateItem(ItemID, Plr); if(ItemToAdd == NULL) return; // failed creation, no memory to allocate, or invalid item id Slot = Plr->GetItemInterface()->FindFreeInventorySlot(ItemToAdd->GetProto()); if(Slot.Result) { Plr->GetItemInterface()->SafeAddItem(ItemID, Slot.ContainerSlot, Slot.Slot); Plr->BroadcastMessage("%s%s x1 Awarded", MSG_COLOR_GOLD, ItemToAdd->GetProto()->Name1); } else Plr->BroadcastMessage("No free inventory slots could be located, aborting"); } } PvPStorage *PvPStorage::Instance = NULL; PvPStorage::PvPStorage() { } PvPStorage *PvPStorage::GetInstance() { if(Instance == NULL) Instance = new PvPStorage(); return Instance; } PvPMgr *PvPStorage::CreateMgr(const uint32 &Index) { PvPMgr *Mgr = new PvPMgr(); if(Mgr == NULL) return NULL; // no memory to allocate Mgr->Index = Index; StorageLock.Acquire(); Vect.push_back(Mgr); StorageLock.Release(); return Mgr; } PvPMgr *PvPStorage::GetMgr(const uint32 &Index, const bool Create) { StorageLock.Acquire(); for(Itr = Vect.begin();Itr != Vect.end();Itr++) { if((*Itr)->Index == Index) { StorageLock.Release(); return (*Itr); } } StorageLock.Release(); if(Create) { PvPMgr * mgr = CreateMgr(Index); mgr->LoadData(); return mgr; } return NULL; } void PvPStorage::CleanVect() { if(Vect.empty()) return; StorageLock.Acquire(); Itr = Vect.begin(); while(Itr != Vect.end()) { Player * Eraser = objmgr.GetPlayer((*Itr)->Index); if(Eraser == NULL || Eraser->IsInWorld() == false || Eraser->GetSession() == NULL) { if((*Itr)->Summon) { (*Itr)->Summon->Despawn(0,0); } Itr = Vect.erase(Itr); } else { Itr++; } } StorageLock.Release(); } PvPManager.h: #ifndef PvPMgr_H #define PvPMgr_H #include "StdAfx.h" #include "Setup.h" class PvPMgr { private: bool IsInTurny; public: uint32 Index; uint32 CurrentKills; uint32 TotalKills; uint32 GroupKills; uint32 TotalDeaths; uint32 LastGuid; uint32 LastGuidCount; uint32 Spree; uint32 LastSpree; uint32 CurrentDeaths; Creature * Summon; PvPMgr(); void AddItem(const uint32 &ItemID, const uint32 &Amt, const bool &Stack = false); void SaveData(); void LoadData(); }; class PvPStorage : public EventableObject { private: static PvPStorage *Instance; vector<PvPMgr*> Vect; vector<PvPMgr*>::iterator Itr; Mutex StorageLock; PvPStorage(); void CleanVect(); public: static PvPStorage *GetInstance(); PvPMgr *CreateMgr(const uint32 &Index); PvPMgr *GetMgr(const uint32 &Index, const bool Create); void StartTimer(); vector<PvPMgr*> GetVect() { return Vect; } }; #endif SQL CODE:
  11. That link is for Kills in Battle Ground
  12. Kich0 i checked the ScriptMgr there is no "OnPvPKill" event to hook some thing like that... would i have to make a custom patch for it?
  13. Is there a way i can make a Script on C++ with SD2 to make a PvP(On PvP Kill) to give the killer reward??? i really need to make a PvP Rewarder script
  14. Sorry about that last post Moderatos and Administrators, i didnt know it wasnt allowed that is why i said tell me if im not allowed If im allowed can i ask Whats is ScriptDev2/ACID and mtmaps and what are the benefits Thank you all for the great support!
×
×
  • 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