//***********************************************************************************************
// flags & 1 == destroyed !
//***********************************************************************************************
void ARX_EQUIPMENT_UnEquip(Entity * target, Entity * tounequip, long flags)
{
	if(!target || !tounequip)
		return;

	if(target != entities.player())
		return;

	for(size_t i = 0; i < MAX_EQUIPED; i++) {
		if(ValidIONum(player.equiped[i]) && entities[player.equiped[i]] == tounequip) {
			EERIE_LINKEDOBJ_UnLinkObjectFromObject(target->obj, tounequip->obj);
			ARX_EQUIPMENT_Release(player.equiped[i]);
			target->bbox2D.min.x = 9999;
			target->bbox2D.max.x = -9999;
			
			if(!flags) {
				if(!DRAGINTER) {
					ARX_SOUND_PlayInterface(SND_INVSTD);
					Set_DragInter(tounequip);
				} else {
					giveToPlayer(tounequip);
				}
			}
			
			EVENT_SENDER = tounequip;
			SendIOScriptEvent(entities.player(), SM_EQUIPOUT);
			EVENT_SENDER = entities.player();
			SendIOScriptEvent(tounequip, SM_EQUIPOUT);
		}
	}

	if(tounequip->type_flags & (OBJECT_TYPE_HELMET | OBJECT_TYPE_ARMOR | OBJECT_TYPE_LEGGINGS))
		ARX_EQUIPMENT_RecreatePlayerMesh();
}
Пример #2
0
void ApplySPArm() {
	ARX_SPSound();

	res::path cls;
	switch (sp_arm) {
		case 0:
			cls = "graph/obj3d/interactive/items/armor/helmet_plate_cm/helmet_plate_cm";
		break;
		case 1:
			cls = "graph/obj3d/interactive/items/armor/legging_plate_cm/legging_plate_cm";
		break;
		case 2:
			cls = "graph/obj3d/interactive/items/armor/chest_plate_cm/chest_plate_cm";
		break;
		default:
			return;
		break;
	}

	Entity * ioo = AddItem(cls);
	if(ioo) {

		sp_wep = 1;
		MakeCoolFx(player.pos);
		MakeCoolFx(player.pos);
		ioo->scriptload = 1;
		SendInitScriptEvent(ioo);

		giveToPlayer(ioo);

		MakeSpCol();
		sp_max_ch = "!! Toi aussi cherches les Cheats !!";

		switch (sp_arm)
		{
		case 0:
			sp_max_ch = "------ZoliChapo------";
		break;
		case 1:
			sp_max_ch = "-----TiteBottine-----";
		break;
		case 2:
			sp_max_ch = "-----Roooo-La-La-----";
		break;
		default:
			return;
		break;
		}
		
		sp_max_start=arxtime.get_updated();
	}

	sp_arm++;
}
Пример #3
0
static void ApplySPBow() {

	ARX_SPSound();

	const char * cls = "graph/obj3d/interactive/items/weapons/bow_mx/bow_mx";
	Entity * ioo = AddItem(cls);
	if(ioo) {

		MakeCoolFx(player.pos);
		MakeCoolFx(player.pos);

		ioo->scriptload = 1;
		SendInitScriptEvent(ioo);

		giveToPlayer(ioo);

		MakeSpCol();
		DisplayCheatText("!!!_Bow to Samy & Anne_!!!");
	}
}
Пример #4
0
void ApplySPBow() {

	ARX_SPSound();

	const char * cls = "graph/obj3d/interactive/items/weapons/bow_mx/bow_mx";
	Entity * ioo = AddItem(cls);
	if(ioo) {

		MakeCoolFx(player.pos);
		MakeCoolFx(player.pos);

		ioo->scriptload = 1;
		SendInitScriptEvent(ioo);

		giveToPlayer(ioo);

		MakeSpCol();
		sp_max_ch = "!!!_Bow to Samy & Anne_!!!";
		sp_max_start=arxtime.get_updated();
	}
}
Пример #5
0
static void ApplySPWep() {
	
	if(!sp_wep) {
		
		ARX_SPSound();
		
		res::path cls = "graph/obj3d/interactive/items/weapons/sword_mx/sword_mx";
		Entity * ioo = AddItem(cls);
		if(ioo) {
			sp_wep = 1;
			MakeCoolFx(player.pos);
			MakeCoolFx(player.pos);
			ioo->scriptload = 1;
			SendInitScriptEvent(ioo);
			
			giveToPlayer(ioo);
			
			MakeSpCol();
			DisplayCheatText("!!!_Grosbillite_!!!");
		}
	}
}
Пример #6
0
void ApplySPWep() {

	if(!sp_wep) {

		ARX_SPSound();

		res::path cls = "graph/obj3d/interactive/items/weapons/sword_mx/sword_mx";
		Entity * ioo = AddItem(cls);
		if(ioo) {

			sp_wep = 1;
			MakeCoolFx(player.pos);
			MakeCoolFx(player.pos);
			ioo->scriptload = 1;
			SendInitScriptEvent(ioo);

			giveToPlayer(ioo);

			MakeSpCol();
			sp_max_ch = "!!!_Grosbillite_!!!";
			sp_max_start=arxtime.get_updated();
		}
	}
}