Reputation gossip script menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reputation gossip script

    Hey Mmowned

    I'm a bit stuck working on a lua script. I'm attempting to make a gossip script that trades reputation for an amount of rep tokens (the player can fill in the amount they want to trade in a code box). I'm kinda stuck however, as I was only able to find SetStanding(faction, amount) in the lua engine core to change reputation values with. So what I'm trying to do is getting the player's current rep in a number value, and set the new reputation with a formula. like so:

    Code:
    if (intid == 99990) then
     local Amount_Code = tonumber(code)
     local Standing_Number = Player:GetStanding(Faction_ID)
       if (Amount_Code ~= nil) and (Amount_Code ~= "") then
         if (Player:GetItemCount(180928) >= Amount_Code) then
           Player:RemoveItem(180928, Amount_Code)
           RepAdd = Standing_Number + (Token_Rep * Amount_Code)
           AddedRep = Token_Rep * Amount_Code
         end
       end
      Player:SetStanding(Faction_ID, RepAdd)
      Player:SendBroadcastMessage("Added "..AddedRep.." reputation with the faction of your choice at the cost of "..Amount_Code.." Rep tokens.")
    end
    my problem is in the part that is supposed to get the player's reputation. I'm using Player:GetStanding(Faction_ID) to get a numeric value, but it keeps returning nil values regardless of the player's reputation causing the script to fail because it can't do math with a nil value. I've tried printing a number of factions to the console, but all of them returned nil. I'm running arcemu r3462 and using luahyparc as an engine.

    any help/suggestion would be very much appreciated!
    Last edited by Ground Zero; 07-04-2010 at 09:35 AM. Reason: typo
    If you’re going to convict us, convict us of disorganised crime. - Peter Sunde

    Reputation gossip script
  2. #2
    iWoW-Programming's Avatar Sergeant
    Reputation
    6
    Join Date
    Jan 2010
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I were you i would look into that command and see if it is functional, it may just be unimplemented.

  3. #3
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply. I have looked into the lua engine core, In UnitFunctions.h it shows the following bit:
    Code:
    	int GetStanding(lua_State * L, Unit * ptr)
    	{
    		TEST_PLAYER()
    		uint32 faction = luaL_checkint(L,1);
    		if (faction)
    			lua_pushinteger(L, TO_PLAYER(ptr)->GetStanding(faction));
    		return 0;
    	}
    I can't read C that well however, so I'm not sure if it's functional.

  4. #4
    iWoW-Programming's Avatar Sergeant
    Reputation
    6
    Join Date
    Jan 2010
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That seems to be completely in order

    Maybe check the object Player? Try taking that function out and replacing it with a defined # and see if the script works.

    EDIT: okay i tried this and i also got nil no matter what, so i have no idea, i definitely think its an LUA Engine problem though.
    Last edited by iWoW-Programming; 07-04-2010 at 04:23 AM. Reason: typo, 2nd time added info

  5. #5
    thetrueman2's Avatar Active Member
    Reputation
    16
    Join Date
    Nov 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Too bad, seems I'll have to abandon this project then

    thanks for your help tho! +rep to you
    If you’re going to convict us, convict us of disorganised crime. - Peter Sunde

Similar Threads

  1. [Lua] Gossip Script
    By LJN in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 07-20-2008, 04:38 AM
  2. Gossip Script is Crashing the Server, what's wrong?
    By guitargod218 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-08-2008, 02:24 PM
  3. [share] mini-tut on gossip scripts lua
    By b!atch in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-29-2008, 05:11 AM
  4. Intergrating my SkillNPC and WarpNPC to gossip scripts?
    By chronic7 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 04-25-2008, 12:11 AM
  5. Gossip scripting guide!
    By Le Froid in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-13-2007, 05:06 PM
All times are GMT -5. The time now is 06:25 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search