Topic is locked.
Page: << 1 2 >>
AoE
Author Message
Post #59930 AoE

Hi guys, i need help with AoE (Area of Effect) however it is working but not as i want it

im using some guys code cant remember his name here is the code


Direction direct1 = static_cast<Direction>(1);//defining the Directions


    Direction direct2 = static_cast<Direction>(2);


    Direction direct3 = static_cast<Direction>(3);


    Direction direct4 = static_cast<Direction>(4);


     if(this->player->character->paperdoll[Character::Weapon] == 21) // item id


                {

this->player->character->Attack(direct1);






                    this->player->character->Attack(direct2);






                    this->player->character->Attack(direct3);






                    this->player->character->Attack(direct4);




                    break;

                }


if (this->player->character->sitting != SIT_STAND)

{

return true;

}


Anyways, this code only makes it attack 1 tiles around me

i want it to attack 6 tiles around me how to do that?

14 years, 33 weeks ago
Post #59950 Re: AoE

Newguy is my name helping you is my game :D. Kidding. This is a really hacky way that I did it a while ago. I am pretty sure if you search around you will find one that goes in map.cpp. I cant really think of it now. 

---
Love you too.
14 years, 33 weeks ago
Post #59984 Re: AoE

Finally after 3 hours someones replying :D


I have searched for AoE and AoE Attacks and AoE effects and Area of Effect i took all the links and found nothing that wanted to work without alooooot of errors

14 years, 33 weeks ago
Post #59987 Re: AoE

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp
14 years, 33 weeks ago
Post #59988 Re: AoE

Haha, isomniac. You know what I like about you. Almost every response you have to a topic has a bunch of code in it. I feel like mario... I got 1uped xD.

---
Love you too.
14 years, 33 weeks ago
Post #59997 Re: AoE
insomniac posted: (28th Jan 2011 03:04 pm)

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp

Thnx, but this wasnt what i expected .. It makes me hit in the whole map?
i want it to be 6 tiles around me :D Can you help?
14 years, 33 weeks ago
Post #59998 Re: AoE

Heres a AoE Code, in Map.cpp under Map::Attack

In map.cpp search for;
case DIRECTION_LEFT:
target_x -= 1;
break;
}

Then under that (1 line space) add this;
if(from->paperdoll[Character::Weapon] == Weapon id here!)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
 {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0, from->maxdam + 0);

if (distance <=4 && closeby->alive)
{
closeby->Damage(from, amount);
}
}
}


Hope this helped! ~Austin

---
Create your own destiny, don't let someone else do it for you.
14 years, 33 weeks ago
Post #59999 Re: AoE
AustinB posted: (28th Jan 2011 04:09 pm)

Heres a AoE Code, in Map.cpp under Map::Attack

In map.cpp search for;
case DIRECTION_LEFT:
target_x -= 1;
break;
}

Then under that (1 line space) add this;
if(from->paperdoll[Character::Weapon] == Weapon id here!)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
 {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0,from->maxdam + 0);

if (distance <=4 && closeby->alive)
{
closeby->Damage(from,amount);
}
}
}


Hope this helped! ~Austin

Thanks for the credits ;D
---
i think ur fun to argue with so i want to hold ur hand
14 years, 33 weeks ago
Post #60000 Re: AoE
AustinB posted: (28th Jan 2011 04:09 pm)

Heres a AoE Code, in Map.cpp under Map::Attack

In map.cpp search for;
case DIRECTION_LEFT:
target_x -= 1;
break;
}

Then under that (1 line space) add this;
if(from->paperdoll[Character::Weapon] == Weapon id here!)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
 {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0,from->maxdam + 0);

if (distance <=4 && closeby->alive)
{
closeby->Damage(from,amount);
}
}
}


Hope this helped! ~Austin


This makes when you walk it hits the distance around you lol?
14 years, 33 weeks ago
Post #60001 Re: AoE
matiasmunk posted: (28th Jan 2011 04:21 pm)

AustinB posted: (28th Jan 2011 04:09 pm)

Heres a AoE Code, in Map.cpp under Map::Attack

In map.cpp search for;
case DIRECTION_LEFT:
target_x -= 1;
break;
}

Then under that (1 line space) add this;
if(from->paperdoll[Character::Weapon] == Weapon id here!)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
 {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0,from->maxdam+ 0);

