예제 #1
0
void ConditionSpeed::addCondition(Creature* creature, const Condition* addCondition)
{
	if(conditionType != addCondition->getType() || (ticks == -1 && addCondition->getTicks() > 0))
		return;

	setTicks(addCondition->getTicks());
	const ConditionSpeed& conditionSpeed = static_cast<const ConditionSpeed&>(*addCondition);
	int32_t oldSpeedDelta = speedDelta;

	mina = conditionSpeed.mina;
	maxa = conditionSpeed.maxa;
	minb = conditionSpeed.minb;
	maxb = conditionSpeed.maxb;

	speedDelta = conditionSpeed.speedDelta;
	outfits = conditionSpeed.outfits;

	changeOutfit(creature);
	if(!speedDelta)
	{
		int32_t min, max;
		getFormulaValues(creature->getBaseSpeed(), min, max);
		speedDelta = random_range(min, max);
	}

	int32_t newSpeedChange = speedDelta - oldSpeedDelta;
	if(newSpeedChange)
		g_game.changeSpeed(creature, newSpeedChange);
}
예제 #2
0
bool ConditionOutfit::startCondition(Creature* creature)
{
	if(!Condition::startCondition(creature))
		return false;

	changeOutfit(creature);
	return true;
}
예제 #3
0
void ConditionOutfit::addCondition(Creature* creature, const Condition* addCondition)
{
	if (updateCondition(addCondition))
	{
		setTicks(addCondition->getTicks());
		const ConditionOutfit& conditionOutfit = static_cast<const ConditionOutfit&>(*addCondition);
		outfits = conditionOutfit.outfits;
		changeOutfit(creature);
	}
}
예제 #4
0
bool ConditionOutfit::startCondition(Creature* creature)
{
	changeOutfit(creature);
	return Condition::startCondition(creature);
}