Jump to content

Anti

Members
  • Posts

    81
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by Anti

  1. There are all updates which was posted by gen1us2k. I just applyed it in the commit. I want vehicle class work with dbc data but I can't implement it now.
  2. I have remastered the regen system for vehicles. And now there are works a vehicles like Salvaged Chopper. Added new data for vahicle_* tables. Thanks to gen1us2k There was posted only base part of my fix. diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 04c7e99..24d6da9 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -81,14 +81,14 @@ void Vehicle::Update(uint32 diff) if(m_regenTimer <= diff) { - Regenerate(getPowerType()); + RegeneratePower(getPowerType()); m_regenTimer = 4000; } else m_regenTimer -= diff; } -void Vehicle::Regenerate(Powers power) +void Vehicle::RegeneratePower(Powers power) { uint32 curValue = GetPower(power); uint32 maxValue = GetMaxPower(power); @@ -98,11 +98,12 @@ void Vehicle::Regenerate(Powers power) float addvalue = 0.0f; - if(m_vehicleInfo->m_powerType == POWER_STEAM) - addvalue = 20.0; - else - if(m_vehicleInfo->m_powerType == POWER_PYRITE) - return; + // hack: needs more research of power type from the dbc. + // It must contains some info about vehicles like Salvaged Chopper. + if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE) + return; + + addvalue = 20.0f; ModifyPower(power, (int32)addvalue); } @@ -149,43 +150,42 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u { ((InstanceMap*)map)->GetInstanceData()->OnCreatureCreate(this); } - if(Creature *cre = dynamic_cast<Creature*>(this)) + + if(m_vehicleInfo->m_powerType == POWER_TYPE_STEAM) { - if(m_vehicleInfo->m_powerType == POWER_STEAM) - { - this->setPowerType(POWER_ENERGY); - this->SetMaxPower(POWER_ENERGY, 100); - this->SetPower(POWER_ENERGY, 100); - } - else if(m_vehicleInfo->m_powerType == POWER_PYRITE) - { - this->setPowerType(POWER_ENERGY); - this->SetMaxPower(POWER_ENERGY, 50); - this->SetPower(POWER_ENERGY, 50); - } - else + setPowerType(POWER_ENERGY); + SetMaxPower(POWER_ENERGY, 100); + SetPower(POWER_ENERGY, 100); + } + else if(m_vehicleInfo->m_powerType == POWER_TYPE_PYRITE) + { + setPowerType(POWER_ENERGY); + SetMaxPower(POWER_ENERGY, 50); + SetPower(POWER_ENERGY, 50); + } + else + { + for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i) { - for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i) - { - if(!cre->m_spells[i]) - continue; - SpellEntry const *spellInfo = sSpellStore.LookupEntry(cre->m_spells[i]); - if(!spellInfo) - continue; + if(!GetVehicleData()->v_spells[i]) + continue; + SpellEntry const *spellInfo = sSpellStore.LookupEntry(GetVehicleData()->v_spells[i]); + if(!spellInfo) + continue; - if(spellInfo->powerType == POWER_MANA) - break; + if(spellInfo->powerType == POWER_MANA) + break; - if(spellInfo->powerType == POWER_ENERGY) - { - this->setPowerType(POWER_ENERGY); - this->SetMaxPower(POWER_ENERGY, 100); - this->SetPower(POWER_ENERGY, 100); - break; - } + if(spellInfo->powerType == POWER_ENERGY) + { + setPowerType(POWER_ENERGY); + SetMaxPower(POWER_ENERGY, 100); + SetPower(POWER_ENERGY, 100); + break; } } } + InstallAllAccessories(); return true; diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h index 7c17edc..b164172 100644 --- a/src/game/Vehicle.h +++ b/src/game/Vehicle.h @@ -43,8 +43,8 @@ enum VehicleSeatFlags enum PowerType { - POWER_STEAM = 61, - POWER_PYRITE = 41, + POWER_TYPE_PYRITE = 41, + POWER_TYPE_STEAM = 61 }; #define MAX_SEAT 8 @@ -66,7 +66,7 @@ class Vehicle : public Creature void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update - void Regenerate(Powers power); + void RegeneratePower(Powers power); uint32 GetVehicleId() { return m_vehicleId; } bool SetVehicleId(uint32 vehicleid); DOWNLOAD*NOW! PS to Wojta. When you'll apply the patch add my "signed-off".
  3. I think that from the packets obtains not only seatId, but something else. Or... This is crazy idea, but... May be we have to defined seatID as uint32...
  4. It works for int variables. But there are types of variables defined in special way and we have to use static_cast or something else. I had use static_cast because it'll work as I want it.
  5. Small code style fix. + uint32 ItemID = fields[5].GetUInt32(); + uint32 ItemCount = fields[6].GetUInt32(); + + if(Player *receiver = sObjectMgr.GetPlayer( receiver_guid )) + { + sLog.outString("EXTERNAL MAIL> Sending mail to %u, Item:%u", receiver_guid, ItemID); +
  6. Look at Spell::EffectCharge. There are uses 3.(6) instead of 5.
  7. We need smbd to implement all vehicle's spell. I don't know how it can be done.
  8. oh... Read 1st part of my prev post. I has already written fix.
  9. The function has missed. diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index eada9cb..dc5402e 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1332,3 +1332,15 @@ void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3 SetFloatValue(GAMEOBJECT_PARENTROTATION+2, rotation2); SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3); } + +void GameObject::DealSiegeDamage(uint32 damage) +{ + m_actualHealth -= damage; + + // TODO : there are a lot of thinghts to do here + if(m_actualHealth < 0) + { + m_actualHealth = GetGOInfo()->destructibleBuilding.intactNumHits; + SetLootState(GO_JUST_DEACTIVATED); + } +} \\ No newline at end of file added I'd implemented regen system for vehicles. There is patch for the Wojta's vehicles branch. diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index d3fa42a..04c7e99 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -70,6 +70,7 @@ void Vehicle::Update(uint32 diff) { Creature::Update(diff); InstallAllAccessories(); + if(despawn) { m_spawnduration -= diff; @@ -77,6 +78,33 @@ void Vehicle::Update(uint32 diff) Dismiss(); despawn = false; } + + if(m_regenTimer <= diff) + { + Regenerate(getPowerType()); + m_regenTimer = 4000; + } + else + m_regenTimer -= diff; +} + +void Vehicle::Regenerate(Powers power) +{ + uint32 curValue = GetPower(power); + uint32 maxValue = GetMaxPower(power); + + if (curValue >= maxValue) + return; + + float addvalue = 0.0f; + + if(m_vehicleInfo->m_powerType == POWER_STEAM) + addvalue = 20.0; + else + if(m_vehicleInfo->m_powerType == POWER_PYRITE) + return; + + ModifyPower(power, (int32)addvalue); } bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team, const CreatureData *data) @@ -127,14 +155,12 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u { this->setPowerType(POWER_ENERGY); this->SetMaxPower(POWER_ENERGY, 100); - this->SetPower(POWER_ENERGY, 0); this->SetPower(POWER_ENERGY, 100); } else if(m_vehicleInfo->m_powerType == POWER_PYRITE) { this->setPowerType(POWER_ENERGY); this->SetMaxPower(POWER_ENERGY, 50); - this->SetPower(POWER_ENERGY, 0); this->SetPower(POWER_ENERGY, 50); } else @@ -154,7 +180,6 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u { this->setPowerType(POWER_ENERGY); this->SetMaxPower(POWER_ENERGY, 100); - this->SetPower(POWER_ENERGY, 0); this->SetPower(POWER_ENERGY, 100); break; } diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h index c2e883e..7c17edc 100644 --- a/src/game/Vehicle.h +++ b/src/game/Vehicle.h @@ -66,6 +66,8 @@ class Vehicle : public Creature void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update + void Regenerate(Powers power); + uint32 GetVehicleId() { return m_vehicleId; } bool SetVehicleId(uint32 vehicleid); DOWNLOAD*AS FILE! Has the pyrite regen? Or it gets from some sources?
  10. Thanks to x.e.x but your fix is hack. But thanks to it i had found bug in the vehicle system. There is no a power regen system. I'm work on it now.
  11. damn. Forgot about it. ALTER TABLE game_tele ADD COLUMN `gmlevel` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `name`;
  12. Works patch. Based on the Licked's patch but i have rewrited many things and it looks fine now. Enjoy it! And sql. ALTER TABLE game_tele ADD COLUMN `gmlevel` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `name`;
  13. I'll post a patch file when it'll be good to work. Now it just couple of ideas which has been expressed in the code. Important fix to my prev post. @@ -98,11 +98,11 @@ const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx"; const char TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix"; const char TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; const char TaxiPathEntryfmt[]="niii"; const char TaxiPathNodeEntryfmt[]="diiifffiixx"; const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; -const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifixxx"; +const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; const char WorldMapAreaEntryfmt[]="xinxffffixx"; const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx"; const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx"; Another bug in the movement handler
  14. I have implemented the power but I don't know how send info about energy to the client. May be with a SMSG_* or some thing else... The Commit from my local repo: --------------------------- src/game/DBCStructure.h --------------------------- index 2e0ce90..a27acb4 100644 @@ -1663,7 +1663,7 @@ struct VehicleEntry uint32 m_uiLocomotionType; // 34 float m_msslTrgtImpactTexRadius; // 35 uint32 m_uiSeatIndicatorType; // 36 - // 37, new in 3.1 + uint32 m_powerType; // 37, new in 3.1 // 38, new in 3.1 // 39, new in 3.1 }; ----------------------------- src/game/ObjectMgr.h ----------------------------- index d21bdd6..6dba638 100644 @@ -342,7 +342,7 @@ MANGOS_DLL_SPEC LanguageDesc const* GetLanguageDescByID(uint32 lang); class PlayerDumpReader; // vehicle system -#define MAX_VEHICLE_SPELLS 10 +#define MAX_VEHICLE_SPELLS 6 struct VehicleDataStructure { ----------------------------- src/game/Vehicle.cpp ----------------------------- index f80d26b..39fff88 100644 @@ -120,9 +121,41 @@ bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, u { ((InstanceMap*)map)->GetInstanceData()->OnCreatureCreate(this); } + if(Creature *cre = dynamic_cast<Creature*>(this)) + { + if(m_vehicleInfo->m_powerType == POWER_STEAM) + { + this->setPowerType(POWER_ENERGY); + this->SetMaxPower(POWER_ENERGY, 100); + } + else if(m_vehicleInfo->m_powerType == POWER_PYRITE) + { + this->setPowerType(POWER_ENERGY); + this->SetMaxPower(POWER_ENERGY, 50); + } + else + { + for (uint32 i = 0; i < MAX_VEHICLE_SPELLS; ++i) + { + if(!cre->m_spells[i]) + continue; - InstallAllAccessories(); + SpellEntry const *spellInfo = sSpellStore.LookupEntry(cre->m_spells[i]); + if(!spellInfo) + continue; + if(spellInfo->powerType == POWER_MANA) + break; + + if(spellInfo->powerType == POWER_ENERGY) + { + this->setPowerType(POWER_ENERGY); + this->SetMaxPower(POWER_ENERGY, 100); + break; + } + } + } + } return true; } ------------------------------ src/game/Vehicle.h ------------------------------ index fadb9ea..dc81125 100644 @@ -41,6 +41,11 @@ enum VehicleSeatFlags SEAT_VEHICLE_FULL = 0x08 // seat occupied by vehicle and that vehicle is full too }; +enum PowerType +{ + POWER_STEAM = 61, + POWER_PYRITE = 41, +}; #define MAX_SEAT 8 typedef std::map<int8, VehicleSeat> SeatMap; And about 2nd problem: We need smbd to implement changing of seats between base vehicle and the accessories. Added Whence we receives the information for CustomVehicleFLags?
  15. Wojta i don't know have you repaired loading of accessories but in update() must be InstallAllAccessories() void Vehicle::Update(uint32 diff) { Creature::Update(diff); [b] InstallAllAccessories();[/b] if(despawn) { m_spawnduration -= diff; if(m_spawnduration < 0) Dismiss(); despawn = false; } }
  16. Qs can be realized by using quest_start_script table or by another ways.
  17. I don't understand what you want to say... Use a translater or somthing else... Wojta there is no way to spawn a vehicle instead a creature. And I has come to a conclusion that is right and blizzlike. In the wintergrasp and the ulduar a vehicles must be spawned by a script. I think there is no problem as we thought earlier.
  18. The wintergrasp and the ulduar need to be scripted before it will work. All what we can implement now is the silver tournament. I think it possible.
  19. when you pulled the sources you obtained all updates. If the dua.patch is dual spec, you done ererything right. If you show the errors i'll help to fix it.
  20. Some proofs special for you: It's no very hard to implement Silver Tournament or few new vehicles.
  21. Ill test it tommorow because I'm so tired now.
  22. We can drop useless columns in any time. Where you will place the new data? It will not be simple to make a copy well. We have to use data which exists in a dbase.
  23. I have the qustions for a devs or a knowledge peolpes. How to make strongly connection between spawn and npc? I'd try to implement it by including the new condition in respawn() if (isVehicle() && isAlive()) return; in respawn() but it failed. Oh god, a minute passed After I posted my question and I obtained the answer. When we click on a vehicle it constructing a new one. And we obtain the vehicle. But spawn became free. And it call to respawn. I wish to connect a vehicle and it's spawn. May be we can overwrite isAlive func for the vehicle's class or do smth else in this way.
×
×
  • 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