if (distance <=4 && closeby->alive)
{
closeby->Damage(from,amount);
}
}
}


Hope this helped! ~Austin


This makes when you walk it hits the distance around you lol?

Lolno. When you attack with the weapon that you coded in, it attacks every monster withing 6 spaces.
---
i think ur fun to argue with so i want to hold ur hand
14 years, 33 weeks ago
Post #60002 Re: AoE
Cyber.N1nja posted: (28th Jan 2011 04:24 pm)

matiasmunk posted: (28th Jan 2011 04:21 pm)

AustinB posted: (28th Jan 2011 04:09 pm)

Heres a AoE Code, in Map.cpp under Map::Attack

In map.cpp search for;
case DIRECTION_LEFT:
target_x -= 1;
break;
}

Then under that (1 line space) add this;
if(from->paperdoll[Character::Weapon] == Weapon id here!)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
 {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0,from->maxdam+0);

if (distance <=4 && closeby->alive)
{
closeby->Damage(from,amount);
}
}
}


Hope this helped! ~Austin


This makes when you walk it hits the distance around you lol?

Lolno. When you attack with the weapon that you coded in, it attacks every monster withing 6 spaces.

I have just tried it here is my code

if(from->paperdoll[Character::Weapon] == 486)
{
UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, closeby)
    {
int distance = util::path_length(target_x, target_y, closeby->x, closeby->y);
int amount = util::rand(from->mindam + 0, from->maxdam + 0);

if (distance <=3 && closeby->alive)
        {
closeby->Damage(from, amount);
        }
    }
}

And its when i walk it hits them
if i hit CTRL it just attacks like normal if im facing a monster..

14 years, 33 weeks ago
Post #60004 Re: AoE
matiasmunk posted: (28th Jan 2011 03:57 pm)

insomniac posted: (28th Jan 2011 03:04 pm)

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp

Thnx, but this wasnt what i expected .. It makes me hit in the whole map?
i want it to be 6 tiles around me :D Can you help?
If you put it in the right spot it will only hit npcs within 4 spaces and for the newest code I think you put in map::walk not map::attack

heres a screen shot of what it does


14 years, 33 weeks ago
Post #60006 Re: AoE
insomniac posted: (28th Jan 2011 05:09 pm)

matiasmunk posted: (28th Jan 2011 03:57 pm)

insomniac posted: (28th Jan 2011 03:04 pm)

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp

Thnx, but this wasnt what i expected .. It makes me hit in the whole map?
i want it to be 6 tiles around me :D Can you help?
If you put it in the right spot it will only hit npcs within 4 spaces and for the newest code I think you put in map::walk not map::attack

heres a screen shot of what it does



You were rite i made it in the map::walk but when i make it in map::attack around line 1340 in map.cpp i get theese 3 errors


-------------- Build: MYSQL+SQLITE in eoserv ---------------

Compiling: ..\src\handlers\Attack.cpp
Compiling: ..\src\map.cpp
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(Character*, Direction, bool)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: expected ';' before 'rbuilder'
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: statement cannot resolve address of overloaded function
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(NPC*, Direction)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1312: error: 'buildMap' has not been declared
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::AttackPKSpell(Character*, int, int)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1862: warning: comparison between signed and unsigned integer expressions
Process terminated with status 1 (0 minutes, 2 seconds)
3 errors, 1 warnings
 

14 years, 33 weeks ago
Post #60007 Re: AoE
matiasmunk posted: (28th Jan 2011 05:46 pm)

insomniac posted: (28th Jan 2011 05:09 pm)

matiasmunk posted: (28th Jan 2011 03:57 pm)

insomniac posted: (28th Jan 2011 03:04 pm)

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp

Thnx, but this wasnt what i expected .. It makes me hit in the whole map?
i want it to be 6 tiles around me :D Can you help?
If you put it in the right spot it will only hit npcs within 4 spaces and for the newest code I think you put in map::walk not map::attack

heres a screen shot of what it does



You were rite i made it in the map::walk but when i make it in map::attack around line 1340 in map.cpp i get theese 3 errors


-------------- Build: MYSQL+SQLITE in eoserv ---------------

