Advertisement
Terrah

SetAssociate example

Aug 9th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include "inc_lua"
  2.  
  3. //Adds oTarget as an associate to oMaster as type (ASSOCIATE_TYPE_*), if type is -1 the associate is instead removed
  4. void SetAssociate(object oMaster, object oTarget, int nAssociateType);
  5.  
  6. void SetAssociate(object oMaster, object oTarget, int nAssociateType){
  7.     ExecuteLuaString(oMaster, "nwn.SetAssociate(OBJECT_SELF,'"+ObjectToString(oTarget)+"',"+IntToString(nAssociateType)+");" );
  8. }
  9.  
  10. void main()
  11. {
  12.     object oPC = OBJECT_SELF;
  13.     object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oPC);
  14.     SetAssociate(oPC,oTarget,ASSOCIATE_TYPE_SUMMONED);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement