Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

Results 1 to 18 of 18
  1. #1
    Account Upgraded | Title Enabled! doyos is offline
    MemberRank
    Apr 2008 Join Date
    267Posts

    Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Make your damageMobS[in mobs.cpp, not mobspacket.cpp] look similar to this:

    Code:
    void Mobs::damageMobRanged(Player* player, unsigned char* packet, int size){
        int itemid=0;
        int pos=getInt(packet+14);
        for(int i=0; i<player->inv->getItemNum(); i++){
            if(player->inv->getItem(i)->pos == pos && player->inv->getItem(i)->inv == 2){
                itemid = player->inv->getItem(i)->id;
                break;
            }
        }
        printf_s("Current Ranged ItemID: %d\n", itemid);
        MobsPacket::damageMobRanged(player, Maps::info[player->getMap()].Players, packet, itemid);
        int howmany = packet[1]/0x10;
        int hits = packet[1]%0x10;
        int map = player->getMap();
        int skillid = getInt(packet+2);
        if(skillid > 0)
            Skills::useAttackSkill(player, skillid);
        int damage;
        int totalDmg = 0;
        for(int i=0; i<howmany; i++){
            int mobid = getInt(packet+19+i*(22+4*(hits-1)));
            if (skillid == 3121004 || skillid == 3221001) mobid = getInt(packet+23+i*(22+4*(hits-1))); // fix storm arrow/pierce
            for(int k=0; k<hits; k++){
                damage = getInt(packet+37+i*(22+4*(hits-1)) +k*4);
                totalDmg = totalDmg + damage;
                if (skillid == 3121004 || skillid == 3221001) damage = getInt(packet+41+i*(22+4*(hits-1))+k*4); // fix storm arrow/pierce
                for(unsigned int j=0; j<mobs[map].size(); j++){
                    if(mobs[map][j]->getID() == mobid){
                        mobs[map][j]->setHP(mobs[map][j]->getHP()-damage);
                        int mhp=-1;
                        mhp = mobinfo[mobs[map][j]->getMobID()].hp;
                        MobsPacket::showHP(player, mobid ,mobs[map][j]->getHP()*100/mhp);
                        if(mobs[map][j]->getHP() <= 0){
                            dieMob(player, mobs[map][j]);
                            break;
                        }
                    break;
                    }
                }
            }
        }
        if(skillid == 4101005){ // Drain
            int hpRecover = ((totalDmg * Skills::skills[4101005][player->skills->getSkillLevel(4101005)].x)/100);
            if(player->getHP()+hpRecover > player->getMHP())
                player->setHP(player->getMHP());
            else
                player->setHP(player->getHP()+hpRecover);
        }
    }
    Obviously you'll want to change the instances of damageMobRanged to damageMobS, or just rename your function declarations and etc from damageMobS to the much better named damageMobRanged. lolol This is in large text because I know lots of people here have trouble reading which might be due to poor eye sight.

    AS FOR THE SPOILER FOR VERSION .10 AND ITS BIG UPDATE, HERE IT IS:

    Code:
    /*
    		for(unsigned int l=0; l< WZInitialize::MobsInfo[WZInitialize::MapsInfo[pd.map].Spawned[j].id].summon.size(); l++){
    		SpawnedInfo mob;
    		mob.id = WZInitialize::MobsInfo[WZInitialize::MapsInfo[pd.map].Spawned[j].id].summon[l];
    			mob.spid = -1;
    		mob.mid = WZInitialize::mobid++;
    		mob.x = WZInitialize::MapsInfo[pd.map].Spawned[j].x;
    		mob.cy = WZInitialize::MapsInfo[pd.map].Spawned[j].cy;	mob.fh = WZInitialize::MapsInfo[pd.map].Spawned[j].fh;
    							mob.hp = WZInitialize::MobsInfo[WZInitialize::MapsInfo[pd.map].Spawned[j].id].hp;
    							mob.mp = WZInitialize::MobsInfo[WZInitialize::MapsInfo[pd.map].Spawned[j].id].mp;
    							mob.by = pd.userid;
    							SpawnMob(mob, pd);
    						}
    						*/
    THIS IS FOUND IN MOBS.CPP, AND FOR THE SPOILER PLAY CLOSE ATTENTION TO THE CLASS NAME IN BOLD, AND THE PART IN INTALICS.


  2. #2
    Account Upgraded | Title Enabled! Watounment is offline
    MemberRank
    Apr 2008 Join Date
    851Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    The code compiled fine, but I'm in the middle of writing an essay so I'll have to test it out later -_-. Thanks doyos!

    As for the version 10 spoiler, I think my mouth actually went like this :o in real life xD. I can't wait for it to be released.

  3. #3
    Member bigwilly808 is offline
    MemberRank
    Apr 2008 Join Date
    63Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    ahh I'm not that smart and I don't know what the spoiler means... I just want to ask what is so special about it? or What is it? lol...

  4. #4
    Valued Member LeoDirk is offline
    MemberRank
    Apr 2008 Join Date
    140Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Nice one Doyos, and if I'm getting the 'spoiler' right it basically means titan is going to have custom WZ support soon?

  5. #5
    Account Upgraded | Title Enabled! doyos is offline
    MemberRank
    Apr 2008 Join Date
    267Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Quote Originally Posted by LeoDirk View Post
    Nice one Doyos, and if I'm getting the 'spoiler' right it basically means titan is going to have custom WZ support soon?
    Not quite, it'll be loading a good share of its data from the WZs.

  6. #6
    Account Upgraded | Title Enabled! DarkZero88 is offline
    MemberRank
    Apr 2008 Join Date
    357Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Wowwww Doyos awesome release like always ~.^

  7. #7
    Account Upgraded | Title Enabled! xSLaYaHx is offline
    MemberRank
    Apr 2007 Join Date
    334Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    About fucking time koolk did that. Look at what odin does.

  8. #8
    Account Upgraded | Title Enabled! RsRendi is offline
    MemberRank
    Feb 2007 Join Date
    Sabah, MalaysiaLocation
    233Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    As always, nice...

  9. #9
    Apprentice knarkaas is offline
    MemberRank
    Nov 2007 Join Date
    10Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    I am getting this error:
    1>.\Mobs.cpp(291) : error C2660: 'Mobs::dieMob' : function does not take 2 arguments

    At the line:
    dieMob(player, mobs[map][j]);

    Could you explain me what this could be?=)

  10. #10
    Valued Member LeoDirk is offline
    MemberRank
    Apr 2008 Join Date
    140Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Quote Originally Posted by doyos View Post
    Not quite, it'll be loading a good share of its data from the WZs.
    Even better. I could really care less about custom data -not that artsy- but loading from the WZ would be great, I lag pretty bad under heavy loads..

  11. #11
    Account Upgraded | Title Enabled! doyos is offline
    MemberRank
    Apr 2008 Join Date
    267Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Quote Originally Posted by LeoDirk View Post
    Even better. I could really care less about custom data -not that artsy- but loading from the WZ would be great, I lag pretty bad under heavy loads..
    That lag doesn't have anything to do with loading from SQL or XML or anything. lol Keep in mind it's only done once, at the start of the server.

  12. #12
    Valued Member LeoDirk is offline
    MemberRank
    Apr 2008 Join Date
    140Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    lol touche.. Doyos you use AIM or MSN? I still have yet to ask/add you >.> lol x=

  13. #13
    Valued Member ZacTheSin is offline
    MemberRank
    Mar 2007 Join Date
    138Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    WZInitialize!?

    OMG HOT~

    But.. what does this mean for the rest of us D:

    Adding wz files to the mix, won't that make it slower, UNLESS! you've fully worked out the code and stuff..



    *implodes*


    Oh, the possibilities! :D

  14. #14
    Proficient Member DUfire is offline
    MemberRank
    Dec 2006 Join Date
    175Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Quote Originally Posted by ZacTheSin View Post
    WZInitialize!?

    OMG HOT~

    But.. what does this mean for the rest of us D:

    Adding wz files to the mix, won't that make it slower, UNLESS! you've fully worked out the code and stuff..



    *implodes*


    Oh, the possibilities! :D
    Faster, the WZ files only load once at the beginning of the server [Assuming I just pinned down what Doyos said correctly.
    As for Emily, I tried logging in my Dark Knight today but I can't remember the password, it was just a fling I made when the PG hack was circulating.
    I gave it to my girlfriend and I'm not too sure what she did with it but she's sleeping now so yeah, I'll see what I can do.

    - Thumbs up -, and yeah, those would be some useful packets.

  15. #15
    Account Upgraded | Title Enabled! theonendonly is offline
    MemberRank
    Apr 2008 Join Date
    411Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    what other fixes are in here ? stars and arrows fix included ?

  16. #16
    Account Upgraded | Title Enabled! doyos is offline
    MemberRank
    Apr 2008 Join Date
    267Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Quote Originally Posted by theonendonly View Post
    what other fixes are in here ? stars and arrows fix included ?
    If you mean them getting used up, no. I won't put this in until I or somebody else figures out the proper way to recharge stars. You can add it in on your own if you want, but this does include fixes for pierce/hurricane damage if you notice.

  17. #17
    Proficient Member zomgno1 is offline
    MemberRank
    Apr 2008 Join Date
    157Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Another spoiler? Channels
    It seems to work on koolk's test server

  18. #18
    Proficient Member LazyBui is offline
    MemberRank
    Apr 2008 Join Date
    Illinois, USLocation
    156Posts

    Re: [Release] Server-side part of Drain(aka the healing part) AND titanMS010 SPOILER

    Was there something wrong with mine? o_O



Advertisement