Compiling: ..\src\handlers\Attack.cpp
Compiling: ..\src\map.cpp
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(Character*, Direction, bool)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: expected ';' before 'rbuilder'
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: statement cannot resolve address of overloaded function
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(NPC*, Direction)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1312: error: 'buildMap' has not been declared
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::AttackPKSpell(Character*, int, int)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1862: warning: comparison between signed and unsigned integer expressions
Process terminated with status 1 (0 minutes, 2 seconds)
3 errors, 1 warnings
 


search for this in map:: walk     rbuilder  it looks like you left some code in map::walk

If you havnt closed the project you can undo undo undo to before you started adding this stuff and start over!

14 years, 33 weeks ago
Post #60008 Re: AoE
insomniac posted: (28th Jan 2011 06:02 pm)

matiasmunk posted: (28th Jan 2011 05:46 pm)

insomniac posted: (28th Jan 2011 05:09 pm)

matiasmunk posted: (28th Jan 2011 03:57 pm)

insomniac posted: (28th Jan 2011 03:04 pm)

heres some aoe stuff i made,this is an adjustable AOE system.


To get Ananas weapon effect system to use for the effects part go here


Ok first in map.cpp in void Map::Attack(Character *from, Direction direction)

find

UTIL_PTR_VECTOR_FOREACH(this->npcs, NPC, npc)
            {


add this here


int eff = util::rand(1, 32);// doesnt have to be a random u could give a specific effect  id EX: int eff = 5;
      int dmg = util::rand(from->mindam, from->maxdam);
      int dist = util::path_length(target_x, target_y, npc->x, npc->y);

     if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 1 )
       {

            npc->Damage(from, dmg);

       }

      if ((npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive ||
      from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) && npc->alive &&
      dist < 4 && this->world->eif->Get(from->paperdoll[Character::Weapon])->aoe == 2 )
       {
            npc->Effect(from, eff, dmg);// if you dont have ananas effect or dont want effect remove this line
            npc->Damage(from, dmg);
       }


now in eodata.cpp

find

    newdata->chareq = PacketProcessor::Number(buf[51], buf[52]);

add this here

newdata->aoe = PacketProcessor::Number(buf[54]);

in eodata.hpp find

short chareq;

and add this here

unsigned char aoe;

alittle bit lower you will see 

EIF_Data() : id(0), graphic(0), type(EIF::Static), subtype(EIF::None), special(EIF::Normal),
    hp(0), tp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), str(0), intl(0), wis(0),
    agi(0), con(0), cha(0), light(0), dark(0), earth(0), air(0), water(0), fire(0), scrollmap(0),
    gender(0), scrolly(0), levelreq(0), classreq(0), strreq(0), intreq(0), wisreq(0), agireq(0),
    conreq(0), chareq(0),  aoe(0), weight(0), size(EIF::Size1x1) { }

notice where the  aoe(0),    is and add it to yours

now in your pub editor select your weapon and set your unkE to 1 or 2 on the items you want to have that type of aoe!

You can also adjust the aoe of your weapon by messing with the dist < 4  in map.cpp

Thnx, but this wasnt what i expected .. It makes me hit in the whole map?
i want it to be 6 tiles around me :D Can you help?
If you put it in the right spot it will only hit npcs within 4 spaces and for the newest code I think you put in map::walk not map::attack

heres a screen shot of what it does



You were rite i made it in the map::walk but when i make it in map::attack around line 1340 in map.cpp i get theese 3 errors


-------------- Build: MYSQL+SQLITE in eoserv ---------------

Compiling: ..\src\handlers\Attack.cpp
Compiling: ..\src\map.cpp
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(Character*, Direction, bool)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: expected ';' before 'rbuilder'
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1051: error: statement cannot resolve address of overloaded function
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::Walk(NPC*, Direction)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1312: error: 'buildMap' has not been declared
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp: In member function 'bool Map::AttackPKSpell(Character*, int, int)':
C:\Users\Matias\Desktop\Spil\Endless-Online\EOSERV LEWIS FIX!!!!\Lewis999's Rev189 v1.1b2\src\quest.hpp:1862: warning: comparison between signed and unsigned integer expressions
Process terminated with status 1 (0 minutes, 2 seconds)
3 errors, 1 warnings
 


search for this in map:: walk     rbuilder  it looks like you left some code in map::walk

If you havnt closed the project you can undo undo undo to before you started adding this stuff and start over!


?? I never made anything in rbuilder ='[
14 years, 33 weeks ago
Page: << 1 2 >>
Topic is locked.