PDA

View Full Version : Zone & World Emotes


Striat
04-06-2008, 01:57 AM
Added for zone emote and world emotes

Add to questmgr.cpp :

void QuestManager::ze(int type, const char *str) {
entity_list.Message(0, type, str);
}

void QuestManager::we(int type, const char *str) {
worldserver.SendEmoteMessage(0, 0, type, str);
}

to questmgr.h :
void ze(int type, const char *str);
void we(int type, const char *str);

To perlparser.cpp :

XS(XS__ze);
XS(XS__ze)
{
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: ze(type, str)");

int type = (int)SvIV(ST(0));
char * str = (char *)SvPV_nolen(ST(1));

quest_manager.ze(type, str);

XSRETURN_EMPTY;
}

XS(XS__we);
XS(XS__we)
{
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: we(type, str)");

int type = (int)SvIV(ST(0));
char * str = (char *)SvPV_nolen(ST(1));

quest_manager.we(type, str);

XSRETURN_EMPTY;
}

and at the bottom of perlparser.cpp :

newXS(strcpy(buf, "ze"), XS__ze, file);
newXS(strcpy(buf, "we"), XS__we, file);

Now for usage:

sub EVENT_SPAWN {
#ze = zone emote. 15 is the type(color). Yellow in this case.
#we = world emote. 13 is the type(color). Red in this case.
quest::ze(15, "Welcome to the zone!");
quest::we(15, "Prepare for a new world of challenges!");
}