Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

balliztik1

Members
  • Posts

    2052
  • Joined

  • Last visited

    Never

Everything posted by balliztik1

  1. > Sub ScriptedNPC(Index, Script) > Select Case Script > Case 0 > Dim Exp > Dim x > Dim y > Dim z > Dim a > > Exp = GetplayerExp(index) > > x = 10 > y = 20 > z = 30 > a = 5 > If GetPlayerLevel(Index) Call PlayerMsg(index, "Hi! I'm Trainer Lar, and I'm here to teach melee combat! It's quite simple! Go out and use the CTRL key to attack some rabbits! Bring me back five rabbit feet.", 12) > If CanTake(Index, 2, 5) = false Then > Call PlayerMsg(Index, "You do not currently have the rabbit feet, please return when you do.", 12) > Else > Call TakeItem(index, 2, 5) > Call GiveItem(index, 1, 10) > Call PlayerMsg(index, "Now that you know the basics of combat, take this gold and go to Trainer Kude there, he'll tell you what to do next.", 12) > Call SetPlayerExp(index, Exp + x) > Call PlayerMsg(Index, "+10 EXP", 15) > Call SendStats(index) > End If > Else > Call PlayerMsg(index, "Sorry, but this tutorial is for new adventurers.", 12) > End If > Exit Sub > > Case Else > Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) > Exit Sub > End Select > End Sub
  2. SendPlayerData doesn't do the same thing as SendMP and SendMap.
  3. @dg1423: > nah, you'd have to do a small source edit to include the item number in the scripteditem sub call. it's a very easy modification, and I think it'll be included in 2.8. If you've not already thought about it, adding the slot parameter would also be beneficial.
  4. balliztik1

    Help!

    @lucifer1101: > you could also make an admin class. so that they all are like that instantly all they have to do is have a little scripted tile that will change your class to admin class but put it in a map that nobody can get to except admins….. Or even just a sprite change tile.
  5. balliztik1

    Help!

    @JAM: > Oh i see. Good idea! do you know if it works for sure? YOU DOUBT ME?!?!? Jk. Yeah. It works. Just type their name, and set their sprite to a different number.
  6. @HailBlazR: > While we're on the subject, isn't it also possible to add query boxes onto custom menus, and add "yes" and "no" inputs onto custom menus? o.o It's possible for a query box, but you have to script a prompt via two separate buttons (which may be simpler).
  7. To answer your original question, yes, someone knows. http://www.touchofdeathforums.com/smf/index.php/topic,15084.0.html Prompts and QueryBoxes weren't used even when they were new, largely due to a misunderstanding of how they worked. I personally like them, and have implemented them in several scripts. I'll throw some examples up here in a second. http://www.touchofdeathforums.com/smf/index.php/topic,14245.0.html http://www.touchofdeathforums.com/smf/index.php/topic,14589.0.html I suddenly have an idea for a new siggy.
  8. Oops. I think that needs to be in quotations. ``` #include ```
  9. balliztik1

    Help!

    Yeah, just set their sprite, via the admin menu, to that sprite, and don't do that for anyone else.
  10. Hooray! Fellow stalkers, unite!
  11. balliztik1

    Banner

    You mean changing the GUI where the buttons are on top? Yeah, that's possible, but only via the source code.
  12. balliztik1

    Main.txt

    @‪‫‬‭‮‪‫‬‭Admiral: > You noticed that too? > > YAY for this topic! I didn't just notice it, it's how I got here. I manually typed the link to wish Eclipse a happy 30k-th post, and it turns out the topic was right up my alley, so I answered the question too.
  13. balliztik1

    Main.txt

    Yes, you could copy everything from the main.txt into the source code. What you'd have to do is find where the server calls the ExecuteStatement method, and replace that with the appropriate lines from the main.txt. If you don't know what you should be transferring, though, it's not recommended that you try. Happy 30000th topic, Eclipse! Woo!
  14. @Shadowwulf: > exactly what i thought. > the only question is how is damage being figured before OnAttack? > i know the weapon is a factor and there is no other way to get a bonus from weapon damage. > so making damage equal only my calculations is bad. > but how else do i get weapon bonus? ``` Damage = Damage - GetPlayerStr(index) \ 2 ``` Adding that line should make damage equal to just weapon and item bonuses. The Damage variable doesn't include an enemy's defense beforehand, I think. I haven't tested, though, so I'm not sure.
  15. Not quite like that. You don't use #include with the sub name, but with the .txt file name. ``` #include ``` Then, after adding that, you could call any sub from that .txt file in your main.txt.
  16. Other .txt files actually. There would be no difference in speed, though. All the scripts are loaded into a script control when you boot up the server or refresh the scripts, so it may take a tiny bit longer when you do that, but it won't affect script execution in any way, because it all runs from one object when it's all said and done anyway. Ah, I forgot pros and cons. PROS: Easy script sharing - just tell people to download the .txt file and add the appropriate #include in their main.txt. Organized - No searching through the whole main.txt to find one script CONS: Harder Debugging - It may take longer to find an error if you have to search a ton of files. Unorganized - Contradictory, maybe, but you may have certain subs separate, so you may be switching back and forth a lot, making it less organized in a sense.
  17. @Gwen: > hehe flesh light!!!! Gwen, there are children here! …But the resemblence is uncanny... Oh, yeah, right. Welcome back Oracle, sir (or ma'am).
  18. http://www.touchofdeathforums.com/smf/index.php/topic,16162.0.html
  19. There's a topic over in the source edits forum about how to do this. If you have access to the source, it's very easy to do.
  20. Well, my entire main is filled with random food words and still runs perfectly. Success?
  21. This is Balliztik on a bored night… ``` ' Executes when a player steps onto a Spaghettied tile. Sub ScriptedTile(Meatball, Spaghetti) Select Case Spaghetti Case 0 Call PlayerMsg(Meatball, "This Spaghettied tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Meatball, "No tile Spaghetti found. Please contact an admin to solve this problem.", WHITE) Exit Sub End Select End Sub ' Executes when a player clicks on an OnClick tile. Sub OnClick(Meatball, Spaghetti) Select Case Spaghetti Case 0 Call PlayerMsg(Meatball, "This Spaghettied tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Meatball, "No tile Spaghetti found. Please contact an admin to solve this problem.", WHITE) Exit Sub End Select End Sub ``` ``` Case "/testspaghettis" Call TestMain(Meatball) Exit Sub Sub TestMain(Meatball) Call PlayerMsg(Meatball, "Spaghettis are working properly.", BRIGHTGREEN) End Sub ```
  22. Yeah…looking back on it, that was a really bad judgment. Lol. What was I thinking? >.< But he did send me his main.txt which had a syntax error. I fixed it, but he said it still didn't work, though it worked fine on my server.
  23. First, don't put spaces between the sub name and the parameters. For example, this: ``` If GetPlayerClass (Target) = GetPlayerClass (Index) Then ``` Should be: ``` If GetPlayerClass(Target) = GetPlayerClass(Index) Then ``` Secondly, you forgot the color parameter on the PlayerMsg call. ``` Call PlayerMsg(index, "Don't attack your allies.", 4) ``` Third, you are using the variable "target" before it is given value, and before we know if the target even has a class (meaning that they are not an NPC, but a player). You need to restructure the sub like so: ``` ' Executes when a player presses the CONTROL key. Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) If GetPlayerClass(Target) = GetPlayerClass(Index) Then Call PlayerMsg(Index, "Don't attack your allies", 4) Else Call DamagePlayer(Index, Target, Damage) End If Else Target = GetPlayerTargetNpc(Index) Call DamageNPC(Index, Target, Damage) End If End If End Sub ```
  24. :-\ I was interested in hearing some of his stuff, too.
×
×
  • Create New...