Code:
Index: perlparser.cpp
===================================================================
--- perlparser.cpp (revision 921)
+++ perlparser.cpp (working copy)
@@ -547,6 +547,24 @@
XSRETURN_EMPTY;
}
+XS(XS__voicetell);
+XS(XS__voicetell)
+{
+ dXSARGS;
+ if (items != 4)
+ Perl_croak(aTHX_ "Usage: voicetell(clientname, type, race, gender)");
+
+ char * str = (char *)SvPV_nolen(ST(0));
+ int macronum = (int)SvIV(ST(1));
+ int racenum = (int)SvIV(ST(2));
+ int gendernum = (int)SvIV(ST(3));
+
+ quest_manager.voicetell(str, macronum, racenum, gendernum);
+
+ XSRETURN_EMPTY;
+}
+
+
XS(XS__depop);
XS(XS__depop)
{
@@ -2817,6 +2835,7 @@
newXS(strcpy(buf, "shout"), XS__shout, file);
newXS(strcpy(buf, "shout2"), XS__shout2, file);
newXS(strcpy(buf, "gmsay"), XS__gmsay, file);
+ newXS(strcpy(buf, "voicetell"), XS__voicetell, file);
newXS(strcpy(buf, "depop"), XS__depop, file);
newXS(strcpy(buf, "settarget"), XS__settarget, file);
newXS(strcpy(buf, "follow"), XS__follow, file);
Index: questmgr.cpp
===================================================================
--- questmgr.cpp (revision 921)
+++ questmgr.cpp (working copy)
@@ -392,6 +392,10 @@
worldserver.SendChannelMessage(0,0,11,0, 0, "%s", str);
}
+void QuestManager::voicetell(char *str, int macronum, int racenum, int gendernum) {
+ worldserver.SendVoiceMacroFromMob(owner,1,str,macronum, racenum, gendernum);
+}
+
void QuestManager::depop(int npc_type) {
if(!owner->IsNPC())
return;
Index: questmgr.h
===================================================================
--- questmgr.h (revision 921)
+++ questmgr.h (working copy)
@@ -63,6 +63,7 @@
void shout(const char *str);
void shout2(const char *str);
void gmsay(const char *str);
+ void voicetell(char *str, int macronum, int racenum, int gendernum);
void depop(int npc_type = 0);
void depopall(int npc_type = 0);
void depopzone(bool StartSpawnTimer = true);
Index: worldserver.cpp
===================================================================
--- worldserver.cpp (revision 921)
+++ worldserver.cpp (working copy)
@@ -1507,6 +1507,39 @@
return Ret;
}
+bool WorldServer::SendVoiceMacroFromMob(Mob* From, int32 Type, char* Target, int32 MacroNumber, int16 racenum, int8 gendernum) {
+
+ if(!worldserver.Connected())
+ return false;
+
+ ServerPacket* pack = new ServerPacket(ServerOP_VoiceMacro, sizeof(ServerVoiceMacro_Struct));
+
+ ServerVoiceMacro_Struct* svm = (ServerVoiceMacro_Struct*) pack->pBuffer;
+
+ if(!From){
+ strcpy(svm->From, "A Mysterious Voice");
+ }
+ else {
+ strcpy(svm->From, From->GetCleanName());
+ }
+
+ strcpy(svm->To, Target);
+
+ svm->Type = 1;
+
+ svm->Voice = (racenum * 2) + gendernum;
+
+ svm->MacroNumber = MacroNumber;
+
+ pack->Deflate();
+
+ bool Ret = SendPacket(pack);
+
+ safe_delete(pack);
+
+ return Ret;
+}
+
bool WorldServer::RezzPlayer(EQApplicationPacket* rpack,int32 rezzexp, int16 opcode) {
_log(SPELLS__REZ, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp);
ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct));
Index: worldserver.h
===================================================================
--- worldserver.h (revision 921)
+++ worldserver.h (working copy)
@@ -39,6 +39,7 @@
bool SendEmoteMessage(const char* to, int32 to_guilddbid, int32 type, const char* message, ...);
bool SendEmoteMessage(const char* to, int32 to_guilddbid, sint16 to_minstatus, int32 type, const char* message, ...);
bool SendVoiceMacro(Client* From, int32 Type, char* Target, int32 MacroNumber, int32 GroupOrRaidID = 0);
+ bool SendVoiceMacroFromMob(Mob* From, int32 Type, char* Target, int32 MacroNumber, int16 racenum, int8 gendernum);
void SetZone(int32 iZoneID, int32 iInstanceID = 0);
int32 SendGroupIdRequest();
bool RezzPlayer(EQApplicationPacket* rpack,int32 rezzexp, int16 opcode);