• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[REQUEST] Mailbox Effect

Grehy

Killroy
Joined
Nov 21, 2008
Messages
2,631
Reaction score
33
Location
United States
Hello! I'm not sure if this should go here or in c++ requests. If it can be done in c++, then post how please.

I would like mailboxes to have a special effect (green sparkles) and display a text message when someone sends a letter or parcel. Preferably a red message over it like what a stuffed dragon does.
 
An attempt, mailbox.cpp
Code:
void Mailbox::__addThing(Creature* actor, int32_t index, Thing* thing)
{
	Item* item = thing->getItem();
	if(!item)
		return;

	if(canSend(item))
	{	
		sendItem(actor, item);
[B][COLOR="Red"]		g_game.addMagicEffect(this->getPosition(), MAGIC_EFFECT_WRAPS_GREEN);
		g_game.internalCreatureSay(actor, SPEAK_MONSTER_SAY, "Text", false, NULL, this->getPosition());[/COLOR][/B]
	}
}
 
../mailbox.cpp: In member function `virtual void Mailbox::__addThing(Creature*, int32_t, Thing*)':
../mailbox.cpp:61: error: no matching function for call to `Game::internalCreatureSay(Creature*&, SpeakClasses, const char[21], bool, NULL, Position)'
../game.h:437: note: candidates are: bool Game::internalCreatureSay(Creature*, SpeakClasses, const std::string&, bool, SpectatorVec*, Position*)

make.exe: *** [../mailbox.o] Error 1

Execution terminated

short, looks like theres a problem with the creaturesay function for it?
 
Code:
void Mailbox::__addThing(Creature* actor, int32_t index, Thing* thing)
{
	Item* item = thing->getItem();
	if(!item)
		return;

	if(canSend(item))
		sendItem(actor, item);
[B][COLOR="Red"]		g_game.addMagicEffect(this->getPosition(), MAGIC_EFFECT_WRAPS_GREEN);
		SpectatorVec list;
		g_game.getSpectators(list, this->getPosition(), false, false, 7, 7, 5, 5);
		std::string text = "Text";
		g_game.internalCreatureSay(actor, SPEAK_MONSTER_SAY, text, false, list, this->getPosition());[/COLOR][/B]
}
../mailbox.cpp: In member function `virtual void Mailbox::__addThing(Creature*, int32_t, Thing*)':
../mailbox.cpp:63: error: no matching function for call to `Game::internalCreatureSay(Creature*&, SpeakClasses, std::string&, bool, SpectatorVec&, Position)'
../game.h:437: note: candidates are: bool Game::internalCreatureSay(Creature*, SpeakClasses, const std::string&, bool, SpectatorVec*, Position*)
Buy fix 7 gp >;|
 
Back
Top