Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Character Class check
Author Message
Lordbl4 Offline
Seer of Hallate
*

Posts: 89
Joined: Dec 2013
Reputation: 9
Version: 1.4.2.131
Post: #1
Character Class check

Dodgy what is the right "if" script for check self class and do something?

i try use

    LUA Programming
Command("/target %self");
ShowToClient("Class", L2Class2String(GetTarget():GetClass()));
my_class = (GetTarget():GetClass());
Sleep(3000);
 
if (my_class == "Human Fighter") then
TargetNpc("NPC1", 10001);
end



and have no results

help me pls Confused
01-10-2014 19:38 PM
Find all posts by this user Quote this message in a reply
SimonHM Offline
@iProtion.com
**

Posts: 174
Joined: Oct 2012
Reputation: 83
Version: 1.4.1.116
Post: #2
RE: Character Class check

my_class = L2Class2String(GetTarget():GetClass());

If you don't have function L2Class2String, the return value is a number of that class instead of "Human Fighter"

Actually you don't need to target yourself to get your class.
You can try something like this:

    LUA Programming
ShowToClient("Class", L2Class2String(GetMe():GetClass()));
my_class = L2Class2String(GetMe():GetClass());
Sleep(3000);
 
if (my_class == "Human Fighter") then
TargetNpc("NPC1", 10001);


Plugin aPickup using /pickup with filtering list

[Image: simonhm.gif]
Bot for Kingdom Under Fire II
(This post was last modified: 01-10-2014 19:59 PM by SimonHM.)
01-10-2014 19:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Lordbl4 Offline
Seer of Hallate
*

Posts: 89
Joined: Dec 2013
Reputation: 9
Version: 1.4.2.131
Post: #3
RE: Character Class check

(01-10-2014 19:56 PM)SimonHM Wrote:  my_class = L2Class2String(GetTarget():GetClass());

If you don't have function L2Class2String, the return value is a number of that class instead of "Human Fighter"

Actually you don't need to target yourself to get your class.
You can try something like this:

    LUA Programming
ShowToClient("Class", L2Class2String(GetMe():GetClass()));
my_class = L2Class2String(GetMe():GetClass());
Sleep(3000);
 
if (my_class == "Human Fighter") then
TargetNpc("NPC1", 10001);


ty. but i solve problem without L2Class2String and find classes ID , its easy way
01-10-2014 20:10 PM
Find all posts by this user Quote this message in a reply
SimonHM Offline
@iProtion.com
**

Posts: 174
Joined: Oct 2012
Reputation: 83
Version: 1.4.1.116
Post: #4
RE: Character Class check

yah, sure.
The L2Class2String sometime return the name like this "Orc Fighter."
(Some classes have the extra dot "." in the end of name class when using L2Class2String function)

Plugin aPickup using /pickup with filtering list

[Image: simonhm.gif]
Bot for Kingdom Under Fire II
(This post was last modified: 01-10-2014 20:22 PM by SimonHM.)
01-10-2014 20:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  I seriously feel like Daniel Kaluuya’s character in “Get Out” these days zhangzk 0 359 02-20-2019 09:07 AM
Last Post: zhangzk
  check l2 deathwhisper truthak0s69 0 859 11-07-2016 23:40 PM
Last Post: truthak0s69
  character stand still/stuck OnTheFly 2 1,103 09-22-2015 14:54 PM
Last Post: OnTheFly
  Good Pvp class aiwaras83 1 1,058 06-20-2015 04:20 AM
Last Post: capucine
  lf Script for 1rd and 3rd class Quest l2exee 0 1,144 01-25-2015 21:28 PM
Last Post: l2exee
  Free Check EXP to Town Script!!!!!!!!!!!!!!!!! soul2eat 7 2,456 12-23-2014 15:24 PM
Last Post: TheQQmaster
Question Check masterparty benbt91 10 2,692 09-05-2014 22:18 PM
Last Post: kerberos464
  ID new class huymapvuitinh 3 1,424 08-29-2014 08:33 AM
Last Post: devil7
  check ss atrivido1 5 1,931 08-20-2014 01:02 AM
Last Post: tophersoccer
Exclamation check weapon/gear KristalSystem 4 1,594 07-06-2014 00:10 AM
Last Post: KristalSystem



User(s) browsing this thread: 1 Guest(s)