EOSERV Forum > EOSERV > NPC Paralyze release/review!
Topic is locked.
Page: << 1 >>
NPC Paralyze release/review!
Author Message
Post #116083 NPC Paralyze release/review!

This is something Addison inspired me to do a while back, its an npc type that randomly paralyzes its opponents! This is compiled in a rev 189,and should be fairly easy to add. If it wont compile or I forgot somthing Ill  fix it. Theres also a more advanced database option topreventcharacters from logging out while paralyzed and relogging not paralyzed, but I didnt get into it may add later or upon request!

I havnt contributed anything in awhile so here ya go ( :.

In character.cpp in Character::Character(std::string name, World *world)

find std::tr1::unordered_map<std::string, util::variant> row = res.front();

add below

this->poisoned = false;

Done in character.cpp go to npc.cpp in void NPC::Act() find Character *attacker = 0;

add below

PacketBuilder r;

https://tehsausage.com/paste/parnpc

done in npc.cpp go to world.cpp find void world_timed_save(void *world_void)

add above

void world_poison(void *world_void)
{
    World *world = static_cast<World *>(world_void);
    UTIL_PTR_VECTOR_FOREACH(world->characters, Character, to)
    {
       if(to->poisoned == true)
       {
          int r = util::rand(1,4);
          if(r < 3)
          {
             to->poisoned = false;
             PacketBuilder r(PACKET_WALK, PACKET_OPEN);
             to->player->client->SendBuilder(r);
          }
       }
   }
}

scroll down and find

TimeEvent *event = new TimeEvent(world_spawn_npcs, this, 1.0, Timer::FOREVER);
    this->timer.Register(event);
    event->Release();

add below

int p = util::rand(2.0, 20.0);
    event = new TimeEvent(world_poison, this, p, Timer::FOREVER);
    this->timer.Register(event);
    event->Release();

done in world.cpp go to character.hpp find AdminLevel admin;

add below

bool poisoned;

done in npc.cpp go to Internal.cpp find

case PACKET_INTERNAL_WARP: // Death warp
        {

add below
if(this->player->character->poisoned == true)
    {
        this->player->character->poisoned = false;
        PacketBuilder r(PACKET_WALK, PACKET_OPEN);
        this->player->character->client->SendBuilder(r);
    }


done now just set the npc of your choice in the pub to npc type 8-unknown, right after inn type

12 years, 28 weeks ago
Post #116084 Re: NPC Paralyze release/review!

Very nice release as usual insomniac :) i will definatly use this!

---
stay tuned.
12 years, 28 weeks ago
Post #116093 Re: NPC Paralyze release/review!

so basicly if(poisoned == true) it will freeze my character? it's a nice extra npc type to add if some newbies want alot of npc types. Very useful if you use it on a good way ;]

12 years, 28 weeks ago
Post #116101 Re: NPC Paralyze release/review!

Yeah it randomly freezes its opponent! Someone could make a more detailed system off this very easily, a formula to decide how long your paralyzed, a resistance etc, could be added to weapons or tile specs on and on!

Also want to know if it compiles for you my rev is altered so much just hoping I altered it correctly!

12 years, 28 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > NPC Paralyze release/review!