Jump to content

Anti

Members
  • Posts

    81
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Anti

  1. 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".

    Signed-off-by: AntiDiavol <[email protected]>
  2. I could be totally off base but it looks like when the function changes abruptly from eather a user command or system command it puts out this error due to the data not getting processed in time and there is some data that is and or will be lost because of it. :eek:

    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...

  3. Looks good. The only problem is:

    +    uint32 tmp_gmlevel = 0;
    +
    +    switch(m_session->GetSecurity()) // Maybe check this later with the direct GMLevelID from Account table
    +    {
    +    case SEC_PLAYER:
    +        tmp_gmlevel = 0;
    +        break;
    +    case SEC_MODERATOR:
    +        tmp_gmlevel = 1;
    +        break;
    +    case SEC_GAMEMASTER:
    +        tmp_gmlevel = 2;
    +        break;
    +    case SEC_ADMINISTRATOR:
    +        tmp_gmlevel = 3;
    +        break;
    +    default: 
    +        return false;
    +    }
    +
    +    uint32 a_gmlevel = tmp_gmlevel;   // GM-SecurityLevel from GetSecurity(), maybe pull that directly from AccountData for better Custom Settings

    Like they said, can be reduced to just:

    +    uint32 a_gmlevel = m_session->GetSecurity();

    Does exactly the same thing. If that doesn't work (I haven't tried it) try:

    +    uint32 a_gmlevel = ((uint32)m_session->GetSecurity());

    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.

  4. Anti, over the last 2 days I keep getting this error on compile and don't know how to fix maybe you do,

    Creating library .\\mangosd__Win32_Release\\mangosd.lib and object .\\mangosd__Win32_Release\\mangosd.exp

    game.lib(SpellEffects.obj) : error LNK2019: unresolved external symbol "public: void __thiscall GameObject::DealSiegeDamage(unsigned int)" (?DealSiegeDamage@GameObject@@QAEXI@Z) referenced in function "public: void __thiscall Spell::EffectDamageBuilding(unsigned int)" (?EffectDamageBuilding@Spell@@QAEXI@Z)

    ..\\..\\bin\\Win32_Release\\mangosd.exe : fatal error LNK1120: 1 unresolved externals

    Build log was saved at "file://c:\\MangosSRC\\win\\VC90\\mangosd__Win32_Release\\BuildLog.htm"

    mangosd - 2 error(s), 0 warning(s)

    ------ Build started: Project: script, Configuration: Release Win32 ------

    Compiling...

    sc_default.cpp

    system.cpp

    ScriptMgr.cpp

    Generating Code...

    Linking...

    Creating library .\\script__Win32_Release/mangosscript.lib and object .\\script__Win32_Release/mangosscript.exp

    Embedding manifest...

    Build log was saved at "file://c:\\MangosSRC\\win\\VC90\\script__Win32_Release\\BuildLog.htm"

    script - 0 error(s), 0 warning(s)

    ========== Build: 12 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Thank you for the news in advance

    oh... Read 1st part of my prev post. I has already written fix.

  5. I have problems to compile the emulator after applying the command:

    git pull git: //github.com/Tasssadar/Valhalla-roject.git vehicle

    my mangos rev. 8993 sql

    Error:

    "12> Creating library .\\mangosd__Win32_Release\\mangosd.lib and object .\\mangosd__Win32_Release\\mangosd.exp

    12>game.lib(SpellEffects.obj) : error LNK2019: unresolved external symbol "public: void __thiscall GameObject::DealSiegeDamage(unsigned int)" (?DealSiegeDamage@GameObject@@QAEXI@Z) referenced in function "public: void __thiscall Spell::EffectDamageBuilding(unsigned int)" (?EffectDamageBuilding@Spell@@QAEXI@Z)

    12>..\\..\\bin\\Win32_Release\\mangosd.exe : fatal error LNK1120: 1 unresolved externals"

    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?

  6. anti sry for asking but you have a patch/git?

    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

    wowscrnshot121309175320.th.jpg

  7. U can seat on tanks but its works nemnogo koryavo :D

    in Ulduar vehicles operate so.

    you can ride on them

    you can shoot

    but they have not filled with energy

    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?

  8. Yes..but there are many Q in NR which uses vehicles, and there are pre-spawned here, for example: http://www.wowhead.com/?quest=12326#. or http://www.wowhead.com/?quest=12856#. and theres many more of them :/ but maybe when you click on them, new vehicle spawns and the old one despawns(not die, despawn), so it does not look so horrible :/ but if its not vehicle, you cant see accessories, and in ulduar there are many vehicles near flame levithian(they are flying, http://www.wowhead.com/?npc=33214). Script for spawns like that would be really big :/)

    ArtUrlWWW: never, because I using this GIT for my server :)

    Qs can be realized by using quest_start_script table or by another ways.

  9. i have a error...

    error: no changes?

    wat?

    ty guys

    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.

  10. but... I understood one thing.

    I got a clean source... Then

    git pull git://github.com/Tasssadar/Valhalla-Project.git vehicle

    then

    patch -p1 -l <dua.patch

    now compiling... then testing...

    and I notices 3-4 SQL errors,,,

    but a made vehicle.pacth as diff master vehicle....

    Well ... see how It Will work

    sorry for my bad English

    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.

  11. 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