Beispiel #1
0
void GameObject::EndFishing(Player* player, bool abort )
{
	Spell * spell = player->GetCurrentSpell();
	
	if(spell)
	{
		if(abort)   // abort becouse of a reason
		{
			//FIXME: here 'failed' should appear over progress bar
			spell->SendChannelUpdate(0);
			//spell->cancel();
			spell->finish();
		}
		else		// spell ended
		{
			spell->SendChannelUpdate(0);
			spell->finish();
		}
	}

	if(!abort)
		sEventMgr.AddEvent(this, &GameObject::ExpireAndDelete, EVENT_GAMEOBJECT_EXPIRE, 10000, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
	else
		ExpireAndDelete();
}
Beispiel #2
0
void GameObject::EndFishing(Player* player, bool abort )
{
	Spell* spell = player->GetCurrentSpell();
	
	if(spell)
	{
		if(abort)   // abort becouse of a reason
		{
			// FIXME: here 'failed' should appear over progress bar
			spell->SendChannelUpdate(0);
			// spell->cancel();
			spell->finish();
		}
		else		// spell ended
		{
			spell->SendChannelUpdate(0);
			spell->finish();
		}
	}

	if(!abort)
		TO_GAMEOBJECT(this)->ExpireAndDelete(20000);
	else
		ExpireAndDelete();
}
Beispiel #3
0
void GameObject::EndFishing(Player* player, bool abort )
{
	Spell * spell = player->GetCurrentSpell();
	
	if(spell)
	{
		if(abort)   // abort becouse of a reason
		{
			//FIXME: here 'failed' should appear over progress bar
			spell->cancel();
		}
		else		// spell ended
		{
			if (!(GetUInt32Value(GAMEOBJECT_FLAGS) & 32)) // if there was no loot
				spell->SendCastResult(SPELL_FAILED_NO_FISH);

			spell->SendChannelUpdate(0);
			spell->finish();

			/*if(this->IsInWorld())
				RemoveFromWorld();
			delete this;*/

			ExpireAndDelete();
			return;
		}
	}
	else // if this is called, and there is no spell so remove the gameobject
	{
		if(this->IsInWorld())
				RemoveFromWorld();
		delete this;
	}
}