Перейти к содержанию

Вопрос по Deadly Relfex 6


Рекомендуемые сообщения

Всем доброго времени суток уважаемые форумчане.

Меня за всю мою историю игры в Обливион с Деадли Рефлексом интерисует только 1 вопрос:

Каким образом можно настроить в моде 100% "втыкание" оружия в врага? (я имею ввиду что если к примеру летит меч и ударяется во врага рукоятью, то он бы всёравно "втыкался" острием)

 

Уж подскажите пожалуйста = (

Ссылка на комментарий
Поделиться на другие сайты

Народ, я нашёл скрип отвечающий за метание оружия, подскажите что в нём нужно изменить?

 

 

 

scn skycaptainsdaggerthrowquestscript

 

float fQuestDelayTime

float timer

float random

float timepassed

float delay

float angle

float angle2

float playerz

float lastplayerz

float victimz

float damage

float distance

float posx

float posy

float posz

float lastx

float lasty

float lastz

float projectilex

float projectiley

float projectilez

float lastprojectilex

float lastprojectiley

float lastprojectilez

float oldprojectilex

float oldprojectiley

float oldprojectilez

float projectiledifference

float collisionx

float collisiony

float collisionz

float distancetemp

float distancetemp2

float differenceangle

float startspeed

float startangle

float speedy

float speedx

float g

float airFactor

float flyangle

float rotationspeed

float moveforward

float armlength

float weaponweight

float weaponlength

float reach

float flytime

float numrotations

float newnumrotations

float flyheight

float chance

ref victim

ref playerweapon

ref droppedweapon

ref tempTorch

ref newtorch

ref weaponowner

ref flyingweapon

ref projectile

ref oldprojectile

ref projectiletarget

ref collisionWatch

ref victimamulet

ref victimshield

ref victimarmor

ref bloodspray

ref emitterScript

short action

short playerweapontype

short animdelay

short aim

short doOnce

short count

short forcehit

short trackweapon

short torchthrow

short istorch

short wassneaking

short torchtriggered

short collisionfound

short weapontype

short dropWeapon

short animcleared

short functionValue

;WEAPON HEALTH TO BE APPLIED WHEN THE WEAPON IS RETURNED

float daggerhealth

short healthApplied

string_var extraDataString

string_var torchModName

string_var torchId

begin gamemode

if(action == 0)

if(trackweapon == 0)

return

elseif(flyingweapon != 0)

if(trackweapon == 1)

if(player.getitemcount playerweapon == 0)

if(isformvalid flyingweapon)

if(player.getlos flyingweapon == 0)

set timer to timer + getsecondspassed

if(timer > 60)

if(isformvalid victim)

set posz to victim.getpos z

flyingweapon.moveto victim, 0,0,50

flyingweapon.disable

set trackweapon to 2

return

else

flyingweapon.disable

flyingweapon.deletereference

player.additemns playerweapon 1

endif

set trackweapon to 0

set victim to 0

set flyingweapon to 0

endif

else

set timer to 0

endif

else

player.additemns playerweapon 1

set trackweapon to 0

set victim to 0

set flyingweapon to 0

endif

else

if(isformvalid flyingweapon)

flyingweapon.disable

flyingweapon.deletereference

endif

set trackweapon to 0

set flyingweapon to 0

set victim to 0

endif

else

flyingweapon.enable

set flyingweapon to 0

set victim to 0

set trackweapon to 0

endif

endif

 

else

set timepassed to getsecondspassed

set timer to timer + timepassed

if(aim == 1)

if(torchthrow == 0)

set angle to player.getangle z + player.getheadingangle victim

player.setangle z angle

set victimz to victim.getpos z + 100

set playerz to player.getpos z + 100

set playerz to playerz - victimz

set distance to player.getdistance victim

if(distance == 0)

set distance to 1

endif

set angle to (playerz / distance)

set angle to (atan angle)

 

player.setangle x angle

elseif(animcleared == 0)

if(player.isidleplaying == 0)

;player.playgroup attackpower 1

set skycaptainsplayerunlock.freeplayer to 1

set skycaptainsplayerunlock.delay to 0

player.playgroup idle 1

set animcleared to 1

endif

endif

if(doOnce == 0)

;weapon flying params

 

set startspeed to 1300

set armlength to 25

if(istorch == 0)

set reach to getweaponreach playerweapon

set weaponlength to (reach * 55) / 2

set weapontype to getweapontype playerweapon

 

set weaponweight to (1 + ((getweight playerweapon) / 100))

if(weaponweight == 0)

set weaponweight to 1

endif

else

set weaponweight to 1

set weaponlength to 20

endif

 

set startspeed to startspeed/(squareroot weaponweight)

set rotationspeed to (startspeed / (armlength + weaponlength))

set rotationspeed to rotationspeed / 6.2832

set g to 588.6

set flyangle to player.getangle z

set posx to player.getpos x + (sin flyangle) * 50

set posy to player.getpos y + (cos flyangle) * 50

set posz to player.getpos z + 100

if(torchthrow == 0)

set victimz to victim.getpos x - posx

set victimz to (pow victimz 2)

set playerz to victim.getpos y - posy

set playerz to (pow playerz 2)

set playerz to playerz + victimz

set playerz to (squareroot playerz)

set lastplayerz to playerz

set startangle to (g * playerz) / (startspeed * startspeed)

set startangle to (asin startangle)

set startangle to startangle / 2

set startangle to ((-1) * angle) + startangle

 

;FLY TIME

set flytime to player.getpos x - victim.getpos x

set flytime to (pow flytime 2)

set flyheight to player.getpos y - victim.getpos y

set flyheight to (pow flyheight 2)

set flytime to flytime + flyheight

set flytime to (squareroot flytime)

set flytime to (flytime - 50) / speedx

 

;CHECK IF THE WEAPON WOULD FLY TOO HIGH - TO AVOID CLIPPING INDOORS

set flyheight to ((speedy - (g * (flytime / 2))) / 2)

set flyheight to (flyheight * (flytime / 2))

 

 

set flyheight to flyheight + player.getpos z - ((player.getpos z + victim.getpos z) / 2)

 

if(flyheight > 100)

message "Нужно подойти чуть поближе"

set aim to 0

set action to 100

return

endif

 

;does the weapon hit tip first?

set numrotations to flytime * rotationspeed

set numrotations to 180 + numrotations * 360

set newnumrotations to numrotations

set numrotations to numrotations % 360

if(numrotations > 225 && numrotations < 300)

debugprint "THE WEAPON MOST LIKELY HITS SUCCESFULLY AT ANGLE %.2f", numrotations

else

set random to (getrandompercent / 100) * getrandompercent

if(random < (getrandompercent * (player.getactorvalue blade / 100)))

set numrotations to 270 - numrotations

set numrotations to numrotations / newnumrotations

set numrotations to numrotations + 1

set rotationspeed to rotationspeed * numrotations

endif

endif

endif

set angle to player.getangle z

set airfactor to 0

 

set doOnce to 1

endif

if(torchthrow == 0)

set angle to player.getangle z + player.getheadingangle victim

player.setangle z angle

endif

endif

 

if(action == 1)

if(player.isidleplaying)

set skycaptainssb.throwdagger to 0

set action to 2

set timer to 0

elseif(timer > 1)

set action to 100

endif

return

elseif(action == 2)

if(timer < delay) ;delay set in skycaptainssb depending on anim

if(aim == 0 && delay - timer < 0.2)

set playerweapon to player.getequippedObject 16

if(torchthrow != 0)

if(player.getequippedobject 14 != 0)

set playerweapon to player.getequippedobject 14

if(nameincludes "факел" playerweapon || nameincludes "torch" playerweapon)

set istorch to 1

else

debugprint "playerweapon name is %n", playerweapon

endif

elseif(playerweapon != 0)

set daggerhealth to player.getequippedcurrenthealth 16

else

set playerweapon to player.getequippedobject 13

set daggerhealth to player.getequippedcurrenthealth 13

endif

endif

set aim to 1

endif

return

else

if(torchthrow == 0)

set flyingweapon to player.placeatme playerweapon 1 50 0

 

set flyangle to 180

flyingweapon.setangle z flyangle

else

;weapon flying parameters

set startangle to (-1) * player.getangle x

set speedy to (sin startangle) * startspeed

set speedx to (cos startangle) * startspeed

set flyingweapon to call functionSetModelNoScabbard skycaptainsflyingtorch, playerweapon

set flyingweapon to player.placeatme skycaptainsflyingtorch 1,50,0

set collisionwatch to skycaptainssb.rat

collisionwatch.moveto player

if(collisionwatch.getdisabled)

collisionwatch.enable

endif

collisionwatch.saa 0

collisionwatch.setunconscious 1

set flyangle to 90

flyingweapon.setangle z flyangle

endif

set projectiletarget to skycaptainssb.source1

 

 

player.unequipitem playerweapon

;player.removeitemns playerweapon 1

 

if(istorch == 0)

set count to player.getitemcount playerweapon

player.drop playerweapon 1

if(player.getitemcount playerweapon >= count)

player.removeitemns playerweapon 1

endif

 

set droppedweapon to getpclastdroppeditemref

debugprint "droppedweapon is %n", droppedweapon

droppedweapon.disable

else

set torchModName to scc.dropTorchModName

set torchid to scc.torchId

if(isModLoaded TorchModName)

let tempTorch := GetFormFromMod TorchModName torchId

if(tempTorch != 0)

player.drop tempTorch 1

set droppedweapon to getpclastdroppeditemref

droppedweapon.disable

else

set droppedWeapon to 0

endif

else

set droppedweapon to 0

endif

player.removeitemns playerweapon 1

endif

 

if(wassneaking != 0)

set posz to player.getpos z + 100

else

set posz to player.getpos z + 115

endif

flyingweapon.setpos z posz

 

set posx to flyingweapon.getpos x

set posy to flyingweapon.getpos y

set posz to flyingweapon.getpos z

set timer to 0

set action to 3

if(aim == 0)

set aim to 1

endif

return

endif

elseif(action == 3)

if(torchthrow == 0)

set victimz to victim.getpos x - posx

set victimz to (pow victimz 2)

set playerz to victim.getpos y - posy

set playerz to (pow playerz 2)

set playerz to playerz + victimz

set playerz to (squareroot playerz)

endif

 

if((torchthrow == 0 && (playerz < 30 || forcehit == 1)) || (torchthrow == 1 && torchtriggered == 1)) ;distance between weapon and the target is small or the hit should already have happened due to low fps

if(torchthrow == 0)

set angle to flyangle + ((playerz / speedx) * rotationspeed * 360)

set angle to angle % 360

debugprint "calculated hitangle is %.2f", angle

else

if(victim == player)

debugprint "ignored hitting player"

set torchtriggered to 0

return

endif

if(collisionwatch.getdisabled == 0)

collisionwatch.disable

endif

 

;weapon fly angle

set flyangle to flyangle + (360 * rotationspeed * timepassed)

flyingweapon.setangle z flyangle

flyingweapon.setangle x 90

set angle2 to 270 - angle

flyingweapon.setangle y angle2

 

set angle to flyangle % 360

debugprint "hitangle is %.2f", angle

endif

 

if(torchthrow == 0 && angle > 225 && angle < 300)

set skycaptainsneckstab.me to victim

set skycaptainsneckstab.instaeffect to 1

set skycaptainsneckstab.action to 1

 

victim.additem playerweapon 1

set victimamulet to victim.getequippedobject 8

if(victimamulet != 0)

victim.unequipitem victimamulet

endif

set victimarmor to victim.getequippedobject 2

if(victimarmor != 0)

sethidesamulet 0 victimarmor

endif

set angle to victim.getheadingangle player

set angle to (abs angle)

if(angle > 90)

if(angle < 135)

set angle to angle + victim.getangle z - 180

victim.setangle z angle

endif

victim.additem skycaptainsdaggerinback 1

victim.equipitem skycaptainsdaggerinback

set skycaptainsneckstab.backstab to 1

else

if(angle > 45)

set angle to angle + victim.getangle z

victim.setangle z angle

endif

victim.additem skycaptainsdaggerinthroat 1

victim.equipitem skycaptainsdaggerinthroat

endif

flyingweapon.disable

flyingweapon.deletereference

victim.modactorvalue encumbrance 9000

set count to victim.getitemcount skycaptainsForwardImpaleDeathFlag

if(count > 0)

victim.removeitem skycaptainsForwardImpaleDeathFlag count

endif

if(victim.getdead == 0 && victim.getactorvalue health > 0)

if(victim.getrestrained == 0)

victim.playgroup idle 1

victim.setrestrained 1

endif

if(victim.getunconscious == 0)

victim.setunconscious 1

endif

endif

set skycaptainsneckstab.doonce to 0

set skycaptainsneckstab.timer to 0

set skycaptainsneckstab.animdelay to 0

victim.playsound3d spinningdecaphitsound

victim.playsound3d skycaptainsthroatslitdecapsound

if(player.isactordetected)

set skycaptainsNPCanger.me to victim

set skycaptainsNPcanger.action to 1

endif

elseif(torchThrow == 0)

set angle to flyingweapon.getangle z

debugprint "hit failed, flyangle %.2f", angle

victim.playsound3d wpnhitbluntflesh

set skycaptainsNPCstagger.victim to victim

set skycaptainsNPCstagger.action to 1

set trackweapon to 1

elseif(victim != 0 && victim.getItemcount stopflag < 2)

debugprint "throw has a victim ref"

if(victim.isactor)

debugprint "throw victim is actor"

if(victim.getdead == 0)

debugprint "throw victim is not dead"

if(istorch == 1)

set dropWeapon to 1

debugprint "IS TORCH!"

victim.playsound3d wpnhitbluntflesh

victim.playmagicshadervisuals skycaptainsfiredamage 2

 

;if(angle > 0 && victim.isessential == 0)

if(angle > 225 && angle < 315 && victim.isessential == 0)

set damage to (1 - victim.getactorvalue resistfire) * 50

set damage to (abs damage)

;if(damage > 0)

if(damage > victim.getactorvalue health)

debugprint "killing throw victim"

if(victim.getiscreature || victim.isessential)

call functionAddXp victim

victim.kill player

else

victim.additem stopflag 2

victim.additem skycaptainsFireCriticalEffectToken 1

endif

else

set damage to damage * (-1)

if(victim.getiscreature == 0 && victim.isessential == 0)

debugprint "throw stunned the victim"

set skycaptainsNPCstun.victim to victim

set skycaptainsNPCstun.action to 1

else

debugprint "throw victim creature or essential, stagger"

set skycaptainsNPCstagger.victim to victim

set skycaptainsNPCstagger.action to 1

endif

victim.modactorvalue2 health damage

endif

else

set damage to (1 - victim.getactorvalue resistfire) * 15

set damage to (abs damage)

if(damage > victim.getactorvalue health)

call functionAddXp victim

victim.kill player

else

if(getrandompercent > 50 || player.isactordetected == 0)

set skycaptainsNPCstagger.victim to victim

set skycaptainsNPCstagger.action to 1

endif

set damage to damage * (-1)

victim.modactorvalue2 health damage

endif

;anger the NPCs

if(player.isactordetected)

set skycaptainsNPCstagger.attack to 1

set skycaptainsNPCanger.me to victim

set skycaptainsNPcanger.action to 1

endif

endif

else ;NOT TORCH, WEAPON HIT

debugprint "BEFORE EXTRA DATA"

if(victim.getIsCreature == 0)

set extradataString to call functionDecideExtraData flyingWeapon, victim, reach

set functionValue to call functionIsWeaponHitSuccess playerweapon, extradatastring, angle

else

set extradatastring to sv_construct "%e"

set functionValue to 0

endif

set playerweapontype to getweapontype playerweapon

 

debugprint "AFTER EXTRA DATA"

if(functionValue == 1 && victim.isessential == 0)

debugprint "dagger made contact!"

set victimamulet to victim.getequippedobject 8

if(victimamulet != 0)

victim.unequipitem victimamulet

endif

debugprint "after adding player weapon"

 

call functionShowAmulet victim

debugprint "after victim armor"

 

set angle2 to victim.getheadingangle flyingweapon - victim.getheadingangle player

if((abs angle2) > 90)

set angle2 to victim.getheadingangle player

else

set angle2 to victim.getheadingangle flyingweapon

endif

;set angle2 to angle2 - 180

debugprint "after victim headingangle to weapon"

 

if(weapontype < 2)

set reach to 30 * reach

else

set reach to 40 * reach

endif

 

debugprint "before amulet"

 

;attach weapon?

set functionValue to call functionIsAxe playerweapon

if(playerweapontype < 2 || functionValue == 1)

set victimamulet to apple

set victimamulet to cloneform weaponamulet

set victimamulet to call functionAttachWeapon playerweapon, victimamulet, extraDataString, angle2 , angle, reach

debugprint "after amulet"

victim.additem victimamulet 1

victim.equipitem victimamulet

 

;weapon retrieval helper

victim.additem skycaptainsweaponthrowhelper 1

;BLOOD SPRAY

set bloodspray to cloneform daggeremitter

call functionDropShield victim

set bloodspray to call functionAttachEmitter bloodspray, extradatastring, angle2

 

victim.additem bloodspray 1

victim.equipitem bloodspray

else

set dropWeapon to 2

endif

 

flyingweapon.disable

flyingweapon.deletereference

debugprint "disabled flying weapon"

 

victim.playsound3d spinningdecaphitsound

victim.playsound3d skycaptainsthroatslitdecapsound

 

call functionRemoveFlags victim

if(victim.getItemcount stopflag == 0)

victim.additem stopflag 1

endif

call functionPlayDaggerHitCritical victim,angle2,extradataString,weapontype

else

set dropweapon to 1

set angle to flyingweapon.getangle z

debugprint "hit failed, flyangle %.2f", angle

victim.playsound3d wpnhitbluntflesh

 

set functionValue to call functionGetBluntThrowKnockdownChance playerweapon

if(playerweapontype > 1 && functionValue > getRandomPercent)

if(sv_find "Neck" extraDataString > 0 || sv_find "Head" extraDataString > 0)

set skycaptainsNPCknockdown.knockdowntype to 1

else

set skycaptainsNPCknockdown.forcemod to 3

endif

set skycaptainsNPCknockdown.victim to victim

 

set skycaptainsNPCknockdown.bash to 1

if(victim.isincombat == 0)

set skycaptainsNPCknockdown.notcombat to 1

endif

set skycaptainsNPCknockdown.action to 1

else

set skycaptainsNPCstagger.victim to victim

set skycaptainsNPCstagger.attack to 1

set skycaptainsNPCstagger.action to 1

endif

endif

set extradatastring to sv_destruct

endif

endif

endif

else

set dropweapon to 1

endif

; тec/aг/pу

if(dropweapon > 0)

if(isTorch == 1 && droppedweapon == 0)

set droppedweapon to flyingweapon.placeAtMe DRtorch 1,0,0

else

droppedweapon.moveto flyingweapon

endif

 

set angle to flyingweapon.getangle x

droppedweapon.setangle x angle

set angle to flyingweapon.getangle y

droppedweapon.setangle y angle

set angle to flyingweapon.getangle z

 

if(dropweapon == 1) ;only bounce back if non-critical hit

droppedweapon.setangle z angle

droppedweapon.setpos x lastx

droppedweapon.setpos y lasty

droppedweapon.setpos z lastz

endif

if(droppedweapon.getdisabled)

droppedweapon.enable

endif

set dropweapon to 0

endif

set action to 100

return

elseif(timer > 5 || (torchthrow == 0 && (lastplayerz < playerz)))

set action to 100

return

else

set lastplayerz to playerz

set lastx to posx

set lasty to posy

set lastz to posz

if(skycaptainsSb.throwdagger == 1)

if(player.isidleplaying == 0)

debugprint "reseting idle variable"

set skycaptainssb.throwdagger to 0

endif

endif

;moving horizontallly

if(torchthrow == 0)

set angle to player.getangle z + player.getheadingangle victim

endif ;else using value stored on launch

 

set moveforward to speedx * timepassed

set posx to posx + ((sin angle) * moveforward)

set posy to posy + ((cos angle) * moveforward)

flyingweapon.setpos x posx

flyingweapon.setpos y posy

 

if(torchthrow == 0)

;anticipating hit

set victimz to ((sin angle) * moveforward)

set victimz to (pow victimz 2)

set playerz to ((cos angle) * moveforward)

set playerz to (pow playerz 2)

set playerz to playerz + victimz

set playerz to (squareroot playerz)

set playerz to lastplayerz - playerz

if(playerz < 0 || playerz < 30)

set forcehit to 1

endif

endif

 

;reducing speed horizontally

set speedx to speedx - (airfactor * timepassed )

;weapon fly angle

set flyangle to flyangle + (360 * rotationspeed * timepassed)

flyingweapon.setangle z flyangle

flyingweapon.setangle x 90

set angle2 to 270 - angle

flyingweapon.setangle y angle2

 

;moving vertically

set posz to posz + speedy * timepassed

flyingweapon.setpos z posz

 

;reducing speed vertically

set speedy to (speedy - (g * timepassed))

;debugprint "moving projectile: %.2f -> %.2f, %.2f -> %.2f, %.2f -> %.2f", lastx, posx, lasty, posy, lastz, posz

 

;collision scanning

if(torchthrow != 0)

if(projectiletarget.getdisabled == 0)

projectiletarget.disable

endif

 

set projectilex to posx + (sin angle) * 100

set projectiley to posy + (cos angle) * 100

projectiletarget.setpos x posx

projectiletarget.setpos y posy

set projectilez to posz - (100)

projectiletarget.enable

flyingweapon.cast skycaptainscollisionspell projectiletarget

 

set projectilex to posx + posx - lastx

set projectiley to posy + posy - lasty

set projectilez to posz + (speedy * timepassed)

projectiletarget.setpos x projectilex

projectiletarget.setpos y projectiley

projectiletarget.setpos z projectilez

;projectiletarget.enable

debugprint "projectile: %.2f, %.2f, %.2f - weapon: %.2f, %.2f, %.2f", projectilex, projectiley,projectilez, posx,posy,posz

flyingweapon.cast skycaptainscollisionspell projectiletarget

set victim to 0

;set collisionwatch next to weapon

set angle2 to angle + 90

set projectilex to posx + (20 * (sin angle2))

set projectiley to posy + (20 * (cos angle2))

collisionwatch.setpos x projectilex

collisionwatch.setpos y projectiley

collisionwatch.setpos z posz

endif

endif

 

elseif(action == 100)

debugprint "action 100, exit"

player.playgroup idle 1

enableplayercontrols

if(torchthrow == 0 || animcleared == 0)

;player.playgroup attackpower 1

set skycaptainsplayerunlock.freeplayer to 1

set skycaptainsplayerunlock.delay to 0

player.playgroup idle 1

endif

set dropweapon to 0

set torchModName to sv_destruct

set torchId to sv_destruct

set animcleared to 0

set skycaptainssb.movedenied to 0

set projectile to 0

set timer to 0

set torchtriggered to 0

set action to 0

set skycaptainssb.throwdagger to 0

set delay to 0

set daggerhealth to 0

set collisionfound to 0

set doonce to 0

set aim to 0

set istorch to 0

set torchthrow to 0

set forcehit to 0

endif

endif

end

 

 

Изменено пользователем Abelardo
Ссылка на комментарий
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
  • Последние посетители   0 пользователей онлайн

    • Ни одного зарегистрированного пользователя не просматривает данную страницу
×
×
  • Создать...