Author | Message | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() This is cool stuff, a spell casting npc type! Edit: Have added poisonous nps type Edited 1/31/11 fixed the map.cpp poison, so server wont crash at the last hp, and removed the freeze in the spell casters it wasnt fair and gltchy Ill try and work on a freeze type npc. Edited 2/1/11 the last of the glitches are fixed if you added before the edit please replace the part in npc act and the void map poison both are updated! In character.cpp under Character::Character(std::string name, World *world) find poisoned dont copy and paste add it to yours just like it is here Database_Result res = this->world->db.Query("SELECT `name`, `title`, `home`, `fiance`, `partner`, `admin`, `hidden`, `invincible`, `poisoned`, `class`, `gender`, `race`, `hairstyle`, `haircolor`," scroll down a little bit and find this->hidden = GetRow<bool>(row, "hidden"); now way down at the bottom in void Character::Save() find poisoned and this->poisoned and add them to yours just like it is here #ifdef DEBUG In eodata.cpp under void ENF::Read(std::string filename)find newdata->hp = PacketProcessor::Number(buf[11], buf[12], buf[13]); add here now go to map.cpp and add this in anywhere here if you dont have invincibility use this 1 also make sure to add/replace this part in to your map attack and attack spell if ((npc->Data()->type == ENF::Unknown3 || npc->Data()->type == ENF::Unknown4 || npc->Data()->type == ENF::Passive || npc->Data()->type == ENF::Aggressive || from->admin > static_cast<int>(this->world->admin_config["killnpcs"])) In npc.cpp under void NPC::Spawn(NPC *parent) find this->hp = this->Data()->hp; add here this->spells = this->Data()->spells; //?test now scroll down to void NPC::Act() find Character *attacker = 0; if you dont have invincibility dont use the one above use this one now go down to world.cpp and add this in under voidworld_timed_save(void *world_void)void world_poisoned(void *world_void){ World *world = static_cast<World *>(world_void); UTIL_PTR_VECTOR_FOREACH(world->maps, Map, map) { map->Poisoned(); } } scroll down a little bit and add in this timer with the others event = new TimeEvent(world_poisoned, this, 5.00, Timer::FOREVER); this->timer.Register(event); event->Release(); in character.hpp find bool hidden; and add here bool poisoned; now go to eodata.hpp under struct ENF_Data : public Shared find short type_index; add here unsigned short spells; //? scroll down a little bit you will see this dont copy and paste just add spells(0),were it is to yours! ENF_Data() : id(0), graphic(0), boss(0), child(0), type(ENF::NPC), spells(0), hp(0), exp(0), mindam(0), maxdam(0), accuracy(0), evade(0), armor(0), weakness1(0) { } scroll a little bit more find SCRIPT_REGISTER_VARIABLE("uint16", type_index); add here SCRIPT_REGISTER_VARIABLE("uint16", spells); //? now go to map.hpp and find void Effect(int effect, int param); now go to npc.hpp and find bool attack; add unsigned short spells; //?test now got to Item.cpp and find replace your case EIF::CureCurse: with this one should be set to compile! Now in your pub select the npc you want to have spells and set their npc type to unknown 5 and then set the unkA: to the spell id you want them to cast >.< To use the poisonous npcs set their npc type to the one right after inn, Hope you like it and also if anyone canhelpdebuganyglitches they find or help make this better, or condense this code,Thanks.I will update later with a poisonous npc type! In your database create a row named poisoned, type tinyint, length/set 1, default 0
|
| ![]() I don't really mess with eoserv much anymore but this is something I always wanted to see on main/test server for a very long time. Just wanted to say good job if this actually works. Might download a rev just to play around with it for a bit. Did you test it out yourself
before releasing?
|
| ![]() Yes its tested,and works ,still searching for glitches none yet! Edit: A minor glitch found multiple spell casting npcs can mess with the walk packets! not bad though just unfreezes you sooner than it should!
|
| ![]() server crashes when you are on your last hp when getting poison with out the npc attacking you Great Work to come's in handy EDIT: one more thing when you die you are still getting poison :P just forgot about it :D lags the client when taking life away using poison i'll see what i can do to help.
|
| ![]() maori posted: (31st Jan 2011 04:58 am)Ill try and fix the poison npc damage thanks for the feedback! Edit: I fixed the crashing on last hp replace the map.cpp part, and if you die while poisoned you will no longer be poisoned! I also removed the freeze on the spell casting npcs it didnt seem fair and was pretty glitchy replace the part in the npc::Act! seems to be working 100% now.
|
| ![]() One glitch i found was that even after the npc dies, and even after you reboot it, the map still has "poison" --- Create your own destiny, don't let someone else do it for you.
|
| ![]() AustinB posted: (2nd Feb 2011 02:54 pm) I made to where you are poisoned entell you die or use a cure potion. is that what your talking about austin?
|
| ![]() I'm a bit confused about this part I've been working with the database (as I use sqlite) " In your database create a row named poisoned, type tinyint, length/set 1, default 0"
|
| ![]() xIFearlessIxx posted: (27th Feb 2011 01:29 am) try this `poisoned` tinyint(1) DEFAULT 0,
|
| ![]() Ive found a glitch, so ill be updateing this in the next couple days when someone dies on a poison map "sometimes" all characters warp to their home. Hopefully an easy fix. If youve added this and found any glitches please post so i can debug.
|
| ![]() So far I've found Two glitches.. #1. I don't belive your health even lowers when you get poisoned #2. I'm pretty sure my level was just raised by like 100(something like that) it's happened to tow of us as of now. Maybe I haven't added something maybe you can find out for me. I'll post my map.cpp click "map.cpp" or here XD If you find any errors... Can you post em and re-most my map.cpp (I have a feeling I messed something up. NOTE: I never got any errors.. Thats why I'm guessing it's a bug, I've also looked it over myself but I'm not use to others work in my source. Thanks.
|
| ![]() Check out this topic for an updated paralized system! https://eoserv.net/forum/topic/16978 Edit: Im also going to add an updated version of the npc spell casters and poison for use/test/review! Known glitches = lag, if to many spell casters are are active, "random hp/tp glitches ,Im not even sure if its from this system" but yeah, I think its from the effect packet it self? |