Jump to content

[Lua]Репутация за квест


Recommended Posts

Создаем функцию в function.lua 

function AddReputation(role,amount)
   local playerReputation = GetChaAttr(role, ATTR_FAME)
   playerReputation = playerReputation + amount
   SetCharaAttr(playerReputation, role, ATTR_FAME)
   SystemNotice(role,"You've recieved "..amount.." reputation! ["..playerReputation.."]")

В MissionSdk.lua находим блок похожий c elseif actions.func == и добавляем свое условие. 

elseif actions[i].func == AddReputation then
            PRINT( "ActionProc:AddReputation, p1 = ", actions[i].p1 )
            AddReputation( character, actions[i].p1 )

В самом задании используем следующим образом

MisResultAction(AddReputation,1000) -- Give 1k rep


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Please enter your display name

  • Create New...