

balrok
Members-
Posts
222 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Everything posted by balrok
-
you need to configure it right in the top of the script, and then just run it with argument1 as starting revision number, (starting means, from what point all updates are read) it only works since mangos rev6936 and sd2 rev221 if you give a number as second argument the script determines, if this is a sd or mangos rev improvements are welcome #!/bin/bash DB_MANGOS="mangos" DB_CHARACTERS="characters" DB_REALMD="realmd" DB_SCRIPTDEV="scriptdev2" USER="root" PASS="lalala" EXECUTE=0 DIR="/home/mangos/mangos/source" if [ -z $1 ]; then echo "usage: ./mysql_updater #startrevision" echo "if #startrevision is lower than 6936 it guesses a sd2-rev" echo "else it thinks its a mangos-rev" exit 1 fi if [[ $1 =~ ^[0-9]+$ ]]; then if [ $1 -lt 6936 ]; then if [ $1 -lt 221 ]; then echo "revisions lower 221 are not supported - your rev" $1 exit 1 fi echo "sd2 revnumber - patching sd2 from rev" $1 else echo "mangos revnumber - patching mangos from rev" $1 fi else echo "you should use integers as revisionnumber" exit 1 fi START_REV=$1 #startrevision if [ $1 -ge 6936 ]; then #mangos MANGDIR=$DIR"/sql/updates" for b in $( ls ${MANGDIR} | grep -v "2008" | grep -v "acid" | grep sql); do REV=$(echo $b | sed -r 's/([0-9]*).*/\\1/') if [ $REV -lt 6936 ]; then echo "strange file recived stopping " $b exit 1 fi if [ $REV -lt $START_REV ]; then continue fi if echo "$b" | grep -q mangos; then echo "mysql "$DB_MANGOS" -u"$USER" -p"$PASS" < "$MANGDIR"/"$b";" if [ $EXECUTE -eq 1 ]; then mysql $DB_MANGOS -u$USER -p$PASS < $MANGDIR"/"$b";" fi elif echo "$b" | grep -q characters; then echo "mysql "$DB_CHARACTERS" -u"$USER" -p"$PASS" < "$MANGDIR"/"$b";" if [ $EXECUTE -eq 1 ]; then mysql $DB_CHARACTERS -u$USER -p$PASS < $MANGDIR"/"$b";" fi elif echo "$b" | grep -q realmd; then echo "mysql "$DB_REALMD" -u"$USER" -p"$PASS" < "$MANGDIR"/"$b";" if [ $EXECUTE -eq 1 ]; then mysql $DB_REALMD -u$USER -p$PASS < $MANGDIR"/"$b";" fi else echo "-------WARNING ONE FILE IS MISSING:---" $MANGDIR"/"$b fi done else #sd2 SD2DIR=$DIR"/src/bindings/ScriptDev2/sql/Updates/" for b in $( ls ${SD2DIR} | grep sql | grep "r[0-9]*_" ); do REV=$(echo $b | sed -r 's/r([0-9]*).*/\\1/') if [ $REV -ge 6936 -o $REV -lt 221 ]; then echo "strange file recived stopping " $b exit 1 fi if [ $REV -lt $START_REV ]; then continue fi if echo "$b" | grep -q mangos; then echo "mysql "$DB_MANGOS" -u"$USER" -p"$PASS" < "$SD2DIR"/"$b";" if [ "$EXECUTE" -eq "1" ]; then mysql $DB_MANGOS -u$USER -p$PASS < $SD2DIR"/"$b";" fi elif echo "$b" | grep -q scriptdev2; then echo "mysql "$DB_SCRIPTDEV" -u"$USER" -p"$PASS" < "$SD2DIR"/"$b";" if [ "$EXECUTE" -eq "1" ]; then mysql $DB_SCRIPTDEV -u$USER -p$PASS < $SD2DIR"/"$b";" fi elif echo "$b" | grep -q characters; then echo "mysql "$DB_CHARACTERS" -u"$USER" -p"$PASS" < "$SD2DIR"/"$b";" if [ "$EXECUTE" -eq "1" ]; then mysql $DB_CHARACTERS -u$USER -p$PASS < $SD2DIR"/"$b";" fi elif echo "$b" | grep -q realmd; then echo "mysql "$DB_REALMD" -u"$USER" -p"$PASS" < "$SD2DIR"/"$b";" if [ "$EXECUTE" -eq "1" ]; then mysql $DB_REALMD -u$USER -p$PASS < $SD2DIR"/"$b";" fi else echo "-------WARNING ONE FILE IS MISSING:---" $SD2DIR"/"$b fi done fi
-
hello, i hope you are still here, or someone with cmake experience is here, i tested your cmakelists.txt and changed some stuff diff: --- pastebin.php?dl=f350ad0db 2009-01-17 16:20:58.000000000 +0100 +++ CMakeLists.txt 2009-01-17 16:16:25.000000000 +0100 @@ -41,6 +41,9 @@ src/game/ArenaTeamHandler.cpp src/game/AuctionHouse.cpp src/game/Bag.cpp +src/game/BattleGroundDS.cpp +src/game/BattleGroundRV.cpp +src/game/BattleGroundSA.cpp src/game/BattleGround.cpp src/game/BattleGroundAA.cpp src/game/BattleGroundAB.cpp @@ -157,9 +160,8 @@ src/game/WorldSocket.cpp src/game/WorldSocketMgr.cpp src/game/debugcmds.cpp -src/game/tools.cpp ) -add_library( mangosscript SHARED +add_library( mangosscript SHARED src/bindings/universal/ScriptMgr.cpp src/bindings/universal/Scripts/sc_default.cpp src/bindings/universal/Scripts/sc_defines.cpp @@ -696,4 +698,4 @@ SET_TARGET_PROPERTIES( ace PROPERTIES COMPILE_FLAGS -fPIC ) install( TARGETS mangos-worldd mangos-realmd ZThread mangosscript RUNTIME DESTINATION /usr/local/bin - LIBRARY DESTINATION /usr/local/lib ) \\ No newline at end of file + LIBRARY DESTINATION /usr/local/lib ) but i get some error, after compiling, and don't know how this can be solved: Scanning dependencies of target ace [ 4%] Building CXX object CMakeFiles/ace.dir/dep/ACE_wrappers/ace/ACE.o In file included from /home/mangos/mangos/source/./dep/ACE_wrappers/ace/config-lite.h:24, from /home/mangos/mangos/source/./dep/ACE_wrappers/ace/ACE.h:25, from /home/mangos/mangos/source/dep/ACE_wrappers/ace/ACE.cpp:3: /home/mangos/mangos/source/./dep/ACE_wrappers/ace/config-macros.h:27:24: error: ace/config.h: No such file or directory In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/backward/new.h:33, from /home/mangos/mangos/source/./dep/ACE_wrappers/ace/Global_Macros.h:912, from /home/mangos/mangos/source/./dep/ACE_wrappers/ace/Flag_Manip.h:26, from /home/mangos/mangos/source/./dep/ACE_wrappers/ace/ACE.h:32, from /home/mangos/mangos/source/dep/ACE_wrappers/ace/ACE.cpp:3: /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_signal.h:239: error: declaration of C function 'int sigwait(sigset_t*)' conflicts with /usr/include/signal.h:272: error: previous declaration 'int sigwait(const sigset_t*, int*)' here /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_ucontext.h:40: error: conflicting declaration 'typedef int ucontext_t' /usr/include/sys/ucontext.h:127: error: 'ucontext_t' has a previous declaration as 'typedef struct ucontext ucontext_t' /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/sys/os_socket.h:44: error: redefinition of 'struct msghdr' /usr/include/bits/socket.h:217: error: previous definition of 'struct msghdr' /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_time.h:58: error: redefinition of 'struct timespec' /usr/include/time.h:122: error: previous definition of 'struct timespec' /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_time.h:64: error: invalid type in declaration before ';' token /home/mangos/mangos/source/./dep/ACE_wrappers/ace/OS_NS_signal.h:51: error: using typedef-name 'siginfo_t' after 'struct' /usr/include/bits/siginfo.h:108: error: 'siginfo_t' has a previous declaration here /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_sched.h:44: error: conflicting declaration 'typedef struct cpu_set_t cpu_set_t' /usr/include/bits/sched.h:118: error: 'cpu_set_t' has a previous declaration as 'typedef struct cpu_set_t cpu_set_t' /home/mangos/mangos/source/./dep/ACE_wrappers/ace/os_include/os_stropts.h:99: error: redefinition of 'struct strbuf' /usr/include/bits/stropts.h:181: error: previous definition of 'struct strbuf' make[2]: *** [CMakeFiles/ace.dir/dep/ACE_wrappers/ace/ACE.o] Error 1 make[1]: *** [CMakeFiles/ace.dir/all] Error 2 make: *** [all] Error 2 it would be great if mangos can be configured this way, it looks very easy to edit and configured everything in 5seconds - i think the old autoconf way needs at least some minutes
-
sorry for offtopic and a bit complicated looking resolution for your git problem if your change is already commited, make it possible that you can add your changes to the staging area again (git rebase -i <edit commit> git reset HEAD^ or if its the last commit, just do a git reset HEAD^) then you can git add every change you want if your mistake is alone in this file, without any other changes, you just can ignore this file and dont add it (git checkout -f file can revert every change in this file) or do a git add -i file p(atching) file 1 (to select file) enter and then it shows every hunk and you can tell what hunks to add and what hunk shouldnt be added a nice overview about what y,a,n,d,s means is in git help add so you just add everything without this change another faster solution is maybe just remove your wrong whitespaces, it seems that you indented this line a bit more.. btw: learning how to use rebase -i and add -i is also usefull if you like to play with git, it's a nice feature to split bigger patches (and i actually doing this, thats why i can tell something about it (: ) but please be aware, that rebase is a dangerous tool and you easily can break something with it..
-
mh i never pushed with -f, but i got a strange error last time, i thought it's a github bug maybe you try it with git pull -f then you force a pull
-
if this doesn't affect the speed so much, i think this can be rejected.. cause the coding-style doesn't look as good as before.. i made the last improvement, which i could find about this, and merged this new query to the guildloading query above.. in my github repo under the branch "guildloading" this can be found.. but i don't think i look further for this, cause i just did a delete from guild, and now my problems are solved^^ maybe mangos shouldn't load all guilds at startup.. only that one, which are needed in the last 2-7 days.. and if guild-information about not loaded guilds is needed, then it trys to load it after this.. - but i can't implement something like this^^ - it's just an idea
-
[patch][7275] Generic "getbattlegroundqueueidfromlevel"
balrok replied to a topic in ... acceptedOld
hello, i updated this to the newest revision, with rewriting everything from the ground.. also i renamed many wrong named function variables and so on.. at least this should be put to master, cause before there existed three totaly different queue_id's i tested it a bit, and it should work.. the commits can be found here: http://github.com/balrok/mangos/commits/queue_id -
who has written the patch? balrok what should this patch do? speed up server starting for what revision? rev @ 13.12. i compared with phpmyadmin: edit: when i run every update several time the first one goes down to 1.x seconds and the second command goes down to 0.000x seconds mysql version:5.0.51a so i made this fix diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 1b69292..f5ef907 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -459,7 +459,7 @@ void Master::clearOnlineAccounts() "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID); - CharacterDatabase.Execute("UPDATE characters SET online = 0"); + CharacterDatabase.Execute("UPDATE characters SET online = 0 WHERE online<>0"); } /// Handle termination signals after that, i searched the code for other similar queries with grep -i "execute.*UPDATE" game/WorldSocket.cpp | grep -vi "WHERE" and only found those queries: Level2.cpp:3140: WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '0'"); Level3.cpp:4567: CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u'",atLogin);
-
who has written the patch? balrok what is the aim of the patch: speedup guildloading at server-start is there a bugreport? no Cause the last days i had a real big characters-database with very much testdata, i noticed, that on server-startup there are many 4 queries for every guildmember to get it's data.. example: SQL: SELECT name FROM characters WHERE guid = '1086483' SQL: SELECT data FROM characters WHERE guid='1086483' SQL: SELECT zone FROM characters WHERE guid='1086483' SQL: SELECT class FROM characters WHERE guid='1086483' cause it always accesses characters-table i thought about merging those queries together.. a viewable patch can be found here: http://mangos-files.eu/patches/?file=faster_guildloading.patch and a downloadable one here: http://mangos-files.eu/patches/faster_guildloading.patch i haven't tested,if this realy will improve the speed, also the code looks not so nice as before, so you have to decide what will be better
-
i think gentoo will be the best for a server cause then you don't have to struggle with the ubuntu-bugs. and to know more about what your system does.. also, if you like the open source idea, you can be sure that gentoo is upstreaming it's patches back to the developers.. which may be a criteria for someone.. i see Ubuntu offers a server edition while Kubuntu does not? how will that affect the performance if i go with kubuntu normal Download? i don't think that ubuntu-server-edition uses gnome.. so there will also be no kde ;-) a server mostly doesn't have a graphical interface.. dabian isn't based on any other distribution.. ubuntu is based on debian-unstable (or testing or something like that) i also would recommend ubuntu, cause you don't need to do much and have a very big community where you can find help
-
what feature does this patch add: implements rl-arena just, to split up the arena-patch who has been writing this patch: w12x and i copied it + modified it a bit patch can be found here http://github.com/balrok/mangos/tree/bg_rl if you think the coding-style is good i will make a branch for all other arena-files.. One thing may be a bit slow, this is the function getaliveplayerscount. Later, if the system provides a better way to get the current team (based on bg-team not faction) it will be possible to use an array (one value for each team), declared in battleground-class which increments at battleground::addplayer and player::ressurect... it will decrement at battleground::removeplayer and player::kill but this can be easily extended and is currently not a big problem, cause arenas just don't work
-
this guide is as always just the way i do it, which surely can be improved somehow, feel free to criticize me and posting better solutions merging arena with alterac: (co is an alias for checkout ) git co master git co -b alterac git remote add balrok balroks_git-pull_url git pull balrok alterac git co master git co -b arena git pull balrok arena git co alterac git co -b av-arena git merge arena *some conflicts occur* git mergetool *successfully merged* (you also can edit at this point some parts by hand, it doesn't matter) git commit -a -you are done- git mergetool: i use vimdiff, but wyk3d said that kdiff3 is a great tool.. and i think most other users will be happy with this too, cause it has a gui so you are able to use your mouse.. but i explain my vimdiff-view cause i don't know how it'll looks like in kdiff at vimdiff it opens a vimeditor, with a splitscreen with 3 files in it: filename.cpp.LOCAL the file like it was before the merge filename.cpp - the file it looked like after the merge (also with some >>> === <<< signs in it to show you the conflicts you could easily resolv) filename.cpp.REMOTE - the file from the branch you try to merge in now i explain every thing you need to change, so that av works together with arena battleground.cpp 455 <<<<<<< HEAD:src/game/BattleGround.cpp 456 winmsg = GetMangosString(LANG_BG_A_WINS); //TODO herald yells this.. (at least in bg_av) 457 ======= 458 if(isBattleGround()) 459 winmsg = GetMangosString(LANG_BG_A_WINS); 460 else 461 winmsg = GetMangosString(LANG_ARENA_GOLD_WINS); 462 >>>>>>> arena:src/game/BattleGround.cpp <<<< this code is from the alterac-branch (or the branch where you are currently in) ==== this code is from the other branch you try to merge in (arena) >>>>> cause the difference is just a comment, you can remove the alterac part so that after the change it looks like: 458 if(isBattleGround()) 459 winmsg = GetMangosString(LANG_BG_A_WINS); 460 else 461 winmsg = GetMangosString(LANG_ARENA_GOLD_WINS); the next thing in this file happens sometimes and is confusing: 1521 <<<<<<< HEAD:src/game/BattleGround.cpp 1522 int32 BattleGround::GetObjectType(uint64 guid) 1523 { 1524 for(uint32 i = 0;i <= m_BgObjects.size(); i++) 1525 if(m_BgObjects[i] == guid) 1526 return i; 1527 sLog.outError("BattleGround: cheating? a player used a gameobject which isnt supposed to be a usable object!"); 1528 return -1; 1529 } 1530 1531 void BattleGround::HandleKillUnit(Creature *creature, Player *killer) 1532 { 1533 ======= 1534 // return the player's team based on battlegroundplayer info 1535 // used in same faction arena matches mainly 1536 uint32 BattleGround::GetPlayerTeam(uint64 guid) 1537 { 1538 std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.find(guid); 1539 if(itr!=m_Players.end()) 1540 return itr->second.Team; 1541 return 0; 1542 } 1543 1544 uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const 1545 { 1546 int count = 0; 1547 for(std::map<uint64, BattleGroundPlayer>::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) 1548 { 1549 if(itr->second.Team == Team) 1550 { 1551 Player * pl = objmgr.GetPlayer(itr->first); 1552 if(pl && pl->isAlive()) 1553 ++count; 1554 } 1555 } 1556 return count; 1557 >>>>>>> arena:src/game/BattleGround.cpp 1558 } at the first time i haven't seen any relation, why this couldn't be merged be the script but after the compilation failed i found it out, look at these parts 1531 void BattleGround::HandleKillUnit(Creature *creature, Player *killer) 1532 { 1533 ======= 1556 return count; 1557 >>>>>>> arena:src/game/BattleGround.cpp 1558 } alterac had a function-segment ending with "}" and an arena-function, which also ended with "}" stole it so you have to edit this code, that you just replace the "====" line with a "}" in an earlier merge i've also seen that the "return true" was stolen.. so watch out for thieves.. also don't forget to remove the ">>>>", "===" and "<<<<" lines they are just for you to find out what things are conflicting next file: language.h quite easy, just remove the >>,==,<< lines and you are finished unit.cpp this conflict was with copying one part at another section, cause it's hard to explain and doesn't have much to do with stupid conflict-resolving (also it's not userfriendly) i changed the alterac patch in a way, that this conflict doesn't happen anymore.. thank you for reading, i hope something gets clear for you now.. and the best thing to learn merging is just practice.. this guide looks long but you are done with it in less then 5minutes
-
Multithreaded maps performance discussion
balrok replied to Auntie Mangos's topic in OldGeneral discussion
it just means random output.. your file also should be mangos-worldd i don't think that any (/etc/init.d/ for example) bash-script which starts a mangos-daemon can be checked with gdb (but maybe you'll test it by yourself) and if you realy have your bin in etc.. it's ok, but etc is mostly used for configuration-files, not binary -
Multithreaded maps performance discussion
balrok replied to Auntie Mangos's topic in OldGeneral discussion
mhh gdb is not that hard to use.. $gdb path/to/file ... ...gdb needs a bit time to start ... gdb-console>run .. ..mangos starts .. .. mangos crashes .. gdb-console>bt some information about the latest things $ means that you run this in your normal bash and ">" means the intern prompt of gdb.. -
search the code for an example look at level3.cpp Tokens data; Player::LoadValuesArrayFromDB(data,targetGUID); level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL); data get it's values cause you give it to "loadv..." by reference..
-
but if multithreading gets implemented, please look out, that the battleground-system can get its own process (cause somewhere derex written that it won't be possible to add multiprocessing to a multithreaded-code) - only if this will be possible i voted btw for multithreading, cause i don't have any clue what will be better and want that this poll has a draw at the end, so that people with knowledge about this have to decide it by thereself
-
you're right this is important too, i added it as a sidenote
-
i want to give a short guide how to set up an own fork with an own branch (for patchwriters or developers) i'm no expert in git, i just explain how i did it, there are surely better ways for this, so please read comments to the thread if someone know better ways or hints) also i just have linux, but i think for windows this should be quite the same first create a github-account and provide your ssh-key to them.. if you don't have ssh-keys already (mostly found in ~/.ssh/*.pub) you need to run "ssh-keygen" and then the pub-key is in "~/.ssh/id_rsa.pub (or dsa if you specified it) then go to http://github.com/mangos/mangos/tree/master and press the "fork" button you now should be in "http://github.com/YOUR-NAME/mangos/tree/master" and, if you are on this page, you should see the "public clone url" is just for simple cloning (like the public in mangos/mangos)"your clone url" is for cloning and pushing (so if you want to make changes to your fork, you need this url (or if you allowed someone else to commit to your fork he also needs to checkout from there) --- side note: if you haven't set your name+email do it now: $ git config --global user.name "My Name" $ git config --global user.email [email][email protected][/email]" it's good for anybody who has questions to you, if you don't set this you only will be listed as "unknown" (which is a cool nickname, but confuses others) /end sidenote --- git clone yourclone_url source cd source git remote add upstream git://github.com/mangos/mangos.git //update mangos: git pull upstream master //create own branch git checkout -b //edit something, commit something echo "muh" >> THANKS git commit -a //now push it to your internet-space //origin, cause you cloned it from there git push origin test //dont forget the branch-name --> finished if it needs much time for devs to review your patch or you just want to update it: cd source git checkout master git pull upstream master git checkout Your_branch git merge master //if problems occur git mergetool git commit -a //endif git push origin Your_branch If you do want to delete the remote branch you can use: "git push origin :branch_to_delete". notes: please read freghars post about commitmessages in short: specify a commit-header containing 50 chars (if you don't know how to summarize to 50 chars you surely need to commit more often) followed by 2 newlines and then you can describe your changes by as much text as you want (i have seen a linux-kernel commit where the comment was 50 lines and the code changed were just 3 lines^^) push when you think you're ready, mostly there is no need to be fast.. cause if you want to change something already commited later, it will be bad for everyone who checked out your branch cause the sha-hashes won't fit anymore
-
scriptdev2.com download their scripts, compile it with mangos and read one of their scripts, also you can look how the scripts behave ingame, and if you ask a script-related question at their forum, the people there can help you better, than the people from mangosforum
-
i just like the idea to customize mangos
-
i uploaded a working version: http://mangos-files.eu/patches/?file=playerloot.patch but you only can loot others, when he/she released their spirit - also it's not possible to loot players from own faction edit: now it should also be possible to loot players who hasn't released their spirit: http://github.com/balrok/mangos/commit/0d82232c5379bbb31602e0e1d0fdcf3eda677572
-
the problem is simply, that it's currently not implemented to loot players outside bg.. i'll look later where i can change this behaviour..
-
you added loot in creature_loot_template for id 1? i haven't tested my patchfile, i just looked, if it will compile.. if you are quite sure, that you added the loot and the patch right, i'll look for the problem..
-
http://mangos-files.eu/patches/?file=playerloot.patch compiles at my computer.. next time, please give a more detailed information, about what part of code doesn't compile (i at least can't see whats in your player.cpp at line 7213)
-
this was the wrong-code part where you are searching ^^ this just looks, if a player can loot a specific gameobject, when the mine-owner changed (and yes, this is a hack ^^) (maybe player-loot is also a hack) cause i already extracted the code somewhere, here you have a nice patch: and you just need to remove the line with "if(GetBattleGround()->GetTypeID() ==BATTLEGROUND_AV) " out of it, then it'll work everywhere.. Index: Player.cpp =================================================================== --- Player.cpp (revision 6446) +++ Player.cpp (working copy) @@ -7068,6 +7068,8 @@ bones->lootForBody = true; uint32 pLevel = bones->loot.gold; bones->loot.clear(); + if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV) //make other conditions if you want + loot->FillLoot(1, LootTemplates_Creature, this); //1 is the id in creature_template // It may need a better formula // Now it works like this: lvl10: ~6copper, lvl70: ~9silver bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) ); Index: LootHandler.cpp =================================================================== --- LootHandler.cpp (revision 6446) +++ LootHandler.cpp (working copy) @@ -29,6 +29,7 @@ #include "Group.h" #include "World.h" #include "Util.h" +#include "ObjectAccessor.h" void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data ) { @@ -68,6 +69,16 @@ loot = &pItem->loot; } + else if (IS_CORPSE_GUID(lguid)) + { + Corpse *bones = ObjectAccessor::GetCorpse(*player, lguid); + if (!bones) + { + player->SendLootRelease(lguid); + return; + } + loot = &bones->loot; + } else { Creature* pCreature =
-
thank you for sharing your great work i want also learn python, so i have a look at it
Contact Us
To contact us
click here
You can also email us at [email protected]
Privacy Policy | Terms & Conditions

You can also email us at [email protected]
Privacy Policy | Terms & Conditions
Copyright © getMaNGOS. All rights Reserved.
This website is in no way associated with or endorsed by Blizzard Entertainment®
This website is in no way associated with or endorsed by Blizzard Entertainment®