Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:16:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by Ertzel
[Today at 10:11:57 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Pages: [1] 2
Site Author : Topic: Stealing Script: Difficulty (2/5)  (Read 6084 times)
0 Members and 1 Guest are viewing this topic.
December 04, 2006, 09:56:59 AM
I stuff cotton balls into asprin bottles in my spare time.
Veteran
Advanced Member
*
User No : 810
Posts: 589
  • 0 credits
  • View Inventory
  • Send Money To SwiftDeathSK
  • Location : In your brain, thinking your thoughts.
    Mapper's Delight
    • View Profile


    add this to the bottom of your main.txt

    Code: [Select]
    '***Script by SwiftDeathSK***
    Sub Stealing(index, itemnum, minvalue, maxvalue)
    '*************************************
    Dim Target
    Dim chance
    Dim x
    Dim y
    Dim z
    Dim value
    Target = getplayertarget(index)

    If getplayertarget(index) < 1 Then
        Exit Sub
    End If

    If GetPlayerX(index) = (GetPlayerX(Target) + 1) Or (GetPlayerX(Target) - 1) Then
        If GetPlayerY(index) = (GetPlayerY(Target) + 1) Or (GetPlayerY(Target) - 1) Then
            x = 0
            Do While x <= 24
                If GetPlayerInvItemNum(index, x) = 0 Or itemnum Then
                    y = "True"
                    x = 26
                End If
                    x = x + 1
            Loop
           
              If y = "True" Then
                    x = 0
                    Do While x <= 24
                        If GetPlayerInvItemNum(getplayertarget(index), x) = itemnum Then
                            z = "True"
                            x = 26
                        End If
                            x = x + 1
                    Loop
           
                    If z = "True" Then
                        Call PlayerMsg(index, "You attempt to pickpocket " & Target & "...", 15)
                        chance = rand(1, 100)
                            If chance >= 50 Then
                                value = rand(minvalue, maxvalue)
                                Call PlayerMsg(index, "You successfully steal " & value & " Gold from " & Target & "!", 15)
                                x = 0
                                    Do While x <= 24
                                          If GetPlayerInvItemNum(index, x) = itemnum Then
                                                Call SetPlayerInvItemValue(index, x, (GetPlayerInvItemValue(index, x) + value))
                                          Else
                                                If GetPlayerInvItemNum(index, x) = 0 Then
                                                    Call SetPlayerInvItemNum(index, x, itemnum)
                                                    Call SetPlayerInvItemValue(index, x, value)
                                                End If
                                          End If
                                        x = x + 1
                                    Loop
                                x = 0
                                Do While x <= 24
                                    If GetPlayerInvItemNum(Target, x) = itemnum Then
                                        Call SetPlayerInvItemValue(Target, x, (GetPlayerInvItemValue(Target, x) - value))
                                            If GetPlayerInvItemValue(Target, x) <= 0 Then
                                                Call SetPlayerInvItemNum(Target, x, 0)
                                            End If
                                    End If
                                    x = x + 1
                                Loop
                               
                                Call SendInventory(index)
                                Call SendInventory(Target)
                            Else
                              Call PlayerMsg(index, "You are caught while stealing!", 15)
                              Call SetPlayerPK(index, 1)
                            End If
                    End If
                            Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
                            Exit Sub
                End If
                            Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
                            Exit Sub
        Else
            Call PlayerMsg(index, "That target is too far away!", 15)
            Exit Sub
        End If
    Else
        Call PlayerMsg(index, "That target is too far away!", 15)
    End If

    Use this line to run the script:
    Code: [Select]
    Call Stealing(index, itemnum, minvalue, maxvalue)-itemnum: the number of the item being stolen; must be a currency item
    -minvalue: the minimum amount stolen
    -maxvalue: the maximum amount stolen

    NOTES
    To use this script, just use the command Call Stealing(index, itemnum, minvalue, maxvalue).
    The item being stolen must be a currency item.
    The amount of that item being stolen is selected randomly between the values of the minvalue and maxvalue variables.
    The target must be a single step away from the player.
    Target cannot be an NPC.
    This only works with EE.


    If you use this script, please give me credit :)

    edit - fixed the getplayertarget and inventory things
    « Last Edit: January 19, 2007, 11:19:25 AM by Godlord » Logged
    December 04, 2006, 10:10:51 AM
    Administrator
    Demi God
    *
    User No : 141
    Posts: 5001
  • 48 credits
  • View Inventory
  • Send Money To unnown
  • -Admin-
    • View Profile
          If GetPlayerInvItemNum(index, x) <> 0 or itemnum Then
            Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
            Exit Sub

    that would cause it to stop if you have an item in your inventory..(without the inventory being full)
    and you should add an check if the player has targeted somebody:)

    besides that great script
    Logged

    thinks godlord is an crazy dutchie :D
    December 04, 2006, 10:35:11 AM
    Active Member
    ***
    User No : 752
    Posts: 357
  • 0 credits
  • View Inventory
  • Send Money To ~.:Lidnel:.~
  • Location : Ukraine
    The truth is out there...
    • View Profile
    • WWW
    Thnx man, you are the best!   :)
    Logged


     Collapse Online (FIRST ECLIPSE ISO RPG)  Progress: 70% Maps: 145/150 Items: 10/400 NPC: 60/100 Classes: 6/6 Graphic: 97% GUI: 100%  
    December 04, 2006, 10:43:20 AM
    I stuff cotton balls into asprin bottles in my spare time.
    Veteran
    Advanced Member
    *
    User No : 810
    Posts: 589
  • 0 credits
  • View Inventory
  • Send Money To SwiftDeathSK
  • Location : In your brain, thinking your thoughts.
    Mapper's Delight
    • View Profile
          If GetPlayerInvItemNum(index, x) <> 0 or itemnum Then
            Call PlayerMsg(index, "Your inventory is full, you cant steal anything!", 15)
            Exit Sub

    that would cause it to stop if you have an item in your inventory..(without the inventory being full)
    and you should add an check if the player has targeted somebody:)

    besides that great script

    k ill try to fix that, ill let you know when ive updated the main code ;)


    EDIT: Updated, someone please run it to check to make sure I fixed it ;)
    « Last Edit: December 04, 2006, 10:46:06 AM by swiftdeathsk » Logged
    December 04, 2006, 10:49:39 AM
    Administrator
    Demi God
    *
    User No : 141
    Posts: 5001
  • 48 credits
  • View Inventory
  • Send Money To unnown
  • -Admin-
    • View Profile
    (check the edit...  ;D )
    Logged

    thinks godlord is an crazy dutchie :D
    December 04, 2006, 10:53:53 AM
    I stuff cotton balls into asprin bottles in my spare time.
    Veteran
    Advanced Member
    *
    User No : 810
    Posts: 589
  • 0 credits
  • View Inventory
  • Send Money To SwiftDeathSK
  • Location : In your brain, thinking your thoughts.
    Mapper's Delight
    • View Profile
    (check the edit...  ;D )

    ah :P thanks unnown! it works now :) just be sure to follow the notes and it should work :)

    you could add this to a hotscript, or maybe a spell, hell, if you figure a way to do it, you might even be able to use it as an item (maybe like pickpocketing gloves that you need to equip to be able to steal :P)

    hey unnown, if they use this in a script NPC, would it still work? or does the GetPlayerTarget command not work with npc's? I wasnt entirely sure about that...
    Logged
    December 04, 2006, 11:51:21 AM
    Administrator
    Demi God
    *
    User No : 141
    Posts: 5001
  • 48 credits
  • View Inventory
  • Send Money To unnown
  • -Admin-
    • View Profile
    getplayertarget doesn't work on npc...(you can use GetPlayerTargetNpc(index) for that)
    Logged

    thinks godlord is an crazy dutchie :D
    December 06, 2006, 05:04:37 AM
    Newb
    *
    User No : 1534
    Posts: 18
  • 0 credits
  • View Inventory
  • Send Money To Axeon
  • What net??
    • View Profile
    • WWW
    Hey when I add this I cant start the server`..  :o
    Logged

    Darkness Destruction status:
    December 06, 2006, 10:29:01 AM
    I stuff cotton balls into asprin bottles in my spare time.
    Veteran
    Advanced Member
    *
    User No : 810
    Posts: 589
  • 0 credits
  • View Inventory
  • Send Money To SwiftDeathSK
  • Location : In your brain, thinking your thoughts.
    Mapper's Delight
    • View Profile
    Hey when I add this I cant start the server`..  :o

    are you using Eclipse Evolution? because this script will not work with total eclipse... what is the run time error number and message you get with it?
    Logged
    December 06, 2006, 10:41:36 AM
    Active Member
    ***
    User No : 752
    Posts: 357
  • 0 credits
  • View Inventory
  • Send Money To ~.:Lidnel:.~
  • Location : Ukraine
    The truth is out there...
    • View Profile
    • WWW
    It works with TE 2.0...
    *Tested*
    Logged


     Collapse Online (FIRST ECLIPSE ISO RPG)  Progress: 70% Maps: 145/150 Items: 10/400 NPC: 60/100 Classes: 6/6 Graphic: 97% GUI: 100%  
    December 06, 2006, 12:33:15 PM
    Newb
    *
    User No : 1534
    Posts: 18
  • 0 credits
  • View Inventory
  • Send Money To Axeon
  • What net??
    • View Profile
    • WWW
    I´m using EE. But I don´t get any errors. It just stops loading the server..
    Logged

    Darkness Destruction status:
    December 06, 2006, 03:47:03 PM
    Administrator
    Demi God
    *
    User No : 141
    Posts: 5001
  • 48 credits
  • View Inventory
  • Send Money To unnown
  • -Admin-
    • View Profile
    getplayertarget(index) = 1 means you targetet the player with indexnumber 1...you...
    Logged

    thinks godlord is an crazy dutchie :D
    December 06, 2006, 06:15:39 PM
    Custom GFX'erer
    Advanced Eclipser
    *****
    User No : 788
    Posts: 1275
  • 0 credits
  • View Inventory
  • Send Money To Timus
  • Location : My Computer...
    • View Profile
    Nice Swift! Should add in like custom menus or something so people dont have to go: Call stealing bla bla bla...
    Logged


    I recon u hav a nack for gfx.  :D

    PIRATEZ Online:
     Overall: 80%
    March 01, 2007, 05:09:39 PM
    Active Member
    ***
    User No : 1940
    Posts: 130
  • 0 credits
  • View Inventory
  • Send Money To Chrono917
  • Location : Wherever I wanna be
    • View Profile
    And how do you actually use this after you put in the script?
    Logged

    March 01, 2007, 05:15:56 PM
    asd
    Active Member
    ***
    User No : 2062
    Posts: 128
  • 0 credits
  • View Inventory
  • Send Money To vicho815
    • View Profile
    casting the spell? xD
    Logged

    March 02, 2007, 06:46:18 PM
    Active Member
    ***
    User No : 1940
    Posts: 130
  • 0 credits
  • View Inventory
  • Send Money To Chrono917
  • Location : Wherever I wanna be
    • View Profile
    That didn't help at all -.- If it can't help, THEN DON'T SAY IT
    Logged

    March 02, 2007, 07:29:17 PM
    Eclipse Evolution Dev
    Active Member
    ***
    User No : 1115
    Posts: 414
  • 0 credits
  • View Inventory
  • Send Money To Heytherejake
  • Location : Why would I tell you?
    Currently working on C++ 3D
    • View Profile
    • WWW
    Add the call Stealing command under a sub :P
    Logged

    Quote from: The Pickle
    When Japanese try to make RPGs, somebody sets up us the bomb
    Currently Working On: Flogs and Trockets 3D
    March 15, 2007, 10:43:13 AM
    I stuff cotton balls into asprin bottles in my spare time.
    Veteran
    Advanced Member
    *
    User No : 810
    Posts: 589
  • 0 credits
  • View Inventory
  • Send Money To SwiftDeathSK
  • Location : In your brain, thinking your thoughts.
    Mapper's Delight
    • View Profile
    yeah, there isnt a set way to use this script, you can add to to a hotkey, a spell, a command, etc. it's up to you.
    Logged
    October 24, 2008, 02:16:35 PM
    Newb
    *
    User No : 8923
    Posts: 3
  • 0 credits
  • View Inventory
  • Send Money To BuddhaWrath
    • View Profile
    Hi there, cool script. Quick question, this script only allows the player to steal "Money" then? Is there a way to set up so they can steal actual items (weps, armor, potions, etc)? Thanks!
    Logged
    October 25, 2008, 10:51:44 AM
    Active Member
    ***
    User No : 6774
    Posts: 123
  • 0 credits
  • View Inventory
  • Send Money To naruto1289
    • View Profile
    so you can only steal from other players? what thing on the keyboard do I press to steal?
    Logged
    Pages: [1] 2
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.603 seconds with 28 queries.