Jump to content

Darkruler

Members
  • Posts

    206
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Darkruler

  1. We're not allowed to speak about "making it available to your friends over the internet" here, but you could search on other forums (such as ac-web) for that info
  2. @ Wyarp what part of didnt you understand
  3. player->GetSession()->GetAccountId() the "player" definition depends on where you intend to put this code but i think you'll manage from here and note that im still learning as well and cant test because my core is screwed after commit 10156
  4. True, i wasn't saying that they needed to adjust the existing ones and the primary key is still present after using the update sql, having a primary key (which should be an unique identifier ) that doesn't even exist...now that isn't right
  5. For as far as i can see, effect_index doesn't need a replacement and the issue you're talking about is not only a problem in sql/characters.sql but also in sql/updates/10156_01_characters_character_aura.sql and sql/updates/10156_02_characters_pet_aura.sql needed is: ALTER TABLE character_aura DROP PRIMARY KEY; ALTER TABLE character_aura ADD PRIMARY KEY (`guid`,`spell`); ALTER TABLE pet_aura DROP PRIMARY KEY; ALTER TABLE pet_aura ADD PRIMARY KEY (`guid`,`spell`);
  6. My guess is that another app was running on port 80 and thus it couldn't start to use it after the reboot, the app that kept port 80 running was closed and thus apache could use it
  7. @ Blueboy As you might know, we (HSC_DEV3 and me) got a custom project, our core and SD2 will take a couple of days to merge with the new MaNGOS commits (yes, it really is THAT bad) so i totally understand what you meant with minefield after checking the merge conflicts in the core (246 merge conflicts, BIG ONES) haven't even checked SD2 yet
  8. changed from void RemoveSingleAuraFromStack(uint32 spellId, SpellEffectIndex effindex, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); to void RemoveSingleAuraHolderFromStack(uint32 spellId, uint64 casterGUID = 0, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT); so probably change if (m_creature->HasAura(chargeSpell, EFFECT_INDEX_0)) { m_creature->RemoveSingleAuraFromStack(chargeSpell, EFFECT_INDEX_0); DoCastSpellIfCan(m_creature->getVictim(), unleashSpell); HasCast = true; --SoulChargeCount; } to if (m_creature->HasAura(chargeSpell, EFFECT_INDEX_0)) { m_creature->RemoveSingleAuraHolderFromStack(chargeSpell, m_creature); DoCastSpellIfCan(m_creature->getVictim(), unleashSpell); HasCast = true; --SoulChargeCount; } note: it's 01:00 (AM) so i was just going to bed when seeing this, it may not be correct
  9. Since this is now implemented in the master repo, i guess you can move it to accepted? EDIT: nvm, just noticed it was already moved (firefox didn't refresh, cached page still showed it being in under-review, saw it was in accepted after posting this )
  10. didn't take more than 30 seconds to try and find this so im not sure if this is correct but i think it is UNIT_BYTE2_FLAG_UNK2
  11. Small improvements to the account registration script: <?php $realmd = array( 'db_host'=> 'localhost', // Host IP 'db_username' => 'root', // Database login-name 'db_password' => 'mangos', // Database login-pass 'db_name'=> 'realmd', // Database name ); function check_for_symbols($string) { $len=strlen($string); $allowed_chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; for($i=0;$i<$len;$i++)if(!strstr($allowed_chars,$string[$i])) return TRUE; return FALSE; } function sha_password($user,$pass) { $user = strtoupper($user); $pass = strtoupper($pass); return SHA1($user.':'.$pass); } $realmd_bc_new_connect = mysql_connect($realmd[db_host],$realmd[db_username],$realmd[db_password]); if ($realmd_bc_new_connect) $selectdb = mysql_select_db($realmd[db_name],$realmd_bc_new_connect); else { echo "Could NOT connect to db: Configs (Name/Pass/Port/IP) are incorrect"; die; } if ($realmd_bc_new_connect && !$selectdb) { echo "Could NOT connect to db: Database does not exist!"; die; } if ($_POST['registration']) { $username = $_POST['username']; $password = sha_password($username,$_POST['password']); $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'"); if (check_for_symbols($_POST[password]) == TRUE) { echo "Error with creating account: password has invalid symbols in it."; } else if (check_for_symbols($username) == TRUE) { echo "Error with creating account: username has invalid symbols in it."; } else if (mysql_num_rows($qry_check_username) != 0) { echo "Error with creating account: name is already in use."; } else { mysql_query("INSERT INTO account (username,sha_pass_hash) VALUES ('$username','$password')"); echo "Account created."; } } else { ?> <html> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> Username <input type="text" name="username"> Password <input type="password" name="password"> <input type="submit" name="registration"> </form> </html> <?php } ?> The error messages are now split into pieces so you can actually tell what is wrong (instead of being given 3 options like "The name is already in use OR the pass contains incorrect symbols OR the name contains incorrect symbols) and for as far as i know, numbers are allowed in the name and pass as well so i've added them to the allowed_chars variable
  12. Are you using git apply? you should really be using patch -p1 < mangchat.patch as git apply sometimes comes up with the error you encountered
  13. diff is that he runs on x64 which is more error-sensitive (yours displays the error and goes on)
  14. it's the original SD2 repo with added customs for various instances, it's way better than clean SD2 (he even has a great part of ICC working ) he doesn't support Windows however, so you'll have to add some stuff to the solution files yourself
  15. if (checkcooldown && m_aggroDelay > 0 && !getPetType() == SUMMON_PET) return false; dunno if the pet has already been defined in the file targetted by the patch, otherwise it will need one ( Pet *pet = GetPet(); ) not only summoned creatures need to be excepted, all pets should be (right?) if (checkcooldown && m_aggroDelay > 0 && !pet) return false;
  16. 1st: that's not related to this patch 2nd: that's probably caused by the "minlevel" and "maxlevel" entries in the database, if a mob respawns he might get checked through that spawn system again and given a random level between min and max (not sure though)
  17. probably the check on how much talent points you SHOULD have in total (total = spent + unspent) overrides the command, when adding 500 talent points... each SPENT talent point after the total talent points you should have, removes the other 499 UNSPENT talent points (the talent you clicked does get spent, so you can still get a full talent tree by clicking -> .mod tp -> clicking -> .mod tp) hope that's enough information
  18. in the meanwhile, dont be lazy and apply it manually
  19. perhaps an areatrigger to fake it would do as well?
  20. try this diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ae03a34..9989ea0 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5520,15 +5520,27 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return false; Aura *aur = GetAura(71905, EFFECT_INDEX_0); - if (aur && uint32(aur->GetStackAmount() + 1) >= aur->GetSpellProto()->StackAmount) + if (aur && uint32(aur->GetStackAmount() + 1) == 0) + { + RemoveAurasDueToSpell(72521); // Remove First Effect + RemoveAurasDueToSpell(72523); + } + else if (aur && uint32(aur->GetStackAmount()) == 0) + CastSpell(this, 72521, false); // First Effect + else if (aur && uint32(aur->GetStackAmount()) == 5) + { + RemoveAurasDueToSpell(72521); // Remove First Effect + CastSpell(this, 72523, false); // Second Effect + } + else if (aur && uint32(aur->GetStackAmount() + 1) >= aur->GetSpellProto()->StackAmount) { RemoveAurasDueToSpell(71905); + RemoveAurasDueToSpell(72523); // Remove Second Effect CastSpell(this, 71904, true); // Chaos Bane return true; } else triggered_spell_id = 71905; - break; } i have no idea (yet) how to check if the stackamount is 0 outside of the spell case -.-
  21. likely fixed the stack amount needed for it to show up, it removes the visual after Chaos Bane is triggered by the max stack amount (or atleast...it DID)
  22. Yeah, i do... it does compile but after compiling you can't start mangosd.exe because of "SIDE BY SIDE CONFIGURATION INCORRECT" still looking for the problem
  23. PvP Token: From 8d17841e608c4c1ee8db22b62c2804b26351386f Mon Sep 17 00:00:00 2001 From: Dark <[email protected]> Date: Mon, 31 May 2010 15:49:35 +0200 Subject: [PATCH 1/2] PvP Token --- src/game/Language.h | 1 + src/game/Player.cpp | 30 ++++++++++++++++++++++++++++++ src/game/Player.h | 3 +++ src/game/Unit.cpp | 5 +++++ src/game/World.cpp | 9 +++++++++ src/game/World.h | 8 +++++++- src/mangosd/mangosd.conf.dist.in | 31 +++++++++++++++++++++++++++++++ 7 files changed, 86 insertions(+), 1 deletions(-) diff --git a/src/game/Language.h b/src/game/Language.h index 38ec346..4f8e6a9 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -851,6 +851,7 @@ enum MangosStrings // Use for not-in-offcial-sources patches // 10000-10999 + LANG_YOU_RECEIVE_TOKEN = 11050, // Use for custom patches 11000-11999 diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7513657..c83ed53 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21355,6 +21355,36 @@ void Player::UpdateFallInformationIfNeed( MovementInfo const& minfo,uint16 opcod SetFallInformation(minfo.GetFallTime(), minfo.GetPos()->z); } +///PVP Token +void Player::ReceiveToken() +{ + if(!sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE)) + return; + + uint8 MapRestriction = sWorld.getConfig(CONFIG_PVP_TOKEN_RESTRICTION); + + if( MapRestriction == 1 && !InBattleGround() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) || + MapRestriction == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP) || + MapRestriction == 3 && !InBattleGround()) + return; + + uint32 itemID = sWorld.getConfig(CONFIG_PVP_TOKEN_ITEMID); + uint32 itemCount = sWorld.getConfig(CONFIG_PVP_TOKEN_ITEMCOUNT); + + ItemPosCountVec dest; + uint8 msg = CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, itemID, itemCount); + if( msg != EQUIP_ERR_OK ) // convert to possible store amount + { + SendEquipError( msg, NULL, NULL ); + return; + } + + Item* item = StoreNewItem( dest, itemID, true, Item::GenerateItemRandomPropertyId(itemID)); + SendNewItem(item,itemCount,true,false); + + ChatHandler(this).PSendSysMessage(LANG_YOU_RECEIVE_TOKEN); +} + void Player::UnsummonPetTemporaryIfAny() { Pet* pet = GetPet(); diff --git a/src/game/Player.h b/src/game/Player.h index cdf20bb..12b201b 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1966,6 +1966,9 @@ class MANGOS_DLL_SPEC Player : public Unit void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply); void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply); + ///PVP Token + void ReceiveToken(); + void _ApplyItemMods(Item *item,uint8 slot,bool apply); void _RemoveAllItemMods(); void _ApplyAllItemMods(); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e35ab4f..4d57907 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -698,6 +698,11 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa { player_tap->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0); + /// PvP Token + int8 leveldiff = player_tap->getLevel() - pVictim->getLevel(); + if((pVictim->GetTypeId() == TYPEID_PLAYER) && leveldiff < 10) + player_tap->ReceiveToken(); + WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL data << player_tap->GetObjectGuid(); //player with killing blow data << pVictim->GetObjectGuid(); //victim diff --git a/src/game/World.cpp b/src/game/World.cpp index abf273d..11f967e 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -756,6 +756,15 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_UINT32_TIMERBAR_FIRE_GMLEVEL, "TimerBar.Fire.GMLevel", SEC_CONSOLE); setConfig(CONFIG_UINT32_TIMERBAR_FIRE_MAX, "TimerBar.Fire.Max", 1); + /* PvP Token System */ + setConfig(CONFIG_PVP_TOKEN_ENABLE,"PvPToken.Enable", true); + setConfig(CONFIG_PVP_TOKEN_ITEMID,"PvPToken.ItemID", 29434); + setConfig(CONFIG_PVP_TOKEN_ITEMCOUNT,"PvPToken.ItemCount", 1); + setConfig(CONFIG_PVP_TOKEN_RESTRICTION,"PvPToken.MapRestriction", 4); + + if(getConfig(CONFIG_PVP_TOKEN_ITEMCOUNT) < 1) + setConfig(CONFIG_PVP_TOKEN_ITEMCOUNT,"PvPToken.ItemCount",1); + m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1); if(m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE) { diff --git a/src/game/World.h b/src/game/World.h index b289b91..12d10ae 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -260,7 +260,13 @@ enum eConfigFloatValues CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS, CONFIG_FLOAT_GROUP_XP_DISTANCE, CONFIG_FLOAT_THREAT_RADIUS, - CONFIG_FLOAT_VALUE_COUNT + CONFIG_FLOAT_VALUE_COUNT, + + ///PVP Token + CONFIG_PVP_TOKEN_ENABLE, + CONFIG_PVP_TOKEN_ITEMID, + CONFIG_PVP_TOKEN_ITEMCOUNT, + CONFIG_PVP_TOKEN_RESTRICTION }; /// Configuration elements diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 673ed2a..5717262 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -1508,3 +1508,34 @@ SOAP.Port = 7878 CharDelete.Method = 0 CharDelete.MinLevel = 0 CharDelete.KeepDays = 30 + +################################################################################################################### +# PvP Token System (custom patch) +# +# PvPToken.Enable +# Enable/disable PvP Token system. +# Default: 1 (enabled) +# 0 (disabled) +# +# PvPToken.ItemID +# The item ID of the token that players will receive after killing an enemy. +# Default: 29434 (Badge of Justice) +# +# PvPToken.ItemCount +# The count amount of the ItemID +# Default: 1 +# +# PvPToken.MapRestriction +# The type of maps where players can receive the token +# Default: 4 - all maps +# 3 - battlegrounds only +# 2 - FFA areas only (both instanced and world arenas) +# 1 - battlegrounds and FFA areas only +# +################################################################################################################### + +PvPToken.Enable = 1 +PvPToken.ItemID = 29434 +PvPToken.ItemCount = 1 +PvPToken.MapRestriction = 4 + -- PvP Announcer: From 0c184680cf5d185b3c9510eb1d105d1b1a27d692 Mon Sep 17 00:00:00 2001 From: Dark <[email protected]> Date: Mon, 31 May 2010 14:50:21 +0100 Subject: [PATCH] PvP Announcer Signed-off-by: Dark <[email protected]> --- src/game/Unit.cpp | 7 +++++++ src/game/World.cpp | 18 ++++++++++++++++++ src/game/World.h | 10 ++++++++-- src/mangosd/mangosd.conf.dist.in | 11 +++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e35ab4f..751f017 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -698,6 +698,13 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa { player_tap->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0); + /// PvP Announcer + if (sWorld.getConfig(CONFIG_BOOL_PVP_ANNOUNCER)) + { + if (pVictim->GetTypeId() == TYPEID_PLAYER) + sWorld.SendPvPAnnounce(player_tap, ((Player*)pVictim)); + } + WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL data << player_tap->GetObjectGuid(); //player with killing blow data << pVictim->GetObjectGuid(); //victim diff --git a/src/game/World.cpp b/src/game/World.cpp index abf273d..63ab448 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -61,6 +61,7 @@ #include "GMTicketMgr.h" #include "Util.h" #include "CharacterDatabaseCleaner.h" +#include "Language.h" INSTANTIATE_SINGLETON_1( World ); @@ -77,6 +78,20 @@ float World::m_MaxVisibleDistanceInFlight = DEFAULT_VISIBILITY_DISTANCE; float World::m_VisibleUnitGreyDistance = 0; float World::m_VisibleObjectGreyDistance = 0; +///PVP Announcer +void World::SendPvPAnnounce(Player* killer, Player* killed) +{ + std::ostringstream msg; + std::ostringstream KillerName; + std::ostringstream KilledName; + + KillerName << killer->GetName(); + KilledName << killed->GetName(); + + msg << "|CFFFFFF01[" << KillerName.str().c_str() << "]" << "|CFF0042FF Has Killed " << "|CFFFFFF01[" << KilledName.str().c_str() << "]" << "|CFFE55BB0 in " << "|CFFFE8A0E[" << killer->GetBaseMap()->GetMapName() << "]"; + SendWorldText(LANG_SYSTEMMESSAGE, msg.str().c_str()); +} + /// World constructor World::World() { @@ -756,6 +771,9 @@ void World::LoadConfigSettings(bool reload) setConfig(CONFIG_UINT32_TIMERBAR_FIRE_GMLEVEL, "TimerBar.Fire.GMLevel", SEC_CONSOLE); setConfig(CONFIG_UINT32_TIMERBAR_FIRE_MAX, "TimerBar.Fire.Max", 1); + /* PvP Announcer System */ + setConfig(CONFIG_BOOL_PVP_ANNOUNCER,"PvPAnnouncer.Enable", true); + m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1); if(m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE) { diff --git a/src/game/World.h b/src/game/World.h index b289b91..4f245be 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -260,7 +260,10 @@ enum eConfigFloatValues CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS, CONFIG_FLOAT_GROUP_XP_DISTANCE, CONFIG_FLOAT_THREAT_RADIUS, - CONFIG_FLOAT_VALUE_COUNT + CONFIG_FLOAT_VALUE_COUNT, + + ///PVP Announcer + CONFIG_BOOL_PVP_ANNOUNCER }; /// Configuration elements @@ -517,7 +520,10 @@ class World void SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self = 0, uint32 team = 0); void SendZoneText(uint32 zone, const char *text, WorldSession *self = 0, uint32 team = 0); void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = NULL); - + + ///PVP Announcer + void SendPvPAnnounce(Player* killer, Player* killed); + /// Are we in the middle of a shutdown? bool IsShutdowning() const { return m_ShutdownTimer > 0; } void ShutdownServ(uint32 time, uint32 options, uint8 exitcode); diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 673ed2a..81f9129 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -1508,3 +1508,14 @@ SOAP.Port = 7878 CharDelete.Method = 0 CharDelete.MinLevel = 0 CharDelete.KeepDays = 30 + +################################################################################################################### +# PvP Announcer System (custom patch) +# +# PvPAnnouncer.Enable +# Enable/disable PvP Announcer system. +# Default: 1 (enabled) +# 0 (disabled) +################################################################################################################### + +PvPAnnouncer.Enable = 1 --
×
×
  • 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