wolfdol Posted July 3, 2018 Share Posted July 3, 2018 I am making Creature Companion mod and trying to give him some skills and abilities. some skills are based on his normal hit or Death of Enemies (ex. 1) When Dog hit enemies, Hits cause 25% Paralyze 2) When Dog kill enemy, Buff effect activated) I tried following script but not works :( Can i have it work? ------------------------------------------------------------------------------------------------Scn Talent01 ; script when Enemy dieRef Target......If CompanionRef.GetCombatTarget == Target Get Target to Getself If Target.Getdead == 1 Actor.Moveto Player Actor.Cast BuffSpell Player endifendif -------------------------------------------------------------------------------------------------Thx for Reading :) Link to comment Share on other sites More sharing options...
Surilindur Posted July 6, 2018 Share Posted July 6, 2018 (edited) You could use OBSE event handlers for registering hits by your dog, but other than that, I cannot think of a way to make a buff activate in a neat fashion off the top of my head. Maybe someone else has an idea on how to do that. For hit event registration, you will need:Your persistent dog reference in the gameworld.A function (an object script with a function block) to call when a hit event happens.Registration command when the game is started, to register the function as a handler to the event.For the event handler, something like this might be worth looking into, although I have not tested it myself and it has been some time since I last made an event handler (trying to get back to modding soon): scriptname YourUniquelyNamedDogHitEventHandler ref Target ref Attacker begin _Function { Target Attacker } PrintToConsole "DogHitEvent: %n (%i) -> %n (%i)" Attacker Attacker Target Target endFor registration, assuming your dog reference is called "YourUniquelyNamedDogReference", something like the following might work in a quest script, so that the event would be registered for while in main menu after the game has been restarted (assuming I remember the menu code correctly, I think 1044 was the main menu but I am not sure): scriptname YourUniquelyNamedDogQuestScript begin _MenuMode 1044 if ( GetGameRestarted ) seteventhandler "OnHit" YourUniquelyNamedDogHitEventHandler "object"::YourUniquelyNamedDogReference endif endHopefully that helps a bit. Any corrections are welcome if anyone remembers something I have forgotten. :thumbsup: Edited July 6, 2018 by Contrathetix Link to comment Share on other sites More sharing options...
Recommended Posts