EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Changing textures with a quest? (https://www.eqemulator.org/forums/showthread.php?t=25057)

trevius 04-21-2008 05:31 AM

Changing textures with a quest?
 
Does anyone know if there is a way to change textures via a quest command? I would love to get my Quarm encounter actually working more similar to live. Each #texture you change, he loses a head. I would just set it to change it every 25% of life or so.

On another note; it would be nice if there was a way to change NPC races via a quest. Then, I could set up a loop on a timer that adds +1 to the race every 3 seconds. Then set it to pause the quest by hailing it if I want and resume by saying "resume" or something. That would make it easy to see which races are available in any zone. Just set up 3 NPCs with each one being gender 0, 1 and 2 and then run the quest. Then either pause on the ones that actually show up, or just #npcstats on them when they do. This would mainly be useful in the later expansions that don't have all races listed in the guidebook.

Mortimus 04-21-2008 12:33 PM

Same here
 
I have been trying to accomplish the same thing for quiet some time now, and nothing I seem to do works.

cavedude 04-21-2008 01:08 PM

The Quarm event is already setup in PEQ. I know because I wrote it. NPCs 223991-223994 in potimeb.

You do not want to change the texture of a single NPC, you want to use 4 different NPCs each with a different texture. This is how it works on Live, because each time a head is killed, Quarm is stripped of all buffs and debuffs and you have to re-target him.

cavedude 04-21-2008 01:19 PM

Also, Each of the 4 heads have a different spellset ;)

Mortimus 04-21-2008 01:28 PM

Ok
 
Ok, how bout the changing of an npc's race during a quest? or changing his size? w/o spawning a new npc?

AndMetal 04-21-2008 02:51 PM

Quote:

Originally Posted by Mortimus (Post 147556)
Ok, how bout the changing of an npc's race during a quest? or changing his size? w/o spawning a new npc?

This page in the Wiki should help with what you're trying to do.

It doesn't look like you can change the race using a quest, but you should be able to change their size:

Code:

$mob->ChangeSize(in_size)
Just execute that where you want in the script, and it should change the size to in_size (which I think is a float).

Striat 04-21-2008 03:42 PM

Also, can use SendWearChange I believe. I did add these commands to my server. I broke them down to 8 commands to keep things easier. Could also easily do it as one command. But, here is what we have:

Add to perlparser.cpp
Code:

XS(XS__npcrace);
XS(XS__npcrace)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: npcrace(race_id)");

        int        race_id = (int)SvIV(ST(0));

        quest_manager.npcrace(race_id);

        XSRETURN_EMPTY;
}

XS(XS__npcgender);
XS(XS__npcgender)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: npcgender(gender_id)");

        int        gender_id= (int)SvIV(ST(0));

        quest_manager.npcgender(gender_id);

        XSRETURN_EMPTY;
}

XS(XS__npcsize);
XS(XS__npcsize)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: npcsize(newsize)");

        int        newsize = (int)SvIV(ST(0));

        quest_manager.npcsize(newsize);

        XSRETURN_EMPTY;
}

XS(XS__npctexture);
XS(XS__npctexture)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: npctexture(newtexture)");

        int        newtexture = (int)SvIV(ST(0));

        quest_manager.npctexture(newtexture);

        XSRETURN_EMPTY;
}

XS(XS__playerrace);
XS(XS__playerrace)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: playerrace(race_id)");

        int        race_id = (int)SvIV(ST(0));

        quest_manager.playerrace(race_id);

        XSRETURN_EMPTY;
}

XS(XS__playergender);
XS(XS__playergender)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: playergender(gender_id)");

        int        gender_id= (int)SvIV(ST(0));

        quest_manager.playergender(gender_id);

        XSRETURN_EMPTY;
}

XS(XS__playersize);
XS(XS__playersize)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: playersize(newsize)");

        int        newsize = (int)SvIV(ST(0));

        quest_manager.playersize(newsize);

        XSRETURN_EMPTY;
}

XS(XS__playertexture);
XS(XS__playertexture)
{
        dXSARGS;
        if (items != 1)
                Perl_croak(aTHX_ "Usage: playertexture(newtexture)");

        int        newtexture = (int)SvIV(ST(0));

        quest_manager.playertexture(newtexture);

        XSRETURN_EMPTY;
}

