L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

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
 Reputed by : Lordbl4(+1)
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
  check l2 deathwhisper truthak0s69 0 1,858 11-07-2016 23:40 PM
Last Post: truthak0s69
  character stand still/stuck OnTheFly 2 2,670 09-22-2015 14:54 PM
Last Post: OnTheFly
  Good Pvp class aiwaras83 1 2,539 06-20-2015 04:20 AM
Last Post: capucine
  lf Script for 1rd and 3rd class Quest l2exee 0 2,199 01-25-2015 21:28 PM
Last Post: l2exee
  Free Check EXP to Town Script!!!!!!!!!!!!!!!!! soul2eat 7 5,102 12-23-2014 15:24 PM
Last Post: TheQQmaster
Question Check masterparty benbt91 10 5,913 09-05-2014 22:18 PM
Last Post: kerberos464
  ID new class huymapvuitinh 3 2,806 08-29-2014 08:33 AM
Last Post: devil7
  check ss atrivido1 5 4,322 08-20-2014 01:02 AM
Last Post: tophersoccer
Exclamation check weapon/gear KristalSystem 4 3,499 07-06-2014 00:10 AM
Last Post: KristalSystem
WTS WTS 99 ISS w/ lvl97 dual class Bartz xconvict 0 1,651 06-06-2014 12:27 PM
Last Post: xconvict



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