Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to build sm64coopdx v1.0.3 star spammer hacked client:
- 1) add to src/game/behavior_actions.h:
- void bhv_spawn_star_no_level_exit_pos(struct Object* object, u32 params, u8 networkSendEvent, f32 x, f32 y, f32 z);
- 2) add to src/game/behaviors/sparkle_spawn_star.inc.c:
- void bhv_spawn_star_no_level_exit_pos(struct Object* object, u32 params, u8 networkSendEvent, f32 x, f32 y, f32 z) {
- for (s32 i = 0; i < gSpawnedStarNLECount; i++) {
- if (gSpawnedStarNLE[i] == params) { return; }
- }
- if (gSpawnedStarNLECount < 8) {
- gSpawnedStarNLE[gSpawnedStarNLECount++] = params;
- }
- struct Object *star = spawn_object_rel_with_rot(object, MODEL_STAR, bhvSpawnedStarNoLevelExit, x, y, z, 0, 0, 0);
- if (star != NULL) {
- star->oBehParams = params << 24;
- star->oInteractionSubtype = INT_SUBTYPE_NO_EXIT;
- }
- network_send_spawn_star_nle(object, params);
- }
- 3) add to src/game/mario.c after line "u16 gLocalBubbleCounter = 0;":
- bool cooldown = false;
- 4) add to src/game/mario.c in method "void update_mario_inputs(struct MarioState *m) {" after line "debug_print_speed_action_normal(m);":
- if (m->controller->buttonDown & L_TRIG) {
- if (m->controller->buttonDown & U_JPAD || m->controller->buttonDown & D_JPAD) {
- if (cooldown == false) {
- u32 i = 0;
- f32 begin = -2;
- f32 end = 2;
- f32 distance = 0;
- if (m->controller->buttonDown & U_JPAD) {
- distance = 128;
- } else if (m->controller->buttonDown & D_JPAD) {
- distance = 48;
- }
- if (m->controller->buttonDown & Z_TRIG) {
- begin = begin * 2;
- end = end * 2;
- distance = distance * 5;
- }
- if (m->controller->buttonDown & R_TRIG) {
- distance = distance * 2;
- }
- for (f32 iy = begin; iy < end; iy++) {
- for (f32 ix = begin; ix < end; ix++) {
- for (f32 iz = begin; iz < end; iz++) {
- if (m->controller->buttonDown & Z_TRIG) {
- struct MarioState* mState = &gMarioStates[0];
- struct Object* mObj = mState->marioObj;
- bhv_spawn_star_no_level_exit_pos(m->marioObj, i, TRUE, mObj->oPosX + ix*distance + (distance/2), mObj->oPosY + iy*distance + ((begin < 0) ? -begin : begin)*distance + 64, mObj->oPosZ + iz*distance + (distance/2));
- i = i + 1;
- } else {
- for (s32 index = 0; index < MAX_PLAYERS; index++) {
- if (!is_player_active(&gMarioStates[index])) { continue; }
- if (gMarioStates[index].marioObj == NULL) { continue; }
- struct MarioState* mState = &gMarioStates[index];
- struct Object* mObj = mState->marioObj;
- bhv_spawn_star_no_level_exit_pos(m->marioObj, i, TRUE, mObj->oPosX + ix*distance + (distance/2), mObj->oPosY + iy*distance + ((begin < 0) ? -begin : begin)*distance + 64, mObj->oPosZ + iz*distance + (distance/2));
- i = i + 1;
- }
- }
- }
- }
- }
- cooldown = true;
- }
- } else {
- cooldown = false;
- }
- m->health = 0x880;
- m->numLives = 99;
- m->healCounter = 0;
- m->hurtCounter = 0;
- m->peakHeight = m->pos[1];
- if (m->controller->buttonDown & R_TRIG) {
- m->forwardVel = 1000.0f;
- if (m->controller->buttonDown & Z_TRIG) {
- m->forwardVel = 0.0f;
- }
- } else {
- m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800);
- m->vel[1] = 40;
- if (m->action == ACT_FORWARD_GROUND_KB ||
- m->action == ACT_BACKWARD_GROUND_KB ||
- m->action == ACT_SOFT_FORWARD_GROUND_KB ||
- m->action == ACT_HARD_BACKWARD_GROUND_KB ||
- m->action == ACT_FORWARD_AIR_KB ||
- m->action == ACT_BACKWARD_AIR_KB ||
- m->action == ACT_HARD_FORWARD_AIR_KB ||
- m->action == ACT_HARD_BACKWARD_AIR_KB ||
- m->action == ACT_AIR_HIT_WALL) {
- set_mario_action(m, ACT_FREEFALL, 0);
- }
- if (m->controller->buttonDown & START_BUTTON && m->controller->buttonDown & D_JPAD) {
- m->health = 0;
- } else if (m->controller->buttonDown & D_JPAD) {
- m->numCoins = 99;
- }
- }
- }
- 4) add to src/game/interaction.c in method "u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {" at the very top of the method:
- if ((m->controller->buttonDown & D_JPAD) || (m->controller->buttonDown & L_TRIG)) { return FALSE; }
- 5) in src/game/interaction.c replace the method "u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {" with:
- u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
- if (!m || !o) { return FALSE; }
- u32 doorAction = 0;
- u32 saveFlags = save_file_get_flags();
- s16 warpDoorId = o->oBehParams >> 24;
- u32 actionArg;
- if (prevent_interact_door(m, o)) { return FALSE; }
- if ((m->controller->buttonDown & L_TRIG) || m->action == ACT_WALKING || m->action == ACT_DECELERATING) {
- if (!(m->controller->buttonDown & L_TRIG)) {
- if (warpDoorId == 1 && !(saveFlags & SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)) {
- if (!(saveFlags & SAVE_FLAG_HAVE_KEY_2)) {
- if (display_door_dialog(m, (saveFlags & SAVE_FLAG_HAVE_KEY_1) ? gBehaviorValues.dialogs.KeyDoor1HaveDialog : gBehaviorValues.dialogs.KeyDoor1DontHaveDialog)) {
- sDisplayingDoorText = TRUE;
- sCanInteractDoor = FALSE;
- }
- return FALSE;
- }
- doorAction = ACT_UNLOCKING_KEY_DOOR;
- }
- if (warpDoorId == 2 && !(saveFlags & SAVE_FLAG_UNLOCKED_BASEMENT_DOOR)) {
- if (!(saveFlags & SAVE_FLAG_HAVE_KEY_1)) {
- if (display_door_dialog(m, (saveFlags & SAVE_FLAG_HAVE_KEY_2) ? gBehaviorValues.dialogs.KeyDoor2HaveDialog : gBehaviorValues.dialogs.KeyDoor2DontHaveDialog)) {
- sDisplayingDoorText = TRUE;
- sCanInteractDoor = FALSE;
- }
- return FALSE;
- }
- doorAction = ACT_UNLOCKING_KEY_DOOR;
- }
- }
- if ((m->controller->buttonDown & L_TRIG) || m->action == ACT_WALKING || m->action == ACT_DECELERATING) {
- actionArg = should_push_or_pull_door(m, o) + 0x00000004;
- if (doorAction == 0) {
- if (actionArg & 0x00000001) {
- doorAction = ACT_PULLING_DOOR;
- } else {
- doorAction = ACT_PUSHING_DOOR;
- }
- }
- m->interactObj = o;
- m->usedObj = o;
- return set_mario_action(m, doorAction, actionArg);
- }
- }
- return FALSE;
- }
- 6) in src/game/interaction.c replace the method "u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {" with:
- u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
- if (!m || !o) { return FALSE; }
- if (m->playerIndex != 0 && o == NULL) { return FALSE; }
- s16 requiredNumStars = o->oBehParams >> 24;
- s16 numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1);
- if (o->oAction != 0) { return FALSE; }
- // prevent interacting with the same door as someone unlocking it
- if (prevent_interact_door(m, o)) { return FALSE; }
- if ((m->controller->buttonDown & L_TRIG) || m->action == ACT_WALKING || m->action == ACT_DECELERATING) {
- if ((m->controller->buttonDown & L_TRIG) || numStars >= requiredNumStars) {
- u32 actionArg = should_push_or_pull_door(m, o);
- u32 enterDoorAction;
- u32 doorSaveFileFlag;
- if (actionArg & 0x00000001) {
- enterDoorAction = ACT_PULLING_DOOR;
- } else {
- enterDoorAction = ACT_PUSHING_DOOR;
- }
- doorSaveFileFlag = get_door_save_file_flag(o);
- m->interactObj = o;
- m->usedObj = o;
- if (m->controller->buttonDown & L_TRIG) {
- enterDoorAction = ACT_ENTERING_STAR_DOOR;
- } else {
- if (o->oInteractionSubtype & INT_SUBTYPE_STAR_DOOR) {
- enterDoorAction = ACT_ENTERING_STAR_DOOR;
- }
- if (doorSaveFileFlag != 0 && !(save_file_get_flags() & doorSaveFileFlag)) {
- enterDoorAction = ACT_UNLOCKING_STAR_DOOR;
- }
- }
- return set_mario_action(m, enterDoorAction, actionArg);
- } else if (!sDisplayingDoorText) {
- u32 text = gBehaviorValues.dialogs.DoorNeedKeyDialog << 16;
- switch (requiredNumStars) {
- case 1:
- text = gBehaviorValues.dialogs.DoorNeed1StarDialog << 16;
- break;
- case 3:
- text = gBehaviorValues.dialogs.DoorNeed3StarsDialog << 16;
- break;
- case 8:
- text = gBehaviorValues.dialogs.DoorNeed8StarsDialog << 16;
- break;
- case 30:
- text = gBehaviorValues.dialogs.DoorNeed30StarsDialog << 16;
- break;
- case 50:
- text = gBehaviorValues.dialogs.DoorNeed50StarsDialog << 16;
- break;
- case 70:
- text = gBehaviorValues.dialogs.DoorNeed70StarsDialog << 16;
- break;
- }
- text += requiredNumStars - numStars;
- if ((requiredNumStars == 70) || display_door_dialog(m, text)) {
- if (requiredNumStars == 70) {
- m->interactObj = o;
- m->usedObj = o;
- set_mario_action(m, ACT_ENTERING_STAR_DOOR, should_push_or_pull_door(m, o));
- }
- sDisplayingDoorText = TRUE;
- sCanInteractDoor = FALSE;
- return TRUE;
- }
- }
- } else if (m->action == ACT_IDLE && sDisplayingDoorText == TRUE && requiredNumStars == 70) {
- m->interactObj = o;
- m->usedObj = o;
- return set_mario_action(m, ACT_ENTERING_STAR_DOOR, should_push_or_pull_door(m, o));
- }
- return FALSE;
- }
- 7) Compile it and happy trolling and griefing (Funfact: Streamers get very pissed and will meltdown live lmfao)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement