All pastes #490844 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-16 08:36 UTC
rendered paste body

   switch ( targ->client->lasthurt_location & 
                                    ~(LOCATION_BACK | LOCATION_LEFT | LOCATION_RIGHT | LOCATION_FRONT) )
                    {
                    case LOCATION_HEAD:
                            take *= 1.8;
                            break;
                    case LOCATION_FACE:
                            if (targ->client->lasthurt_location & LOCATION_FRONT)
                                    take *= 5.0; // Faceshots REALLY suck
                            else
                                    take *= 1.8;
                            break;
                    case LOCATION_SHOULDER:
                            if (targ->client->lasthurt_location & (LOCATION_FRONT | LOCATION_BACK))
                                    take *= 1.4; // Throat or nape of neck
                            else
                                    take *= 1.1; // Shoulders
                            break;
                    case LOCATION_CHEST:
                            if (targ->client->lasthurt_location & (LOCATION_FRONT | LOCATION_BACK))
                                    take *= 1.3; // Belly or back
                            else
                                    take *= 0.8; // Arms
                            break;
                    case LOCATION_STOMACH:
                            take *= 1.2;
                            break;
                    case LOCATION_GROIN:
                            if (targ->client->lasthurt_location & LOCATION_FRONT)
                                    take *= 1.3; // Groin shot
                            break;
                    case LOCATION_LEG:
                            take *= 0.7;
                            break;
                    case LOCATION_FOOT:
                            take *= 0.5;
                            break;

                    }

Dieser Code prüft den unteren Teil des Körpers auf Beintreffer (auch wenn sich der Spieler duckt). Die Schadenswerte liegen bei 70% des normalen Schadens für Beintreffer und 50% für Fusstreffer. Diese Werte kannst du beliebig verändern.
Um nun den getroffenen Spieler zu verlangsamen, füge folgende Zeilen unter take*=0.7; und take*=0.5;


			        case LOCATION_GROIN:
                            if (targ->client->lasthurt_location & LOCATION_FRONT)
                                    take *= 1.3; // Groin shot
                            break;
                    case LOCATION_LEG:
                            take *= 0.7;
                            targ->client->ps.speed -= take; // slowdown if shot in legs, McBain
                            break;
                    case LOCATION_FOOT:
                            take *= 0.5;
                            targ->client->ps.speed -= take; // slowdown if shot in foot, McBain
                            break;
	}