And also add to perlparser.cpp
Code:

                newXS(strcpy(buf, "npcrace"), XS__npcrace, file);
                newXS(strcpy(buf, "npcgender"), XS__npcgender, file);
                newXS(strcpy(buf, "npcsize"), XS__npcsize, file);
                newXS(strcpy(buf, "npctexture"), XS__npctexture, file);
                newXS(strcpy(buf, "playerrace"), XS__playerrace, file);
                newXS(strcpy(buf, "playergender"), XS__playergender, file);
                newXS(strcpy(buf, "playersize"), XS__playersize, file);
                newXS(strcpy(buf, "playertexture"), XS__playertexture, file);

Now, add to questmgr.cpp
Code:

void QuestManager::npcrace(int race_id)
{
                owner->SendIllusionPacket(race_id);
}

void QuestManager::npcgender(int gender_id)
{
                owner->SendIllusionPacket(owner->GetRace(), gender_id);
}
void QuestManager::npcsize(int newsize)
{
                                owner->ChangeSize(newsize, true);
}
void QuestManager::npctexture(int newtexture)
{
                        owner->SendIllusionPacket(owner->GetRace(), 0xFF, newtexture);
}

void QuestManager::playerrace(int race_id)
{
                        initiator->SendIllusionPacket(race_id);
}

void QuestManager::playergender(int gender_id)
{
                        initiator->SendIllusionPacket(initiator->GetRace(), gender_id);
}
void QuestManager::playersize(int newsize)
{
                        initiator->ChangeSize(newsize, true);
}
void QuestManager::playertexture(int newtexture)
{
                        initiator->SendIllusionPacket(initiator->GetRace(), 0xFF, newtexture);
}

And finally add to questmgr.h
Code:

        void npcrace(int race_id);
        void npcgender(int gender_id);
        void npcsize(int newsize);
        void npctexture(int newtexture);
        void playerrace(int race_id);
        void playergender(int gender_id);
        void playersize(int newsize);
        void playertexture(int newtexture);

Now, usage from our Edone.pl npc:
Code:

sub EVENT_SAY { 
if($text=~/hail/i) {
        quest::say("As you wish!");
}
if($text=~/race/i) {
        quest::say("As you wish!");
        quest::npcrace(217);
        quest::playerrace(217);
}
if($text=~/gender/i) {
        quest::say("As you wish!");
        quest::npcgender(1);
        quest::playergender(1);
}
if($text=~/size/i) {
        quest::say("As you wish!");
        quest::npcsize(20);
        quest::playersize(20);
}
if($text=~/texture/i) {
        quest::say("As you wish!");
        quest::npctexture(22);
        quest::playertexture(15);
}
}

If you do not know how to compile these changes, see http://www.eqemulator.net/wiki/wikka...a=DevVSExpress.
Also, if you have any questions, feel free to PM me or look for me on irc as Striat.

trevius 04-21-2008 04:16 PM

Quote:

Originally Posted by cavedude (Post 147554)
The Quarm event is already setup in PEQ. I know because I wrote it. NPCs 223991-223994 in potimeb.

You do not want to change the texture of a single NPC, you want to use 4 different NPCs each with a different texture. This is how it works on Live, because each time a head is killed, Quarm is stripped of all buffs and debuffs and you have to re-target him.

I completely respawned all of potimeb from scratch. Mainly because since it isn't an instance in the emu, it wouldn't work quite the same if more than 1 group was in there. So, I had to customize it to allow multiple groups in it at once all in separate areas.

I quite EQ live right before my guild killed Quarm. We had done everything in time accept for Quarm. So, I never actually fought it on live. I will have to look into your quests you have written for there. I had just assumed that it was changing spell sets. Though, it does sound more interesting the other way lol. I must say that the quests for that zone are pretty impressive lol. That must have taken you forever!

I will check out that size changing quest command and see if it works. I was thinking a couple weeks ago that it would be cool to have an event where a boss or a few mobs all "grow" over a few seconds. Using that with a 1 second timer between size changes should have a cool effect.

And Striat, you should submit that code! That would be nice stuff to have in the distro!


All times are GMT -4. The time now is 11:33 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.