How to Change Class?
Posted: Fri Jan 03, 2014 6:21 pm
How to Change Class?
How to Change Class Mage - Priest and Priest - Mage?
How to Change Class Mage - Priest and Priest - Mage?
Code: Select all
player:target_NPC("npc name")
RoMScript("ChoiceOption(4)")
Code: Select all
player:target_NPC("Marliss-Schwester");
if(my condition)then
--From class 1/3 to 3/1
sendMacro("ChoiceOption(3);")
yrest(500);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");
yrest(100);
RoMScript("SwapEquipmentItem(3)");
yrest(2000);
player:update()
end
Code: Select all
player:target_NPC("Marliss-Schwester");
if(my condition)then
--From class 3/1 to 1/3
sendMacro("ChoiceOption(3);")
yrest(100);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class2.ID,CEH.Data.class1.ID)");
yrest(100);
RoMScript("SwapEquipmentItem(1)");
yrest(2000);
player:update()
end
Code: Select all
--==[ Simple function to swap classes at housekeeper inside house ]==--
-- mainClass = CLASS_WARRIOR, CLASS_SCOUT, etc. to become your primary class. No quotes around the class name.
-- secClass = CLASS_WARRIOR, CLASS_SCOUT, etc. to become your secondary class. No quotes around the class name.
-- If no arguments are given, then the player's current classes will be swapped.
function swapClass(mainClass, secClass)
player:target_NPC(110758) -- ID for housemaid inside house
yrest(1000)
ChoiceOptionByName(getTEXT("HOUSE_MAID_HOUSE_CHANGEJOB"))
yrest(3000)
player:update()
local pri, sec
if mainClass == nil then
pri = player.Class2 + 1
sec = player.Class1 + 1
else
pri = mainClass + 1
sec = secClass + 1
end
RoMScript("ExchangeClass("..pri..","..sec..")")
end
Code: Select all
swapClass(CLASS_MAGE,CLASS_WARRIOR)
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- Demonstration Battle daily quest -->
<!-- v1.0 -->
<!-- by: lolita -->
<!-- Do Demonstration Battle daily quest in Rorazan, and use daily reset tickets if you have some -->
<onLoad>
settings.profile.mobs = {106474,106475,106476};
function checkCondition()
queststate = getQuestStatus(425124);
if queststate == "complete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
end
end
function checkLoopCondition()
queststate = getQuestStatus(425124);
if queststate ~= "complete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("incomplete"));
end
end
function getclass()
-- those 3 class can be main or secoundary
if (player.Class1 == 4 or player.Class2 == 4) then -- mage
SlashCommand("/cast Fireball")
elseif (player.Class1 == 2 or player.Class2 == 2) then -- scout
SlashCommand("/cast Shot")
elseif (player.Class1 == 3 or player.Class2 == 3) then -- rogue
SlashCommand("/cast Shadowstab")
-- class who can do daily
elseif player.Class1 == 5 then -- priest
SlashCommand("/cast Chain of Light")
elseif player.Class1 == 6 then -- knight
SlashCommand("/cast Holy Strike")
elseif player.Class1 == 7 then -- warden
SlashCommand("/cast Charged Chop")
elseif player.Class1 == 9 then -- warlock
SlashCommand("/cast Surge of Malice")
-- for those 3 class didnt found useful skill for doing this daily
-- so you must use them with mage, scout or rogue as secoundary class
elseif player.Class1 == 8 then -- druid
printf("Pls change your secondary class to Mage or Scout or Rogue");
player:sleep()
elseif player.Class1 == 10 then -- champion
printf("Pls change your secondary class to Mage or Scout or Rogue");
player:sleep()
elseif player.Class1 == 1 then -- warrior
printf("Pls change your secondary class to Mage or Scout or Rogue");
player:sleep()
end
end
function doquest()
LockedOn = RoMScript("UnitExists('target')")
enemy = RoMScript("UnitCanAttack('player','target')")
if (not LockedOn) or (not enemy) then
for i=1,5 do
if getQuestStatus(425124) == "complete" then
break
end
RoMScript("TargetNearestEnemy()")
getclass()
yrest(500)
end
end
end
</onLoad>
<!-- # 1 --><waypoint x="-18346" z="-22692" y="469">
checkCondition()
local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
if 10 == dailyQuestCount then
if inventory:itemTotalCount(202434) > 0 then
printf("We will use Daily Quest Reset Ticket");
inventory:useItem(202434)
yrest(1000)
loadPaths(__WPL.FileName)
elseif inventory:itemTotalCount(202434) == 0 then
error("Ending script",2)
end
else
printf("Done "..dailyQuestCount.." of " .. dailyQuestsPerDay .. " Left " .. dailyQuestsPerDay - dailyQuestCount .. " Quests.");
end
player:target_NPC(119856)
AcceptQuestByName(425124)
</waypoint>
<!-- # 2 --><waypoint x="-18346" z="-22692" y="469" tag="incomplete">
player:target_NPC(119856)
sendMacro("ChoiceOption(1);")
</waypoint>
<!-- # 3 --><waypoint x="-18331" z="-22677" y="469">
doquest()
checkLoopCondition()
</waypoint>
<!-- # 4 --><waypoint x="-18346" z="-22692" y="469" tag="complete"> </waypoint>
<!-- # 5 --><waypoint x="-18356" z="-22767" y="459"> </waypoint>
<!-- # 6 --><waypoint x="-18405" z="-22943" y="459"> </waypoint>
<!-- # 7 --><waypoint x="-18263" z="-22960" y="459"> </waypoint>
<!-- # 8 --><waypoint x="-17936" z="-23020" y="471"> </waypoint>
<!-- # 9 --><waypoint x="-17610" z="-23325" y="552"> </waypoint>
<!-- # 10 --><waypoint x="-17601" z="-23528" y="552"> </waypoint>
<!-- # 11 --><waypoint x="-17264" z="-23427" y="620">
player:target_NPC(120185);
if(my condition)then
sendMacro("ChoiceOption(3);")
yrest(500);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");
yrest(100);
RoMScript("SwapEquipmentItem(3)");
yrest(2000);
player:update()
end
</waypoint>
<!-- # 12 --><waypoint x="-17341" z="-23542" y="624"> </waypoint>
<!-- # 13 --><waypoint x="-18244" z="-23356" y="458"> </waypoint>
<!-- # 14 --><waypoint x="-18518" z="-23124" y="425"> </waypoint>
<!-- # 15 --><waypoint x="-18380" z="-22777" y="459"> </waypoint>
<!-- # 16 --><waypoint x="-18352" z="-22714" y="472">
player:target_NPC(119856);
CompleteQuestByName(425124);
</waypoint>
<!-- # 17 --><waypoint x="-18095" z="-23006" y="471"> </waypoint>
<!-- # 18 --><waypoint x="-17759" z="-23134" y="471"> </waypoint>
<!-- # 19 --><waypoint x="-17634" z="-23378" y="552"> </waypoint>
<!-- # 20 --><waypoint x="-17610" z="-23546" y="552"> </waypoint>
<!-- # 21 --><waypoint x="-17262" z="-23415" y="620">
player:target_NPC(120185);
if(my condition)then
sendMacro("ChoiceOption(3);")
yrest(100);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class2.ID,CEH.Data.class1.ID)");
yrest(100);
RoMScript("SwapEquipmentItem(1)");
yrest(2000);
player:update()
end
</waypoint>
<!-- # 22 --><waypoint x="-17334" z="-23554" y="624"> </waypoint>
<!-- # 23 --><waypoint x="-18181" z="-23394" y="458"> </waypoint>
<!-- # 24 --><waypoint x="-18500" z="-23144" y="425"> </waypoint>
<!-- # 25 --><waypoint x="-18361" z="-22717" y="473"> </waypoint>
</waypoints>
You probably copied this code from some example. "my condition" is supposed to be replaced with your condition, ie. under what circumstances you want to execute that code.if(my condition)then
Code: Select all
player.Name=="mychar" and player.Level > 70
Code: Select all
if()then
.<= Let that stay
.<= until end
end
Code: Select all
<!-- # 1 --><waypoint x="-6621" z="-8128" y="1466">
player:target_NPC("Sahaly Leitin");
if()then
sendMacro("ChoiceOption(3);")
yrest(500);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");
yrest(100);
player:update()
end
</waypoint>
Code: Select all
<!-- # 1 --><waypoint x="-6621" z="-8128" y="1466">
player:target_NPC("Sahaly Leitin");
sendMacro("ChoiceOption(3);")
yrest(500);
RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");
yrest(100);
player:update()
</waypoint>