Help on my code

Post Reply
kennxonline
Posts: 56
Joined: Sun Mar 23, 2014 2:58 pm

Help on my code

Post by kennxonline » Wed Nov 18, 2015 2:14 am

I am trying to augment weapons for quests. I cant seem to figure this out. Can anyone figure this out for me please :(

Code: Select all

-----------------------------------
-- Area: Norg
-- NPC: Andrause
-- Standard Info NPC
-----------------------------------
-----------------------------------
-- onTrigger Action
-----------------------------------
	
function onTrigger(player,npc)
        player:PrintToPlayer("Andrause: You have earned this.")		
	player:addItem(16637 1 2 1);   --Gives item Augmented Deathbringer to player
end

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Help on my code

Post by kjLotus » Wed Nov 18, 2015 2:21 am

it appears that you are unfamiliar with the language syntax of lua. i suggest you read a tutorial or read a book if you have questions on how to program in lua
http://www.lua.org/pil/contents.html

kennxonline
Posts: 56
Joined: Sun Mar 23, 2014 2:58 pm

Re: Help on my code

Post by kennxonline » Wed Nov 18, 2015 2:58 am

kjLotus wrote:it appears that you are unfamiliar with the language syntax of lua. i suggest you read a tutorial or read a book if you have questions on how to program in lua
http://www.lua.org/pil/contents.html

Code: Select all

-----------------------------------
-- Area: Norg
-- NPC: Andrause
-- Standard Info NPC
-----------------------------------

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
  player:PrintToPlayer("Andrause: I can't help you right now.");
  end
  
-----------------------------------
-- onTrigger Action
-----------------------------------
	
function onTrigger(player,npc)

    local count = player:addItem();
    local prize = player:addItem(0);
    local a1 = 0;
    local a2 = 0;
    local a3 = 0;
    local a4 = 0;
    local v1 = 0;
    local v2 = 0;
    local v3 = 0;
    local v4 = 0;

         player:addItem(16637);	
      if player:addItem(16637) then 
         a1 = 17,
         v1 = 9
         a2 = 18,
         v2 = 9
         a3 = 19,
         v3 = 9 
         a4 = 20,
         v4 = 9
       end

   if(player:getFreeSlotsCount() >= 1) then
      player:addItemComplete();
      player:addItem(prize,1,a1,v1,a2,v2,a3,v3,a4,v4);
      player:messageSpecial(ITEM_OBTAINED,prize);
   else
      player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,prize);
   end
 
end;
still cant get it to work, I'll do more reading. Thanks for link. If you can help though I'd appreciate it.

Post Reply