Jump to content

caeruleaus

Members
  • Posts

    185
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by caeruleaus

  1. it's not a duplicate, look at the names.... GetUInt32Value != GetInt32Value
  2. caeruleaus

    some pointers

    it reduces memory usage in the long run because you're not recreating a variable every time but instead passing a reference (ie why it's called a "pointer") to the object so you don't have to recreate it every time. It took me a while to understand it but it's relatively easy. You just have to be careful where you use it and to delete any un-used objects otherwise you get a lot of memory leaks. And pointers to pointers can be dangerous because if you delete the original pointer then the new pointer points to a reference in memory that no longer exists and causes a crash.
  3. since a lot of people don't seem to be downloading the patch to test i pushed it to my github repo git clone git://github.com/caeruleaus/mangos.git git checkout dalaranflyres it's updated to the current mangos master
  4. hey if you get anywhere but get stuck and need help or anything, I'll give it a shot. I haven't fully had time to look at the code yet but it's not too too hard to figure out
  5. it was mentioned earlier in this thread a long time ago that they would consider core integration if you removed the need of a player to populate the AH.
  6. i can attempt to merge everything. I'll give it a shot tomorrow maybe
  7. in the modified branch? The master branch is just a copy of the mangos master http://github.com/caeruleaus/mangos/tree/modified
  8. I'm gonna be updating my repo shortly. I'm waiting for blueboy to push his changes to playerbot. Also, I'm making a scriptdev2 branch in case anyone is interested.
  9. i see you haven't pushed the changed yet. Gonna be fun to fix the merge conflicts in my custom fork since i had the survey patch applied lol
  10. you get the auras that spells apply when you cast them as well as your spells so it causes a bunch of crazy stuff.
  11. yeah I was thinking of seeing if i could override it from the core somehow. I know it's a client problem but i was thinking maybe you could trick the client by sending a false id for broken items just for the use in spells. Like add it to the item_template like normal but have a check to see what equipment type it is and when the client expects a melee weapon (dagger, sword, etc), send a fake ID of a item with that equipment type. I havent looked into it yet but if i figure something out ill post it.
  12. yeah, I had originally just put a check directly into the equip item method but I just wanted to see what i could do to make it easier and more customizable. There are a few items that only 1 person can have (The Ahn'Quiraj Battle Tank for example) but that was only because you could only get it by opening the AQ gates. This takes it to a bit of a further level (you can still get the item, but you can only equip it if your name matches the item or whatever). Again if I had a few people posting about it i could go as far as adding a table to the quest_template that on complete makes it so the item you get is bound to the first person to finish it. It would be a lot of work but it would be fun to see how well I can do some c++ (I usually code in Java, but my programming class in college is doing c++ now)
  13. yeah that was kind of the idea. It's more of a way to control GM's abusing special weapons and stuff meant for higher level gms but it would be fun for some form of role playing or something along that line. I was thinking of making it so you could do multiple names or possibly char GUID's but i just wanted to see if anyone would be interested in it. Or maybe restrict the item to specific GM levels.
  14. sorry i had my code tags messed up but it should look correct now lol.
  15. I merged in Insider42's branch. What error are you getting?
  16. I decided to see if i could implement this through the mysql database and i did. This allows you to make a weapon only usable by a specific person so you can make custom super weapons for specific people. to get it just pull my branch git pull git://github.com/caeruleaus/mangos.git reqname or apply the diff: diff --git a/reqname.sql b/reqname.sql new file mode 100644 index 0000000..7d960a5 --- /dev/null +++ b/reqname.sql @@ -0,0 +1 @@ +ALTER TABLE item_template ADD RequiredName VARCHAR(255) AFTER RequiredLevel; \\ No newline at end of file diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 19b2c13..143b37d 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -283,6 +283,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data ) { std::string Name = pProto->Name1; std::string Description = pProto->Description; + std::string RequiredName = pProto->RequiredName; int loc_idx = GetSessionDbLocaleIndex(); if ( loc_idx >= 0 ) diff --git a/src/game/ItemPrototype.h b/src/game/ItemPrototype.h index 4ee2831..8bae625 100644 --- a/src/game/ItemPrototype.h +++ b/src/game/ItemPrototype.h @@ -529,6 +529,7 @@ struct ItemPrototype uint32 AllowableRace; uint32 ItemLevel; uint32 RequiredLevel; + char* RequiredName; //Won't let anyone but specified name equip/use uint32 RequiredSkill; // id from SkillLine.dbc uint32 RequiredSkillRank; uint32 RequiredSpell; // id from Spell.dbc @@ -642,6 +643,7 @@ struct ItemLocale { std::vector<std::string> Name; std::vector<std::string> Description; + std::vector<std::string> RequiredName; }; // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2992f68..cda30fc 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -9999,7 +9999,7 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo dest = 0; if( pItem ) { - sLog.outDebug( "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); + sLog.outDebug( "STORAGE: CanEquipItem slot = %u, item = %u, count = %u, name = %s", slot, pItem->GetEntry(), pItem->GetCount(), pItem->GetProto()->RequiredName); ItemPrototype const *pProto = pItem->GetProto(); if( pProto ) { @@ -10014,7 +10014,9 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo uint8 res = CanTakeMoreSimilarItems(pItem); if(res != EQUIP_ERR_OK) return res; - + std::string RequiredName = pItem->GetProto()->RequiredName; + if(RequiredName != "" && this->GetName() != RequiredName) + return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; // check this only in game if(not_loading) { diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index 9f8e32a..70cc572 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -33,8 +33,8 @@ const char CreatureInfoAddonInfofmt[]="iiiiiis"; const char EquipmentInfofmt[]="iiii"; const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiiii"; -const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiii"; +const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiiii"; +const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiii"; const char PageTextfmt[]="isi"; const char InstanceTemplatesrcfmt[]="iiiiffffs"; const char InstanceTemplatedstfmt[]="iiiiffffi";
  17. try updating to the head now and see if it works, i forgot to add a few files to the makefile.
  18. i had to manually apply your survey patch but all seems to be working. I created a repo with playerbot and a few other mods. It seems to run fine though i don't really have an extensive testing bed.
  19. try using --whitespace=fix when using apply like git apply playerbotfix.patch --whitespace=fix
  20. at the time that i posted this, that project wasnt really around lol. but ill update this thread, maybe it'll get stickied.
  21. Id just like to know it it's working correctly on windows. I mean i guess no news is good news.
  22. I was bored so i made a patch for windows builds. I know for sure it works on VC90 but not sure about 80 or 100. Some people test it out for me. DOWNLOAD EDIT: I don't know if mangos actually runs, i just got it to compile. I don't have my computer set up for mangos at the moment otherwise I'd test it.
×
×
  • 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